=";
$st = "<=";
$parr = $_GET;
array($parr);
foreach ($parr as $var)
{
$i ++;
if(!empty($var) and $var!="dd.mm.yyyy" and $var!="Check Data" and $var!="Action")
{
switch (key($parr))
{
case 'Customer':
$str = "tablerequest.ID_People ".$tr."'".$var."' AND ";
break;
case 'formDnaBankNumber':
$str = "tablednabanknumbers.Dna_Bank_Number ".$tr."'".$var."' AND ";
break;
case 'formOrderDateFrom':
if ($OrderDateFrom!="") {
$str = "tablerequest.Request_Date ".$bt."'".$OrderDateFrom."' AND ";
}
break;
case 'formOrderDateTo':
if ($OrderDateTo!="") {
$str = "tablerequest.Request_Date ".$st."'".$OrderDateTo."' AND ";
}
break;
case 'formShippingDateFrom':
if ($ShippingDateFrom!="") {
$str = "tablerequest.Shipping_Date ".$bt."'".$ShippingDateFrom."' AND ";
}
break;
case 'formShippingDateTo':
if ($ShippingDateTo!="") {
$str = "tablerequest.Shipping_Date ".$st."'".$ShippingDateTo."' AND ";
}
break;
case 'Status':
if($Status=="order") {
$str = "(tablealiquots.Shipping_Partial ".$no."'YES' AND ";
$str .= "tablealiquots.Shipping_All ".$no."'YES') AND ";}
if($Status=="shipping") {
$str = "(tablealiquots.Shipping_Partial ".$tr."'YES' OR ";
$str .= "tablealiquots.Shipping_All ".$tr."'YES') AND "; }
if($Status=="all") {
$str = "(tablealiquots.Shipping_Partial ".$tr."'YES' OR ";
$str .= "tablealiquots.Shipping_All ".$tr."'YES' OR ";
$str .= "tablealiquots.Order_Partial ".$tr."'YES' OR ";
$str .= "tablealiquots.Order_All ".$tr."'YES') AND ";}
break;
}
$where[$i] = $str;
}
next($parr);
}
if(empty($str))
{ echo ""; }
else {
foreach($where AS $a) $string .= $a;
$l=strlen ($string);
$max = $l-4;
$where_str = substr($string, 0, $max);
$wherestr = " WHERE " . $where_str . " AND tablerequest.Agreement = 'Yes'";
//abfrage
$result = "SELECT tablerequest.ID_Request, " .
"tablerequest.ID_Aliquots, " .
"tablednabanknumbers.Dna_Bank_Number, " .
"tablerequest.Request_Number_Aliquots, " .
"tablerequest.Shipping_All, " .
"tablerequest.Shipping_Partial, " .
"tablerequest.Shipping_Rest, " .
"tablerequest.Order_All, " .
"tablerequest.Order_Partial, " .
"tablerequest.Order_Rest, " .
"tablerequest.Agreement, " .
"tablealiquots.Aliquot_Barcode, " .
"tablealiquots.Aliquot_Position, " .
"tablealiquots_box.Aliquots_Box, " .
"tablealiquots_rack.Aliquots_Rack, " .
"tablealiquots_fridge.Aliquots_Fridge, " .
"tablerequest.Request_Date, " .
"tablerequest.Request_Volume, " .
"tablerequest.Request_Notes, " .
"tablerequest.Shipping_Date, " .
"tablerequest.Price, " .
"tablerequest.Created_When, " .
"tablerequest.Created_Who, " .
"tablepeople.Name_All " .
"FROM tablerequest
LEFT JOIN tablealiquots ON tablerequest.ID_Aliquots = tablealiquots.ID_Aliquots
LEFT JOIN tablednabanknumbers ON tablerequest.ID_DNA = tablednabanknumbers.ID_DNA
LEFT JOIN tablealiquots_box ON tablealiquots.ID_Aliquots_Box = tablealiquots_box.ID_Aliquots_Box
LEFT JOIN tablealiquots_rack ON tablealiquots.ID_Aliquots_Rack = tablealiquots_rack.ID_Aliquots_Rack
LEFT JOIN tablealiquots_fridge ON tablealiquots.ID_Aliquots_Fridge = tablealiquots_fridge.ID_Aliquots_Fridge
LEFT JOIN tablepeople ON tablerequest.ID_People = tablepeople.ID_People " .
$wherestr.$sqllimit;
$sql = mysql_query($result) or die($result.' '.mysql_error());
$gesamt = mysql_num_rows($sql);
if(!mysql_num_rows($sql))
{ echo "No hits found."; }
else {
echo "Liste zeigt nur Aliquots, zu denen ein Material Transfer Agreement existiert!";
//NORMAL
echo "Customer | DNA Extraction No | Aliquot No | Shipping volume | Fridge | Rack | Box | Order Date | Notes | ";
//ZSM MÜNCHEN
//echo "Customer | DNA Extraction No | Position | Aliquot No | Barcode | Shipping volume | Fridge | Drawer | Rack | Order Date | Notes | ";
for ($i=1; $i<=$gesamt; $i++) {
$row=mysql_fetch_array($sql);
$Name_All = $row['Name_All'];
$DnaBankNumber = $row['Dna_Bank_Number'];
$Aliquot_Number = $row['Request_Number_Aliquots'];
$Request_Volume = $row['Request_Volume'];
$Box = $row['Aliquots_Box'];
$Rack = $row['Aliquots_Rack'];
$Fridge = $row['Aliquots_Fridge'];
$Barcode = $row['Aliquot_Barcode'];
$Position = $row['Aliquot_Position'];
$OrderAll = $row['Order_All'];
$OrderPartial = $row['Order_Partial'];
$OrderRest = $row['Order_Rest'];
$ShippingAll = $row['Shipping_All'];
$ShippingPartial = $row['Shipping_Partial'];
$ShippingRest = $row['Shipping_Rest'];
$Request_Date = $row['Request_Date'];
$Request_Notes = $row['Request_Notes'];
$Shipping_Date = $row['Shipping_Date'];
$ID_Request = $row['ID_Request'];
$ID_Aliquots = $row['ID_Aliquots'];
//NORMAL START
echo "".$Name_All." | ".$DnaBankNumber." | ".$Aliquot_Number." | ";
echo "".$Request_Volume." µl | ".$Fridge." | ".$Rack." | ".$Box." | ";
echo "".DatumsWandler($Request_Date)." | ";
echo " | ".$Request_Notes." | ";
echo " "; }
//NORMAL ENDE
/*ZSM MÜNCHEN START
echo "".$Name_All." | ".$DnaBankNumber." | ".$Position." | ".$Aliquot_Number." | ";
echo "".$Barcode." | ";
echo "".$Request_Volume." µl | ".$Fridge." | ".$Rack." | ".$Box." | ";
echo "".DatumsWandler($Request_Date)." | ";
echo " | ".$Request_Notes." | ";
echo " "; }
ZSM MÜNCHEN Ende*/
echo " ";
echo "
| "; }
}
?>
|