本文整理匯總了PHP中item::to_string方法的典型用法代碼示例。如果您正苦於以下問題:PHP item::to_string方法的具體用法?PHP item::to_string怎麽用?PHP item::to_string使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類item
的用法示例。
在下文中一共展示了item::to_string方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: item
if (isset($_POST['item_id']) and !empty($_POST['item_id']) and isset($_POST['item_name']) and !empty($_POST['item_name']) and isset($_POST['item_code']) and !empty($_POST['item_code']) and isset($_POST['mrp']) and isset($_POST['tax_category_id']) and !empty($_POST['tax_category_id']) and isset($_POST['purchace_rate']) and isset($_POST['discount_percent']) and isset($_POST['unit']) and !empty($_POST['unit'])) {
$item = new item();
$item->id = $_POST['item_id'];
$item->getItem();
$item->item_code = $_POST['item_code'];
$item->item_name = $_POST['item_name'];
$item->mrp = $_POST['mrp'];
$item->purchace_rate = $_POST['purchace_rate'];
$item->tax_category_id = $_POST['tax_category_id'];
$item->discount_percent = $_POST['discount_percent'];
$item->unit = $_POST['unit'];
if ($item->updateItem()) {
$message = "Item Updated Successfuly";
$responce = array('status' => 'success', 'error' => '', 'data' => array("message" => $message, "id" => $item->id));
} else {
$description = "Item update failed, item : " . $item->to_string();
Log::e($tag, $description);
$mysql_error = mysql_error();
if (empty($mysql_error)) {
$error_message = 'Some server error occured';
} else {
$error_message = $mysql_error;
}
$responce = array('status' => 'failed', 'error' => $error_message, 'data' => array());
}
} else {
$responce = array('status' => 'failed', 'error' => 'Data missing', 'data' => array());
}
} else {
if ($form_id == 22) {
///edit bank
示例2: item
} else {
if ($form_id == 11) {
//item form
if (isset($_POST['item_code']) and !empty($_POST['item_code']) and isset($_POST['item_name']) and !empty($_POST['item_name']) and isset($_POST['mrp']) and isset($_POST['tax_category_id']) and !empty($_POST['tax_category_id']) and isset($_POST['purchace_rate']) and isset($_POST['discount_percent']) and isset($_POST['unit']) and !empty($_POST['unit'])) {
$item = new item();
$item->item_code = $_POST['item_code'];
$item->item_name = $_POST['item_name'];
$item->mrp = $_POST['mrp'];
$item->tax_category_id = $_POST['tax_category_id'];
$item->purchace_rate = $_POST['purchace_rate'];
$item->discount_percent = $_POST['discount_percent'];
$item->unit = $_POST['unit'];
if ($item->addItem()) {
$responce = array('status' => 'success', 'error' => '', 'data' => array('message' => 'Item Added successfully'));
} else {
Log::e($tag, "Item adding failed item : " . $item->to_string() . 'Error : ' . mysql_error());
$mysql_error = mysql_error();
if (empty($mysql_error)) {
$error_message = 'Some server error occured';
} else {
$error_message = $mysql_error;
}
$responce = array('status' => 'failed', 'error' => $error_message, 'data' => array());
}
} else {
$responce = array('status' => 'failed', 'error' => 'Data missing', 'data' => array());
}
} else {
if ($form_id == 22) {
//bank form
if (isset($_POST['bank_name']) and !empty($_POST['bank_name']) and isset($_POST['branch']) and !empty($_POST['branch']) and isset($_POST['ifsc_code']) and !empty($_POST['ifsc_code']) and isset($_POST['account_number']) and !empty($_POST['account_number'])) {
示例3: item
});
session_start();
if (isset($_SESSION['user_id']) and !empty($_SESSION['user_id']) and isset($_GET['user_id']) and !empty($_GET['user_id']) and $_SESSION['user_id'] === $_GET['user_id']) {
if (isset($_POST['form_id']) and !empty($_POST['form_id'])) {
$form_id = $_POST['form_id'];
$tag = "DELETE_FORM_DATA";
if ($form_id == 17) {
///item delete
if (isset($_POST['item_id']) and !empty($_POST['item_id'])) {
$item = new item();
$item->id = $_POST['item_id'];
if ($item->deleteItem()) {
$message = "Item deleted Successfuly";
$responce = array('status' => 'success', 'error' => '', 'data' => array("message" => $message, "id" => $item->id));
} else {
$description = "Item delete failed, item : " . $item->to_string();
Log::e($tag, $description);
$mysql_error = mysql_error();
if (empty($mysql_error)) {
$error_message = 'Some server error occured';
} else {
$error_message = $mysql_error;
}
$responce = array('status' => 'failed', 'error' => $error_message, 'data' => array());
}
} else {
$responce = array('status' => 'failed', 'error' => 'Data missing', 'data' => array());
}
} else {
if ($form_id == 18) {
///vendor delete