403Webshell
Server IP : 27.254.152.13  /  Your IP : 216.73.217.38
Web Server : Apache/2
System : Linux ns1-252017.dragonhispeed.com 5.2.0 #1 SMP Fri Mar 29 22:50:14 MSK 2024 x86_64
User : coloflew ( 1072)
PHP Version : 5.6.40
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/coloflew/domains/fulltion.com/private_html/administrator/modules/manu_supply/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/coloflew/domains/fulltion.com/private_html/administrator/modules/manu_supply//supplyout.php
 
<?php

@$linkurl = "index.php?name=manu_supply&file=supplyout";
if(isset($fullsc)){
@$linkurl .= "&fullsc=fullsc";
}

if(@$_GET['act2']=="step1"){
	@$arrData = array();
	@$arrCustomerReceive = array();
	@$arrCustomerReceiveAgent = array();
	
	if(@$_POST['ReceiveID']){
		@$getcheckname = @$db->getOne("customer","count(*) as count "," CustomerID='".@$_POST['ReceiveID']."'");
	
		@$getname = @$db->getOne("customer","*"," CustomerID='".@$_POST['ReceiveID']."'");
	}else{
		@$getcheckname = @$db->getOne("customer","count(*) as count "," CustomerName='".@$_POST['ReceiveName']."' and CustomerIdentification='".@$_POST['ReceiveIdentification']."' and CustomerSurName='".@$_POST['ReceiveSurName']."'");
	
		@$getname = @$db->getOne("customer","*"," CustomerName='".@$_POST['ReceiveName']."' and CustomerIdentification='".@$_POST['ReceiveIdentification']."' and CustomerSurName='".@$_POST['ReceiveSurName']."'");
	}
	
	@$getcheck = @$getcheckname['count'];
	@$getidReceive = @$getname['CustomerID'];
	//echo "<pre>"; print_r(@$getidReceive);
	//exit;
	if(@$getcheck == 0)
	{
		@$arrCustomerReceive['CustomerName']		= @$_POST['ReceiveName'];
		@$arrCustomerReceive['CustomerSurName']		= @$_POST['ReceiveSurName'];
		@$arrCustomerReceive['CustomerIdentification']		= @$_POST['ReceiveIdentification'];
		@$arrCustomerReceive['CustomerAddress']		= @$_POST['ReceiveAddress'];
		@$arrCustomerReceive['CustomerProvince']	= @$_POST['ReceiveProvince'];
		@$arrCustomerReceive['CustomerDistrict']	= @$_POST['ReceiveDistrict'];
		@$arrCustomerReceive['CustomerTambon']	= @$_POST['ReceiveTambon'];
		@$arrCustomerReceive['CustomerPostCode']	= @$_POST['ReceivePostCode'];
		@$arrCustomerReceive['CustomerPhon']		= @$_POST['ReceiveTel'];
		@$arrCustomerReceive['CustomerHomePhon']		= @$_POST['ReceiveHomeTel'];
		@$arrCustomerReceive['CustomerOtherPhon']		= @$_POST['ReceiveOtherPhon'];
		@$arrCustomerReceive['CustomerTypeID']		= '1';
		@$arrCustomerReceive['CustomerLastUse']		= @$objMaster->getdateformat(date("d M Y",time()));
		
		foreach($arrCustomerReceive as $k => $v ){
				@$arrCustomerReceive[@$k] = str_replace("'", "\'", @$v); 
		}
		//echo "<pre>"; print_r(@$arrDataContact); exit();
		@$db->insertData("customer",@$arrCustomerReceive);	
		@$getidReceivenew = @$db->getOne("customer","*","","order by CustomerID desc","limit 1");
		@$getidReceive = @$getidReceivenew['CustomerID'];
	}
	else
	{
		//@$arrCustomerReceive['CustomerName']		= @$_POST['ReceiveName'];
		//@$arrCustomerReceive['CustomerSurName']		= @$_POST['ReceiveSurName'];
		@$arrCustomerReceive['CustomerAddress']		= @$_POST['ReceiveAddress'];
		@$arrCustomerReceive['CustomerProvince']	= @$_POST['ReceiveProvince'];
		@$arrCustomerReceive['CustomerDistrict']	= @$_POST['ReceiveDistrict'];
		@$arrCustomerReceive['CustomerTambon']	= @$_POST['ReceiveTambon'];
		@$arrCustomerReceive['CustomerPostCode']	= @$_POST['ReceivePostCode'];
		@$arrCustomerReceive['CustomerPhon']		= @$_POST['ReceiveTel'];
		@$arrCustomerReceive['CustomerHomePhon']		= @$_POST['ReceiveHomeTel'];
		@$arrCustomerReceive['CustomerOtherPhon']		= @$_POST['ReceiveOtherPhon'];
		@$arrCustomerReceive['CustomerLastUse']		= @$objMaster->getdateformat(date("d M Y",time()));
		
		foreach($arrCustomerReceive as $k => $v ){
				@$arrCustomerReceive[@$k] = str_replace("'", "\'", @$v); 
		}
		//echo "<pre>"; print_r(@$arrDataContact); exit();
		@$db->updateData("customer",@$arrCustomerReceive," CustomerID='".@$getidReceive."'");
	}
	@$ReceiveRes = @$db->getOne("customer","*"," CustomerID='".@$getidReceive."'");
	@$idchackinvoice = @$getidReceive;
	
	@$CheckAgent = @$_POST['CheckAgent'];
	if(@$CheckAgent == 1){
		@$getcheckname = @$db->getOne("customer","count(*) as count "," CustomerName='".@$_POST['ReceiveAgentName']."' and CustomerIdentification='".@$_POST['ReceiveAgentIdentification']."' and CustomerSurName='".@$_POST['ReceiveAgentSurName']."'");
		@$getcheck = @$getcheckname['count'];
	
		@$getname = @$db->getOne("customer","*"," CustomerName='".@$_POST['ReceiveAgentName']."' and CustomerIdentification='".@$_POST['ReceiveAgentIdentification']."' and CustomerSurName='".@$_POST['ReceiveAgentSurName']."'");
		
		@$getidReceiveAgent = @$getname['CustomerID'];
		//echo '<pre>';print_r(@$getname);
		
		if(@$getcheck == 0)
		{
			@$arrCustomerReceiveAgent['CustomerName']			= @$_POST['ReceiveAgentName'];
			@$arrCustomerReceiveAgent['CustomerSurName']			= @$_POST['ReceiveAgentSurName'];
			@$arrCustomerReceiveAgent['CustomerIdentification']		= @$_POST['ReceiveAgentIdentification'];
			@$arrCustomerReceiveAgent['CustomerAddress']		= @$_POST['ReceiveAgentAddress'];
			@$arrCustomerReceiveAgent['CustomerProvince']		= @$_POST['ReceiveAgentProvince'];
			@$arrCustomerReceiveAgent['CustomerDistrict']		= @$_POST['ReceiveAgentDistrict'];
			@$arrCustomerReceiveAgent['CustomerTambon']	= @$_POST['ReceiveAgentTambon'];
			@$arrCustomerReceiveAgent['CustomerPostCode']		= @$_POST['ReceiveAgentPostCode'];
			@$arrCustomerReceiveAgent['CustomerPhon']			= @$_POST['ReceiveAgentTel'];
			@$arrCustomerReceiveAgent['CustomerHomePhon']			= @$_POST['ReceiveAgentHomeTel'];
			@$arrCustomerReceiveAgent['CustomerOtherPhon']		= @$_POST['ReceiveAgentOtherPhon'];
			@$arrCustomerReceiveAgent['CustomerTypeID']		= '1';
			@$arrCustomerReceiveAgent['CustomerLastUse']		= @$objMaster->getdateformat(date("d M Y",time()));
			
			foreach($arrCustomerReceiveAgent as $k => $v ){
					@$arrCustomerReceiveAgent[@$k] = str_replace("'", "\'", @$v); 
			}
			//echo "<pre>"; print_r(@$arrDataContact); exit();
			@$db->insertData("customer",@$arrCustomerReceiveAgent);	
			@$getidReceivenew = @$db->getOne("customer","*","","order by CustomerID desc","limit 1");
			@$getidReceiveAgent = @$getidReceivenew['CustomerID'];
		}
		else
		{
			//@$arrCustomerReceive['CustomerName']		= @$_POST['ReceiveName'];
			@$arrCustomerReceiveAgent['CustomerAddress']		= @$_POST['ReceiveAgentAddress'];
			@$arrCustomerReceiveAgent['CustomerProvince']		= @$_POST['ReceiveAgentProvince'];
			@$arrCustomerReceiveAgent['CustomerDistrict']		= @$_POST['ReceiveAgentDistrict'];
			@$arrCustomerReceiveAgent['CustomerTambon']	= @$_POST['ReceiveAgentTambon'];
			@$arrCustomerReceiveAgent['CustomerPostCode']		= @$_POST['ReceiveAgentPostCode'];
			@$arrCustomerReceiveAgent['CustomerPhon']			= @$_POST['ReceiveAgentTel'];
			@$arrCustomerReceiveAgent['CustomerHomePhon']			= @$_POST['ReceiveAgentHomeTel'];
			@$arrCustomerReceiveAgent['CustomerOtherPhon']		= @$_POST['ReceiveAgentOtherPhon'];
			@$arrCustomerReceiveAgent['CustomerLastUse']		= @$objMaster->getdateformat(date("d M Y",time()));
			
			foreach($arrCustomerReceiveAgent as $k => $v ){
					@$arrCustomerReceiveAgent[@$k] = str_replace("'", "\'", @$v); 
			}
			//echo "<pre>"; print_r(@$arrDataContact); exit();
			@$db->updateData("customer",@$arrCustomerReceiveAgent," CustomerID='".@$getidReceiveAgent."'");
		}
	@$ReceiveAgentRes = @$db->getOne("customer","*"," CustomerID='".@$getidReceiveAgent."'");
	@$idchackinvoice = @$getidReceiveAgent;
	}
	
	if($_SESSION['member']['type'] != "Administrator"){
		$whereChkP = " and InvoiceSetEndPoint='".$_SESSION['member']['point']."'";
	}else{
		$whereChkP = "";
	}

  //create by nui //
	if($_REQUEST['CheckAgent']==1){
		@$getInvoiceID = @$db->getAll( "invoice", "*"," InvoiceReceiveID = '".$_REQUEST['ReceiveID']."' and InvoiceStatus != 4 and CheckDalivary != '1'".$whereChkP ,"" );

	}else{
		@$getInvoiceID = @$db->getAll( "invoice", "*"," InvoiceReceiveID = '".@$idchackinvoice."' and InvoiceStatus != 4 and CheckDalivary != '1'".$whereChkP ,"" );
	}
	  //create by nui //

}
//echo "<pre>";print_r(@$getInvoiceID);
if(@$_GET['act']=="add"){
	@$arrData = array();
	@$arrDataHist = array();
	
	if(count(@$_POST['pagedel']) > 0){
		foreach($_POST['pagedel'] as $key => $val){
		
			@$getiddetail = @$db->getOne("invoicedetail","*","InvoiceDetailID='".@$val."'","","");
			@$getend = @$db->getOne("invoice","*","InvoiceID='".@$getiddetail['InvoiceID']."'","","");
			@$arrDataHist['InvoiceDetailID'] = @$getiddetail['InvoiceDetailID'];
			@$arrDataHist['InvoiceID'] 		= @$getiddetail['InvoiceID'];
			@$arrDataHist['LastPoint'] 		= @$getiddetail['LastPoint'];
			@$arrDataHist['EmpSendID'] 		= @$_SESSION['member']['userid'];
			@$arrDataHist['StartPoint']		= @$getend['InvoiceStartPoint'];
			@$arrDataHist['EndPoint']		= @$getend['InvoiceEndPoint'];
			@$arrDataHist['CustomerReceiveID'] = @$_POST['CustomerReceiveID'];
			@$arrDataHist['status'] 			= '4';
			@$arrDataHist['HistDatetime'] 	= date("Y-m-d H:i:s");
			
			@$db->insertData("hist",@$arrDataHist);
		
			@$arrData['CustomerReceiveID'] = @$_POST['CustomerReceiveID'];
			@$arrData['EmpSendID'] = @$_SESSION['member']['userid'];
			@$arrData['EmpReviceID'] = '0';
			@$arrData['status'] = "4";
			
			foreach($arrData as $k => $v ){
					@$arrData[@$k] = str_replace("'", "\'", @$v); 
			}
			
			@$datasu = @$db->updateData("invoicedetail",@$arrData," InvoiceDetailID='".@$val."'");
			
			@$getcode = @$db->getOne( "invoicedetail", "*"," InvoiceDetailID = '".@$val."'" );
			@$getcount = @$db->getOne( "invoicedetail", "count(*) as counts"," InvoiceID = ".@$getcode['InvoiceID'],"" );
			@$getcomplate = @$db->getOne( "invoicedetail", "count(*) as counts"," InvoiceID = ".@$getcode['InvoiceID']." and status = 4","" );
				
			if(@$getcount['counts'] == @$getcomplate['counts']){
				@$arrUpdateComplate = array();
				@$arrUpdateComplate['InvoiceStatus'] = '4';	
				@$datasu = @$db->updateData("invoice",@$arrUpdateComplate," InvoiceID ='".@$getcode['InvoiceID']."'");
			}
		}
	}
	@$CheckAgent = @$_POST['CheckAgentstep2'];
	@$ReceiveRes = @$db->getOne("customer","*"," CustomerID='".@$_POST['CustomerReceiveID']."'");
	if(@$CheckAgent == 1){
	@$ReceiveAgentRes = @$db->getOne("customer","*"," CustomerID='".@$_POST['InvoiceReceiveID']."'");
	}
	@$getInvoiceID = @$db->getAll( "invoice", "*"," InvoiceReceiveID = '".@$_POST['InvoiceReceiveID']."' and InvoiceStatus != 4","" );
	@$msg = "Save Data complete.";
	@$res = true;
}
@$where_lang = "lang_code='".@$lang_code."'";
@$where_province = "lang_code='".@$lang_code."' and status='1'";
@$where_district = "lang_code='".@$lang_code."' and status='1'";
@$where_point = "lang_code='".@$lang_code."' and DeliveryPointStatus='1'";

