| 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_customer/ |
Upload File : |
<?php
$linkUrl = "index.php?name=manu_customer&file=customer";
if(@$_GET['act']=="add"){
@$Ck = @$db->getOne("customer","*"," CustomerIdentification='".@$_POST['CustomerIdentification']."'");
if(@$Ck){
@$msg = "มีข้อมูลบุคคนนี้อยู่ในระบบ";
@$error = true;
}else{
@$arrData = array();
@$arrData['CustomerIdentification'] = @$_POST['CustomerIdentification'];
@$arrData['CustomerName'] = @$_POST['CustomerName'];
@$arrData['CustomerSurName'] = @$_POST['CustomerSurName'];
@$arrData['CustomerAddress'] = @$_POST['CustomerAddress'];
@$arrData['CustomerProvince'] = @$_POST['CustomerProvince'];
@$arrData['CustomerDistrict'] = @$_POST['CustomerDistrict'];
@$arrData['CustomerTambon'] = @$_POST['CustomerTambon'];
@$arrData['CustomerPostCode'] = @$_POST['CustomerPostCode'];
@$arrData['CustomerPhon'] = @$_POST['CustomerPhon'];
@$arrData['CustomerHomePhon'] = @$_POST['CustomerHomePhon'];
@$arrData['CustomerOtherPhon'] = @$_POST['CustomerOtherPhon'];
@$arrData['CustomerTypeID'] = @$_POST['CustomerTypeID'];
@$arrData['CustomerLastUse'] = @$objMaster->getdateformat(date("d M Y",time()));
foreach($arrData as $k => $v ){
@$arrData[@$k] = str_replace("'", "\'", @$v);
}
@$db->insertData("customer",@$arrData);
//exit;
@$msg = "Save Data complete.";
}
@$res = true;
}elseif(@$_GET['act']=="editdata"){
@$arrData = array();
@$arrData['CustomerIdentification'] = @$_POST['CustomerIdentification'];
@$arrData['CustomerName'] = @$_POST['CustomerName'];
@$arrData['CustomerSurName'] = @$_POST['CustomerSurName'];
@$arrData['CustomerAddress'] = @$_POST['CustomerAddress'];
@$arrData['CustomerProvince'] = @$_POST['CustomerProvince'];
@$arrData['CustomerDistrict'] = @$_POST['CustomerDistrict'];
@$arrData['CustomerTambon'] = @$_POST['CustomerTambon'];
@$arrData['CustomerPostCode'] = @$_POST['CustomerPostCode'];
@$arrData['CustomerPhon'] = @$_POST['CustomerPhon'];
@$arrData['CustomerHomePhon'] = @$_POST['CustomerHomePhon'];
@$arrData['CustomerOtherPhon'] = @$_POST['CustomerOtherPhon'];
@$arrData['CustomerTypeID'] = @$_POST['CustomerTypeID'];
@$arrData['CustomerLastUse'] = @$objMaster->getdateformat(date("d M Y",time()));
foreach($arrData as $k => $v ){
@$arrData[@$k] = str_replace("'", "\'", @$v);
}
@$db->updateData("customer",@$arrData," CustomerID='".@$_POST['CustomerID']."'");
@$msg = "Edit Data complete.";
@$res = true;
}elseif(@$_GET['act']=="edit"){
@$arrRes = @$db->getOne("customer","*"," CustomerID='".@$_GET['CustomerID']."'");
}elseif(@$_GET['act']=="deletedata"){
@$db->deleteData("customer"," CustomerID='".@$_GET['CustomerID']."'");
@$msg = "Delete Data complete.";
@$res = true;
}elseif(@$_GET['act']=="deleteAll"){
//echo "<pre>"; print_r(@$_POST);
if(count(@$_POST['pagedel']) > 0){
foreach($_POST['pagedel'] as $key => $val){
@$db->deleteData("customer"," CustomerID='".@$val."'");
}
}
@$msg = "Delete Data complete.";
@$res = true;
}
@$where_f = "";
@$search = @$_POST['keyword'] ? @$_POST['keyword'] : @$_GET['keyword'];
if(@$search){
@$searchnew = str_replace("'", "\'", @$search);
if(@$where_f){
@$where_f .= " and (CustomerHomePhon like '%".@$searchnew."%' or CustomerPhon like '%".@$searchnew."%' or CustomerName like '%".@$searchnew."%' or CustomerIdentification like '%".@$searchnew."%')";
}else{
@$where_f = " (CustomerHomePhon like '%".@$searchnew."%' or CustomerPhon like '%".@$searchnew."%' or CustomerName like '%".@$searchnew."%' or CustomerIdentification like '%".@$searchnew."%')";
}
}
@$provinceId = @$_POST['provinceId'] ? @$_POST['provinceId'] : @$_GET['provinceId'];
if(@$provinceId){
if(@$where_f){
@$where_f .= " and CustomerProvince='".@$provinceId."'";
}else{
@$where_f = " CustomerProvince='".@$provinceId."'";
}
}
@$page = @$_GET['page'] ? @$_GET['page'] : 1;
@$arrpageP = @$db->getAll("customer", "*",@$where_f,"" );
@$arrPage = @$objMaster->viewPages(@$page, @$arrpageP, "15");
@$getPage = @$db->getAll("customer","*",@$where_f,"",@$arrPage["offset"]);
@$where_province = "lang_code='".@$lang_code."' and status='1'";
@$where_district = "lang_code='".@$lang_code."' and status='1'";
@$where_type = "lang_code='".@$lang_code."' and CustomerTypeStatus='1'";
@$getProvince = @$db->getAll( "province", "*",@$where_province," order by PROVINCE_CODE asc" );
@$getDistrict = @$db->getAll( "district", "*",@$where_district," order by PROVINCE_ID,AMPHUR_CODE asc" );
@$getCustomerType = @$db->getAll( "customertype", "*",@$where_type,"" );
//echo "<pre>"; print_r(@$getPage);
?>
<!-- Start Content Box -->
<div class="content-box">
<!-- Start Content Box Header-->
<div class="content-box-header">
<h3>ข้อมูลลูกค้า</h3>
<ul class="content-box-tabs">
<?php if(@$_GET['act']!="edit"){?>
<li><a href="#list" <?php echo (@$_GET['act']=="" ? 'class="default-tab"' : '');?>><?php echo @$lang_set['list_customer']; ?></a></li> <!-- href must be unique and match the id of target div -->
<?php }?>
<li><a href="#add" <?php echo (@$_GET['act']=="edit" ? 'class="default-tab"' : '');?>><?php echo (@$_GET['act']=="edit" ? @$lang_set['edit_customer'] : @$lang_set['add_customer']); ?></a></li>
</ul>
<div class="clear"></div>
</div>
<!-- End Content Box Header-->
<!-- Start Content Box Content-->
<div class="content-box-content">
<?php if(@$res){?>
<?php if(@$error){?>
<div class="notification error 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 }else{?>
<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 }?>
<?php }?>
<!-- Start Tab Content id="list"-->
<div class="tab-content <?php echo (@$_GET['act']=="" ? 'default-tab' : '');?>" id="list">
<form action="<?php echo $linkUrl;?>" method="post" name="form_search">
<table>
<tr>
<td style="width:80px;"><?php echo @$lang_set['input_search'];?> :</td>
<td style="width:150px;">จังหวัด <br />
<select name="provinceId" id="provinceId" style="width:150px">
<option value="">ทั้งหมด</option>
<?php
if(@$getProvince){foreach($getProvince as $key => $val){
?>
<option value="<?php echo @$val['PROVINCE_ID'];?>" <?php echo (@$val['PROVINCE_ID']=='' || @$val['PROVINCE_ID']==@$provinceId ? "selected" : "")?>><?php echo @$val['PROVINCE_NAME'];?></option>
<?php }
}
?>
</select>
</td>
<td style="width:300px;">รายชื่อ <br />
<input type="text" class="text" value="<?PHP echo @$search;?>" name="keyword" />
</td>
<td style="vertical-align:middle; text-align:left;">
<input type="submit" class="button" value="ค้นหา"/>
</td>
</tr>
</table>
</form>
<form action="<?php echo $linkUrl;?>&act=deleteAll" method="post" onsubmit="return confirmDelete(this);">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th width="20"><input type="checkbox" class="check_all" /></th>
<th><?php echo @$lang_set['customer_identification']; ?></th>
<th style="text-align:left"><?php echo @$lang_set['customer_name']; ?></th>
<th style="text-align:left"><?php echo @$lang_set['customer_surname']; ?></th>
<th style="text-align:left"><?php echo @$lang_set['customer_province']; ?></th>
<th style="text-align:left"><?php echo @$lang_set['customer_type']; ?></th>
<th><?php echo @$lang_set['customer_phon']; ?></th>
<th><?php echo @$lang_set['action']; ?></th>
</tr>
</thead>
<?php
if(@$getPage){
foreach($getPage as $key => $val){
@$getprovince = @$db->getOne("province","*"," PROVINCE_ID='".@$val['CustomerProvince']."' and lang_code='".@$lang_code."'");
@$gettype = @$db->getOne("customertype","*"," CustomerTypeID='".@$val['CustomerTypeID']."' and lang_code='".@$lang_code."'");
?>
<tr>
<th><input type="checkbox" name="pagedel[]" value="<?php echo @$val['CustomerID'];?>"/></th>
<th><?php echo @$val['CustomerIdentification'];?></th>
<th><?php echo @$val['CustomerName'];?></th>
<th><?php echo @$val['CustomerSurName'];?></th>
<th><?php echo @$getprovince['PROVINCE_NAME'];?></th>
<th><?php echo @$gettype['CustomerTypeName'];?></th>
<th><?php echo @$val['CustomerPhon'];?></th>
<th>
<a href="<?php echo $linkUrl;?>&act=edit&CustomerID=<?php echo @$val['CustomerID']?>#add" title="Edit"><img src="resources/images/icons/pencil.png" alt="Edit" /></a> |
<a href="javascript:void();" onclick="chkConfirm('<?php echo $linkUrl;?>&act=deletedata&CustomerID=<?php echo @$val['CustomerID']?>','ยืนยันการลบข้อมูล');" title="Delete"><img src="resources/images/icons/cross.png" alt="Delete" /></a>
</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">
<div class="bulk-actions align-left">
<select name="actdel">
<option value="del"><?php echo @$lang_set['delete']; ?></option>
</select>
<input class="button" type="submit" value="<?php echo @$lang_set['selected']; ?>" />
</div>
<!-- Start .pagination -->
<div class="pagination">
<?php if($arrPage['allpage']>1){?>
<a href="<?php echo $linkUrl;?>&page=1&keyword=<?PHP echo @$search;?>" title="หน้าแรก">« หน้าแรก</a><a href="<?php echo $linkUrl;?>&page=<?php echo (1==$page ? $page : @$page-1);?>&keyword=<?PHP echo @$search;?>" title="ก่อนหน้า">« ก่อนหน้า</a>
<?php if( @$arrPage["startPage"]!="" && @$arrPage["endPage"] !="" ){?>
<?php
for($i = @$arrPage["startPage"]; $i <= @$arrPage["endPage"]; ++$i) {
echo'<a href="'.$linkUrl.'&keyword='.@$search.'&page='.@$i.'" '.(@$page == @$i ? 'class="number current"' : '').'>'.(@$i).'</a>';
}?>
<?php }?>
<a href="<?php echo $linkUrl;?>&page=<?php echo ($page==$arrPage["allpage"] ? $page : $page+1);?>&keyword=<?PHP echo @$search;?>" title="ถัดไป">ถัดไป »</a><a href="<?php echo $linkUrl;?>&page=<?php echo @$arrPage["allpage"];?>&keyword=<?PHP echo @$search;?>" title="หน้าสุดท้าย">หน้าสุดท้าย »</a>
<?php }?>
</div>
<!-- End .pagination -->
<div class="clear"></div>
</td>
</tr>
</tfoot>
</table>
</form>
</div>
<!-- End Tab Content id="list"-->
<!-- Start Tab Content id="add"-->
<div class="tab-content <?php echo (@$_GET['act']=="edit" ? 'default-tab' : '');?>" id="add">
<form action="<?php echo $linkUrl;?>&act=<?php echo (@$_GET['act']=="edit" ? "editdata" : "add");?>#add" method="post" enctype="multipart/form-data" onsubmit="return checkpagecustomer();"><!--onsubmit="return checkdelivery();"-->
<fieldset>
<input type="hidden" name="CustomerID" value="<?php echo @$_GET['CustomerID'];?>">
<table>
<tr style="background:#fff;">
<td style="text-align:right; width:100px;">
<label><?php echo @$lang_set['customer_name']; ?>:</label>
</td>
<td>
<input type="text" class="text-input large-input" name="CustomerName" id="CustomerName" value="<?php echo @$arrRes['CustomerName'];?>" />
</td>
<td style="text-align:right; width:100px;">
<label><?php echo @$lang_set['customer_surname']; ?>:</label>
</td>
<td>
<input type="text" class="text-input large-input" name="CustomerSurName" id="CustomerSurName" value="<?php echo @$arrRes['CustomerSurName'];?>" />
</td>
<td style="text-align:right; width:150px;">
<label><?php echo @$lang_set['customer_identification']; ?>:</label>
</td>
<td>
<input type="text" class="text-input smail-input" name="CustomerIdentification" id="CustomerIdentification" value="<?php echo @$arrRes['CustomerIdentification'];?>" maxlength="13"/>
</td>
<td style="text-align:right;">
<label><?php echo @$lang_set['customer_type']; ?>:</label>
</td>
<td>
<select name="CustomerTypeID">
<?php
if(@$getCustomerType){foreach($getCustomerType as $key => $val){
?>
<option value="<?php echo @$val['CustomerTypeID'];?>" <?php echo (@$val['CustomerTypeID']=='' || @$val['CustomerTypeID']==@$arrRes['CustomerTypeID'] ? "selected" : "")?>><?php echo @$val['CustomerTypeName'];?></option>
<?php }
}
?>
</select>
</td>
</tr>
<tr style="background:#fff;">
<td style="text-align:right;">
<label><?php echo @$lang_set['customer_address']; ?>:</label>
</td>
<td colspan="7">
<input type="text" class="text-input large-input" name="CustomerAddress" id="CustomerAddress" value="<?php echo @$arrRes['CustomerAddress'];?>" />
</td>
</tr>
<tr style="background:#fff;">
<td style="text-align:right;">
<label><?php echo @$lang_set['customer_province']; ?>:</label>
</td>
<td>
<select name="CustomerProvince" id="CustomerProvince" onchange="SelectProvince('<?PHP echo @$lang_code;?>','Customer','0')" style="width:150px">
<?php
if(@$getProvince){foreach($getProvince as $key => $val){
?>
<option value="<?php echo @$val['PROVINCE_ID'];?>" <?php echo (@$val['PROVINCE_ID']=='' || @$val['PROVINCE_ID']==@$arrRes['CustomerProvince'] ? "selected" : "")?>><?php echo @$val['PROVINCE_NAME'];?></option>
<?php }
}
?>
</select>
</td>
<td style="text-align:right;">
<label><?php echo @$lang_set['customer_district']; ?>:</label>
</td>
<td>
<select name="CustomerDistrict" id="CustomerDistrict" style="width:150px">
<?php
if(@$getDistrict){foreach($getDistrict as $key => $val){
?>
<option value="<?php echo @$val['AMPHUR_ID'];?>" <?php echo (@$val['AMPHUR_ID']=='' || @$val['AMPHUR_ID']==@$arrRes['CustomerDistrict'] ? "selected" : "")?>><?php echo @$val['AMPHUR_NAME'];?></option>
<?php }
}
?>
</select>
</td>
<td style="text-align:right;">
<label><?php echo @$lang_set['customer_tambon']; ?>:</label>
</td>
<td>
<input type="text" class="text-input large-input" name="CustomerTambon" id="CustomerTambon" value="<?php echo @$arrRes['CustomerTambon'];?>" style="width:150px"/>
</td>
<td style="text-align:right;">
<label><?php echo @$lang_set['customer_postcode']; ?>:</label>
</td>
<td>
<input type="text" class="text-input smail-input" name="CustomerPostCode" id="CustomerPostCode" value="<?php echo @$arrRes['CustomerPostCode'];?>" maxlength="5" style="width:50px"/>
</td>
</tr>
<tr style="background:#fff;">
<td style="text-align:right;">
<label><?php echo @$lang_set['customer_phon']; ?>:</label>
</td>
<td>
<input type="text" class="text-input large-input" name="CustomerPhon" id="CustomerPhon" value="<?php echo @$arrRes['CustomerPhon'];?>" maxlength="10"/>
</td>
<td style="text-align:right;">
<label><?php echo @$lang_set['customer_homephon']; ?>:</label>
</td>
<td>
<input type="text" class="text-input large-input" name="CustomerHomePhon" id="CustomerHomePhon" value="<?php echo @$arrRes['CustomerHomePhon'];?>" maxlength="9" />
</td>
<td style="text-align:right;">
<label><?php echo @$lang_set['customer_phonother']; ?>:</label>
</td>
<td>
<input type="text" class="text-input large-input" name="CustomerOtherPhon" id="CustomerOtherPhon" value="<?php echo @$arrRes['CustomerOtherPhon'];?>"/>
</td>
<td colspan="2"></td>
</tr>
</table>
<p>
<input type="submit" class="button" value="<?php echo @$lang_set['submit']; ?>" />
</p>
</fieldset>
</form>
</div>
<!-- End Tab Content id="add"-->
</div>