Exemplo n.º 1
0
 public function bindRfid()
 {
     $postData = $_POST['txt_json'];
     echo urldecode(json_encode(bindRfid($postData)));
 }
Exemplo n.º 2
0
                $error[$key]->code = 3;
                $error[$key]->des = urlencode('写入RFID数据库失败');
                $error[$key]->rfid = $rfid;
                $key++;
            } else {
                $sql2 = "INSERT INTO {$productionUnit} (rfid_id, waste_id, add_date_time,android_num) VALUES ('{$rfid}', '{$wasteId}', '{$time}','{$imei}')";
                if (!mysql_query($sql2, $con)) {
                    $error[$key]->code = 4;
                    $error[$key]->des = urlencode('写入企业库存数据失败');
                    $error[$key]->rfid = $rfid;
                    $key++;
                }
            }
        } else {
            $error[$key]->code = 5;
            $error[$key]->des = urlencode('RFID标签已经绑定');
            $error[$key]->rfid = $rfid;
        }
        $key++;
    }
    mysql_close($con);
    if (isset($error)) {
        $newerror['error'] = $error;
        return $newerror;
    } else {
        $resultData->code = 200;
        return $resultData;
    }
}
echo urldecode(json_encode(bindRfid()));