403Webshell
Server IP : 104.21.80.248  /  Your IP : 172.71.28.155
Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30
System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586
User : SYSTEM ( 0)
PHP Version : 5.6.30
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Inetpub/www/myschool/ratrard/modules123456/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Inetpub/www/myschool/ratrard/modules123456/admin/workgroup_cat.php
<?
CheckAdmin($_SESSION['admin_user'], $_SESSION['admin_pwd']);
?>
<TABLE width="100%" Valign=top align=center cellSpacing=0 cellPadding=0 border=0 height=420>
		<TR>
			<TD Valign=top>
			<B><IMG SRC="images/icon/plus.gif" BORDER="0" ALIGN="absmiddle"> <A HREF="?name=admin&file=main">หน้าหลักผู้ดูแลระบบ</A> &nbsp;&nbsp;<A HREF="?name=admin&file=workgroup_cat"><IMG SRC="images/admin/open.gif"  BORDER="0" align="absmiddle"> รายการหน่วยงาน</A> &nbsp;&nbsp;&nbsp;<A HREF="?name=admin&file=workgroup_cat&op=workingcat_add"><IMG SRC="images/admin/book.gif"  BORDER="0" align="absmiddle"> เพิ่มกลุ่มสาระ</A> &nbsp;&nbsp;&nbsp;