@$getProvince = @$db->getAll( "province", "*",@$where_province,"" );
@$getDistrict = @$db->getAll( "district", "*",@$where_district,"" );
@$getpoint = @$db->getAll( "deliverypoint", "*",@$where_point,"" );

@$getRoute = @$db->getAll( "route", "*"," RouteStatus = '1'","" );
?>

<!-- Scrip Java-->

              <!--#########################Body######################################################################-->
    
<div class="content-box">

    <div class="content-box-header">
    <?PHP if(isset($fullsc)){ ?>
			<label><a href="index.php?name=manu_main&hk=login"><img src="resources/images/home.png" alt="Edit" /></a></label>
        <?PHP }?>
		<h3><?php echo @$lang_set['ReceiveSupplyProduct']; ?></h3>					       	
    </div>    
    <div class="content-box-content">
    <form action="<?PHP echo @$linkurl;?>&act2=step1" method="post" onsubmit="return checkpagesupplyout();">
    <!--onsubmit="return checkpagesupplyinstepone();"-->
	<div class="content-box">	
    	<div class="content-box-header">
        	<h3 style="color:#FF0000"><?php echo @$lang_set['ReceiveProfile']; ?></h3>
            <span style="float:right; margin-right:5px; margin-top:5px;"><input type="button" class="button" onclick="SearchCustomer('Receive','0');" value="<?PHP echo "ค้นหาข้อมูลในระบบ";?>" /><a href="#Search" id="hideSearch" ></a></span>	
        </div>
        <div class="content-box-content">
        <?php if(@$res){?>
          <div class="notification success png_bg">
             <a href="#" class="close"><img src="resources/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
                   <div>
                       <?php echo @$msg;?>
                   </div>
             </div>
          <meta http-equiv="refresh" content="0;URL=<?PHP echo @$linkurl;?>">
        <?php }?>
        <table style="border:1px solid #fff; background:#fff;">
        	<tr style="background:#fff;">
            	<td width="100"><label><?php echo @$lang_set['NameRecv']; ?>:</label></td>
                <td colspan="2">
                	<input type="hidden" name="ReceiveID" id="ReceiveID" value="" />
                    <input type="text" class="text-input large-input" name="ReceiveName" id="ReceiveName" 
                    value="<?php echo @$ReceiveRes['CustomerName'];?>" />                      
                </td>
                <td>
                	<label><?php echo @$lang_set['SurNameRecv']; ?>:</label>
                </td>
                <td>
                    <input type="text" class="text-input large-input" name="ReceiveSurName" id="ReceiveSurName" 
                    value="<?php echo @$ReceiveRes['CustomerSurName'];?>" />                      
                </td>
                <td>
                	<label><?php echo @$lang_set['IdentificationRecv']; ?>:</label>
                </td>
                <td colspan="2">
                	<input type="text" class="text-input large-input" name="ReceiveIdentification" id="ReceiveIdentification" 
                    value="<?php echo @$ReceiveRes['CustomerIdentification'];?>" maxlength="13"/>
               </td>
                <!--<td align="center">
               		<label><?php echo "เลือกที่มีในระบบ" ?>:</label>
               </td>
               <td>
                    <a title="Search" onclick="SearchCustomer('Receive','0');"><?PHP echo @$lang_set['input_search'];?></a>
                    <a href="#Search" rel="modal" id="hideSearch" ></a>
                    
               </td>-->
            <tr>
        </table>
         <div id="ShowDalivary1" style="display:none">
        <table style="border:1px solid #fff; background:#fff;">
        	<tr>
            	<td width="200">
                	<label><?php echo @$lang_set['AddressRecv']; ?>:</label>
                </td>
                <td>
                    <input type="text" class="text-input large-input" name="ReceiveAddress" id="ReceiveAddress" 
                    value="<?php echo @$ReceiveRes['CustomerAddress'];?>" />
                </td>
                
            <tr>
        </table>
        <table>
        	<tr style="border:1px solid #fff; background:#fff;">
            	<td>   
                    <label><?php echo @$lang_set['emp_province']; ?>:</label>
                </td>
                <td>
                    <select  name="ReceiveProvince" id="ReceiveProvince" onchange="SelectProvince('<?PHP echo @$lang_code;?>','Receive','0')" class="widthselect">
					<?php 
                        if(@$getProvince){
							foreach($getProvince as $key => $val){
                    ?>
                        <option value="<?php echo @$val['PROVINCE_ID'];?>" <?php echo (@$val['PROVINCE_ID']=='' || @$val['PROVINCE_ID']==@$ReceiveRes['CustomerProvince'] ? "selected" : "")?>><?php echo @$val['PROVINCE_NAME'];?></option>
                    <?php 	}
                        }
                    ?>						
                      </select>
                </td>
                <td>
                	<label><?php echo @$lang_set['emp_district']; ?>:</label>
                </td>
                <td>
                    <select name="ReceiveDistrict" id="ReceiveDistrict" class="widthselect">
					<?php 
                        if(@$getDistrict){
							foreach($getDistrict as $key => $val){
                    ?>
                        <option value="<?php echo @$val['AMPHUR_ID'];?>" <?php echo (@$val['AMPHUR_ID']=='' || @$val['AMPHUR_ID']==@$ReceiveRes['CustomerDistrict'] ? "selected" : "")?>><?php echo @$val['AMPHUR_NAME'];?></option>
                    <?php 	}
                        }
                     ?>						
                      </select>
                </td>
                <td>
                   <label><?php echo @$lang_set['tambon']; ?>:</label>
                </td>
                <td>
                      <input type="text" class="text-input large-input" name="ReceiveTambon" id="ReceiveTambon" 
                      value="<?php echo @$ReceiveRes['CustomerTambon'];?>"/>
                </td>
                <td>
                   <label><?php echo @$lang_set['postcode']; ?>:</label>
                </td>
                <td>
                      <input type="text" class="text-input medium-input" name="ReceivePostCode" id="ReceivePostCode" 
                      value="<?php echo @$ReceiveRes['CustomerPostCode'];?>" maxlength="5"/>
                </td>
            <tr>
        </table>
        </div>
        <table >
        	<tr style="border:1px solid #fff; background:#fff;">
                <td>
                   <label><?php echo @$lang_set['telephonenum']; ?>:</label>
                </td>
                <td>
                      <input type="text" class="text-input large-input" name="ReceiveTel" id="ReceiveTel" 
                      value="<?php echo @$ReceiveRes['CustomerPhon'];?>" maxlength="10" />
                </td>
                <td>
                   <label><?php echo @$lang_set['hometelephonenum']; ?>:</label>
                </td>
                <td>
                      <input type="text" class="text-input large-input" name="ReceiveHomeTel" id="ReceiveHomeTel" 
                      value="<?php echo @$ReceiveRes['CustomerHomePhon'];?>" maxlength="9" />
                </td>
                <td>
                         <label><?php echo @$lang_set['customer_phonother']; ?>:</label>
                    </td>
                    <td>
                        <input type="text" class="text-input large-input" name="ReceiveOtherPhon" id="ReceiveOtherPhon"
                         value="<?php echo @$ReceiveRes['CustomerOtherPhon'];?>" />
                     </td>
                     <td></td>
				<td>
                	<label><?php echo @$lang_set['agent']; ?>:</label>
                </td>
                <td>
                <input type="checkbox" name="Agent" onclick="CheckShowAgent();" <?PHP if(@$_POST['CheckAgent'] == 1){echo 'checked="checked"';}?>/>
                <input type="hidden" value="0" id="CheckAgent" name="CheckAgent"/>
                </td>
            <tr>
       </table>
		</div>
    </div>
