X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fmanage%2Fitems.php;h=5497838254b515ee22444ab33e8009376406733d;hb=97122b2b71989c3d2ec2fefd1f4ded105dbbf225;hp=d4904041b2e0c3752f2d5fdf1c1a9e7bc5345ab2;hpb=378bc2b13b012988e10aae40e58dc02e9ff960ed;p=fa-stable.git diff --git a/inventory/manage/items.php b/inventory/manage/items.php index d4904041..54978382 100644 --- a/inventory/manage/items.php +++ b/inventory/manage/items.php @@ -56,7 +56,7 @@ function set_edit($stock_id) $_POST['del_image'] = 0; } -function delete_image($stock_id) +function del_image($stock_id) { foreach (array('jpg', 'png', 'gif') as $ext) { $filename = company_path().'/images/'.item_img_name($stock_id).".".$ext; @@ -335,7 +335,7 @@ if (isset($_POST['delete']) && strlen($_POST['delete']) > 1) $stock_id = $_POST['NewStockID']; delete_item($stock_id); - delete_image($stock_id); + del_image($stock_id); display_notification(_("Selected item has been deleted.")); $_POST['stock_id'] = ''; clear_data(); @@ -686,7 +686,7 @@ function generateBarcode() { $query = "SELECT stock_id FROM ".TB_PREF."stock_master WHERE stock_id='" . $tmpBarcodeID . "'"; $arr_stock = db_fetch(db_query($query)); - if ( !$arr_stock['stock_id'] ) { + if ( !$arr_stock || !$arr_stock['stock_id'] ) { return $tmpBarcodeID; } $tmpBarcodeID = "";