'.$cur.''); } if ( file_exists('curr3.txt')) { $cur=file_get_contents('curr3.txt'); echo (' Bot3 SN: '.$cur.''); } if ( file_exists('curr4.txt')) { $cur=file_get_contents('curr4.txt'); echo (' Bot4 SN: '.$cur.''); } if ( file_exists('curr5.txt')) { $cur=file_get_contents('curr5.txt'); echo (' Bot5 SN: '.$cur.''); } if ( file_exists('curr6.txt')) { $cur=file_get_contents('curr6.txt'); echo (' Bot6 SN: '.$cur.''); } echo ('
'); // MAIN TABLE echo (''); echo (''); // MAIN /* извлечение ассоциативного массива */ while ($row = mysqli_fetch_assoc($result)) { if (strpos($row["model"], "THINKPAD") !== false or strpos($row["model"], "LEGION" ) !== false or strpos($row["model"], "THINKSMART") !== false or strpos($row["model"], "YOGA") !== false ) continue; $index++; // INDEX echo (''); echo (''); // SN COUNT echo (''); // SN COUNT > 11 month echo (''); // WARRANTY MAX MONTH echo (''); // SPECIFICATION echo (''); // FIRST DATE ADD //echo (''); //SELECT * FROM `Lenovo` where `model` NOT LIKE '%thinkpad%' and `model` NOT LIKE '%legion%' group by `pn` ORDER BY `Lenovo`.`date_add` DESC limit 4; echo (''); // TOTAL SN $total= $row["total"]; } echo ('
#NameSNSN>12MonthLenovo Spec
'); echo ($index.' '); echo (''); // MODEL $row["model"] = str_replace(array('-'), ' ', $row["model"]); // del lishnee $row["model"] = str_replace(array('LENOVO '), '', $row["model"]); // del lishnee $model = $row["model"].' ('.$row["pn"].')'; echo (''.$model.''); // SERIAL // serial hide $sns=''; $sales=''; $warantys=''; $nump=1; $nump1=''; $sql = "SELECT sn,month,DATE(`date_sell`) AS data FROM `Lenovo` where `pn` = '".$row["pn"]."' ORDER BY `month` DESC, `date_sell` DESC limit 120;"; $result3 = mysqli_query($link, $sql); while ($row3 = mysqli_fetch_assoc($result3)) { $sns=$sns.$row3["sn"].'
'; $warantys=$warantys.$row3["month"].'
'; $sales=$sales.$row3["data"].'
'; $nump1=$nump1.' '.$nump.'
'; $nump++; } echo('
'.$nump1.' '.$sns.'
'.$warantys.'
'.$sales.'
'); echo ('
'); echo ($row["sn_count"]); echo ('
'); $sql = "SELECT count(*) AS sn_new_count FROM `Lenovo` where `pn`= '".$row['pn']."' and `month` > 11 group by `pn`;"; $result2 = mysqli_query($link, $sql); $row1 = mysqli_fetch_assoc($result2); if ($row1["sn_new_count"] == '' ) echo ('0'); else echo ($row1["sn_new_count"]); echo ('
'); echo ($row["max_month"]); echo ('
'); $row["spec"] = str_replace(array('NB ', 'NBLN'), ' ', $row["spec"]); // del lishnee echo ($row["spec"]); echo (' PS'); echo (' LN'); //https://shop.lenovo.ua/search?q=83a1009sra echo (''); // $sql = "SELECT `date_add` FROM `Lenovo` WHERE `pn`='".$row['pn']."' ORDER BY `Lenovo`.`date_add` ASC limit 1;"; // $result5 = mysqli_query($link, $sql); // $row5 = mysqli_fetch_assoc($result5); // echo ($row5["date_add"]); //echo ('
'); echo ('Total in base UA serial: '.$total. ' (Refresh every 30 mins).'); // LAST ADDED TABLE $sql = "SELECT * FROM `Lenovo` where `model` NOT LIKE '%thinkpad%' and `model` NOT LIKE '%legion%' and `model` NOT LIKE '%THINKSMART%' group by `pn` ORDER BY `Lenovo`.`date_add` DESC limit 10;"; $resulta = mysqli_query($link, $sql); echo ("

LAST NEW 10 ADDED PN:

"); while ($rowa = mysqli_fetch_assoc($resulta)) { echo (""); echo (""); echo (""); echo (""); echo (""); } echo ("
"); $rowa["model"] = str_replace(array('-'), ' ', $rowa["model"]); // del lishnee $rowa["model"] = str_replace(array('LENOVO '), '', $rowa["model"]); // del lishnee $modela = $rowa["model"].' ('.$rowa["pn"].')'; echo ($modela); echo (""); echo($rowa["date_add"]); echo (""); echo('     '.$rowa["spec"]); echo (' PS'); echo (' LN'); echo ("
"); ?>