You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.7 KiB
64 lines
1.7 KiB
<?php
|
|
|
|
parse_str(file_get_contents("php://input"), $data); /* 取得資料並轉成array */
|
|
|
|
/*
|
|
foreach ($data as $key => $value){
|
|
#echo "Key值:" . $key . "Value值" . $value . "<br/>";
|
|
if (substr($key, 0, 4) == "item"){
|
|
|
|
array_push($item, $value); //取出item號碼放入array中
|
|
|
|
if (isset($_POST[$value])) { //判斷item是否有被點選
|
|
array_push($result,1); //取出result放入array中
|
|
echo $value . ":" . $_POST[substr($key, 4)] . "<br>";
|
|
}else{
|
|
array_push($result,0);
|
|
echo $value . ":" . "0" . "<br>";
|
|
}
|
|
}
|
|
|
|
if (substr($key, 0, 11) == "item_detail"){
|
|
array_push($item_detail, urlencode($value)); //取出detail放入array中
|
|
}
|
|
|
|
}
|
|
*/
|
|
|
|
function get_maintenance_item($combono, $data) {
|
|
$item = array();
|
|
foreach ($data as $key => $value){
|
|
if ((substr($key, 0, 4) == "item") && (substr($key, 0, 5) != "item_")){
|
|
array_push($item, $value); //取出item號碼放入array中
|
|
}
|
|
}
|
|
return $item;
|
|
}
|
|
|
|
function get_maintenance_item_detail($combono, $data) {
|
|
$item_detail = array();
|
|
foreach ($data as $key => $value){
|
|
if (substr($key, 0, 11) == "item_detail"){
|
|
array_push($item_detail, urlencode($value)); //取出detail放入array中
|
|
}
|
|
}
|
|
return $item_detail;
|
|
}
|
|
|
|
function get_maintenance_result($combono, $data) {
|
|
$result = array();
|
|
foreach ($data as $key => $value){
|
|
if ((substr($key, 0, 4) == "item") && (substr($key, 0, 5) != "item_")){
|
|
if (isset($_REQUEST[$value])) { //判斷item是否有被點選
|
|
array_push($result,1); //取出result放入array中
|
|
#echo $value . ":" . $_POST[substr($key, 4)] . "<br>";
|
|
}else{
|
|
array_push($result,0);
|
|
#echo $value . ":" . "0" . "<br>";
|
|
}
|
|
}
|
|
}
|
|
return $result;
|
|
}
|
|
|
|
?>
|