<?
//////////////////////////////////////////// แสดงรายการข่าวสาร / ประชาสัมพันธ์ 
if($_GET[op] == ""){
	$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
	$limit = 100 ;
	$SUMPAGE = $db->num_rows(TB_WORKING_CAT,"id","");
	$page=$_GET[page];
	if (empty($page)){
		$page=1;
	}
	$rt = $SUMPAGE%$limit ;
	$totalpage = ($rt!=0) ? floor($SUMPAGE/$limit)+1 : floor($SUMPAGE/$limit); 
	$goto = ($page-1)*$limit ;
?>
 <form action="?name=admin&file=working_cat&op=workingcat_del&action=multidel" name="myform" method="post">
 <table width="100%" cellspacing="2" cellpadding="1" >
  <tr bgcolor="#990000" height=25>
   <td width="5%"><CENTER><font color="#FFFFFF"><B>แก้ไข/ลบ</B></font></CENTER></td>
   <td width="35%"><font color="#FFFFFF"><B>ชื่อสังกัด</B></font></td>   
   <td width="35%"><font color="#FFFFFF"><B>กลุ่มภาระกิจ</B></font></td>   
   <td width="5%"><font color="#FFFFFF"><B>สถานะ</B></font></td>   
   <td width="5%"><font color="#FFFFFF"><B>level</B></font></td>
   
  </tr>  
<?
$res[category] = $db->select_query("SELECT * FROM ".TB_WORKGROUP_CAT."  ORDER BY working_id,id DESC LIMIT $goto, $limit ");
$rows[category] = $db->rows($res[category]);
$CATCOUNT = 0 ;
while ($arr[category] = mysql_fetch_array($res[category])){

$res[working] = $db->select_query("SELECT * FROM ".TB_WORKING_CAT." WHERE id='".$arr[category][working_id]."'  ");
$arr[working] = $db->fetch($res[working]);

    $CATCOUNT ++ ;
   //กำหนดการเปลี่ยนลำดับขึ้น
   $SETSORT_UP = $arr[category][sort]-1;
   if($CATCOUNT == "1"){
	   $SETSORT_UP = "1" ;
   }
	//กำหนดการเปลี่ยนลำดับลง
   $SETSORT_DOWN = $arr[category][sort]+1;
   if($CATCOUNT == $rows[category]){
	   $SETSORT_DOWN = $arr[category][sort] ;
   }
?>
    <tr>
     <td align="center">
      <a href="?name=admin&file=workgroup_cat&op=workingcat_edit&id=<? echo $arr[category][id];?>"><img src="images/admin/edit.gif" border="0" alt="แก้ไข" > &nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:Confirm('?name=admin&file=workgroup_cat&op=workingcat_del&id=<? echo $arr[category][id];?>','คุณมั่นใจในการลบหมวดหมู่นี้ ?');"><img src="images/delete.gif"  border="0" alt="ลบ" ></a>
     </td> 
     <td>
<?
if  ($arr[category][status]!='p1'){
?>
<?echo $arr[category][category_name];?>
<? }?>	
<?
if  ($arr[category][status]=='p1'){
?>
	 <font color=red><?echo $arr[category][category_name];?></font>
<? }?>
	</td>
  <td>
<?
if  ($arr[category][status]!='p1'){
?>
<?echo $arr[working][category_name];?>
<? }?>	
<?
if  ($arr[category][status]=='p1'){
?>
	 <font color=red><?echo $arr[working][category_name];?></font>
<? }?>
	</td>
     <td align="center">
<?
if  ($arr[category][status]!='p1'){
?>
ใช้งาน
<? }?>	
<?
if  ($arr[category][status]=='p1'){
?>
	 <font color=red>ไม่ใช้งงาน</font>
<? }?>
	</td>
  <td align="center"><A HREF="<?echo $arr[category][category_name];?>" target="_blank"><?echo $arr[category][status];?></A></td>
    
    </tr>
	<TR>
		<TD colspan="6" height="1" class="dotline"></TD>
	</TR>
<?
 } 
?>
 </table>
 
 </form><BR><BR>
<?
	SplitPage($page,$totalpage,"?name=admin&file=working_cat");
	echo $ShowSumPages ;
	echo "<BR>";
	echo $ShowPages ;
}
else if($_GET[op] == "workingcat_add" AND $_GET[action] == "add"){
	//////////////////////////////////////////// กรณีเพิ่ม Database
	if(CheckLevel($_SESSION['admin_user'],$_GET[op])){
//ทำการเพิ่มข้อมูลลงดาต้าเบส
$REF = TIMESTAMP ; 
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD); 
$res[maxsort] = $db->select_query("SELECT sort FROM ".TB_WORKGROUP_CAT." ORDER BY sort DESC "); 
$arr[maxsort] = mysql_fetch_array($res[maxsort]); 
$SORT = $arr[maxsort][sort]+1 ; 
// ?????????????????
$db->add_db(TB_WORKGROUP_CAT,array(
"category_name"=> $_POST[CATEGORY_NAME],
"working_id"=> $_POST[WORKING_ID],
"status"=> $_POST[STATUS],
"sort"=>$SORT
));
$db->closedb ();

		$ProcessOutput .= "<BR><BR>";
		$ProcessOutput .= "<CENTER><A HREF=\"?name=admin&file=main\"><IMG SRC=\"images/icon/login-welcome.gif\" BORDER=\"0\"></A><BR><BR>";
		$ProcessOutput .= "<FONT COLOR=\"#336600\"><B>ได้ทำการเพิ่มเมนู   เข้าสู่ระบบเรียบร้อยแล้ว</B></FONT><BR><BR>";
		$ProcessOutput .= "<A HREF=\"?name=admin&file=workgroup_cat\"><B>กลับหน้า จัดการเมนู</B></A>";
		$ProcessOutput .= "</CENTER>";
		$ProcessOutput .= "<BR><BR>";
	}else{
		//กรณีไม่ผ่าน
		$ProcessOutput = $PermissionFalse ;
	}
	echo $ProcessOutput ;
}
else if($_GET[op] == "workingcat_add"){
	//////////////////////////////////////////// กรณีเพิ่ม Form
	if(CheckLevel($_SESSION['admin_user'],$_GET[op])){
//ดึงค่า
		$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
		$res[category] = $db->select_query("SELECT * FROM ".TB_WORKGROUP_CAT." ORDER BY id DESC LIMIT 1 ");
		$arr[category] = $db->fetch($res[category]);
		$db->closedb ();
	//	CheckUser($_SESSION['user_user']);
		$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
		$res[user] = $db->select_query("SELECT * FROM ".TB_user." WHERE username='".$_SESSION['user_user']."' ");
		$arr[user] = $db->fetch($res[user]);
		?>
<FORM NAME="myform" METHOD=POST ACTION="?name=admin&file=workgroup_cat&op=workingcat_add&action=add" enctype="multipart/form-data">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>ชื่องาน:</B> <INPUT TYPE="text" NAME="CATEGORY_NAME" size="50" >
<INPUT TYPE="hidden" NAME="LEVEL" size="50" VALUE="<?=$arr[category][id]+1;?>">
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;กลุ่ม/ฝ่าย :
<SELECT NAME="WORKING_ID"><option></option>
										<?
													$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
												$res[category] = $db->select_query("SELECT * FROM ".TB_WORKING_CAT."  ORDER BY id ");
												while ($arr[category] = $db->fetch($res[category])){
													echo "<option value=\"".$arr[category][id]."\"";
													echo ">".$arr[category][category_name]."</option>";
													}
													$db->closedb ();
													?>
													</SELECT>	
<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>สิทธิการใช้ :</b><input type="radio" name="STATUS"  id="status" value="1"> กลุ่มผู้บริหาร<input type="radio" name="STATUS"  id="status" value="1"> กลุ่มสาระ
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value=" เพิ่มรายการ " name="submit"> <input type="reset" value=" เคลีย " name="reset">
</FORM>
<BR><BR>
<?
	}else{
		//กรณีไม่ผ่าน
		echo  $PermissionFalse ;
	}
}
else if($_GET[op] == "workingcat_edit" AND $_GET[action] == "edit" ){
	//////////////////////////////////////////// กรณีแก้ไข Database Edit
	if(CheckLevel($_SESSION['admin_user'],$_GET[op])){
		//ดึงค่า
		$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
		$res[category] = $db->select_query("SELECT * FROM ".TB_WORKGROUP_CAT." ORDER BY id DESC LIMIT 1 ");
		$arr[category] = $db->fetch($res[category]);
		$db->closedb ();

//ทำการแก้ไขข้อมูลลงดาต้าเบส
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$db->update_db(TB_WORKGROUP_CAT,array(
"category_name"=> $_POST[CATEGORY_NAME],
"working_id"=> $_POST[WORKING_ID],
"status"=> $_POST[STATUS],
		)," id=$_GET[id] ");
		$db->closedb ();

		$ProcessOutput .= "<BR><BR>";
		$ProcessOutput .= "<CENTER><A HREF=\"?name=admin&file=main\"><IMG SRC=\"images/icon/login-welcome.gif\" BORDER=\"0\"></A><BR><BR>";
		$ProcessOutput .= "<FONT COLOR=\"#336600\"><B>ได้ทำการแก้ไขเมนูสร้างเอง เข้าสู่ระบบเรียบร้อยแล้ว</B></FONT><BR><BR>";
		$ProcessOutput .= "<A HREF=\"?name=admin&file=workgroup_cat\"><B>กลับหน้า จัดการเมนูสร้างเอง</B></A>";
		$ProcessOutput .= "</CENTER>";
		$ProcessOutput .= "<BR><BR>";
	}else{
		//กรณีไม่ผ่าน
		$ProcessOutput = $PermissionFalse ;
	}
	echo $ProcessOutput ;
}


