<?php 
session_start();
include('../includes/dbcon.php');

$str=" ";
$email_edit=" ";

//mysqli_real_escape_string($con,$user_unsafe);

//if (empty($item)){   $item=0;   $error=1;       } 


$item_name= mysqli_real_escape_string($con,trim($_POST['itemname_edit']));
$item_id= mysqli_real_escape_string($con,trim($_POST['itemid_edit']));
$description= mysqli_real_escape_string($con,trim($_POST['itemdes_edit']));
$type_id = mysqli_real_escape_string($con,trim($_POST['item_type_edit']));
$cat_id = mysqli_real_escape_string($con,trim($_POST['cat_edit']));
$sp= mysqli_real_escape_string($con,trim($_POST['sp_edit']));
$cp= mysqli_real_escape_string($con,trim($_POST['cp_edit']));
$qoh= mysqli_real_escape_string($con,trim($_POST['qoh_edit']));
$rol= mysqli_real_escape_string($con,trim($_POST['rol_edit']));
$weight= mysqli_real_escape_string($con,trim($_POST['weight_edit']));

if(empty($rol)){     $rol=0; }

if(empty($weight)){
    
    $weight=0;
}

$pp="update item_master set item_name = '$item_name',cat_id='$cat_id',type_id=$type_id, description='$description' ,sales_price=$sp,cost_price=$cp,rol= $rol,Weight=$weight
	  where item_id=$item_id "	;
	  //echo $pp;
		
if ( mysqli_query($con,"update item_master set item_name = '$item_name',cat_id='$cat_id',type_id=$type_id, description='$description' ,sales_price=$sp,cost_price=$cp,rol= $rol,Weight=$weight
	  where item_id=$item_id ")or die(mysqli_error($con)))
		{
			echo "<script>document.location='admin_item_view.php'</script>"; 
		}		



?>