403Webshell
Server IP : 172.67.187.206  /  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/triamudom/2568/modules/publish/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Inetpub/www/myschool/triamudom/2568/modules/publish/add.php
<script language="javascript">
<!--
var Open = ""
var Closed = ""

function preload(){
if(document.images){

Closed = new Image(16,13)

Closed.src = "closed.gif"
}}


function showhide(what,what2){
if (what.style.display=='none'){
what.style.display='';
}
else{
what.style.display='none'

}
}
-->
</script>
<script language="JavaScript">

//******************************************
function checkregis() {

if(document.myform.TOPIC.value=="") {
alert("กรุณาใส่ชื่อเรื่อง") ;
document.myform.TOPIC.select() ;
return false ;
}

if(document.myform.DATE.value=="") {
alert("กรุณากรอกวันเดือนปี") ;
document.myform.DATE.select() ;
return false ;
}
if(document.myform.files1.value=="") {
alert("กรุณาแนบไฟล์") ;
document.myform.files1.focus() ;
return false ;
} 
//********************************************
}
</script>

	<TABLE cellSpacing=0 cellPadding=0 width=100% height=500 border=0>
      <TBODY>
        <TR>
          <TD vAlign=top><BR>
				<TABLE width="600" background="images/1234.jpg" align=center cellSpacing=0 cellPadding=0 border=0>
				<TR>
					<TD  vAlign=top>
