Siemens Automation & PLC Parts
global $rand; global $helprand; $rand = 0; $helprand = 1; $Keyword = $_GET["Keyword"]; $OrderNumber = $_GET["OrderNumber"]; //echo" Get Keyword: $Keyword // Get Order:$OrderNumber"; if ($Keyword=="" and $OrderNumber==""){$Keyword="6"; $OrderNumber="6";} $Keyword = $OrderNumber; if ($Keyword==""){$PicEn=false;}else{$PicEn=true;} //echo" Keyword: $Keyword // Order:$OrderNumber"; $KeyEx = explode(" ",$Keyword); $KeyResult = count($KeyEx); //echo "1:$KeyEx[0] -- 2:$KeyEx[1] -- 3: $KeyEx[2] ---- Cnt:$KeyResult"; $i=0; if ($Sort ==''){$Sort = 'OrderNumber';} $abfrage = "SELECT * FROM `N_Siemens` WHERE (`OrderNumber` LIKE '%$OrderNumber%' or `Keyword` LIKE '%$Keyword%' or `Name` LIKE '%$Keyword%' or `Description` LIKE '%$Keyword%') order by $Sort limit 0,350"; // $abfrage = "SELECT * FROM `N_Siemens` WHERE (`OrderNumber` LIKE '%$OrderNumber%' or `Keyword` LIKE '%$Keyword%' or `Name` LIKE '%$Keyword%' or `Description` LIKE '%$Keyword%') limit 0,350"; // BEGIN 2 KEYWORDS if ($KeyResult ==2) { $abfrage = "SELECT * FROM `N_Siemens` WHERE (`OrderNumber` LIKE '%$OrderNumber%' or (`OrderNumber` LIKE '%$KeyEx[0]%' and `OrderNumber` LIKE '%$KeyEx[1]%') or (`OrderNumber` LIKE '%$KeyEx[0]%' and `Keyword` LIKE '%$KeyEx[1]%') or (`OrderNumber` LIKE '%$KeyEx[0]%' and `Name` LIKE '%$KeyEx[1]%') or (`OrderNumber` LIKE '%$KeyEx[0]%' and `Description` LIKE '%$KeyEx[1]%') or (`Keyword` LIKE '%$KeyEx[0]%' and `Keyword` LIKE '%$KeyEx[1]%') or (`Keyword` LIKE '%$KeyEx[0]%' and `Name` LIKE '%$KeyEx[1]%' ) or (`Keyword` LIKE '%$KeyEx[0]%' and `Description` LIKE '%$KeyEx[1]%') or (`Name` LIKE '%$KeyEx[0]%' and `Name` LIKE'%$KeyEx[1]%') or (`Name` LIKE '%$KeyEx[0]%' and `Keyword` LIKE'%$KeyEx[1]%') or (`Name` LIKE '%$KeyEx[0]%' and `Description` LIKE'%$KeyEx[1]%') or (`Description` LIKE '%$KeyEx[0]%' and `Description` LIKE '%$KeyEx[1]%') or (`Description` LIKE '%$KeyEx[0]%' and `Keyword` LIKE '%$KeyEx[1]%') or (`Description` LIKE '%$KeyEx[0]%' and `Name` LIKE '%$KeyEx[1]%') ) order by $Sort limit 0,150"; } // END 2 KEYWORDS // BEGIN 3 KEYWORDS if ($KeyResult ==3) { $abfrage = "SELECT * FROM `N_Siemens` WHERE (`OrderNumber` LIKE '%$OrderNumber%' or (`Keyword` LIKE '%$KeyEx[0]%' and `Keyword` LIKE '%$KeyEx[1]%' and `Keyword` LIKE '%$KeyEx[2]%') or (`Keyword` LIKE '%$KeyEx[0]%' and `Keyword` LIKE '%$KeyEx[1]%' and `Name` LIKE '%$KeyEx[2]%') or (`Keyword` LIKE '%$KeyEx[0]%' and `Keyword` LIKE '%$KeyEx[1]%' and `Description` LIKE '%$KeyEx[2]%') or (`Keyword` LIKE '%$KeyEx[0]%' and `Name` LIKE '%$KeyEx[1]%' and `Keyword` LIKE '%$KeyEx[2]%') or (`Keyword` LIKE '%$KeyEx[0]%' and `Name` LIKE '%$KeyEx[1]%' and `Name` LIKE '%$KeyEx[2]%') or (`Keyword` LIKE '%$KeyEx[0]%' and `Name` LIKE '%$KeyEx[1]%' and `Description` LIKE '%$KeyEx[2]%') or (`Keyword` LIKE '%$KeyEx[0]%' and `Description` LIKE '%$KeyEx[1]%' and `Keyword` LIKE '%$KeyEx[2]%') or (`Keyword` LIKE '%$KeyEx[0]%' and `Description` LIKE '%$KeyEx[1]%' and `Name` LIKE '%$KeyEx[2]%') or (`Keyword` LIKE '%$KeyEx[0]%' and `Description` LIKE '%$KeyEx[1]%' and `Description` LIKE '%$KeyEx[2]%') or (`Name` LIKE '%$KeyEx[0]%' and `Keyword` LIKE '%$KeyEx[1]%' and `Keyword` LIKE '%$KeyEx[2]%') or (`Name` LIKE '%$KeyEx[0]%' and `Keyword` LIKE '%$KeyEx[1]%' and `Name` LIKE '%$KeyEx[2]%') or (`Name` LIKE '%$KeyEx[0]%' and `Keyword` LIKE '%$KeyEx[1]%' and `Description` LIKE '%$KeyEx[2]%') or (`Name` LIKE '%$KeyEx[0]%' and `Name` LIKE '%$KeyEx[1]%' and `Keyword` LIKE '%$KeyEx[2]%') or (`Name` LIKE '%$KeyEx[0]%' and `Name` LIKE '%$KeyEx[1]%' and `Name` LIKE '%$KeyEx[2]%') or (`Name` LIKE '%$KeyEx[0]%' and `Name` LIKE '%$KeyEx[1]%' and `Description` LIKE '%$KeyEx[2]%') or (`Name` LIKE '%$KeyEx[0]%' and `Description` LIKE '%$KeyEx[1]%' and `Keyword` LIKE '%$KeyEx[2]%') or (`Name` LIKE '%$KeyEx[0]%' and `Description` LIKE '%$KeyEx[1]%' and `Name` LIKE '%$KeyEx[2]%') or (`Name` LIKE '%$KeyEx[0]%' and `Description` LIKE '%$KeyEx[1]%' and `Description` LIKE '%$KeyEx[2]%') or (`Description` LIKE '%$KeyEx[0]%' and `Keyword` LIKE '%$KeyEx[1]%' and `Keyword` LIKE '%$KeyEx[2]%') or (`Description` LIKE '%$KeyEx[0]%' and `Keyword` LIKE '%$KeyEx[1]%' and `Name` LIKE '%$KeyEx[2]%') or (`Description` LIKE '%$KeyEx[0]%' and `Keyword` LIKE '%$KeyEx[1]%' and `Description` LIKE '%$KeyEx[2]%') or (`Description` LIKE '%$KeyEx[0]%' and `Name` LIKE '%$KeyEx[1]%' and `Keyword` LIKE '%$KeyEx[2]%') or (`Description` LIKE '%$KeyEx[0]%' and `Name` LIKE '%$KeyEx[1]%' and `Name` LIKE '%$KeyEx[2]%') or (`Description` LIKE '%$KeyEx[0]%' and `Name` LIKE '%$KeyEx[1]%' and `Description` LIKE '%$KeyEx[2]%') or (`Description` LIKE '%$KeyEx[0]%' and `Description` LIKE '%$KeyEx[1]%' and `Keyword` LIKE '%$KeyEx[2]%') or (`Description` LIKE '%$KeyEx[0]%' and `Description` LIKE '%$KeyEx[1]%' and `Name` LIKE '%$KeyEx[2]%') or (`Description` LIKE '%$KeyEx[0]%' and `Description` LIKE '%$KeyEx[1]%' and `Description` LIKE '%$KeyEx[2]%') ) order by $Sort limit 0,150"; } // END 3 KEYWORDS $conUserId = mysqli_connect( 'localhost', 'nessies1_root', 'neumi', 'nessies1_SPS' ) or die( 'Verbindungsfehler!' ); $ergebnis = mysqli_query ($conUserId, $abfrage); while ($row =mysqli_fetch_object ($ergebnis)) { include 'AddText.php'; $helprand++; $rand++; //if ($helprand >2){$helprand = 1;$rand++;$addText='';} $i++; $Img = $row->OrderNumber.'.png'; // NEW BEGIN /* $ExOrderN = explode("-",$row->OrderNumber); $Img = $ExOrderN[0].'.png'; echo "BILDNAME: = $Img -- 0 $ExOrderN[0], -- 1 $ExOrderN[1], -- 2 $ExOrderN[2]
"; */ // NEW END $name = $row->Name; $description = $row->Description; $StLen = strlen($description); //while ($StLen <= 170){$description = $description.'_'; $StLen = strlen($description);} $price = $row->VK; $OrderNumber = $row->OrderNumber; $ItemId = $row->id; if ($row->Stock>0){$av = "available in Perth WA";}else{$av=" ships in 1-3 days*";} echo "
* Conditions apply
$addText
