Hacked By AnonymousFox

Current Path : C:/AppServ/www/timetable/system/mod_other/
Upload File :
Current File : C:/AppServ/www/timetable/system/mod_other/council8.php

<? 
include("../../lib/session.php"); 
include("../../lib/config.php");
include("../../lib/connect.php");
include("../../lib/function.php");
include("../../lib/register_global.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/main_pm.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>Curriculum Map</title>
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<link href="../../css/menu.css" rel="stylesheet" type="text/css" />
<link href="../../css/font.css" rel="stylesheet" type="text/css" />
<link href="../../css/piya_style.css" rel="stylesheet" type="text/css" />
<link href="../../css/table.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style2 {
	color: #30707C;
	font-weight: bold;
	font-size: 14px;
}
-->
</style>
</head>

<body onload="MM_preloadImages('../../images/menu/menu_03.png','../../images/menu/menu_01_over.png','../../images/menu/menu_05_over.png')">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="100" align="center" background="../../images/head/sky.jpg"><img src="../../images/head/Sirirajlogo.gif" width="126" height="120" /></td>
  </tr>
  <tr>
    <td height="22" background="../../images/head/bar.jpg"><table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td>
		<table width="30%" border="0" align="right" cellpadding="0" cellspacing="0" class="login">
            <tr>
              <td align="right"><img src="../../images/icon/people_1.png" width="13" height="14" />Hi ! 
                <?=$System_Session_UserName?>|<img src="../../images/icon/door.png" width="16" height="15" /><a href="../logout.php">Logout</a></td>
              </tr>
            </table>
        </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td align="center" valign="top"><table width="100" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="747" valign="top"><table width="747" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="24" rowspan="2" valign="top" background="../../images/l/left_menu_02.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td><img src="../../images/l/left_menu_01_l.jpg" width="24" height="27" /></td>
                </tr>
                <tr>
                  <td><img src="../../images/l/left_menu_02.jpg" width="24" height="1" /></td>
                </tr>
            </table></td>
            <td width="24" colspan="2" rowspan="2" valign="top" background="../../images/l/left_menu_02_bg.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td><img src="../../images/l/left_menu_01_r.jpg" width="197" height="27" /></td>
                </tr>
                <tr>
                  <td><table width="100%" border="0" cellspacing="5" cellpadding="0">
                      <tr>
                        <td align="left"><span class="style2">ระบบข้อมูลรายวิชา</span></td>
                      </tr>
                      <tr>
                        <td align="left" class="menu_one">
                        <ul class="menu_one">
                        <li><a href="../../home/home.php">ข้อมูลรายวิชา</a></li>
                       </ul>                        </td>
                      </tr>
                      <tr>
                        <td align="left"><span class="style2">ระบบผู้ใช้งาน</span></td>
                      </tr>
                      <tr>
                        <td align="left"><ul class="menu_one">
                        <? if($System_Session_Level=="Administrator")  { ?>
                            <li><a href="../user_management.php">ข้อมูลผู้ใช้งานในระบบ</a></li>
                            <? } ?>
                             <? if($System_Session_Level=="Staff")  { ?>
                            <li><a href="../user_managementperson.php">ข้อมูลผู้ใช้งานในระบบ</a></li>
                            <? } ?>
							 <? if($System_Session_Level=="Admin")  { ?>
                            <li><a href="../user_managementperson.php">ข้อมูลผู้ใช้งานในระบบ</a></li>
                            <? } ?>
                        </ul></td>
                      </tr>
					    <? if($System_Session_Level=="Administrator")  { ?>
                      <tr>
                        <td align="left"><span class="style2">ระบบข้อมูลที่เกี่ยวข้อง</span></td>
                      </tr>
                      <tr>
                        <td align="left"><ul class="menu_one">
                            <li><a href="standard.php">เพิ่มข้อมูลมาตรฐานการเรียนรู้</a></li>
                            <li><a href="council.php">เพิ่มข้อมูลแพทยสภา</a></li>
                            <li><a href="report.php">ระบบรายงานผล</a></li>
                          
                        </ul></td>
                      </tr>  <? } ?>
                      <tr>
                        <td align="left">&nbsp;</td>
                      </tr>
                      <tr>
                        <td align="left">&nbsp;</td>
                      </tr>
                      <tr>
                        <td align="left"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image16','','file:///C|/AppServ/www/images/menu/menu_05_over.png',1)"></a></td>
                      </tr>
                  </table></td>
                </tr>
            </table></td>
            <td background="../../images/content_border/content_border_02.jpg"><img src="../../images/content_border/content_border_01.jpg" width="747" height="11" /></td>
            <td background="../../images/content_border/content_border_right.jpg"></td>
          </tr>
          <tr>
            <td valign="top" background="../../images/content_border/content_border_02.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="15" height="300">&nbsp;</td>
                  <td align="left" valign="top"><!-- InstanceBeginEditable name="content" -->
                <h3>เพิ่มข้อมูลแพทยสภา</h3>
                <table width="99%" border="2" align="right" style="border-collapse:collapse" bordercolor="#cccccc">
                  <tr>
                    <td width="18%" height="33" bgcolor="#DAE3E8"><div align="center"><span class="style2 style1 style5"><strong><a href="council.php" class="menu_one">เพิ่มข้อมูล Level1</a></strong></span></div></td>
                    <td width="18%" bgcolor="#DAE3E8"><div align="center"><span class="style2 style1 style5"><strong><a href="council2.php" class="menu_one">เพิ่มข้อมูล Level 2</a></strong></span></div></td>
                    <td width="18%" bgcolor="#DAE3E8"><div align="center"><span class="style2 style1 style5"><strong><a href="council3.php" class="menu_one">เพิ่มข้อมูล Level 3</a></strong></span> </div>
                        </div></td>
                    <td width="16%" bgcolor="#DAE3E8"><div align="center"><strong><a href="council4.php" class="menu_one">เพิ่มข้อมูล Level 4</a></strong></div></td>
                    <td width="15%" bgcolor="#DAE3E8"><div align="center"><strong><a href="council5.php" class="menu_one">เพิ่มข้อมูล Level 5</a></strong></div></td>
                    <td width="15%" bgcolor="#DAE3E8"><div align="center"><strong><a href="council6.php" class="menu_one">เพิ่มข้อมูล Level 6</a></strong></div></td>
                  </tr>
                  <tr>
                    <td height="33" colspan="4" bgcolor="#FEFEFE">&nbsp;</td>
                    <td bgcolor="#DAE3E8"><div align="center"><strong><a href="council7.php" class="menu_one">เพิ่มข้อมูล Level 7</a></strong></div></td>
                    <td class="table_title2"><div align="center">เพิ่มข้อมูล Level 8</div></td>
                  </tr>
                </table>
                <br />
                <p>&nbsp;</p>
                <br />
                <br>
                    <? 
