MMCT TEAM
Server IP : 162.214.80.37  /  Your IP : 216.73.216.83
Web Server : Apache
System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : imyrqtmy ( 2189)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home2/imyrqtmy/public_html/inventory/action/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/imyrqtmy/public_html/inventory/action/transfer_data.php
<?php
session_start();
include '../include/db.php';
 // include'../compression.php';

// $uid = $_SESSION["userId"];

 date_default_timezone_set('Asia/Kolkata');
 $cudate = date("Y-m-d") ;

extract($_POST);

 $bid = $_GET['id'];

	 $single_user = "SELECT * FROM `tbl_item` WHERE id = '$bid' and openstock>$stock  ";
		$single_user_r = mysqli_query($con,$single_user);
		$numrow = mysqli_num_rows($single_user_r);
		

		if($numrow > 0)
		{
		 
// 		 echo '1';   

            $sql_row = mysqli_fetch_array($single_user_r);
            
            extract($sql_row);
            
            $news = $openstock - $stock;
            
$sql = "update tbl_item set openstock='$news' where id='$bid'";
$result = mysqli_query($con, $sql) or die(mysqli_error($con));
		 
		    $SQL = "INSERT INTO tbl_item set type='$type',name='$name',wname='$nwname',item_type='item',sku='$sku',unit='$unit',  ret_item='$ret_item',dim_type='$dim_type',dm_l='$dm_l',dm_w='$dm_w',dm_h='$dm_h',manfu='$manfu',upc='$upc',ean='$ean',weight='$weight',w_unit='$w_unit',brand='$brand',mpn='$mpn',isbn='$isbn',sale_price='$sale_price',s_account='$s_account',s_description='$s_description',cost_price='$cost_price',  p_account='$p_account',p_description='$p_description',inventory_acc='$inventory_acc',openstock='$stock',reorderpoint='$reorderpoint',file='$file',barcode='$barcode'    ";
    
    
          if ($con->query($SQL) === TRUE) {

                        $_SESSION['flash_message'] = 'add';
       
        
      echo "<script>;
                window.location.href='../item_list.php';
                </script>";

  }
  else
  {
      echo "<script>;
                window.location.href='../item_list.php';
                </script>";
  }
		    
		}
        else
        {
            echo '2';
        }
                                 
//   $SQL = "INSERT INTO tbl_item set type='$itype',name='$iname',wname='$wname',item_type='item',sku='$sku',unit='$unit',  ret_item='$ret_item',dim_type='$dim_type',dm_l='$l',dm_w='$w',dm_h='$h',manfu='$manfu',upc='$upc',ean='$ean',weight='$wval',w_unit='$wunit',brand='$brand',mpn='$mpn',isbn='$mpn',sale_price='$sale_price',s_account='$s_account',s_description='$s_description',cost_price='$cost_price',  p_account='$p_account',p_description='$p_account',inventory_acc='$inventory_acc',openstock='$openstock',reorderpoint='$reorderpoint',file='$fgr',barcode='$fgr1'    ";
    
    
//           if ($con->query($SQL) === TRUE) {

//                         $_SESSION['flash_message'] = 'add';
       
        
//       echo "<script>;
//                 window.location.href='../item_list.php';
//                 </script>";

//   }
//   else
//   {
//       echo "<script>;
//                 window.location.href='../item_list.php';
//                 </script>";
//   }
  


?>

MMCT - 2023