2025-04-14 13:28:09 +05:30
< ? php
error_reporting ( E_ERROR | E_PARSE );
include ( 'includes/config/config.php' );
$issued_batch = $_REQUEST [ 'issued_batch' ];
$data = array ();
if ( $issued_batch != '' && $issued_batch != null ){
$sql_stock_item_old = " select * from item_stock where item_id=' " . $_POST [ 'item_id' ] . " ' and item_batch_no=' " . $issued_batch . " ' and ohc_type_id=' " . $_SESSION [ 'current_ohcttype' ] . " ' order by expiry_date " ;
2026-01-07 09:12:10 +05:30
error_log ( $sql_stock_item_old . " rahul mali " );
2025-04-14 13:28:09 +05:30
if ( ! $result_stock_item_old = @ mysqli_query ( $conn , $sql_stock_item_old )) {
exit ( mysqli_error ( $conn ));
}
if ( mysqli_num_rows ( $result_stock_item_old ) > 0 ) {
while ( $row_stock_item_old = mysqli_fetch_assoc ( $result_stock_item_old )) {
//extract($row);
$data [] = $row_stock_item_old ;
}
}
}
$sql_stock_item = " select * from item_stock where item_id=' " . $_POST [ 'item_id' ] . " ' and stock_qty>0 and ohc_type_id=' " . $_SESSION [ 'current_ohcttype' ] . " ' order by expiry_date " ;
2026-01-07 09:12:10 +05:30
error_log ( $sql_stock_item_old . " rahul mali22 " );
2025-04-14 13:28:09 +05:30
if ( ! $result_stock_item = @ mysqli_query ( $conn , $sql_stock_item )) {
exit ( mysqli_error ( $conn ));
}
if ( mysqli_num_rows ( $result_stock_item ) > 0 ) {
while ( $row_stock_item = mysqli_fetch_assoc ( $result_stock_item )) {
//extract($row);
if ( $row_stock_item [ 'item_batch_no' ] != $issued_batch ){
$data [] = $row_stock_item ;
}
}
}
else
{
$data [ 'status' ] = 200 ;
$data [ 'message' ] = " Data not found! " ;
}
echo json_encode ( $data );
?>