<div class="content-box" id="ShowAgent" <?PHP if(@$CheckAgent == 0){echo 'style="display:none"';}?>>
       <div class="content-box-header">
        	<h3 style="color:#FF0000"><?php echo @$lang_set['ReceiveAgentProfile']; ?></h3>	
            <span style="float:right; margin-right:5px; margin-top:5px;"><input type="button" class="button" onclick="SearchCustomer('ReceiveAgent','0');" value="<?PHP echo "ค้นหาข้อมูลในระบบ";?>" /><a href="#Search" id="hideSearch" ></a></span>
        </div>
        <div class="content-box-content">
       <table>
            	<tr style="border:1px solid #fff; background:#fff;">
              		<td>
                  		<label><?php echo @$lang_set['NameRecv']; ?>:</label>
                     </td>
                	<td>
                      	<input type="text" class="text-input large-input" name="ReceiveAgentName" id="ReceiveAgentName" 
                        value="<?php echo @$ReceiveAgentRes['CustomerName'];?>" />                      
                    </td>
                     <td>
                        <label><?php echo @$lang_set['SurNameRecv']; ?>:</label>
                    </td>
                	<td>
                        <input type="text" class="text-input large-input" name="ReceiveAgentSurName" id="ReceiveAgentSurName" 
                        value="<?php echo @$ReceiveAgentRes['CustomerSurName'];?>" />                      
                    </td>
                    <td>
                	<label><?php echo @$lang_set['IdentificationRecv']; ?>:</label>
                    </td>
                	<td>
                	<input type="text" class="text-input large-input" name="ReceiveAgentIdentification" id="ReceiveAgentIdentification" 
                    value="<?php echo @$ReceiveAgentRes['CustomerIdentification'];?>" maxlength="13"/>
               		</td>
                <tr>
            </table>
            <div id="ShowDalivary2" style="display:none">
            <table>
            	<tr style="border:1px solid #fff; background:#fff;">
                	<td>
                   		<label><?php echo @$lang_set['AddressRecv']; ?>:</label>
                    </td>
                	<td>
                      	<input type="text" class="text-input large-input" name="ReceiveAgentAddress" id="ReceiveAgentAddress" 
                        value="<?php echo @$ReceiveAgentRes['CustomerAddress'];?>" />
                    </td>
                <tr>
            </table>
            <table>
            	<tr style="border:1px solid #fff; background:#fff;">
                    <td>  
                      	<label><?php echo @$lang_set['emp_province']; ?>:</label>
                    </td>
                	<td>
                      	<select  name="ReceiveAgentProvince" id="ReceiveAgentProvince" onchange="SelectProvince('<?PHP echo @$lang_code;?>','ReceiveAgent')" class="widthselect">
							<?php 
                            if(@$getProvince){
								foreach($getProvince as $key => $val){
                            ?>
                        	<option value="<?php echo @$val['PROVINCE_ID'];?>" <?php echo (@$val['PROVINCE_ID']=='' || @$val['PROVINCE_ID']==@$ReceiveAgentRes['CustomerProvince'] ? "selected" : "")?>><?php echo @$val['PROVINCE_NAME'];?></option>
							<?php }
                            }
                            ?>						
                      </select>
                    </td>
                    <td>
                     	<label><?php echo @$lang_set['emp_district']; ?>:</label>
                    </td>
                	<td>
                      	<select name="ReceiveAgentDistrict" id="ReceiveAgentDistrict" onchange="SelectDistrict('<?PHP echo @$lang_code;?>','ReceiveAgent')" class="widthselect">
							<?php 
                            if(@$getDistrict){
								foreach($getDistrict as $key => $val){
                            ?>
                        	<option value="<?php echo @$val['AMPHUR_ID'];?>" <?php echo (@$val['AMPHUR_ID']=='' || @$val['AMPHUR_ID']==@$ReceiveAgentRes['CustomerDistrict']  ? "selected" : "")?>><?php echo @$val['AMPHUR_NAME'];?></option>
							<?php }
                            }
                            ?>						
                      </select>
                    </td>
                    <td>
                       <label><?php echo @$lang_set['tambon']; ?>:</label>
                    </td>
                	<td>
                          <input type="text" class="text-input large-input" name="ReceiveAgentTambon" id="ReceiveAgentTambon" 
                          value="<?php echo @$ReceiveAgentRes['CustomerTambon'];?>"/>
                    </td>
                    <td>
                       <label><?php echo @$lang_set['postcode']; ?>:</label>
                    </td>
                	<td>
                          <input type="text" class="text-input medium-input" name="ReceiveAgentPostCode" id="ReceiveAgentPostCode" 
                          value="<?php echo @$ReceiveAgentRes['CustomerPostCode'];?>" maxlength="5"/>
                    </td>
                <tr>
            </table>
            </div>
            <table>
                <tr style="border:1px solid #fff; background:#fff;">
                    <td>
                       <label><?php echo @$lang_set['telephonenum']; ?>:</label>
                    </td>
                    <td>
                          <input type="text" class="text-input large-input" name="ReceiveAgentTel" id="ReceiveAgentTel" 
                          value="<?php echo @$ReceiveAgentRes['CustomerPhon'];?>" maxlength="10"/>
                    </td>
                    <td>
                   		<label><?php echo @$lang_set['hometelephonenum']; ?>:</label>
                   </td>
                    <td>
                      <input type="text" class="text-input large-input" name="ReceiveAgentHomeTel" id="ReceiveAgentHomeTel" 
                      value="<?php echo @$ReceiveAgentRes['CustomerHomePhon'];?>"  maxlength="9"/>
                    </td>
                    <td>
                         <label><?php echo @$lang_set['customer_phonother']; ?>:</label>
                    </td>
                    <td>
                        <input type="text" class="text-input large-input" name="ReceiveAgentOtherPhon" id="ReceiveAgentOtherPhon"
                         value="<?php echo @$ReceiveAgentRes['CustomerOtherPhon'];?>" />
                     </td>
                     <td></td>
                </tr>
           </table>
       </div>
	</div>
    <div class="pagination">
    	<input type="submit" class="button" value="<?php echo @$lang_set['submit']; ?>" />
    </div>
    </form>
    </div>