<BR>
<?
 if($_GET[op] == "publish_add" AND $_GET[action] == "add"){
	//////////////////////////////////////////// กรณีเพิ่ม Database
	if(CheckLevelUser($_SESSION['user_user'],$_GET[op])){

	//	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]);

		if (!$_POST[CATEGORY] OR !$_POST[TOPIC] ){
			echo "<script language='javascript'>" ;
			echo "alert('กรุณากรอกข้อมูลต่างๆให้ครบถ้วน')" ;
			echo "</script>" ;
			echo "<script language='javascript'>javascript:history.back()</script>";
			exit();
		}
		
				$FILE = $_FILES['files1'];
			$FILE = $_FILES['files2'];
			$FILE = $_FILES['files3'];
			$FILE = $_FILES['files4'];
		if (!$_POST[CATEGORY] ){
			echo "<script language='javascript'>" ;
			echo "alert('กรุณากรอกข้อมูลต่างๆให้ครบถ้วน')" ;
			echo "</script>" ;
			echo "<script language='javascript'>javascript:history.back()</script>";
			exit();
		}
//==========================================================================================
//======================================================== BEGIN ===== UPLOAD 1 ============
//==========================================================================================
 if($_FILES["files1"]["tmp_name"] != "")
{
			$upload = $_FILES["files1"]["tmp_name"];
			$upload_file = $_FILES["files1"]["type"];
			require 'includes/gen_file_name.php';
			$upload_time=$gen_file_name;
//ตรวจสอบชนิดของไฟล์
	if (( $upload_file!="application/pdf" ) AND ($upload_file!="application/msword") AND ($upload_file!="application/vnd.ms-excel") AND ($upload_file!="application/vnd.openxmlformats-officedocument.wordprocessingml.document") AND ($upload_file!="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") AND  ($upload_file!="application/x-zip-compressed")AND ($upload_file!="application/octet-stream")){
			echo "<script language='javascript'>" ;
			echo "alert('กรุณาใช้ไฟล์ .pdf .doc .xls .zip ')" ;
			echo "</script>" ;
			echo "<script language='javascript'>javascript:history.back()</script>";
			exit();
		}

#แปลงนามสกุล และทำการ upload
if( $upload_file == "application/pdf" )
				{
						$filename = $upload_name.".pdf";
				}
if( $upload_file == "application/msword" )
				{
						$filename = $upload_name.".doc";
				}
		if( $upload_file == "application/vnd.openxmlformats-officedocument.wordprocessingml.document" )
				{
						$filename = $upload_name.".docx";
				}
				if( $upload_file == "application/vnd.ms-excel" )
				{
						$filename = $upload_name.".xls";
				}
				if( $upload_file == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" )
				{
						$filename = $upload_name.".xlsx";
				}
				if( $upload_file == "application/x-zip-compressed" )
				{
						$filename = $upload_name.".zip";
				}

							if( $upload_file == "application/octet-stream" )
				{
						$filename = $upload_name.".rar";
				}
				$new1_upload = $upload_time.$filename;
copy($_FILES["files1"]["tmp_name"], "data/publish/$new1_upload");		
//======================================================== END ======= UPLOAD 4 ============
// เร่อม
  if($_FILES["files2"]["tmp_name"] != "")
{
			$upload = $_FILES["files2"]["tmp_name"];
			$upload_file = $_FILES["files2"]["type"];
			require 'includes/gen_file_name.php';
			$upload_time=$gen_file_name;
//ตรวจสอบชนิดของไฟล์
		if (( $upload_file!="application/pdf" ) AND ($upload_file!="application/msword") AND ($upload_file!="application/vnd.ms-excel") AND ($upload_file!="application/vnd.openxmlformats-officedocument.wordprocessingml.document") AND ($upload_file!="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") AND  ($upload_file!="application/x-zip-compressed")AND ($upload_file!="application/octet-stream")){
			echo "<script language='javascript'>" ;
			echo "alert('กรุณาใช้ไฟล์ .pdf .doc .xls .zip ')" ;
			echo "</script>" ;
			echo "<script language='javascript'>javascript:history.back()</script>";
			exit();
		}
#แปลงนามสกุล และทำการ upload
if( $upload_file == "application/pdf" )
				{
						$filename = $upload_name.".pdf";
				}
if( $upload_file == "application/msword" )
				{
						$filename = $upload_name.".doc";
				}
		if( $upload_file == "application/vnd.openxmlformats-officedocument.wordprocessingml.document" )
				{
						$filename = $upload_name.".docx";
				}
				if( $upload_file == "application/vnd.ms-excel" )
				{
						$filename = $upload_name.".xls";
				}
				if( $upload_file == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" )
				{
						$filename = $upload_name.".xlsx";
				}
				if( $upload_file == "application/x-zip-compressed" )
				{
						$filename = $upload_name.".zip";
				}
					if( $upload_file == "application/octet-stream" )
				{
						$filename = $upload_name.".rar";
				}
					$new2_upload = $upload_time.$filename;
			
copy($_FILES["files2"]["tmp_name"], "data/publish/$new2_upload");		
//======================================================== BEGIN ===== UPLOAD 3 ============
 if($_FILES["files3"]["tmp_name"] != "")
{
			$upload = $_FILES["files3"]["tmp_name"];
			$upload_file = $_FILES["files3"]["type"];
			require 'includes/gen_file_name.php';
			$upload_time=$gen_file_name;
//ตรวจสอบชนิดของไฟล์
		if (( $upload_file!="application/pdf" ) AND ($upload_file!="application/msword") AND ($upload_file!="application/vnd.ms-excel") AND ($upload_file!="application/vnd.openxmlformats-officedocument.wordprocessingml.document") AND ($upload_file!="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") AND  ($upload_file!="application/x-zip-compressed")AND ($upload_file!="application/octet-stream")){
			echo "<script language='javascript'>" ;
			echo "alert('กรุณาใช้ไฟล์ .pdf .doc .xls .zip ')" ;
			echo "</script>" ;
			echo "<script language='javascript'>javascript:history.back()</script>";
			exit();
		}
#แปลงนามสกุล และทำการ upload
if( $upload_file == "application/pdf" )
				{
						$filename = $upload_name.".pdf";
				}
if( $upload_file == "application/msword" )
				{
						$filename = $upload_name.".doc";
				}
		if( $upload_file == "application/vnd.openxmlformats-officedocument.wordprocessingml.document" )
				{
						$filename = $upload_name.".docx";
				}
				if( $upload_file == "application/vnd.ms-excel" )
				{
						$filename = $upload_name.".xls";
				}
				if( $upload_file == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" )
				{
						$filename = $upload_name.".xlsx";
				}
				if( $upload_file == "application/x-zip-compressed" )
				{
						$filename = $upload_name.".zip";
				}
					if( $upload_file == "application/octet-stream" )
				{
						$filename = $upload_name.".rar";
				}
						$new3_upload = $upload_time.$filename;
			
copy($_FILES["files3"]["tmp_name"], "data/publish/$new3_upload");		
//======================================================== BEGIN ===== UPLOAD 4 ============
 if($_FILES["files4"]["tmp_name"] != "")
{
			$upload = $_FILES["files4"]["tmp_name"];
			$upload_file = $_FILES["files4"]["type"];
			require 'includes/gen_file_name.php';
			$upload_time=$gen_file_name;
//ตรวจสอบชนิดของไฟล์
	if (( $upload_file!="application/pdf" ) AND ($upload_file!="application/msword") AND ($upload_file!="application/vnd.ms-excel") AND ($upload_file!="application/vnd.openxmlformats-officedocument.wordprocessingml.document") AND ($upload_file!="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") AND  ($upload_file!="application/x-zip-compressed")AND ($upload_file!="application/octet-stream")){
			echo "<script language='javascript'>" ;
			echo "alert('กรุณาใช้ไฟล์ .pdf .doc .xls .zip ')" ;
			echo "</script>" ;
			echo "<script language='javascript'>javascript:history.back()</script>";
			exit();
		}
#แปลงนามสกุล และทำการ upload
if( $upload_file == "application/pdf" )
				{
						$filename = $upload_name.".pdf";
				}
if( $upload_file == "application/msword" )
				{
						$filename = $upload_name.".doc";
				}
		if( $upload_file == "application/vnd.openxmlformats-officedocument.wordprocessingml.document" )
				{
						$filename = $upload_name.".docx";
				}
				if( $upload_file == "application/vnd.ms-excel" )
				{
						$filename = $upload_name.".xls";
				}
				if( $upload_file == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" )
				{
						$filename = $upload_name.".xlsx";
				}
				if( $upload_file == "application/x-zip-compressed" )
				{
						$filename = $upload_name.".zip";
				}
					if( $upload_file == "application/octet-stream" )
				{
						$filename = $upload_name.".rar";
				}
							$new4_upload = $upload_time.$filename;
			
copy($_FILES["files4"]["tmp_name"], "data/publish/$new4_upload");		
//======================================================== END ======= UPLOAD 4 ============
}
}
}
            
			  		//ทำการเพิ่มข้อมูลลงดาต้าเบส
		$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
		$db->add_db(TB_PUBLISH,array(
			"category"=>"$_POST[CATEGORY]",
			"idpublish"=>"$_POST[IDPUBLISH]",
			"year"=>"$_POST[YEAR]",
			"tabain"=>"$_POST[TABAIN]",
			"topic"=>"$_POST[TOPIC]",
			"date"=>"$_POST[DATE]",
			"posted"=>"$_POST[POSTED]",
			"sangkad"=>"$_POST[SANGKAD]",
			"post_date"=>"".TIMESTAMP."",
			"update_date"=>"".TIMESTAMP."",
			"full_text"=>"$new1_upload",
			"full_texts"=>"$new2_upload",
			"full_textu"=>"$new3_upload",
			"full_texto"=>"$new4_upload",
			"enable_comment"=>"1"));
		$db->closedb ();
} else {
			//ทำการเพิ่มข้อมูลลงดาต้าเบส
		$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
	$db->add_db(TB_PUBLISH,array(
			"category"=>"$_POST[CATEGORY]",
			"idpublish"=>"$_POST[IDPUBLISH]",
			"year"=>"$_POST[YEAR]",
			"tabain"=>"$_POST[TABAIN]",
			"topic"=>"$_POST[TOPIC]",
			"date"=>"$_POST[DATE]",
			"posted"=>"$_POST[POSTED]",
			"sangkad"=>"$_POST[SANGKAD]",
			"post_date"=>"".TIMESTAMP."",
			"update_date"=>"".TIMESTAMP."",
			"enable_comment"=>"1",));
		$db->closedb ();
}

		$ProcessOutput .= "<BR><BR>";
		$ProcessOutput .= "<CENTER><IMG SRC=\"images/icon/login-welcome.gif\" BORDER=\"0\"></A><BR><BR>";
		$ProcessOutput .= "<FONT COLOR=\"#336600\"><B>ได้ทำการเพิ่ม  เข้าสู่ระบบเรียบร้อยแล้ว</B></FONT><BR><BR>";
	$ProcessOutput .= "<meta http-equiv=\"refresh\" content=\"1 ;url=?name=publish&file=tabain\">";
		$ProcessOutput .= "</CENTER>";
		$ProcessOutput .= "<BR><BR>";
	}else{
		//กรณีไม่ผ่าน
		$ProcessOutput = $PermissionFalse ;
	}
	echo $ProcessOutput ;
}
else if($_GET[op] == "publish_add"){
	//////////////////////////////////////////// กรณีเพิ่ม Form
	if(($_GET[op])){

	//	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]);

//ดึงค่า
		$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
		$res[year] = $db->select_query("SELECT * FROM ".TB_YEARS_CAT." ORDER BY id DESC LIMIT 1");
		$arr[year] = $db->fetch($res[year]);

	//ดึงค่า
		$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
		$res[publish] = $db->select_query("SELECT * FROM ".TB_PUBLISH." WHERE year='".$arr[year][name]."'  ORDER BY id DESC LIMIT 1 ");
		$arr[publish] = $db->fetch($res[publish]);
		$db->closedb ();
		?>
<script type="text/javascript" src="datepicker.js"></script>
<FORM NAME="myform" METHOD=POST ACTION="?name=publish&file=add&op=publish_add&action=add" enctype="multipart/form-data"  id="myform" onSubmit="return checkregis()">
<table width="700" align="center" background="images/1234.jpg">
  <tr>
	<td height="24" colspan="2" align="right" valign="top">
<div align="center"><B>ระบบประกาศ</B></div>
	</td>
	</tr>
  <tr> 
    <td width="200" height="22" align="right" valign="top"><strong>ฉบับที่ :</strong></td>
    <td width="500" align="left" valign="top"><?=$arr[publish][idpublish]+1;?> ปีที่ออกประกาศ: <?=$arr[year][name];?>
	<INPUT TYPE="hidden"  size="5" NAME="IDPUBLISH" VALUE="<?=$arr[publish][idpublish]+1;?>">
	<INPUT TYPE="hidden"NAME="TABAIN" VALUE="<?=$arr[publish][idpublish]+1;?>" >
 <INPUT TYPE="hidden" NAME="YEAR" size="80" VALUE="<?=$arr[year][name];?>" >
	</td>
  </tr>
  <tr> 
    <td height="22" align="right" valign="top"><strong>เรื่อง :</strong></td>
    <td align="left" valign="top"><INPUT TYPE="text" NAME="TOPIC" size="55"  ></td>
  </tr>
  <tr> 
    <td height="22" align="right" valign="top"><strong>ประกาศ ณ วันที่ :</strong></td>
    <td align="left" valign="top">
	<input name="DATE"  readonly value="<?=$_GET[dates];?>"style="background-color:#FFFF99"> <IMG SRC="images/admin/dateselect.gif" BORDER="0" ALT="เลือกวันที่" onclick="displayDatePicker('DATE', false, 'ymd', '-');" align="absmiddle"> 
	</td>
  </tr>
<tr> 
    <td height="24" align="right" valign="top"><strong>แนบเอกสาร 1 :</strong></td>
    <td align="left" valign="top"><input type="file" name="files1" size="40"></td>
  </tr>
<tr> 
    <td height="24" align="right" valign="top"><strong>แนบเอกสาร 2 :</strong></td>
    <td align="left" valign="top"><input type="file" name="files2" size="40"></td>
  </tr>
<tr> 
    <td height="24" align="right" valign="top"><strong>แนบเอกสาร 3 :</strong></td>
    <td align="left" valign="top"><input type="file" name="files3" size="40"></td>
  </tr>
<tr> 
    <td height="24" align="right" valign="top"><strong>แนบเอกสาร 4 :</strong></td>
    <td align="left" valign="top"><input type="file" name="files4" size="40"></td>
  </tr>
  <tr> 
    <td height="24" colspan="2" align="right" valign="top">
	<div align="center">
	<INPUT TYPE="hidden" NAME="CATEGORY" size="60" VALUE="o" >	
	<INPUT TYPE="hidden" NAME="POSTED" VALUE="<?=$arr[user][id];?><?=$arr[usersch][name];?>" readonly style=\"color: #FF0000">
	<INPUT TYPE="hidden" NAME="SANGKAD" size="80" VALUE="<?=$arr[user][sangkad];?><?=$arr[usersch][id];?>" >
	<INPUT TYPE="submit" value=" บันทึกออกเลข" name="submit"style="background-color:#FFFF99"> 
	</div></td>
  </tr>
</table>
</FORM>
<BR>
<?
	}else{
		//กรณีไม่ผ่าน
		$ProcessOutput = $PermissionFalse ;
	}
	echo $ProcessOutput ;
}
else if($_GET[op] == "publish_del" AND $_GET[action] == "multidel"){
	//////////////////////////////////////////// กรณีลบ Multi
	if(CheckLevelUser($_SESSION['user_user'],$_GET[op])){
		while(list($key, $value) = each ($_POST['list'])){
			$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
			$res[publish] = $db->select_query("SELECT * FROM ".TB_PUBLISH." WHERE id='".$value."' ");
			$arr[publish] = $db->fetch($res[publish]);
			$db->del(TB_PUBLISH," id='".$value."' "); 

			@unlink("publishdata/".$arr[publish][post_date].".txt");
			@unlink("publishicon/".$arr[publish][post_date].".jpg");
			@unlink("publish/".$arr[publish][full_text]);
			$db->closedb ();
		}
		$ProcessOutput .= "<BR><BR>";
		$ProcessOutput .= "<CENTER><A HREF=\"?name=publish&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=publish&file=addschool&op=publish_add\"><B>ส่งหนังสือถึงโรงเรียนใหม่</B></A>";
		$ProcessOutput .= "</CENTER>";
		$ProcessOutput .= "<BR><BR>";
	}else{
		//กรณีไม่ผ่าน
		$ProcessOutput = $PermissionFalse ;
	}
	echo $ProcessOutput ;
}
else if($_GET[op] == "publish_del"){
	//////////////////////////////////////////// กรณีลบ Form
	if(CheckLevelUser($_SESSION['user_user'],$_GET[op])){
		$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
//		$db->del(TB_PUBLISH," id='".$_GET[id]."' ");
			$res[publish] = $db->select_query("SELECT * FROM ".TB_PUBLISH." WHERE id='".$_GET[id]."' ");
			$arr[publish] = $db->fetch($res[publish]);
			$db->del(TB_PUBLISH," id='".$_GET[id]."' "); 

			@unlink("publishdata/".$arr[publish][post_date].".txt");
			@unlink("publishicon/".$arr[publish][post_date].".jpg");
			@unlink("publish/".$arr[publish][full_text]);
		$db->closedb ();
		$ProcessOutput .= "<BR><BR>";
		$ProcessOutput .= "<CENTER><A HREF=\"?name=user&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=publish&file=addschool&op=publish_add\"><B>ส่งหนังสือถึงโรงเรียนใหม่</B></A>";
		$ProcessOutput .= "<BR><BR>";
	}else{
		//กรณีไม่ผ่าน
		$ProcessOutput = $PermissionFalse ;
	}
	echo $ProcessOutput ;
}
?>
				</TD>
				</TR>
			</TABLE>
			<!-- user -->
		  </TD>
        </TR>
      </TBODY>
    </TABLE>

Youez - 2016 - github.com/yon3zu
LinuXploit