本文整理汇总了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