0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.144.95.167


Current Path : /proc/thread-self/root/var/www/misc/public_html/live100/src/
Upload File :
Current File : //proc/thread-self/root/var/www/misc/public_html/live100/src/sendtostores.php

<?php
function viewSendtoStores($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	session_start();
	
	$query = "select salemrn.FBARCODE, recmrn.FITEMCODE, masitem.FITEMNAME, salemrn.FACCQTY, 
	recmrn.FBATCHNO, date_format(recmrn.FEXPDATE,'%d/%m/%Y') as FEXPDATE from salemrn, recmrn, masitem 
	where recmrn.FITEMCODE = masitem.FITEMCODE and  recmrn.FRECMRNNO = salemrn.FRECMRNNO and ifnull(salemrn.FSTATUS,'') = 'I'
	and ifnull(salemrn.FACCQTY,'0') <> '0'";  
	$rst = $aobj_context->mobj_db->getAll($query);

	if($rst)
	{

		echo $aobj_context->mobj_output->ToJSONEnvelope($rst,0,"success"); 
		return;
	}
	else 
	{
		$error_msg = 'no details found ';
		echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"Disabled"); 
		return;		
	}
}

function saveSendtoStores($aobj_context)
{
	include_once("/JSON.php"); 
	$json = new Services_JSON();
	$lstr_param = stripslashes($aobj_context->mobj_data["sendarr"]);
	$mobj_jsondata = $json->decode($lstr_param);
	$sendarr = get_object_vars($mobj_jsondata);
	for($k=0;$k<count($sendarr);$k++)
	{	   
		$baritmcode = $sendarr[$k]->barcode;
		$val = explode('*',$baritmcode);
		
		$query = "UPDATE salemrn SET FSTATUS='S'
		where FBARCODE ='{$val[0]}'";
		$rst = $aobj_context->mobj_db->Execute($query);	
	}
	if($rst) 
	{		
		$success_msg = 'Updated Successfully';
		echo $aobj_context->mobj_output->ToJSONEnvelope($success_msg,0,"success");
		return;
	}	
	else
	{			
		$error_msg = 'Updated Failed';
		echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"Failure");
		return;
	}
}
?>