managechemicaltype.php
Lekjew.com
# |
สินค้า1 |
สินค้า2 |
ไปส่งด้วยกัน |
# |
# |
สินค้า1 |
สินค้า2 |
ไปส่งด้วยกัน |
# |
managechemicaltype_save.php
RUNNO;
$ITEM_NO1 = $_POST["ITEM_NO1"];
$ITEM_NO2 = $_POST["ITEM_NO2"];
$ITEM_STATUS = $_POST["ITEM_STATUS"];
$sqladd = "INSERT INTO ITEM_TYPE (RUNNO, ITEM_NO1, ITEM_NO2, ITEM_STATUS) VALUES ($RUNNO, '$ITEM_NO1', '$ITEM_NO2', '$ITEM_STATUS'); ";
$rsadd = sqlsrv_query($ConnDB, $sqladd);
if(!$rsadd){ $result[] = array( "ERR" => $sqladd); }
break;
case "DeleteChemicalType":
$sqldel = "DELETE FROM ITEM_TYPE WHERE RUNNO in (".$_POST["RUNNO"].") ";
$rsdel = sqlsrv_query($ConnDB,$sqldel );
if(!$rsdel){ $result[] = array( "ERR" => $sqldel); }
break;
}
sqlsrv_close($ConnDB);
$data = array("result" => $result);
echo json_encode($data, JSON_UNESCAPED_UNICODE);
?>managechemicaltype_data.php
$rowp->RUNNO
, "ITEM_NO1" => $rowp->ITEM_NO1
, "ITEM_NO2" => $rowp->ITEM_NO2
, "ITEM_STATUS" => $rowp->ITEM_STATUS
);
}
sqlsrv_close($ConnDB);
$json = array( "result" => $data);
echo json_encode($json, JSON_UNESCAPED_UNICODE);
?>managechemicaltype_report.php
ประเภทสินค้า |
$rowp1->ITEM_NO2 ";
$data[] = array( "ITEM_NO2" => $rowp1->ITEM_NO2 );
}
?>
$rowp2->ITEM_NO1 ";
for ($i=0;$i";
$itm_status = AnswerData($ConnDB, $data[$i]["ITEM_NO2"], $rowp2->ITEM_NO1 );
if($itm_status=="Y"){
echo "";
}else if($itm_status=="N"){
echo "";
}else{
echo "";
}
echo "";
}
?>
ITEM_STATUS;
}
return $itemstatus;
sqlsrv_close($ConDB);
}
?>
checkchemicaltype.php
";
if($chemicalcheck[$k]=="N"){
$count++;
}
}
if($count>0){
echo "
สินค้าไปด้วยกันไม่ได้";
}else{
echo "
สินค้าไปด้วยกันได้";
}
sqlsrv_close($ConnDB);
function CallChemicalTypeVal($ConDB, $cls){
$res = array();
$c = explode(", ", $cls.", ");
$num = count($c) - 1;
for($i=0;$i<$num;$i++){
for($j=0;$j<$num;$j++){
if($c[$i]!=$c[$j]){
$res[] = CheckChemicalType($ConDB, $c[$i], $c[$j]);
}
}
}
return $res;
sqlsrv_close($ConDB);
}
function CheckChemicalType($ConDB, $item1, $item2){
$sql = "SELECT ITEM_STATUS
FROM ITEM_TYPE
WHERE ITEM_NO1='$item1'
and ITEM_NO2='$item2'";
$rsc = sqlsrv_query($ConDB, $sql);
while($rowp = sqlsrv_fetch_object($rsc)) {
$itemstatus = $rowp->ITEM_STATUS;
}
return $itemstatus;
sqlsrv_close($ConDB);
}
?>