本文整理汇总了PHP中DB_Functions::isAmbulanceExisted方法的典型用法代码示例。如果您正苦于以下问题:PHP DB_Functions::isAmbulanceExisted方法的具体用法?PHP DB_Functions::isAmbulanceExisted怎么用?PHP DB_Functions::isAmbulanceExisted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB_Functions
的用法示例。
在下文中一共展示了DB_Functions::isAmbulanceExisted方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
//$response = array("error" => FALSE);
if (isset($_POST['br_id']) && isset($_POST['ambulance_no'])) {
// receiving the post params
$Br_id = $_POST['br_id'];
$Ambulance_No = $_POST['ambulance_no'];
$Ambulance_Name = $_POST['ambulance_name'];
$Ambulance_Type = $_POST['ambulance_type'];
$Ambulance_Charges = $_POST['ambulance_charges'];
$Driver_Name = $_POST['driver_name'];
$Driver_License_No = $_POST['driver_license_no'];
$Driver_Lincense_Image = $_POST['driver_lincense_image'];
$Status = $_POST['status'];
$Ambulance_Id = $_POST['ambulance_id'];
if ($_POST['ambulance_id'] == "") {
// check if patient already exists
if ($db->isAmbulanceExisted($Ambulance_No)) {
// Bed already allocated
$response["response"] = 0;
$response["message"] = $Ambulance_No . " already exists";
echo json_encode($response);
} else {
// create a new user$Cust_Name, $Cust_Email, $Cust_Phone,$Cust_Address,$Cust_City,$Cust_State
$user = $db->insertAmbulance($Br_Id, $Ambulance_No, $Ambulance_Name, $Ambulance_Type, $Ambulance_Charges, $Driver_Name, $Driver_License_No, $Driver_Lincense_Image, $Status);
if ($user) {
// Bed allocated successfully
$response["response"] = 1;
$response["message"] = "Ambulance Details Inserted.";
echo json_encode($response);
} else {
// Bed allocation failed
$response["response"] = 2;