</div>  
<?PHP 


if(@$getInvoiceID){?>
<div class="content-box">
    <div class="content-box-header">
		<h3><?php echo @$lang_set['SupplyProduct']; ?></h3>	
        <?php if(count($getInvoiceID) > 5){//echo '<pre>';print_r(@$_SESSION['member']['point']);?>
        <div style="float:right; margin-top:10px;">
        		<select name="pointData" style="height:30px; color:#666;" onchange="ShowDataDetail(<?php echo count($getInvoiceID);?>,options[selectedIndex].value);">	
        		<?php 
					
                    foreach($getInvoiceID as $key => $val){ 
						$i = $key+1;
						@$GetInvoice = @$db->getOne( "invoice", "*"," InvoiceID = '".@$val['InvoiceID']."'","" );
                        @$getstartname = @$db->getOne("deliverypoint","*","DeliveryPointID = ".@$GetInvoice['InvoiceStartPoint']);
						@$getendname = @$db->getOne("deliverypoint","*","DeliveryPointID = ".@$GetInvoice['InvoiceEndPoint']);
                ?>
                    <option value="<?php echo @$i; ?>">
                        <?php echo @$getstartname['DeliveryPointName']."-".@$getendname['DeliveryPointName']."|".@$GetInvoice['InvoiceCode'];?>
                    </option> 
                <?PHP 
                    } 
                ?> 
                </select>
         </div>
        <?php }else{?>		
			<ul class="content-box-tabs">
				<?php 
                    @$i =1;
					//echo '<pre>';print_r(@$GetInvoiceID);
                    foreach($getInvoiceID as $val){ 
						  @$GetInvoice = @$db->getOne( "invoice", "*"," InvoiceID = '".@$val['InvoiceID']."'","" );
                          @$getstartname = @$db->getOne("deliverypoint","*","DeliveryPointID = ".@$GetInvoice['InvoiceStartPoint']);
						  @$getendname = @$db->getOne("deliverypoint","*","DeliveryPointID = ".@$GetInvoice['InvoiceEndPoint']);
                ?>
                    <li>
                        <a href="#<?php echo @$i; ?>" <?php echo (@$i=="1" ? 'class="default-tab"' : '');?>><?php echo @$getstartname['DeliveryPointName']."-".@$getendname['DeliveryPointName']."|".@$GetInvoice['InvoiceCode'];?></a>
                    </li> 
                <?PHP 
                    @$i++;
                    } 
                ?> 
            </ul>
          <?php }?>
         <div class="clear"></div>   
               	
    </div>
    <form action="<?PHP echo @$linkurl;?>&act=add" method="post">
    <input type="hidden" name="InvoiceReceiveID" value="<?php echo  @$idchackinvoice;?>">
    <input type="hidden" name="CustomerReceiveID" value="<?php echo  @$getidReceive;?>">
    <input type="hidden" name="CheckAgentstep2" value="<?php echo  @$CheckAgent;?>"/>
    <div class="content-box-content" >
        <?php 
			@$i =1;
			foreach($getInvoiceID  as $val){
			@$GetInvoice = @$db->getOne( "invoice", "*"," InvoiceID = '".@$val['InvoiceID']."'","" );
			@$Getproduct = @$db->getAll( "invoicedetail", "*"," InvoiceID = '".@$GetInvoice['InvoiceID']."'","" );
			@$sendRes = @$db->getOne("customer","*"," CustomerID='".@$GetInvoice['InvoiceSendID']."'"); 
			@$getsendprovince = @$db->getOne("province","*"," PROVINCE_ID='".@$sendRes['CustomerProvince']."'");
			@$getsenddistrict = @$db->getOne("district","*"," AMPHUR_ID='".@$sendRes['CustomerDistrict']."'");
			//echo "<pre>";print_r($Getproduct);

		?>  
    	<div class="tab-content <?php echo (@$i=="1" ? 'default-tab' : '');?>" id="<?php echo @$i; ?>">
              <!--#########################Body######################################################################-->
        
    	<div class="content-box-header">
        	<h3 style="color:#FF0000"><?php echo @$lang_set['SendProfile']; ?></h3>	
        </div>
        <table>
        	<tr>
            	<td width="110"><label><?php echo @$lang_set['Namesend']; ?>:</label></td>
                <td style="text-align:left;"><?php echo @$sendRes['CustomerName']; ?></td>
                <td width="60"><label><?php echo @$lang_set['SurNamesend']; ?>:</label></td>
                <td style="text-align:left;"><?php echo @$sendRes['CustomerSurName']; ?></td>
                <td width="130"><label><?php echo @$lang_set['Identificationsend']; ?>:</label></td>
                <td style="text-align:left;"><?php echo @$sendRes['CustomerIdentification']; ?></td>
            <tr>
        </table>
        <table>
        	<tr>
            	<td width="50px">
                	<label><?php echo @$lang_set['Addresssend']; ?>:</label>
                </td>
                <td>
                    <?php echo @$sendRes['CustomerAddress']; ?>
                </td>
            <tr>
        </table>
        <table>
        	<tr>
            	<td width="50px">   
                    <label><?php echo @$lang_set['emp_province']; ?>:</label>
                </td>
                <td>
                    <?php echo @$getsendprovince['PROVINCE_NAME']; ?> 
                </td>
                <td width="50px">
                	<label><?php echo @$lang_set['emp_district']; ?>:</label>
                </td>
                <td>
                    <?php echo @$getsenddistrict['AMPHUR_NAME']; ?>
                </td>
                <td width="50px">
                	<label><?php echo @$lang_set['tambon']; ?>:</label>
                </td>
                <td>
                    <?php echo @$sendRes['CustomerTambon']; ?>
                </td>
               <td width="100px">
                   <label><?php echo @$lang_set['postcode']; ?>:</label>
               </td>
                <td>
                   <?php echo @$sendRes['CustomerPostCode']; ?>
                </td>
            <tr>
        </table>
        <table>
        	<tr>
                <td width="100px">
                   <label><?php echo @$lang_set['telephonenum']; ?>:</label>
                </td>
                <td width="300px">
                   <?php echo @$sendRes['CustomerPhon']; ?>
                </td>
                <td width="100px">
                   <label><?php echo @$lang_set['hometelephonenum']; ?>:</label>
                </td>
                <td width="300px">
                   <?php echo @$sendRes['CustomerHomePhon']; ?>
                </td>
                <td></td>
            <tr>
       </table>
       
 <!--#########################ListItem######################################################################-->
		<p></p>
		<div class="content-box-header">
        	<h3 style="color:#FF0000"><?php echo @$lang_set['recvdetailproduct']; ?></h3>	
        </div>
			<table id="mytbl_<?php echo @$i;?>" width="97%">
            	<thead>
            		<tr>
                        <th width="20"><input type="checkbox" class="check_all" onclick="$('.button').show();"/></th>
                        <th style="text-align:left;"><?php echo @$lang_set['CodeProduct']; ?></th>
                        <th style="text-align:left;"><?php echo @$lang_set['NameProduct']; ?></th>
                        <th style="text-align:left;"><?php echo @$lang_set['SizeProducr']; ?></th>
                        <th style="text-align:left;"><?php echo @$lang_set['WeightProduct']; ?></th>
                        <th style="text-align:left;"><?php echo @$lang_set['Sale']; ?></th>
                        <th style="text-align:left;"><?php echo @$lang_set['Price/Unit']; ?></th>
                        <th style="text-align:left;"><?php echo @$lang_set['lastpoint']; ?></th>
                        <th style="text-align:left;"><?php echo @$lang_set['invoice_status']; ?></th>
                        <th></th>
                	</tr>
                </thead>
                <tbody>
                <?PHP 
					
					if(@$Getproduct){
                		foreach($Getproduct as $key => $va){
						@$getpoint = @$db->getOne("deliverypoint","*",@$where_lang." and DeliveryPointID='".@$va['LastPoint']."'");
						@$getstatusproduct = @$db->getOne("invoidestatus","*"," statusid='".@$va['status']."'");
						@$getnamesize = @$db->getOne("setupsize","*","SetupSizeID = ".@$va['ProductSize']);
				?>
              	<tr>
                	<td>
                    <?PHP if(@$va['status'] == "3"){?>
                    	 <input type="checkbox" name="pagedel[]" value="<?php echo @$va['InvoiceDetailID'];?>" onclick="$('.button').show();"/>
                    <?PHP }?>
					</td><td>
                    	<?php echo @$va['ProductCode']; ?>
                    </td><td>
                    	<?php echo @$va['ProductName']; ?>
                    </td><td>
                    	<?php echo @$getnamesize['SetupSizeSize']; ?>
                    </td><td>  
                    	<?php echo @$va['ProductWeight']; ?>
                    </td><td>
                    	<?php echo @$va['Saleper']; ?>
                    </td><td>
                    	<?php echo @$va['totalmoney']; ?>
                    </td><td>
						<?php echo @$getpoint['DeliveryPointName'];?>
                    </td><td>
                    	<span id="divstatus_<?php echo @$va['InvoiceDetailID'];?>"><?php echo @$getstatusproduct['statusdesc'];?></span>
                    </td><td>
                    </td><td align="middle" width="3%">
                    	
                    </td>
               <tr>
               <?PHP }
				}else{
			   ?>
               <tr>
                    <th colspan="11" style="text-align:center"><?php echo @$lang_set['not_data']; ?></th>
               <tr>
               <?php 
               	}
               ?>
           </tbody>
       </table>
 		
       		</div>
       
       <?PHP @$i++;}?>
       
       </div>
       		<div class="pagination" style="padding-right:20px;">
                <input type="submit" class="button" value="<?php echo @$lang_set['submit']; ?>" style=" display:none" id="bH"/>
            </div> 
      </form>
</div>
<?PHP }else{?>
<div class="content-box">
    <div class="content-box-header">
		<h3><?php echo @$lang_set['SupplyProduct']; ?></h3>
    </div>
    <div class="content-box-content" >
    <div class="tab-content default-tab" id="1">
<table>
	<tr>
    	<th colspan="11" style="text-align:center"><?php echo @$lang_set['not_data']; ?></th>
    <tr>
</table>
	</div>
	</div>
</div>
<?PHP }?>

<div id="dialog" style="display:none" title="รายการค้นหา">

</div>
<script type="text/javascript">
$('#ReceiveName').focus();
</script> 

Youez - 2016 - github.com/yon3zu
LinuXploit