## Load Module Configuration Variable ############################################

## 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") { ?>
                    <table style="border-collapse: collapse" border="1" width="95%" align="center" cellpadding="0" cellspacing="1" class="table_border" bordercolor="#E8E7E1">
                      <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" enctype="multipart/form-data"  onSubmit=" if(!verifySubmit()) { return false; } ">
                        <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="addnew">
                        <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?>">
                        <tr> 
                          <td bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="mytable_inner">
                              
                              <tr align="center"> 
                                <td height="24" colspan="2" align="center" bgcolor="#F7F6F0" class="table_title2" style="font-weight: bold"><span class="table_title2" style="font-weight: bold">เพิ่มข้อมูล Level 8</span></td>
                              </tr>
                              <tr>
                                <td width="171" height="24" align="right" class="table_row2">ข้อมูล Level 7 :</td>
                                <td width="493" class="table_col2"><?
		$sqlGroup = "SELECT * FROM cm_councillevel7 order by cm_councillevel7_No asc";
		$QueryGroup =MYSQL_DB_QUERY($System_DataBase_Name,$sqlGroup) OR DIE("Error: เกิดความผิดพลาด <br>$sqlGroup<br>\n");
		$recordGroup=MYSQL_NUMROWS($QueryGroup);
		?>
                                    <select name="councilno" id="councilno">
                                      <?
								$index=1;
								while ($index<=$recordGroup){ $RowGroup=MYSQL_FETCH_ARRAY($QueryGroup);?>
                                      <option value="<?=$RowGroup[cm_councillevel7_ID]?>">
                                      <?=$RowGroup[cm_councillevel7_No]?>
                                        <?=$RowGroup[cm_councillevel7_Name]?>
                                      </option>
                                      <? $index++;}?>
                                    </select>
                                  &nbsp;</td>
                              </tr>
                              <tr>
                                <td height="24" align="right" class="table_row2">หมายเลข :</td>
                                <td class="table_col2"><input name="inputnum" type="text" class="input_left" id="inputnum" size="40" maxlength="100" />
                                  <span style="color: #FF0000">*</span></td>
                              </tr>
                              <tr>
                                <td height="24" align="right" class="table_row2">ข้อมูลแพทยสภา Level 8: </td>
                                <td class="table_col2"><input name="inputdata" type="text" class="input_left" id="inputdata" size="40" maxlength="100" />
                                    <span style="color: #FF0000">*</span></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_row2"> 
                                  <table width="300" border="0" cellspacing="0" cellpadding="2">
                                    <tr align="center"> 
                                      <td> 
