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

$str=" ";

$data = array();

$edate=date("Y-m-d");
$userid=$_SESSION['hrm_id'];

if (isset($_POST['adj_no'])) {
 	$item = trim($_POST['item_id']);
 	$adj_no = trim($_POST['adj_no']);
 	$qty= trim($_POST['qty']);




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


if ($item<>0) {


$sqlsp=mysqli_query($con,"SELECT  * from stock_adjust_temp_detail where tran_id=$adj_no and item_id=$item  ")or die(mysqli_error($con));
	 $count=mysqli_num_rows($sqlsp);
	 if ($count==0){

////////////////////////////////	
 			if ( mysqli_query($con,"INSERT INTO stock_adjust_temp_detail(tran_id,item_id,tran_qty) 
			 VALUES($adj_no,$item,$qty )  ")or die(mysqli_error($con)))
	            { 	exit();    	}

	    }
	    else {
	    	echo "ss";
	    	exit();
              }



} ///if ($item<>0) {

} ///// if (isset($_POST['category'])) {

?>