Hacked By AnonymousFox
<?
include("../../lib/session.php");
include("../../lib/config.php");
include("../../lib/connect.php");
include("../../lib/function.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/inner.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>:: Crm ::</title>
<link rel="stylesheet" type="text/css" href="../../css/theme.css" />
<link rel="stylesheet" type="text/css" href="../../css/style.css" />
</head>
<body>
<div id="container">
<div id="header">
<h2 align="left"><img src="../../img/logo_clickthumb.png" width="60" height="54" />Clickbkk CRM</h2>
</div>
<p> </p>
<p align="right">
<strong>Hi ! <?=$System_Session_UserName?> | <a href="../logout.php">logout</a></strong></p>
<div id="wrapper">
<div id="content">
<!-- InstanceBeginEditable name="content" -->
<div id="box">
<h3>ข้อมูลรับเรื่องแทนที่อ่านแล้ว</h3>
<table width="454" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td width="196" bgcolor="#999999"><h3 align="center"><a href="index2.php">ข้อมูลรับเรื่องแทนใหม่</a></h3></td>
<td width="18" bgcolor="#F7F6F0"><div align="center">|</div></td>
<td width="257"><h3 align="center"><a href="index3.php">ข้อมูลรับเรื่องแทน ที่อ่านแล้ว</a></h3></td>
</tr>
</table>
<br>
<script language="JavaScript" src="../lib/popup.js" type="text/JavaScript"></script>
<?
## Load Module Configuration Variable ############################################
include("config.php");
## Default Value ############################################
$SystemModule_defaultPageSize = 10;
$SystemModule_defaultPageShow = 1;
$SystemModule_MaxPage = 20;
$SystemModule_ReduceRange = 10; // +,- from current page show
$SystemModule_ASCDESC = "DESC";
$SystemModule_OrderBy = $myModule_Table."_ID";
#########################################################
?>
<? if($action=="add") { ?>
<?
//########################################################
} else if ($action=="addnew") {
$image_W=getimagesize($inputThumbnailPicture); //Cjeck ขนาดภาพ
$image_H=getimagesize($inputThumbnailPicture);
if ($image_W[0]>150 || $image_H[1]>40) {
echo "<SCRIPT LANGUAGE=\"JavaScript\">alert(\"use a picture file size as 150 x 40 pixel.\");</SCRIPT>";
?>
<form action="?" method="post" name="myForm" id="myForm">
<input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
<input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
<input name="admin" type="hidden" id="admin" value="<?=$admin?>">
<input name="action" type="hidden" id="action">
<input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
<input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
<input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
<input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
<input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
</form>
<script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
<?
exit(); }
//if($inputLinkType=="Group") $inputURL="";
$sql = "INSERT INTO ".$myModule_Table."(".$myModule_Table."_Name, ".$myModule_Table."_LName, ".$myModule_Table."_Company,".$myModule_Table."_Department,".$myModule_Table."_Teloffice,".$myModule_Table."_Mobile,".$myModule_Table."_Fax,".$myModule_Table."_Email,".$myModule_Table."_Website,".$myModule_Table."_Contactno,".$myModule_Table."_Price,".$myModule_Table."_Bill,".$myModule_Table."_Invoiceno,".$myModule_Table."_Address,".$myModule_Table."_Road,".$myModule_Table."_Zone,".$myModule_Table."_Area,".$myModule_Table."_Province,".$myModule_Table."_Postcode,".$myModule_Table."_Description,".$myModule_Table."_CreateDate,".$myModule_Table."_Status) VALUES('".trim(addslashes($inputName))."', '".trim(addslashes($inputLName))."', '$inputCompany','$inputDepartment','$inputPhone','$inputMobile','$inputFax','$inputEmail','$inputWebsite','$inputContactno','$inputInvoice','$inputBill','$inputNo','$inputCompanyadd','$inputRoad','$inputZone','$inputArea','$inputProvince','$inputProvince','$inputDesc',Now(),'Enable')";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
//if($DisplayStyle!="Link"){
$sql = "SELECT MAX(".$myModule_Table."_ID) FROM ".$myModule_Table;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$Row=MYSQL_FETCH_ARRAY($Query);
$MaxID = $Row[0];
for($i=0;$i<count($inputhistory);$i++){
$sql="insert into crm_mod_customer_history (crm_mod_customer_history_ID,crm_mod_customer_history_Text,crm_mod_customer_history_Sub,crm_mod_customer_history_Sendto,crm_mod_customer_history_Datetime) values ('$MaxID','$inputhistory','$inputsub','$inputsend',Now())";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
}
srand(make_seed());
$myrand = rand(1111,9999);
// Check to create module data directory. ---------
if(!is_dir($System_RelativePath_Upload."/".$SystemModuleKey)) { mkdir($System_RelativePath_Upload."/".$SystemModuleKey,0777); }
if(!is_dir($myModule_Path_ThumbnailPicture)) { mkdir($myModule_Path_ThumbnailPicture,0777); }
// ------------------------------------------------
if(isset($_FILES['inputThumbnailPicture'])) {
if($_FILES['inputThumbnailPicture']['error']==0){
$exts = explode(".", $_FILES['inputThumbnailPicture']['name']);
$ext = strtolower(($exts[count($exts) - 1]));
$ImageType = $ext;
$ThumbnailPictureName = "$MaxID-$myrand.$ImageType";
if(file_exists($myModule_Path_ThumbnailPicture."/".$ThumbnailPictureName)) {
unlink($myModule_Path_ThumbnailPicture."/".$ThumbnailPictureName);
}
if(move_uploaded_file($_FILES['inputThumbnailPicture']['tmp_name'],$myModule_Path_ThumbnailPicture."/".$ThumbnailPictureName)) {
chmod($myModule_Path_ThumbnailPicture."/".$ThumbnailPictureName,0777);
}
$sql = "UPDATE ".$myModule_Table." SET ".$myModule_Table."_PictureFile='$ThumbnailPictureName' WHERE ".$myModule_Table."_ID=".$MaxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
}
}
/*if(is_file($inputThumbnailPicture)) {
$ImageData = getimagesize($inputThumbnailPicture);
if($ImageData!=NULL) {
if($ImageData[2]==1) {
$ImageType="gif";
} elseif($ImageData[2]==2) {
$ImageType="jpg";
}
$ThumbnailPictureName = "$MaxID-$myrand.$ImageType";
if(file_exists($myModule_Path_ThumbnailPicture."/".$ThumbnailPictureName)) {
unlink($myModule_Path_ThumbnailPicture."/".$ThumbnailPictureName);
}
if(copy($inputThumbnailPicture,$myModule_Path_ThumbnailPicture."/".$ThumbnailPictureName)) {
chmod($myModule_Path_ThumbnailPicture."/".$ThumbnailPictureName,0777);
}
$sql = "UPDATE ".$myModule_Table." SET ".$myModule_Table."_PictureFile='$ThumbnailPictureName' WHERE ".$myModule_Table."_ID=".$MaxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
}
*/
//}
//}
?>
<form action="?" method="post" name="myForm" id="myForm">
<input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
<input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
<input name="admin" type="hidden" id="admin" value="<?=$admin?>">
<input name="action" type="hidden" id="action">
<input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
<input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
<input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
<input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
<input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
</form>
<script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
<? }elseif($action=="edit") {
$myCheckBoxID=0;
for($i=1;$i<=$TotalCheckBoxID;$i++) {
$myVar="CheckBoxID".$i;
if(strlen($$myVar)>0) {
$myCheckBoxID=$$myVar;
}
}
$sql="SELECT * FROM ".$myModule_Table." WHERE ".$myModule_Table."_ID=".$myCheckBoxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$Row=MYSQL_FETCH_ARRAY($Query);
?>
<br>
<br>
<?
##############################################
}elseif($action=="view") {
$myModule_Table=crm_mod_customer;
$myCheckBoxID=0;
for($i=1;$i<=$TotalCheckBoxID;$i++) {
$myVar="CheckBoxID".$i;
if(strlen($$myVar)>0) {
$myCheckBoxID=$$myVar;
}
}
//$sql = "SELECT * FROM crm_mod_customer p,crm_mod_customer_history t WHERE p.crm_mod_customer_ID = crm_mod_customer_history_ID AND p.crm_mod_customer_ID=".$myCheckBoxID;
$sql="UPDATE crm_mod_customer_history SET crm_mod_customer_history_Read='1' WHERE crm_mod_customer_history_ID=".$myCheckBoxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$sql="SELECT * FROM ".$myModule_Table." WHERE ".$myModule_Table."_ID=".$myCheckBoxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$Row=MYSQL_FETCH_ARRAY($Query);
?>
<br>
<br>
<table style="border-collapse: collapse" border="1" bordercolor="#E8E7E1" width="95%" align="center" cellpadding="0" cellspacing="1" class="table_border">
<form action="?" method="post" name="myReturnForm" id="myReturnForm">
<input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
<input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
<input name="admin" type="hidden" id="admin" value="<?=$admin?>">
<input name="action" type="hidden" id="action" value="">
<input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
<input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
<input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
<input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
<input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
</form>
<form action="?" method="post" name="myForm" id="myForm" >
<input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
<input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
<input name="admin" type="hidden" id="admin" value="<?=$admin?>">
<input name="action" type="hidden" id="action" value="update">
<input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
<input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
<input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
<input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
<input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
<input name="CheckBoxID1" type="hidden" id="CheckBoxID1" value="<?=$myCheckBoxID?>">
<input name="TotalCheckBoxID" type="hidden" id="TotalCheckBoxID" value="1">
<tr>
<td bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="mytable_inner">
<tr align="center">
<td height="24" colspan="3" align="center" class="table_header" style="font-weight: bold">ดูข้อมูล</td>
</tr>
<tr>
<td width="228" height="31" align="right" class="table_col1">ชื่อ </td>
<td width="460" colspan="2" class="table_col2"><?=$Row[crm_mod_customer_Name]?></td>
</tr>
<tr>
<td width="228" align="right" class="table_col1">นามสกุล </td>
<td height="22" colspan="2" class="table_col2">
<?=$Row[crm_mod_customer_LName]?></td>
</tr>
<tr>
<td width="228" align="right" class="table_col1">บริษัท</td>
<td height="22" colspan="2" class="table_col2"><?=$Row[crm_mod_customer_Company]?></td>
</tr>
<tr>
<td width="228" align="right" class="table_col1">แผนก</td>
<td height="22" colspan="2" valign="top" class="table_col2"><?=$Row[crm_mod_customer_Department]?></td>
</tr>
<tr>
<td width="228" align="right" class="table_col1">เบอร์สำนักงาน </td>
<td height="22" colspan="2" class="table_col2"><?=$Row[crm_mod_customer_Teloffice]?></td>
</tr>
<tr>
<td width="228" align="right" class="table_col1">เบอร์มือถือ</td>
<td height="22" colspan="2" class="table_col2"><?=$Row[crm_mod_customer_Mobile]?></td>
</tr>
<tr>
<td align="right" class="table_col1">เบอร์แฟกซ์</td>
<td height="22" colspan="2" class="table_col2"><?=$Row[crm_mod_customer_Fax]?></td>
</tr>
<tr>
<td width="228" align="right" class="table_col1">อีเมลล์ </td>
<td height="22" colspan="2" class="table_col2"><?=$Row[crm_mod_customer_Email]?></td>
</tr>
<tr>
<td align="right" class="table_col1">เว็บไซต์</td>
<td height="22" colspan="2" class="table_col2"><?=$Row[crm_mod_customer_Website]?></td>
</tr>
<tr>
<td align="right" class="table_col1">เลขที่สัญญา</td>
<td height="22" colspan="2" class="table_col2"><?=$Row[crm_mod_customer_Contactno]?></td>
</tr>
<tr>
<td width="228" align="right" class="table_col1">ใบเสนอราคา</td>
<td height="22" colspan="2" class="table_col2"><a href="http://quote.clickbkk.com/qua/show.php?id=<?=$Row[crm_mod_customer_Price]?>" target="_blank"><?=$Row[crm_mod_customer_Price]?></a></td>
</tr>
<tr>
<td align="right" class="table_col1">ใบวางบิล</td>
<td height="22" colspan="2" class="table_col2">
<?=$Row[crm_mod_customer_Bill]?> </td>
</tr>
<tr>
<td width="228" align="right" class="table_col1">ใบเสร็จเลขที่ </td>
<td height="22" colspan="2" class="table_col2"><?=$Row[crm_mod_customer_Invoiceno]?></td>
</tr>
<tr>
<td width="228" align="right" class="table_col1">ที่อยู่บริษัท </td>
<td height="22" colspan="2" class="table_col2"><?=$Row[crm_mod_customer_Address]?></td>
</tr>
<tr>
<td align="right" class="table_col1">ถนน</td>
<td height="22" colspan="2" class="table_col2"><?=$Row[crm_mod_customer_Road]?></td>
</tr>
<tr>
<td align="right" class="table_col1">แขวง</td>
<td height="22" colspan="2" class="table_col2"><?=$Row[crm_mod_customer_Zone]?></td>
</tr>
<tr>
<td align="right" class="table_col1">เขต </td>
<td height="22" colspan="2" class="table_col2"><?=$Row[crm_mod_customer_Area]?></td>
</tr>
<tr>
<td align="right" class="table_col1">จังหวัด</td>
<td height="22" colspan="2" class="table_col2"><?=$Row[crm_mod_customer_Province]?></td>
</tr>
<tr>
<td align="right" class="table_col1">รหัสไปรษณีย์</td>
<td height="22" colspan="2" class="table_col2"><?=$Row[crm_mod_customer_Postcode]?></td>
</tr>
<tr>
<td width="228" align="right" class="table_col1">รายละเอียด </td>
<td height="22" colspan="2" class="table_col2"><?=$Row[crm_mod_customer_Description]?></td>
</tr>
<tr>
<td align="right" class="table_col1">ประวัติลูกค้า</td>
<td height="22" class="table_col2">
<?
$sql = "SELECT * FROM crm_mod_customer_history where crm_mod_customer_history_ID=".$myCheckBoxID;
$QueryGroup=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
while ($rs=mysql_fetch_array($QueryGroup)) {
$name_type=$rs[crm_mod_customer_history_Text];
$date=$rs[crm_mod_customer_history_Datetime];
$sub=$rs[crm_mod_customer_history_Sub];
$send=$rs[crm_mod_customer_history_Sendto];
if($sub && $send !="" && $send!="$System_Session_FullName")
{
echo "$name_type หมายเหตุ $sub - $date <br />";
}
if($sub && $send !="" && $send=="$System_Session_FullName")
{
echo "<b><font color=#375A90><img src=../images/bullet/j.gif />ข้อมูลแจ้งเรื่องถึงคุณ ข้อความ $name_type หมายเหตุ $sub - $date </font></b><br />";
}
else
{
echo "$name_type - $date <br />";
}
}
?> </td>
<td class="table_col2"> </td>
</tr>
</table>
<table width="100%" height="24" border="0" cellpadding="3" cellspacing="0">
<tr align="right">
<td height="30" colspan="4" align="center" class="table_footer">
<table width="300" border="0" cellspacing="0" cellpadding="2">
<tr align="center">
<? if($System_Session_Permission[$SystemMenuID]=="RW" ){ ?>
<td>
<input name="btEdit" type="submit" class="button_80" id="btEdit" value="Edit" onClick="
document.myForm.action.value='edit';
document.myForm.submit();
"> </td>
<? }?>
<td> <input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="
if(confirm('Are you sure to return to list?')) {
document.myReturnForm.submit();
}
" value="Cancel"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</form>
</table>
<?
//########################################################
} else if ($action=="update") {
$MaxID = $CheckBoxID1;
if($check_delete=="yes"){
$sql="SELECT ".$myModule_Table."_PictureFile FROM ".$myModule_Table." WHERE ".$myModule_Table."_ID=".$MaxID;
$query=mysql_query($sql);
$row=mysql_fetch_array($query);
if(file_exists($myModule_Path_ThumbnailPicture."/".$row[$myModule_Table."_PictureFile"])) {
unlink($myModule_Path_ThumbnailPicture."/".$row[$myModule_Table."_PictureFile"]);
}
$sql = "UPDATE ".$myModule_Table." SET ".$myModule_Table."_PictureFile='' WHERE ".$myModule_Table."_ID=".$MaxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
}
if($DisplayStyle!="Link"){
srand(make_seed());
$myrand = rand(1111,9999);
// Check to create module data directory. ---------
if(!is_dir($System_RelativePath_Upload."/".$SystemModuleKey)) { mkdir($System_RelativePath_Upload."/".$SystemModuleKey,0777); }
if(!is_dir($myModule_Path_ThumbnailPicture)) { mkdir($myModule_Path_ThumbnailPicture,0777); }
// ------------------------------------------------
if(isset($_FILES['inputThumbnailPicture'])) {
if($_FILES['inputThumbnailPicture']['error']==0){
$exts = explode(".", $_FILES['inputThumbnailPicture']['name']);
$ext = strtolower(($exts[count($exts) - 1]));
$ImageType = $ext;
$ThumbnailPictureName = "$MaxID-$myrand.$ImageType";
if(file_exists($myModule_Path_ThumbnailPicture."/".$ThumbnailPictureName)) {
unlink($myModule_Path_ThumbnailPicture."/".$ThumbnailPictureName);
}
if(move_uploaded_file($_FILES['inputThumbnailPicture']['tmp_name'],$myModule_Path_ThumbnailPicture."/".$ThumbnailPictureName)) {
chmod($myModule_Path_ThumbnailPicture."/".$ThumbnailPictureName,0777);
}
$sql = "UPDATE ".$myModule_Table." SET ".$myModule_Table."_PictureFile='$ThumbnailPictureName' WHERE ".$myModule_Table."_ID=".$MaxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
}
}
/* if(is_file($inputThumbnailPicture)) {
$ImageData = getimagesize($inputThumbnailPicture);
if($ImageData!=NULL) {
if($ImageData[2]==1) {
$ImageType="gif";
} elseif($ImageData[2]==2) {
$ImageType="jpg";
}
$ThumbnailPictureName = "$MaxID-$myrand.$ImageType";
if(file_exists($myModule_Path_ThumbnailPicture."/".$ThumbnailPictureName)) {
unlink($myModule_Path_ThumbnailPicture."/".$ThumbnailPictureName);
}
if(copy($inputThumbnailPicture,$myModule_Path_ThumbnailPicture."/".$ThumbnailPictureName)) {
chmod($myModule_Path_ThumbnailPicture."/".$ThumbnailPictureName,0777);
}
$sql = "UPDATE ".$myModule_Table." SET ".$myModule_Table."_PictureFile='$ThumbnailPictureName' WHERE ".$myModule_Table."_ID=".$MaxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
}
}
*/
}
//if($inputLinkType=="Group") $inputURL="";
$sql = "UPDATE ".$myModule_Table." SET ".
$myModule_Table."_Name='$inputName' ,".
$myModule_Table."_LName='$inputLName' ,".
$myModule_Table."_Company='$inputCompany' ,".
$myModule_Table."_Department='$inputDepartment' ,".
$myModule_Table."_Teloffice='$inputPhone' ,".
$myModule_Table."_Mobile='$inputMobile' ,".
$myModule_Table."_Fax='$inputFax' ,".
$myModule_Table."_Email='$inputEmail' ,".
$myModule_Table."_Website='$inputWebsite' ,".
$myModule_Table."_Contactno='$inputContactno' ,".
$myModule_Table."_Price='$inputInvoice' ,".
$myModule_Table."_Bill='$inputBill' ,".
$myModule_Table."_Invoiceno='$inputNo' ,".
$myModule_Table."_Address='$inputCompanyadd' ,".
$myModule_Table."_Road='$inputRoad' ,".
$myModule_Table."_Zone='$inputZone' ,".
$myModule_Table."_Area='$inputArea' ,".
$myModule_Table."_Province='$inputProvince' ,".
$myModule_Table."_Postcode='$inputPostcode' ,".
$myModule_Table."_Description='$inputDesc' ".
//$myModule_Table."_ParentID=0 ".
" WHERE ".$myModule_Table."_ID=".$CheckBoxID1;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
for($i=0;$i<count($inputhistory);$i++){
$sql="insert into crm_mod_customer_history (crm_mod_customer_history_ID,crm_mod_customer_history_Text,crm_mod_customer_history_Sub,crm_mod_customer_history_Sendto,crm_mod_customer_history_Datetime) values ('$MaxID','$inputhistory','$inputsub','$inputsend',Now())";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
}
?>
<form action="?" method="post" name="myForm" id="myForm">
<input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
<input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
<input name="admin" type="hidden" id="admin" value="<?=$admin?>">
<input name="action" type="hidden" id="action">
<input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
<input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
<input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
<input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
<input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
</form>
<script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
<?
#########################################################
}elseif ($action=="delete") {
for($i=1;$i<=$TotalCheckBoxID;$i++) {
$myVar="CheckBoxID".$i;
if(strlen($$myVar)>0) {
$sql = "SELECT * FROM ".$myModule_Table." WHERE ".$myModule_Table."_ID=".$$myVar;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$Row=MYSQL_FETCH_ARRAY($Query);
if(strlen($Row[$myModule_Table."_PictureFile"])>0) {
if(file_exists($myModule_Path_ThumbnailPicture."/".$Row[$myModule_Table."_PictureFile"])) {
unlink($myModule_Path_ThumbnailPicture."/".$Row[$myModule_Table."_PictureFile"]);
}
}
$sql = "DELETE FROM ".$myModule_Table." WHERE ".$myModule_Table."_ID=".$$myVar;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
}
}
?>
<form action="?" method="post" name="myForm" id="myForm">
<input name="action" type="hidden" id="action">
<input name="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
<input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
<input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
<input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
<input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
<input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
<input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
<input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
</form>
<script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
<?
#########################################################
} else if ($action=="setstatus") {
$myCheckBoxID=0;
for($i=1;$i<=$TotalCheckBoxID;$i++) {
$myVar="CheckBoxID".$i;
if(strlen($$myVar)>0) {
$myCheckBoxID=$$myVar;
}
}
$sql="UPDATE ".$myModule_Table." SET ".$myModule_Table."_Status='$SelectStatus' WHERE ".$myModule_Table."_ID=".$myCheckBoxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
?>
<form action="?" method="post" name="myForm" id="myForm">
<input name="action" type="hidden" id="action">
<input name="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
<input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
<input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
<input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
<input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
<input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
<input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
<input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
</form>
<script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
<?
#########################################################
} else { ?>
<?
# Check to set default value #########################
if($PageSize=="") { $PageSize = $SystemModule_defaultPageSize; }
if($PageShow=="") { $PageShow = $SystemModule_defaultPageShow; }
if($ASCDESC=="") { $ASCDESC = $SystemModule_ASCDESC; }
if($OrderBy=="") { $OrderBy = $SystemModule_OrderBy; }
if($action=="switchorder") {
if($ASCDESC=="ASC") { $ASCDESC = "DESC"; } else { $ASCDESC="ASC"; }
}
if($PageSearch!="") { $PageSearch=trim($PageSearch); }
if($GroupID=="") { $GroupID=0; }
# Count total record size #########################
$sql = "SELECT * FROM crm_mod_customer a,crm_mod_customer_history h where h.crm_mod_customer_history_Sendto='$System_Session_FullName' and h.crm_mod_customer_history_Read='1' and a.crm_mod_customer_ID=h.crm_mod_customer_history_ID";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("<br><br><b><font color=#FF0000>ไม่สามารถใช้งานระบบได้<br>หากคุณเข้าใช้งานเป็นครั้งแรก<br><a href=\"#\" onClick=\"Popup('popupCreateDatabaseWindow','createdatabase.php',220,180,1);\">กรุณาคลิ๊กที่นี่</a><br>เพื่อทำการสร้างฐานข้อมูลใหม่</font></b>\n");
if($PageSearch=="") {
$sql = "SELECT * FROM crm_mod_customer a,crm_mod_customer_history h where h.crm_mod_customer_history_Sendto='$System_Session_FullName' and h.crm_mod_customer_history_Read='1' and a.crm_mod_customer_ID=h.crm_mod_customer_history_ID";
} else {
$sql = "SELECT * FROM crm_mod_customer a,crm_mod_customer_history h where h.crm_mod_customer_history_Sendto='$System_Session_FullName' and a.crm_mod_customer_ID=h.crm_mod_customer_history_ID and a.crm_mod_customer_ID LIKE '%$PageSearch%' OR a.crm_mod_customer_Name LIKE '%$PageSearch%' ";
}
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("<br><br><b><font color=#FF0000>ไม่สามารถใช้งานระบบได้<br>หากคุณเข้าใช้งานเป็นครั้งแรก<br><a href=\"#\" onClick=\"Popup('popupCreateDatabaseWindow','createdatabase.php',220,180,1);\">กรุณาคลิ๊กที่นี่</a><br>เพื่อทำการสร้างฐานข้อมูลใหม่</font></b>\n");
$TotalRecordCount=MYSQL_NUMROWS($Query);
# Find max page size #########################
if($TotalRecordCount>$PageSize) {
$NoOfPage= ceil($TotalRecordCount/$PageSize);
} else {
$NoOfPage=1;
}
# Recover page show into range #########################
if($PageShow>$NoOfPage) { $PageShow=$NoOfPage; }
# Select only paging range #########################
$RecordStart = ($PageShow-1)*$PageSize;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$RecordCount=MYSQL_NUMROWS($Query);
?>
<script language="JavaScript" type="text/JavaScript">
function Paging_CheckAll(objCheckHeader,txtCheckBoxFirstName,intTotalItems) {
if(intTotalItems>0)
for(i=1;i<=intTotalItems;i++)
document.getElementById(txtCheckBoxFirstName+i).checked = objCheckHeader.checked;
return true;
}
function Paging_CheckAllHandle(objCheckHeader,txtCheckBoxFirstName,intTotalItems) {
var isCheckedAll = true;
if(intTotalItems>0)
for(i=1;i<=intTotalItems;i++)
if(!document.getElementById(txtCheckBoxFirstName+i).checked)
isCheckedAll = false;
objCheckHeader.checked = isCheckedAll;
return true;
}
function Paging_CountChecked(txtCheckBoxFirstName,intTotalItems) {
var intChecked = 0;
if(intTotalItems>0)
for(i=1;i<=intTotalItems;i++)
if(document.getElementById(txtCheckBoxFirstName+i).checked)
intChecked ++;
return intChecked ;
}
function Paging_CheckedThisItem(objCheckHeader,indexing,txtCheckBoxFirstName,intTotalItems) {
if(intTotalItems>0)
for(i=1;i<=intTotalItems;i++)
if(i==indexing) {
document.getElementById(txtCheckBoxFirstName+i).checked = true;
} else {
document.getElementById(txtCheckBoxFirstName+i).checked = false;
}
objCheckHeader.checked = false;
return true;
}
</script>
<div id="divDataPicker" style="display:none; position:absolute; top:-135px; left:81px; width: 200px; z-index: 1;Filter:Alpha(opacity=95)">
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="table_border">
<form action="?" method="post" name="myStatusForm" id="myStatusForm">
<input name="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
<input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
<input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
<tr>
<td height="22"><table width="100%" height="22" border="0" cellpadding="0" cellspacing="0" class="table_header">
<tr>
<td width="28" align="center"><img src="../images/icon/ico439.gif" width="19" height="15"></td>
<td align="center">Select Status</td>
<td width="22" align="center"><img src="../images/icon/ico215.gif" width="16" height="16" onMouseOver="this.style.cursor='hand'" onClick="document.getElementById('divDataPicker').style.display='none'; "></td>
</tr>
</table></td>
</tr>
<tr>
<td height="120" align="center" class="table_row1"><br>
<table width="120" border="0" cellpadding="2" cellspacing="0">
<tr>
<td height="22" align="center"><input name="toolbarStatus" type="radio" class="form_checkbox" value="Enable"></td>
<td height="22" class="text_bold">Enable</td>
</tr>
<tr>
<td width="26" height="22" align="center"><input name="toolbarStatus" type="radio" class="form_checkbox" value="Disable"></td>
<td height="22" class="text_bold">Disable</td>
</tr>
</table>
<br> <table border="0" cellspacing="0" cellpadding="6">
<tr>
<td><input name="btSave" type="button" class="button_th_60" id="btSave" value="Save" onClick="
if(document.myStatusForm.toolbarStatus[0].checked) {
document.myForm.SelectStatus.value=document.myStatusForm.toolbarStatus[0].value;
}
if(document.myStatusForm.toolbarStatus[1].checked) {
document.myForm.SelectStatus.value=document.myStatusForm.toolbarStatus[1].value;
}
document.myForm.action.value='setstatus';
Paging_CheckedThisItem(document.myForm.CheckBoxAll, StatusIndex ,'CheckBoxID', document.myForm.TotalCheckBoxID.value );
document.myForm.submit();
"></td>
<td><input name="btClose" type="button" class="button_th_60" id="btClose" value="Close" onClick="document.getElementById('divDataPicker').style.display='none';"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="6" class="table_footer"><img src="../images/blank.gif" width="1" height="1"></td>
</tr>
</form>
</table>
</div>
<script language="JavaScript" type="text/JavaScript">
var StatusIndex=0;
function ShowDataPicker(myDivName,RefX,RefY) {
document.getElementById(myDivName).style.display='';
document.getElementById(myDivName).style.left = document.body.scrollLeft + window.event.clientX + RefX;
document.getElementById(myDivName).style.top= document.body.scrollTop+ window.event.clientY + RefY;
}
</script>
<br />
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="1" class="table_border">
<tr>
<td bgcolor="#FFFFFF"> <table style="border-collapse: collapse" border="1" width="100%" align="center" cellpadding="0" cellspacing="1" class="table_border" bordercolor="#E8E7E1">
<form action="?" method="post" name="myForm" id="myForm">
<input name="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
<input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
<input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
<input name="action" type="hidden" id="action">
<input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
<input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
<input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
<input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
<input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
<input name="SelectStatus" type="hidden" id="SelectStatus">
<tr align="center" class="menu_table_header">
<td width="49" height="24" bgcolor="#F7F6F0"><input name="CheckBoxAll" type="checkbox" class="form_checkbox" id="CheckBoxAll" value="Yes" onClick="Paging_CheckAll(this,'CheckBoxID',document.myForm.TotalCheckBoxID.value)"></td>
<td width="49" height="24" align="center" bgcolor="#F7F6F0"><a href="#" class="link_headbar" style="font-weight: bold" onClick="
with(document.myForm) {
<? if($OrderBy==$myOrderBy) { echo "action.value='switchorder';\n"; } ?>
OrderBy.value='<?=$myOrderBy?>';
submit();
}
">No.</a></td>
<? if($DisplayStyle!="Link"){?>
<? }?>
<td width="236" height="24" bgcolor="#F7F6F0"><a href="#" class="link_headbar" style="font-weight: bold" onClick="
with(document.myForm) {
<? if($OrderBy==$myOrderBy) { echo "action.value='switchorder';\n"; } ?>
OrderBy.value='<?=$myOrderBy?>';
submit();
}
"> Name</a></td>
<td width="134" height="24" bgcolor="#F7F6F0"><a href="#" class="link_headbar" style="font-weight: bold" onclick="
with(document.myForm) {
<? if($OrderBy==$myOrderBy) { echo "action.value='switchorder';\n"; } ?>
OrderBy.value='<?=$myOrderBy?>';
submit();
}
">ผู้รับเรื่องแทน</a></td>
<td width="105" height="24" bgcolor="#F7F6F0"><a href="#" class="link_headbar" style="font-weight: bold" onclick="
with(document.myForm) {
<? if($OrderBy==$myOrderBy) { echo "action.value='switchorder';\n"; } ?>
OrderBy.value='<?=$myOrderBy?>';
submit();
}
">วันที่สร้าง</a></td>
<td width="105" height="24" bgcolor="#F7F6F0"><span style="color: #a43708; font-weight: bold">Action</span></td>
</tr>
<?
$index=1;
if($RecordCount>0) {
while($index<$RecordCount+1) {
if($myClassRow=="table_row1") { $myClassRow="table_row2"; } else { $myClassRow="table_row1"; }
$Row=MYSQL_FETCH_ARRAY($Query);
?>
<tr class="<?=$myClassRow?>" onMouseOver="this.className='table_rowover'" onMouseOut="this.className='<?=$myClassRow?>'">
<td width="49" height="30" align="center"> <input name="CheckBoxID<?=$index?>" type="checkbox" class="form_checkbox" id="CheckBoxID<?=$index?>" onClick="Paging_CheckAllHandle(document.myForm.CheckBoxAll,'CheckBoxID',document.myForm.TotalCheckBoxID.value)" value="<?=$Row[crm_mod_customer_ID]?>"></td>
<td width="49" height="30" align="center">
<? if($ASCDESC=="DESC") { echo $RecordStart+$index; } else { echo ($TotalRecordCount-($RecordStart+$index)+1); } ?></td>
<td height="30">
<strong>CustomerID :
<?=$Row[crm_mod_customer_ID]?>
<br />
Fullname : <?=$Row[crm_mod_customer_Name]?> - <?=$Row[crm_mod_customer_LName]?></strong>
<br />
<strong>
Company : <?=$Row[crm_mod_customer_Company]?>
</strong><br />
<strong>
Office Tel : <?=$Row[crm_mod_customer_Teloffice]?>
</strong><br />
<strong>
Mobile : <?=$Row[crm_mod_customer_Mobile]?>
</strong><br />
<strong>
Email :
<?=$Row[crm_mod_customer_Email]?>
</strong></td>
<td width="134" height="30" align="center"><?=$Row[crm_mod_customer_history_Whois]?></td>
<td width="105" align="center"><?=substr($Row[crm_mod_customer_CreateDate],0,10)?></td>
<td width="105" height="30" align="center" valign="middle">
<table border="0" cellspacing="0" cellpadding="1">
<tr align="center" valign="bottom">
<td><img src="../../img/icons/view.png" alt="View" width="16" height="16" border="0" onMouseOver="this.style.cursor='hand'" onClick="
Paging_CheckedThisItem( document.myForm.CheckBoxAll, <?=$index?>, 'CheckBoxID', document.myForm.TotalCheckBoxID.value );
document.myForm.action.value='view';
document.myForm.submit();
"></td>
<td> </td>
<? if($System_Session_Level=="Administrator") { ?>
<td> </td>
<? } ?>
</tr>
</table></td>
</tr>
<?
$index++;
}
} else { ?>
<tr class="table_row1">
<td height="80" colspan="8" align="center"> Data
not found!</td>
</tr>
<? } ?>
<input name="TotalCheckBoxID" type="hidden" id="TotalCheckBoxID" value="<?=$index-1?>">
</form>
</table>
<table width="100%" height="24" border="0" cellpadding="3" cellspacing="0">
<form action="?" method="post" name="mySearchForm" id="mySearchForm" onSubmit="return false;">
<input name="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
<input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
<input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
<tr align="right">
<td colspan="4" align="right" class="table_footer"><div id="pager">
<div align="left">Page
<?
if($NoOfPage>1) {
?>
<select name="toolbarPageShow" class="select" onchange="document.myForm.PageShow.value=this.value; document.myForm.submit(); ">
<?
if($NoOfPage<$SystemModule_MaxPage) {
// Show page list #########################
for($i=1;$i<=$NoOfPage;$i++) {
echo "<option value=\"$i\"";
if($i==$PageShow) { echo " selected"; }
echo ">$i</option>";
}
} else {
// # If total page count greater than default max page value then reduce page select size #########################
$starti = $PageShow-$SystemModule_ReduceRange;
if($starti<1) { $starti=1; }
$endi = $PageShow+$SystemModule_ReduceRange;
if($endi>$NoOfPage) { $endi=$NoOfPage; }
//#####################
for($i=$starti ;$i<=$endi;$i++) {
echo "<option value=\"$i\"";
if($i==$PageShow) { echo " selected"; }
echo ">$i</option>";
}
}
?>
</select>
<?
} else {
echo "1";
}
?>
of
<?=$NoOfPage?>
| Total
<?=$TotalRecordCount?>
records found </div>
</div></td>
</tr>
</form>
</table></td>
</tr>
</table>
<br>
<?
}
#########################################################
?>
<br>
</div>
<!-- InstanceEndEditable -->
</div>
<div id="sidebar">
<ul>
<li>
<h3><a href="../../home/home.php" class="house">หน้าหลัก </a></h3>
<h3><a href="#" class="house">ระบบผู้ใช้งาน</a></h3>
<ul>
<li><a href="../user_management.php" class="report">ข้อมูลผู้ใช้งานในระบบ</a></li>
</ul>
</li>
<li>
<h3><a href="#" class="folder_table">ระบบเก็บข้อมูลลูกค้า</a></h3>
<ul>
<li><a href="../mod_customer/index.php" class="addorder">ข้อมูลลูกค้า</a></li>
</ul>
</li>
<li>
<h3><a href="#" class="folder_table">ระบบปฏิทินงาน</a></h3>
<ul>
<li><a href="../mod_calendar/calendar.php" class="manage_page">ข้อมูลปฏิทินงาน</a></li>
<li><a href="../mod_calendar/index.php" class="manage_page">ข้อมูลนัดหมายงานลูกค้า</a></li>
<li><a href="../mod_calendar/index2.php" class="manage_page">ข้อมูลติดตามงานลูกค้า</a></li>
<li><a href="../mod_calendar/index3.php" class="manage_page">ข้อมูลอื่นๆ</a></li>
<li><a href="../mod_calendar/today.php" class="folder">ปฏิทินงานวันนี้</a></li>
</ul>
</li>
<li>
<h3><a href="#" class="user">ข้อมูลการติดต่อลูกค้า</a></h3>
<ul>
<li><a href="../mod_track/index.php" class="useradd">ข้อมูลติดต่อลูกค้า</a></li>
</ul>
</li>
<li>
<h3><a href="#" class="user">ข้อมูลส่วนตัว</a></h3>
<ul>
<li><a href="index.php" class="useradd">ข้อมูลติดต่อลูกค้าของฉัน </a></li>
</ul>
<ul>
<li><a href="index2.php" class="useradd">ข้อมูลรับเรื่องแทน</a></li>
</ul>
</li>
<li>
<ul>
<li></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</body>
<!-- InstanceEnd --></html>
Hacked By AnonymousFox1.0, Coded By AnonymousFox