<script language="JavaScript" type="text/JavaScript">
function isBlank(myObj) { if(myObj.value=='') { return true; } return false; }
function verifySubmit() {
 	with(document.myForm) {
				if(inputnum.value=='') {
				alert('กรุณากรอกข้อมูลหมายเลข');
					inputnum.focus();
					return false;
				}
				if(inputdata.value=='') {
				alert('กรุณากรอกข้อมูลแพทยสภา');
					inputdata.focus();
					return false;
				}
				
	
	}
	return true;
}
						</script> <input name="btAdd" type="submit" class="button_60" id="btAdd" value="Add"> 
					&nbsp;&nbsp;&nbsp;	 <input name="btCalcel" type="button" class="button_60" 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=="addnew") { 
?>
	<?
	 $sql = "INSERT INTO cm_councillevel8(cm_councillevel8_No,cm_councillevel8_Name,cm_councillevel8_Createdate,cm_councillevel8_Createby,cm_councillevel8_councillevel7No) VALUES('$inputnum','$inputdata',Now(),'$System_Session_UserName','$councilno')";
	$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>
					
					
					
<? } else if($action=="addproject") { 
?>

  <!-- import the calendar script -->
                    <link rel="stylesheet" type="text/css" href="../../css/myCalendarStyle.css">
                    <script type="text/javascript" src="../mod_calendar/lib/calendar.js"></script>
                    <script type="text/javascript" src="../mod_calendar/lib/lang/calendar-en.js"></script>
                    <script type="text/javascript" src="../mod_calendar/lib/loadcalendar.js"></script>
                    <!-- end the calendar script -->
                    <? 
//########################################################
} else if ($action=="addnewproject") { 
$sql="select max(crm_mod_project_ID) from crm_mod_project";
$query=mysql_query($sql);
$row=mysql_fetch_array($query);
$in=$row[0];
$g=$in+1;

$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="";
	if($activitystatus=="track")
	{
	 $sql = "INSERT INTO ".$myModule_Table1."(".$myModule_Table1."_ID,".$myModule_Table1."_Activitystatus,".$myModule_Table1."_Date,".$myModule_Table1."_Time,".$myModule_Table1."_Detail,".$myModule_Table1."_Total,".$myModule_Table1."_Term,".$myModule_Table1."_Datepay1,".$myModule_Table1."_Percentpay1,".$myModule_Table1."_Datepay2,".$myModule_Table1."_Percentpay2,".$myModule_Table1."_Datepay3,".$myModule_Table1."_Percentpay3,".$myModule_Table1."_Datepay4,".$myModule_Table1."_Percentpay4,".$myModule_Table1."_Datepay5,".$myModule_Table1."_Percentpay5,".$myModule_Table1."_Datepay6,".$myModule_Table1."_Percentpay6,".$myModule_Table1."_Customerid,".$myModule_Table1."_CreateByID,".$myModule_Table1."_CreateBy,".$myModule_Table1."_CreateDate) VALUES('$g','$activitystatus','$inputdate','$inputtime','$inputdetail','$inputtotal','$inputterm','$inputdatepay1','$inputpercentpay1','$inputdatepay2','$inputpercentpay2','$inputdatepay3','$inputpercentpay3','$inputdatepay4','$inputpercentpay4','$inputdatepay5','$inputpercentpay5','$inputdatepay6','$inputpercentpay6','$myCheckBoxID','$System_Session_User_ID','$System_Session_UserName',Now())";

	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	
	$sql = "INSERT INTO ".$myModule_Table2."(".$myModule_Table2."_DateFrom,".$myModule_Table2."_DateTo,".$myModule_Table2."_TimeFrom,".$myModule_Table2."_Subject,".$myModule_Table2."_CreateByID,".$myModule_Table2."_CreateBy,".$myModule_Table2."_CreateDate,".$myModule_Table2."_Status,".$myModule_Table2."_Language,".$myModule_Table2."_GroupID) VALUES('$inputdate','$inputdate','$inputtime','$inputdetail','$System_Session_User_ID','$System_Session_UserName',Now(),'Enable','Thai','4')";

	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	}	
	if($activitystatus=="requestdata")
	{
	$sql = "INSERT INTO ".$myModule_Table1."(".$myModule_Table1."_ID,".$myModule_Table1."_Activitystatus,".$myModule_Table1."_Date,".$myModule_Table1."_Time,".$myModule_Table1."_Detail,".$myModule_Table1."_Total,".$myModule_Table1."_Term,".$myModule_Table1."_Datepay1,".$myModule_Table1."_Percentpay1,".$myModule_Table1."_Datepay2,".$myModule_Table1."_Percentpay2,".$myModule_Table1."_Datepay3,".$myModule_Table1."_Percentpay3,".$myModule_Table1."_Datepay4,".$myModule_Table1."_Percentpay4,".$myModule_Table1."_Datepay5,".$myModule_Table1."_Percentpay5,".$myModule_Table1."_Datepay6,".$myModule_Table1."_Percentpay6,".$myModule_Table1."_Customerid,".$myModule_Table1."_CreateByID,".$myModule_Table1."_CreateBy,".$myModule_Table1."_CreateDate) VALUES('$g','$activitystatus','$inputdate2','$inputtime2','$inputdetail2','$inputtotal','$inputterm','$inputdatepay1','$inputpercentpay1','$inputdatepay2','$inputpercentpay2','$inputdatepay3','$inputpercentpay3','$inputdatepay4','$inputpercentpay4','$inputdatepay5','$inputpercentpay5','$inputdatepay6','$inputpercentpay6','$myCheckBoxID','$System_Session_User_ID','$System_Session_UserName',Now())";

	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	
		$sql = "INSERT INTO ".$myModule_Table2."(".$myModule_Table2."_DateFrom,".$myModule_Table2."_DateTo,".$myModule_Table2."_TimeFrom,".$myModule_Table2."_Subject,".$myModule_Table2."_CreateByID,".$myModule_Table2."_CreateBy,".$myModule_Table2."_CreateDate,".$myModule_Table2."_Status,".$myModule_Table2."_Language,".$myModule_Table2."_GroupID) VALUES('$inputdate','$inputdate','$inputtime','$inputdetail','$System_Session_User_ID','$System_Session_UserName',Now(),'Enable','Thai','5')";
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");

	}	
	if($activitystatus=="requestquotation")
	{
	$sql = "INSERT INTO ".$myModule_Table1."(".$myModule_Table1."_ID,".$myModule_Table1."_Activitystatus,".$myModule_Table1."_Date,".$myModule_Table1."_Time,".$myModule_Table1."_Detail,".$myModule_Table1."_Total,".$myModule_Table1."_Term,".$myModule_Table1."_Datepay1,".$myModule_Table1."_Percentpay1,".$myModule_Table1."_Datepay2,".$myModule_Table1."_Percentpay2,".$myModule_Table1."_Datepay3,".$myModule_Table1."_Percentpay3,".$myModule_Table1."_Datepay4,".$myModule_Table1."_Percentpay4,".$myModule_Table1."_Datepay5,".$myModule_Table1."_Percentpay5,".$myModule_Table1."_Datepay6,".$myModule_Table1."_Percentpay6,".$myModule_Table1."_Customerid,".$myModule_Table1."_CreateByID,".$myModule_Table1."_CreateBy,".$myModule_Table1."_CreateDate) VALUES('$g','$activitystatus','$inputdate3','$inputtime3','$inputdetail3','$inputtotal','$inputterm','$inputdatepay1','$inputpercentpay1','$inputdatepay2','$inputpercentpay2','$inputdatepay3','$inputpercentpay3','$inputdatepay4','$inputpercentpay4','$inputdatepay5','$inputpercentpay5','$inputdatepay6','$inputpercentpay6','$myCheckBoxID','$System_Session_User_ID','$System_Session_UserName',Now())";

	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	
		$sql = "INSERT INTO ".$myModule_Table2."(".$myModule_Table2."_DateFrom,".$myModule_Table2."_DateTo,".$myModule_Table2."_TimeFrom,".$myModule_Table2."_Subject,".$myModule_Table2."_CreateByID,".$myModule_Table2."_CreateBy,".$myModule_Table2."_CreateDate,".$myModule_Table2."_Status,".$myModule_Table2."_Language,".$myModule_Table2."_GroupID) VALUES('$inputdate','$inputdate','$inputtime','$inputdetail','$System_Session_User_ID','$System_Session_UserName',Now(),'Enable','Thai','6')";
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");

	}	
	if($activitystatus=="trackprice")
	{
	$sql = "INSERT INTO ".$myModule_Table1."(".$myModule_Table1."_ID,".$myModule_Table1."_Activitystatus,".$myModule_Table1."_Date,".$myModule_Table1."_Time,".$myModule_Table1."_Detail,".$myModule_Table1."_Total,".$myModule_Table1."_Term,".$myModule_Table1."_Datepay1,".$myModule_Table1."_Percentpay1,".$myModule_Table1."_Datepay2,".$myModule_Table1."_Percentpay2,".$myModule_Table1."_Datepay3,".$myModule_Table1."_Percentpay3,".$myModule_Table1."_Datepay4,".$myModule_Table1."_Percentpay4,".$myModule_Table1."_Datepay5,".$myModule_Table1."_Percentpay5,".$myModule_Table1."_Datepay6,".$myModule_Table1."_Percentpay6,".$myModule_Table1."_Customerid,".$myModule_Table1."_CreateByID,".$myModule_Table1."_CreateBy,".$myModule_Table1."_CreateDate) VALUES('$g','$activitystatus','$inputdate4','$inputtime4','$inputdetail4','$inputtotal','$inputterm','$inputdatepay1','$inputpercentpay1','$inputdatepay2','$inputpercentpay2','$inputdatepay3','$inputpercentpay3','$inputdatepay4','$inputpercentpay4','$inputdatepay5','$inputpercentpay5','$inputdatepay6','$inputpercentpay6','$myCheckBoxID','$System_Session_User_ID','$System_Session_UserName',Now())";

	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	
		$sql = "INSERT INTO ".$myModule_Table2."(".$myModule_Table2."_DateFrom,".$myModule_Table2."_DateTo,".$myModule_Table2."_TimeFrom,".$myModule_Table2."_Subject,".$myModule_Table2."_CreateByID,".$myModule_Table2."_CreateBy,".$myModule_Table2."_CreateDate,".$myModule_Table2."_Status,".$myModule_Table2."_Language,".$myModule_Table2."_GroupID) VALUES('$inputdate','$inputdate','$inputtime','$inputdetail','$System_Session_User_ID','$System_Session_UserName',Now(),'Enable','Thai','7')";
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");

	}	
		if($activitystatus=="appoint")
	{
	$sql = "INSERT INTO ".$myModule_Table1."(".$myModule_Table1."_ID,".$myModule_Table1."_Activitystatus,".$myModule_Table1."_Date,".$myModule_Table1."_Time,".$myModule_Table1."_Detail,".$myModule_Table1."_Total,".$myModule_Table1."_Term,".$myModule_Table1."_Datepay1,".$myModule_Table1."_Percentpay1,".$myModule_Table1."_Datepay2,".$myModule_Table1."_Percentpay2,".$myModule_Table1."_Datepay3,".$myModule_Table1."_Percentpay3,".$myModule_Table1."_Datepay4,".$myModule_Table1."_Percentpay4,".$myModule_Table1."_Datepay5,".$myModule_Table1."_Percentpay5,".$myModule_Table1."_Datepay6,".$myModule_Table1."_Percentpay6,".$myModule_Table1."_Customerid,".$myModule_Table1."_CreateByID,".$myModule_Table1."_CreateBy,".$myModule_Table1."_CreateDate) VALUES('$g','$activitystatus','$inputdate5','$inputtime5','$inputdetail5','$inputtotal','$inputterm','$inputdatepay1','$inputpercentpay1','$inputdatepay2','$inputpercentpay2','$inputdatepay3','$inputpercentpay3','$inputdatepay4','$inputpercentpay4','$inputdatepay5','$inputpercentpay5','$inputdatepay6','$inputpercentpay6','$myCheckBoxID','$System_Session_User_ID','$System_Session_UserName',Now())";

	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	
		$sql = "INSERT INTO ".$myModule_Table2."(".$myModule_Table2."_DateFrom,".$myModule_Table2."_DateTo,".$myModule_Table2."_TimeFrom,".$myModule_Table2."_Subject,".$myModule_Table2."_CreateByID,".$myModule_Table2."_CreateBy,".$myModule_Table2."_CreateDate,".$myModule_Table2."_Status,".$myModule_Table2."_Language,".$myModule_Table2."_GroupID) VALUES('$inputdate','$inputdate','$inputtime','$inputdetail','$System_Session_User_ID','$System_Session_UserName',Now(),'Enable','Thai','8')";
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");

	}	
		if($activitystatus=="sign")
	{
	$sql = "INSERT INTO ".$myModule_Table1."(".$myModule_Table1."_ID,".$myModule_Table1."_Activitystatus,".$myModule_Table1."_Date,".$myModule_Table1."_Time,".$myModule_Table1."_Detail,".$myModule_Table1."_Total,".$myModule_Table1."_Term,".$myModule_Table1."_Datepay1,".$myModule_Table1."_Percentpay1,".$myModule_Table1."_Datepay2,".$myModule_Table1."_Percentpay2,".$myModule_Table1."_Datepay3,".$myModule_Table1."_Percentpay3,".$myModule_Table1."_Datepay4,".$myModule_Table1."_Percentpay4,".$myModule_Table1."_Datepay5,".$myModule_Table1."_Percentpay5,".$myModule_Table1."_Datepay6,".$myModule_Table1."_Percentpay6,".$myModule_Table1."_Customerid,".$myModule_Table1."_CreateByID,".$myModule_Table1."_CreateBy,".$myModule_Table1."_CreateDate) VALUES('$g','$activitystatus','$inputdate6','$inputtime6','$inputdetail6','$inputtotal','$inputterm','$inputdatepay1','$inputpercentpay1','$inputdatepay2','$inputpercentpay2','$inputdatepay3','$inputpercentpay3','$inputdatepay4','$inputpercentpay4','$inputdatepay5','$inputpercentpay5','$inputdatepay6','$inputpercentpay6','$myCheckBoxID','$System_Session_User_ID','$System_Session_UserName',Now())";

	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	
	$sql = "INSERT INTO ".$myModule_Table2."(".$myModule_Table2."_DateFrom,".$myModule_Table2."_DateTo,".$myModule_Table2."_TimeFrom,".$myModule_Table2."_Subject,".$myModule_Table2."_CreateByID,".$myModule_Table2."_CreateBy,".$myModule_Table2."_CreateDate,".$myModule_Table2."_Status,".$myModule_Table2."_Language,".$myModule_Table2."_GroupID) VALUES('$inputdate','$inputdate','$inputtime','$inputdetail','$System_Session_User_ID','$System_Session_UserName',Now(),'Enable','Thai','9')";
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");

	}	
		if($activitystatus=="closesale")
	{
	$sql = "INSERT INTO ".$myModule_Table1."(".$myModule_Table1."_ID,".$myModule_Table1."_Activitystatus,".$myModule_Table1."_Date,".$myModule_Table1."_Time,".$myModule_Table1."_Detail,".$myModule_Table1."_Total,".$myModule_Table1."_Term,".$myModule_Table1."_Datepay1,".$myModule_Table1."_Percentpay1,".$myModule_Table1."_Datepay2,".$myModule_Table1."_Percentpay2,".$myModule_Table1."_Datepay3,".$myModule_Table1."_Percentpay3,".$myModule_Table1."_Datepay4,".$myModule_Table1."_Percentpay4,".$myModule_Table1."_Datepay5,".$myModule_Table1."_Percentpay5,".$myModule_Table1."_Datepay6,".$myModule_Table1."_Percentpay6,".$myModule_Table1."_Customerid,".$myModule_Table1."_CreateByID,".$myModule_Table1."_CreateBy,".$myModule_Table1."_CreateDate) VALUES('$g','$activitystatus','$inputdate6','$inputtime6','$inputdetail6','$inputtotal','$inputterm','$inputdatepay1','$inputpercentpay1','$inputdatepay2','$inputpercentpay2','$inputdatepay3','$inputpercentpay3','$inputdatepay4','$inputpercentpay4','$inputdatepay5','$inputpercentpay5','$inputdatepay6','$inputpercentpay6','$myCheckBoxID','$System_Session_User_ID','$System_Session_UserName',Now())";

	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	
	}	
	if($activitystatus=="uncompletesale")
	{
	$sql = "INSERT INTO ".$myModule_Table1."(".$myModule_Table1."_ID,".$myModule_Table1."_Activitystatus,".$myModule_Table1."_Date,".$myModule_Table1."_Time,".$myModule_Table1."_Detail,".$myModule_Table1."_Total,".$myModule_Table1."_Term,".$myModule_Table1."_Datepay1,".$myModule_Table1."_Percentpay1,".$myModule_Table1."_Datepay2,".$myModule_Table1."_Percentpay2,".$myModule_Table1."_Datepay3,".$myModule_Table1."_Percentpay3,".$myModule_Table1."_Datepay4,".$myModule_Table1."_Percentpay4,".$myModule_Table1."_Datepay5,".$myModule_Table1."_Percentpay5,".$myModule_Table1."_Datepay6,".$myModule_Table1."_Percentpay6,".$myModule_Table1."_Customerid,".$myModule_Table1."_CreateByID,".$myModule_Table1."_CreateBy,".$myModule_Table1."_CreateDate) VALUES('$g','$activitystatus','$inputdate6','$inputtime6','$inputdetail6','$inputtotal','$inputterm','$inputdatepay1','$inputpercentpay1','$inputdatepay2','$inputpercentpay2','$inputdatepay3','$inputpercentpay3','$inputdatepay4','$inputpercentpay4','$inputdatepay5','$inputpercentpay5','$inputdatepay6','$inputpercentpay6','$myCheckBoxID','$System_Session_User_ID','$System_Session_UserName',Now())";

	$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];
				
				
			
				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 cm_councillevel7 WHERE cm_councillevel7_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" width="95%" align="center" cellpadding="0" cellspacing="1" class="table_border" bordercolor="#E8E7E1">
                      <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" enctype="multipart/form-data"  onSubmit=" if(!verifySubmit()) { return false; } ">
                        <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="2" align="center" class="table_title2" style="font-weight: bold">แก้ไขข้อมูล</td>
                              </tr>
                              <tr>
                                <td width="171" align="right" class="table_row2">ข้อมูล Level 7 :</td>
                                <td class="table_col2"><?
		$sqlGroup = "SELECT * FROM cm_councillevel7 order by cm_councillevel7_No asc";
		$QueryGroup =MYSQL_DB_QUERY($System_DataBase_Name,$sqlGroup) OR DIE("Error: เกิดความผิดพลาด <br>$sqlGroup<br>\n");
		$recordGroup=MYSQL_NUMROWS($QueryGroup);
		?>
                                  <select name="councilno" id="councilno">
                                    <?
								$index=1;
								while ($index<=$recordGroup){ $RowGroup=MYSQL_FETCH_ARRAY($QueryGroup);?>
                                 <option value="<?=$RowGroup[cm_councillevel7_ID]?>" <?php if (!(strcmp($Row[cm_councillevel7_councillevel2No], $RowGroup[cm_councillevel7_ID]))) {echo "selected=\"selected\"";} ?>> <?=$RowGroup[cm_councillevel7_No]?> <?=$RowGroup[cm_councillevel7_Name]?></option>
                                    </option>
                                    <? $index++;}?>
                                  </select>
&nbsp;</td>
                              </tr>
                              <tr>
                                <td align="right" class="table_row2">หมายเลข :</td>
                                <td class="table_col2"><input name="inputnum" type="text" class="input_left" id="inputnum" size="40" maxlength="100" value="<?=$Row[cm_councillevel7_No]?>" />
                                  <span style="color: #FF0000">*</span></td>
                              </tr>
                              <tr>
                                <td width="195" align="right" class="table_row2">ข้อมูลแพทยสภา Level 8: </td> 
                                <td width="489" class="table_col2"><input name="inputdata" type="text" class="input_left" id="inputdata" value="<?=$Row[cm_councillevel7_Name]?>" size="40" maxlength="100">
                                  <span style="color: #FF0000">*</span></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_row2"> 
                                  <table width="300" border="0" cellspacing="0" cellpadding="2">
                                    <tr align="center"> 
                                      <td>
<script language="JavaScript" type="text/JavaScript">
function isBlank(myObj) { if(myObj.value=='') { return true; } return false; }
function verifySubmit() {
 	with(document.myForm) {
				if(inputnum.value=='') {
				alert('กรุณากรอกข้อมูลหมายเลข');
					inputnum.focus();
					return false;
				}
				if(inputdata.value=='') {
				alert('กรุณากรอกข้อมูลแพทยสภา');
					inputdata.focus();
					return false;
				}
				
	
	}
	return true;
}
						</script> <input name="btSave" type="submit" class="button_60" id="btSave" value="Save">                                      </td>
                                      <td> <input name="btCalcel" type="button" class="button_60" 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>
<? 
##############################################
 }elseif($action=="view") { 
 $CheckBoxID=$_GET["CheckBoxID"];
 
	$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="SELECT * FROM roadpump_typepump WHERE roadpump_typepump_ID='$myCheckBoxID'";
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	$Row=MYSQL_FETCH_ARRAY($Query);
?>
                    <br>
                    <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_title2" style="font-weight: bold">ดูข้อมูล</td>
                              </tr>
                              <tr>
                                <td width="228" height="31" align="right" class="table_row2">แพทยภา : </td> 
                                <td width="460" colspan="2" class="table_row2"><?=$Row[roadpump_typepump_Name]?></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_row2"> 
                                  <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>
					</form>
                    <br />
					<? 
//########################################################
} else if ($action=="update") { 
	$MaxID = $CheckBoxID1;
	$sql = "UPDATE cm_councillevel8 SET cm_councillevel8_No='$inputnum',cm_councillevel8_Name='$inputdata',cm_councillevel8_councillevel7No='$councilno' WHERE cm_councillevel8_ID='$CheckBoxID1'";
	$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 = "DELETE FROM cm_councillevel8 WHERE cm_councillevel8_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 cm_councillevel8";
$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 cm_councillevel8";
	} else {
		$sql = $sql."  WHERE  (cm_councillevel8_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;

$sql.=" ORDER BY cm_councillevel8_No ASC LIMIT $RecordStart , $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>
                    <table width="95%" border="0" align="center" cellpadding="2" cellspacing="0" >
                  <form action="" method="post" name="mySearchForm1" id="mySearchForm1" onsubmit="return false;">
                    <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>" />
                    <input name="SystemMenuID2" type="hidden" id="SystemMenuID2" value="<?=$SystemMenuID?>" />
                    <tr>
                      <td>
                        
                        <div align="right">
                          <input name="toolbarPageSearch1" type="text"  style="height:15px"class="input_left" id="toolbarPageSearch1" value="<?=$PageSearch?>" size="20" maxlength="50" />                        
                          <input name="btPageSearch" type="button" class="button_60" id="btPageSearch" value="Search" onclick="
document.myForm.PageSearch.value=document.mySearchForm1.toolbarPageSearch1.value;
document.myForm.submit();
						" />
                          <input name="btAdd2" type="button" class="button_80" id="btAdd2" value="Add New" onclick="
document.myForm.action.value='add';
document.myForm.submit();
				" />
                      </div></td></tr>
                  </form>
                </table>
                    <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="98%" 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 height="24" colspan="5" bgcolor="#F7F6F0" class="table_title1"><div align="left">แพทยสภา</div></td>
                                </tr>
                              <tr align="center" class="menu_table_header"> 
                                <td width="61" height="24" bgcolor="#F7F6F0" class="table_title2"><input name="CheckBoxAll" type="checkbox" class="form_checkbox" id="CheckBoxAll" value="Yes" onClick="Paging_CheckAll(this,'CheckBoxID',document.myForm.TotalCheckBoxID.value)"></td>
                                <td width="61" height="24" align="center" bgcolor="#F7F6F0" class="table_title2">หัวข้อ</td>
					<? if($DisplayStyle!="Link"){?>
                                <? }?>
                                <td width="278" height="24" bgcolor="#F7F6F0" class="table_title2">แพทยสภา</td>
                                
                                <td width="131" height="24" bgcolor="#F7F6F0" class="table_title2">วันที่เพิ่ม</td>
                                <td width="130" height="24" bgcolor="#F7F6F0" class="table_title2">Action</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?>"> 
                                <td width="61" 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[cm_councillevel8_ID]?>"></td>
                                <td width="61" height="30" align="center"> 
                                 <?=$Row[cm_councillevel8_No]?></td>
							
								<td height="30"> 
                                  <div align="left"><strong>
                                    <?=$Row[cm_councillevel8_Name]?>
                                  </strong></div></td>
                                
                                <td width="131" height="30" align="center"> 
                                  <div align="center">
                                    <?=substr($Row[cm_councillevel8_Createdate],0,10)?>                                
                                  </div></td>
                                <td width="130" height="30" align="center" valign="middle"> 
                                  <table border="0" cellspacing="0" cellpadding="1">
                                    <tr align="center" valign="bottom">
<td>&nbsp;</td>    
						<td><img src="../../img/icons/edit.png" alt="Edit" width="16" height="16" border="0" onMouseOver="this.style.cursor='hand'" onClick="
if(confirm('Are you sure to edit this record?')) {
	Paging_CheckedThisItem( document.myForm.CheckBoxAll, <?=$index?>, 'CheckBoxID', document.myForm.TotalCheckBoxID.value );
	document.myForm.action.value='edit';
	document.myForm.submit();
}
						"></td>									
									  <td style="display:none"><img src="../../img/icons/delete.png" alt="Delete" width="16" height="16" border="0" onMouseOver="this.style.cursor='hand'" onClick="
if(confirm('Are you sure to delete this record?')) {
	Paging_CheckedThisItem( document.myForm.CheckBoxAll, <?=$index?>, 'CheckBoxID', document.myForm.TotalCheckBoxID.value );
	document.myForm.action.value='delete';
	document.myForm.submit();
}
						"></td>
                                    </tr>
                                </table></td>
                              </tr>
                              <?
		$index++;
	}
} else {  ?>
                              <tr class="table_row1"> 
                                <td height="80" colspan="7" 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 class="menu_one"> 
                                  <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>
			  <!-- InstanceEndEditable --> </td>
                  <td width="15">&nbsp;</td>
                </tr>
            </table></td>
            <td background="../../images/content_border/content_border_right.jpg">&nbsp;</td>
          </tr>
          <tr>
            <td><img src="../../images/l/left_menu_03_l.jpg" width="24" height="29" /></td>
            <td colspan="2"><img src="../../images/l/left_menu_03_r.jpg" width="197" height="29" /></td>
            <td><img src="../../images/content_border/content_border_03.jpg" width="747" height="29" /></td>
            <td><img src="../../images/content_border/content_border_right2.jpg" width="17" height="29" /></td>
          </tr>
        </table></td>
        </tr>
    </table></td>
  </tr>
</table>
</body>
<!-- InstanceEnd --></html>

Hacked By AnonymousFox1.0, Coded By AnonymousFox