| 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 : |
<?php
@$linkurl = "index.php?name=manu_supply&file=supplytotle";
@$link1 = "index.php?name=manu_supply&file=supplydetail";
if(isset($fullsc)){
@$linkurl .= "&fullsc=fullsc";
@$link1 .= "&fullsc=fullsc";
}
//echo "<pre>"; print_r($_SESSION);
/*if(@$_SESSION['member']['permistion'] != 4)
{
@$setpoint = @$_SESSION['member']['point'];
}else
{
@$setpoint = 1;
}*/
@$arrDataHist = array();
if(@$_GET['act'] == "endday"){
@$getiddetail = @$db->getAll( "invoicedetail", "*","status = '1' or status='7'","" );
if(@$getiddetail){
foreach($getiddetail as $key => $val){
@$getinvoice = @$db->getOne( "invoice", "*","InvoiceID = '".@$val['InvoiceID']."'","" );
@$arrDataHist['InvoiceDetailID'] = @$val['InvoiceDetailID'];
@$arrDataHist['InvoiceID'] = @$val['InvoiceID'];
@$arrDataHist['LastPoint'] = @$val['LastPoint'];
@$arrDataHist['StartPoint'] = @$getinvoice['InvoiceStartPoint'];
@$arrDataHist['EndPoint'] = @$getinvoice['InvoiceEndPoint'];
@$arrDataHist['status'] = '9';
@$arrDataHist['HistDatetime'] = date("Y-m-d H:i:s");
@$db->insertData("hist",@$arrDataHist);
}
}
@$msg = "Save Data complete.";
@$res = true;
}
@$search = @$_REQUEST['keyword'];
$where_f = "";
if(@$search){
@$searchnew = str_replace("'", "\'", @$search);
if(@$where_f){
@$where_f .= " and InvoiceDate = '".@$objMaster->getdateformat(@$searchnew)."'";
}else{
@$where_f = " InvoiceDate = '".@$objMaster->getdateformat(@$searchnew)."'";
}
}else{
//@$where_f = " InvoiceCreatePoint = '".@$setpoint."' and InvoiceDate = '".@$objMaster->getdateformat(date("d M Y",time()))."'";
}
if(@$_SESSION['member']['type']!="Administrator"){
@$setpoint = @$_SESSION['member']['point'];
}else{
@$setpoint = @$_POST['DeliveryPointID'];
}
if(@$setpoint){
if(@$where_f){
@$where_f .= " and InvoiceCreatePoint = '".@$setpoint."' ";
}else{
@$where_f = "InvoiceCreatePoint = '".@$setpoint."'";
}
}
@$where_lang = "lang_code='".@$lang_code."'";
@$page = @$_GET['page'] ? @$_GET['page'] : 1;
@$arrpageP = @$db->getAll( "invoice", "*",@$where_f,"" );
@$arrPage = @$objMaster->viewPages(@$page, @$arrpageP, "20");
@$getPage = @$db->getAll( "invoice", "*",@$where_f,@$arrPage["offset"] );
//echo "<pre>";print_r(@$getPage);
@$getPoint = @$db->getAll( "deliverypoint", "*",@$where_lang." and DeliveryPointStatus = '1'","" );
@$getselectstatus = @$db->getAll("invoidestatus","*","");
?>
<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['submanu_supplytotle']; ?></h3>
<ul class="content-box-tabs">
<li><a href="#list" <?php echo (@$_GET['act']=="" ? 'class="default-tab"' : '');?>><?php echo @$lang_set['Productlist']; ?></a></li>
</ul>
<div class="clear"></div>
</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="1;URL=<?PHP echo @$linkurl;?>">
<?php }?>
<div class="tab-content <?php echo (@$_GET['act']=="" ? 'default-tab' : '');?>" id="list">
<form action="<?PHP echo @$linkurl;?>" method="post" name="form_search" id="form_search">
<?php echo @$lang_set['input_search'];?> :
<?php if(@$_SESSION['member']['permistion'] == "4"){?>
<select name="DeliveryPointID">
<?php
if(@$getPoint){foreach($getPoint as $key => $val){
?>
<option value="<?php echo @$val['DeliveryPointID'];?>" <?php echo (@$val['DeliveryPointID']=='' || @$val['DeliveryPointID']==@$setpoint ? "selected" : "")?>><?php echo @$val['DeliveryPointName'];?></option>
<?php }
}
?>
</select>
<?PHP }else{?>
<input type="hidden" name="DeliveryPointID" value="<?PHP echo @$setpoint;?>" />
<?PHP }?>
<input type="text" class="text date_picker" name="keyword" value="<?php echo @$search == ''? @$objMaster->getdbdateformat(date("Y-m-d")) : @$search ;?>"/>
<input type="submit" class="button" value="ค้นหา"/>
</form>
<form action="<?PHP echo @$linkurl;?>" method="post" id="fromupdate" >
<!--#########################Body######################################################################-->
<div class="content-box-header">
<h3 style="color:#FF0000"><?php echo @$lang_set['sendlist']; ?></h3>
</div>
<table cellpadding="0" cellspacing="0" width="100%">
<thead>
<tr>
<!--<th width="20"><input type="checkbox" class="check_all" /></th>-->
<th align="left"><?php echo @$lang_set['invoice_code']; ?></th>
<th align="left"><?php echo @$lang_set['invoice_start']; ?></th>
<th align="left"><?php echo @$lang_set['invoice_end']; ?></th>
<th align="left"><?php echo @$lang_set['invoice_date']; ?></th>
<th align="left" width="20%"><?php echo @$lang_set['invoice_send']; ?></th>
<th align="left" width="20%"><?php echo @$lang_set['NameRecv']; ?></th>
<!--<th style="text-align:right;"><?php echo @$lang_set['invoice_status']; ?></th>-->
<th style="text-align:right;"><?php echo @$lang_set['action']; ?></th>
</tr>
</thead>
<?php
if(@$getPage){
foreach($getPage as $key => $val){
@$getstatusproduct = @$db->getOne("invoidestatus","*"," statusid='".@$val['InvoiceStatus']."'");
@$getstartname = @$db->getOne("deliverypoint","*","DeliveryPointID = ".@$val['InvoiceStartPoint']);
@$getendname = @$db->getOne("deliverypoint","*","DeliveryPointID = ".@$val['InvoiceEndPoint']);
@$sendRes = @$db->getOne("customer","*"," CustomerID='".@$val['InvoiceSendID']."'");
@$receiveRes = @$db->getOne("customer","*"," CustomerID='".@$val['InvoiceReceiveID']."'");
@$getstatus = @$db->getOne("invoidestatus","*"," statusid='".@$val['InvoiceStatus']."'");
?>
<tr>
<th><?php echo @$val['InvoiceCode'];?></th>
<th><?php echo @$getstartname['DeliveryPointName'];?></th>
<th><?php echo @$getendname['DeliveryPointName'];?></th>
<th><?php echo @$objMaster->getdbdateformat(@$val['InvoiceDate']);?></th>
<th><?php echo @$sendRes['CustomerName'];?></th>
<th><?php echo @$receiveRes['CustomerName'];?></th>
<!--<th style="text-align:right;">
<div id="ShowDe"></div>
<?PHP if(@$_SESSION['member']['permistion'] == 4 and @$val['InvoiceStatus'] != 7){?>
<select name="InvoiceStatus_<?php echo @$val['InvoiceID'];?>" id="InvoiceStatus_<?php echo @$val['InvoiceID'];?>" onchange="UpdateStatusInvoice(<?php echo @$val['InvoiceID'];?>,options[selectedIndex].value);">
<?php if(@$getselectstatus){foreach($getselectstatus as $key => $va){?>
<?PHP if(@$va['statusid'] == 1 or @$va['statusid'] == 2 or @$va['statusid'] == 3 or @$va['statusid'] == 4 or @$va['statusid'] == 6 or @$va['statusid'] == 5){?>
<option value="<?PHP echo @$va['statusid'];?>" <?php echo (@$va['statusid']==@$val['InvoiceStatus'] ? "selected" : "");?>><?PHP echo @$va['statusdesc'];?></option>
<?php }}}?>
</select>
<?php
}else{ //echo @$getstatusproduct['statusdesc'];
}?>
</th>-->
<th style="text-align:right;"><a id="show_<?php echo @$val['InvoiceID'];?>" title="Detail" onclick="ShowDetail(<?php echo @$val['InvoiceID'];?>);" style="cursor:pointer;"><?PHP echo @$lang_set['productdetail'];?></a> |
<a href="<?PHP echo @$link1;?>&InvoiceID=<?php echo @$val['InvoiceID'];?>"><?PHP echo @$lang_set['detail'];?></a>
<input type="hidden" value="0" id="CheckShowDetail_<?php echo @$val['InvoiceID'];?>" />
</th>
</tr>
<tr>
<th colspan="11">
<div id="Detail_<?php echo @$val['InvoiceID'];?>" style="display:none">
<table>
<tr style="background:#999; color:#fff;">
<th>ลำดับ</th>
<th align="left"><?php echo @$lang_set['CodeProduct']; ?></th>
<th align="left"><?php echo @$lang_set['NameProduct']; ?></th>
<th align="left"><?php echo @$lang_set['ProductWeight']; ?></th>
<th align="left"><?php echo @$lang_set['ProductSize']; ?></th>
<th align="left"><?php echo @$lang_set['totalmoney']; ?></th>
<th align="left"><?php echo @$lang_set['lastpoint']; ?></th>
<th><?php echo @$lang_set['invoice_status']; ?></th>
<th><?php echo @$lang_set['comment']; ?></th>
</tr>
<?PHP
@$getproduct = @$db->getAll( "invoicedetail", "*"," InvoiceID = '".@$val['InvoiceID']."'","" );
if(@$getproduct){
foreach($getproduct as $key => $va){
@$getstatusproduct = @$db->getOne("invoidestatus","*"," statusid='".@$va['status']."'");
/*@$getstatusstart = @$db->getOne("invoidestatus","*"," statusid=1");
@$getstatuserror = @$db->getOne("invoidestatus","*"," statusid=7");*/
@$getpoint = @$db->getOne("deliverypoint","*",@$where_lang." and DeliveryPointID='".@$va['LastPoint']."'");
@$getnamesize = @$db->getOne("setupsize","*","SetupSizeID = ".@$va['ProductSize']);
?>
<tr>
<td><?php echo ($key+1);?></td>
<td><?php echo @$va['ProductCode'];?></td>
<td><?php echo @$va['ProductName'];?></td>
<td><?php echo @$va['ProductWeight'];?></td>
<td><?php echo @$getnamesize['SetupSizeSize']; ?></td>
<td><?php echo @$va['totalmoney'];?></td>
<td><?php echo @$getpoint['DeliveryPointName'];?></td>
<td>
<?PHP if(@$_SESSION['member']['type'] == "Administrator"){?>
<select name="Status_<?php echo @$va['InvoiceDetailID'];?>" id="Status_<?php echo @$va['InvoiceDetailID'];?>" onchange="UpdateStatusProduct(<?php echo @$va['InvoiceDetailID'];?>,options[selectedIndex].value);">
<?php if(@$getselectstatus){
foreach($getselectstatus as $kk=> $vv){
if($_SESSION['member']['permistion']!=4){
$disabled = "disabled";
}else{
$disabled = "";
}
?>
<?PHP if(@$va['statusid'] != 7 ){?>
<option value="<?PHP echo @$vv['statusid'];?>" <?php echo (@$vv['statusid']==@$va['status'] ? "selected" : "");?> <?php //echo (@$vv['statusid'] != 6 ? $disabled : "");
echo ( (@$va['status']==1 && @$vv['statusid'] == 6) ? "" : $disabled );?>><?PHP echo @$vv['statusdesc'];?></option>
<?php }
}}?>
</select>
<?php }else{?>
<?php echo @$getstatusproduct['statusdesc'];?>
<?php }?>
</td>
<td><div id="divComment<?php echo @$va['InvoiceDetailID'];?>"><?php echo @$va['comment'];?></div></td>
<tr>
<?php }
}else{
?>
<tr>
<th colspan="11" style="text-align:center"><?php echo @$lang_set['not_data']; ?></th>
<tr>
<?php
}
?>
</table>
</div>
</th>
<tr>
<?php
}
}else{
?>
<tr>
<th colspan="11" style="text-align:center"><?php echo @$lang_set['not_data']; ?></th>
</tr>
<?php
}
?>
<tfoot>
<tr>
<td colspan="11">
<!-- Start .pagination -->
<div class="pagination">
<?php if($arrPage['allpage']>1){?>
<a href="<?PHP echo @$linkurl;?>&keyword=<?PHP echo @$search;?>&DeliveryPointID=<?PHP echo @$setpoint;?>&page=1" title="หน้าแรก">« หน้าแรก</a><a href="<?PHP echo @$linkurl;?>&keyword=<?PHP echo @$search;?>&DeliveryPointID=<?PHP echo @$setpoint;?>&page=<?php echo ($page==1 ? $page : @$page-1);?>" title="ก่อนหน้า">« ก่อนหน้า</a>
<?php if( @$arrPage["startPage"]!="" && @$arrPage["endPage"] !="" ){?>
<?php
for($i = @$arrPage["startPage"]; $i <= @$arrPage["endPage"]; ++$i) {
echo'<a href="'.@$linkurl.'&keyword='.@$search.'&DeliveryPointID='.@$setpoint.'&page='.@$i.'" '.(@$page == @$i ? 'class="number current"' : '').'>'.(@$i).'</a>';
}?>
<?php }?>
<a href="<?PHP echo @$linkurl;?>&keyword=<?PHP echo @$search;?>&DeliveryPointID=<?PHP echo @$setpoint;?>&page=<?php echo ($page==$arrPage["allpage"] ? $page : $page+1);?>" title="ถัดไป">ถัดไป »</a><a href="<?PHP echo @$linkurl;?>&keyword=<?PHP echo @$search;?>&DeliveryPointID=<?PHP echo @$setpoint;?>&page=<?php echo @$arrPage["allpage"];?>" title="หน้าสุดท้าย">หน้าสุดท้าย »</a>
<?php }?>
</div>
<!-- End .pagination -->
<div class="clear"></div>
</td>
</tr>
</tfoot>
</table>
</form>
<?php if(@$_SESSION['member']['permistion'] == "4"){?>
<div class="pagination">
<a href="<?PHP echo @$linkurl;?>&act=endday"><img src="resources/images/icons/ShutdownIcon-80x80.png" alt="Print" width="50px" height="50px"/><?PHP echo "Close Day";?></a>
</div>
<?PHP }?>
</div>
</div>
</div>
<a href="#" id="deleteLink"></a>
<div id="dialogDelete" title="หมายเหตุในการเปลี่ยนสถานะพัสดุ">
<form action="" method="post" onSubmit="return chkDelete()">
<textarea name="cause_change" id="cause_change" style="width:100%" /></textarea>
<table>
<tr style="background:#fff;">
<td width="75px">
<label><?php echo @$lang_set['image'];?>:</label>
</td><td>
<?php if(@$arrRes['image']){?>
<img src="images/bus/thumbs/<?php echo @$arrRes['image'];?>" />
<?php }?>
<p class="fileupload"><input type="file" name="image" id="image" class="shortcut-button upload-image" size="45" <?php echo ( !@$arrRes['image'] ? "":"DISABLED");?> ><span class="png_bg"><img src="resources/images/icons/icon_upload.png" alt="อัพโหลดรูปภาพ" width="20" height="20"/></span>
<?php echo ( !@$arrRes['image'] ? "": "<br><input type='checkbox' onClick='if(this.checked){document.getElementById(\"chkDelImage1\").value=\"".@$arrRes['image']."\";document.getElementById(\"image\").disabled=\"\";}else{document.getElementById(\"chkDelImage1\").value=\"\";document.getElementById(\"image\").disabled=\"true\";}'> ".@$lang_set['delete_image']." <input type='hidden' value='' id='chkDelImage1' name='chkDelImage1'>" ) ?><input type="hidden" id="oldImage1" name="oldImage1" value="<?php echo @$arrRes['image']; ?>"></p>
</td>
<tr>
</table>
<input type="hidden" name="id_hid" id = "id_hid" value="" />
<div id="txtErrorCause" style="display:none; color:#F00; font-size:14px;" align="center">!! กรุณากรอกหมายเหตุการเปลี่ยนสถานะพัสดุด้วยค่ะ</div>
<div class="submit" align="center"><input type="submit" id="submit_change_status" label="" value="บันทึกหมายเหตุ" /></div>
</form>
</div>