else if($_GET[op] == "workingcat_edit" ){
	//////////////////////////////////////////// กรณีแก้ไข Form
	if(CheckLevel($_SESSION['admin_user'],$_GET[op])){
			//ดึงค่า
		$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
		$res[category] = $db->select_query("SELECT * FROM ".TB_WORKGROUP_CAT." WHERE id='".$_GET[id]."' ");
		$arr[category] = $db->fetch($res[category]);
		$db->closedb ();
?>
<FORM NAME="myform" METHOD=POST ACTION="?name=admin&file=workgroup_cat&op=workingcat_edit&action=edit&id=<?=$_GET[id];?>" enctype="multipart/form-data">
<div  align=center>
<table border="0" cellpadding="0" cellspacing="1" width="60%" align=center>
	<tr>
		<td>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>ชื่องาน :</B><INPUT TYPE="text" NAME="CATEGORY_NAME" size="50" value="<?=$arr[category][category_name];?>">
<BR>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;กลุ่ม/ฝ่าย :
<SELECT NAME="WORKING_ID"><option></option>
										<?
													$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
												$res[category] = $db->select_query("SELECT * FROM ".TB_WORKING_CAT."  ORDER BY id ");
												while ($arr[category] = $db->fetch($res[category])){
													echo "<option value=\"".$arr[category][id]."\"";
													echo ">".$arr[category][category_name]."</option>";
													}
													$db->closedb ();
													?>
													</SELECT>	
<BR>
<BR>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>สิทธิการใช้ :</b>

<?
if  ($arr[category][status]=='p1'){
?>
<input type="radio" name="STATUS"  id="status" value="2"> กลุ่มผู้บริหาร
<input type="radio" name="STATUS"  id="status" value="1"> กลุ่มสาระ
<? }?>
<?
if  ($arr[category][status]==''){
?>
<input type="radio" name="STATUS"  id="status" value="2"> กลุ่มผู้บริหาร
<input type="radio" name="STATUS"  id="status" value="1"> กลุ่มงานในสำนักงาน
<? }?>
<?
if  ($arr[category][status]=='1'){
?>
<input type="radio" name="STATUS"  id="status" value="2"> กลุ่มผู้บริหาร
<input type="radio" name="STATUS"  id="status" value="1"> กลุ่มสาระ
<? }?>
<?
if  ($arr[category][status]=='2'){
?>
<input type="radio" name="STATUS"  id="status" value="2"> กลุ่มผู้บริหาร
<input type="radio" name="STATUS"  id="status" value="1"> กลุ่มสาระ
<? }?>
<?
if  ($arr[category][status]=='4'){
?>
<input type="radio" name="STATUS"  id="status" value="2"> กลุ่มผู้บริหาร
<input type="radio" name="STATUS"  id="status" value="1"> กลุ่มงานในสำนักงาน
<? }?>
<?
if  ($arr[category][status]=='5'){
?>
<input type="radio" name="STATUS"  id="status" value="2"> กลุ่มผู้บริหาร
<input type="radio" name="STATUS"  id="status" value="1"> กลุ่มสาระ
<? }?>
<?
if  ($arr[category][status]=='2'){
?>
<input type="radio" name="STATUS"  id="status" value="2"> กลุ่มผู้บริหาร
<input type="radio" name="STATUS"  id="status" value="p1"> ปิดการใช้งาน
<? }?>
<?
if  ($arr[category][status]=='1'){
?>
<input type="radio" name="STATUS"  id="status" value="2"> กลุ่มผู้บริหาร
<input type="radio" name="STATUS"  id="status" value="p1"> ปิดการใช้งาน
<? }?>
<?
if  ($arr[category][status]=='4'){
?>
<input type="radio" name="STATUS"  id="status" value="2"> กลุ่มผู้บริหาร
<input type="radio" name="STATUS"  id="status" value="p1"> ปิดการใช้งาน
<? }?>
<?
if  ($arr[category][status]=='5'){
?>
<input type="radio" name="STATUS"  id="status" value="2"> กลุ่มผู้บริหาร
<input type="radio" name="STATUS"  id="status" value="p1"> ปิดการใช้งาน
<? }?>
<BR>

<BR>
<div align=center><input type="submit" value="บันทึกแก้ไข" name="submit"></div>
</td>
</tr>
</table>
</div>
</FORM>
<BR><BR>
<?
	}else{
		//กรณีไม่ผ่าน
		$ProcessOutput = $PermissionFalse ;
	}
	echo $ProcessOutput ;
}
else if($_GET[op] == "workingcat_del" AND $_GET[action] == "multidel"){
	//////////////////////////////////////////// กรณีลบ Multi
	if(CheckLevel($_SESSION['admin_user'],$_GET[op])){
		while(list($key, $value) = each ($_POST['list'])){
			$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
			$db->del(TB_WORKGROUP_CAT," id='".$value."' "); 
			$db->closedb ();

	//		@unlink("pageicon/".$arr[page][post_date].".jpg");
		}
		$ProcessOutput .= "<BR><BR>";
		$ProcessOutput .= "<CENTER><A HREF=\"?name=admin&file=main\"><IMG SRC=\"images/icon/login-welcome.gif\" BORDER=\"0\"></A><BR><BR>";
		$ProcessOutput .= "<FONT COLOR=\"#336600\"><B>ได้ทำการลบเมนูสร้างเองเรียบร้อยแล้ว</B></FONT><BR><BR>";
		$ProcessOutput .= "</CENTER>";
		$ProcessOutput .= "<BR><BR>";
	}else{
		//กรณีไม่ผ่าน
		$ProcessOutput = $PermissionFalse ;
	}
	echo $ProcessOutput ;
}
else if($_GET[op] == "workingcat_del"){
	//////////////////////////////////////////// กรณีลบ Form
	if(CheckLevel($_SESSION['admin_user'],$_GET[op])){
		$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
		$db->del(TB_WORKGROUP_CAT," id='".$_GET[id]."' "); 
		$db->closedb ();
//	@unlink("pageicon/".$_GET[prefix].".jpg");
		$ProcessOutput .= "<BR><BR>";
		$ProcessOutput .= "<CENTER><A HREF=\"?name=admin&file=main\"><IMG SRC=\"images/icon/login-welcome.gif\" BORDER=\"0\"></A><BR><BR>";
		$ProcessOutput .= "<FONT COLOR=\"#336600\"><B>ได้ทำการลบเมนูสร้างเองเรียบร้อยแล้ว</B></FONT><BR><BR>";
		$ProcessOutput .= "</CENTER>";
		$ProcessOutput .= "<BR><BR>";
	}else{
		//กรณีไม่ผ่าน
		$ProcessOutput = $PermissionFalse ;
	}
	echo $ProcessOutput ;
}
?>
						<BR><BR>
					</TD>
				</TR>
			</TABLE>
			<BR><BR>
			<!-- Admin -->
		  </TD>
        </TR>
      </TBODY>
    </TABLE>

Youez - 2016 - github.com/yon3zu
LinuXploit