? GR0V Shell

GR0V shell

Linux www.koreapackagetour.com 2.6.32-042stab145.3 #1 SMP Thu Jun 11 14:05:04 MSK 2020 x86_64

Path : /home/admin/domains/happytokorea.com/public_html/backend/images/
File Upload :
Current File : /home/admin/domains/happytokorea.com/public_html/backend/images/mod_article.php

<?
class article extends MySql
{
function add_category($name,$detail){
$numRow=$this->check_data('news_cat','name',$name);
if($numRow==""){
if($name!=""&&$detail!=""){

$result=$this->Query("insert into news_cat (name,detail) values ('$name','$detail')");
if($result){
echo"<meta http-equiv=\"refresh\" content=\"0;url=$PHPSELF?mod=news&ac=show_category&msg=1\">";
}else{
	$error="ไม่สามารถบันทึกข้อมูลได้ในขณะนี้ค่ะ";
	echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n";
	exit(0);
}
}else{
	$error="กรอกข้อมูลไม่ครบค่ะ";
	echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n";
	exit(0);
}//จบ ตรวจสอบว่าข้อมูลครบหรือไม
	}else{
//ข้อมูลมีในฐานข้อมูลหรือป่าว
$error="ชื่อหมวดหมู่ซ้ำกับของเดิม";
	echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n";
	exit(0);
	}	//จบข้อมูลมีในฐานข้อมูลหรือป่าว

}//end

function delete_photo_gallery(){
global $user_login,$db;
$id_p=$_GET['id_p'];
$topic_id=$_GET['id'];
$result=$this->Query("SELECT * FROM tour_photo WHERE id_p='$id_p' ");
$arr=mysql_fetch_array($result);
$flgDelete = unlink("../tour/photo/thumbs/".$arr['picture']);
$flgDelete = unlink("../tour/photo/".$arr['picture']);
$result=$this->Query("DELETE FROM tour_photo WHERE id_p='$id_p' ");

if($result==1){
echo"<meta http-equiv=\"refresh\" content=\"0;url=$PHPSELF?mod=tour&ac=edit_data&id={$topic_id}&msg=3\">";	
}else{
	$error="ไม่สามารถลบข้อมูลได้";
	
	echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n";
	exit(0);
}
}

function edit_category($name,$detail,$cat_id){
	if($this->check_data_edit('news_cat','name',$name,'id',$cat_id)==''){
	if($name!=""&&$detail!=""){
	$result=$this->Query("UPDATE news_cat set name='$name',detail='$detail' where id='$cat_id'");
if($result){
	echo"<meta http-equiv=\"refresh\" content=\"0;url=$PHPSELF?mod=news&ac=edit_cat&cat_id=$cat_id&msg=2\">";
}else{
		$error="ไม่สามารถแก้ไขข้อมูลได้";
	echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n";
	exit(0);
}
}else{
	//else check ข้อมูลครบหรือไม่
		$error="ไม่สามารถแก้ไขข้อมูลได้";
	echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n";
	exit(0);
}// จบการตรวจสอบข้อมูลว่าครบไหม
	}else{
// จบตรวจสอบว่าชื่อซ้ำกันหรือไม
		$error="ชื่อหมวดหมู่มีในฐานข้อมูลแล้ว";
	echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n";
	exit(0);
	}// จบตรวจสอบว่าชื่อซ้ำกันหรือไม่
}//end edit_category
function del_cat(){
$cat_id=$_GET['cat_id'];
$this->setQuery("SELECT id FROM news");
$rs=$this->QueryReturn();
$numrow=$this->numRows();
if($numrow==''){
 $result=$this->Query("DELETE FROM news_cat WHERE  id='$cat_id'");
	if($result==1){
	echo"<meta http-equiv=\"refresh\" content=\"0;url=$PHPSELF?mod=news&ac=show_category&msg=3\">";
}else{
	$error="ไม่สามารถลบข้อมูลได้";
	echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n";
	exit(0);
}
}else{
$error="ไม่สามารถลบข้อมูลได้ เนื่องจากหมวดหมู่นี้ยังมีเรื่องเหลืออยู่ในฐานข้อมูล กรุณาลบเรื่องก่อนค่ะ";
	echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n";
	exit(0);
}//จบการตรวจสอบว่ามีข้อมูลหัวข้ออยู่ในฐานข้อมูลหรือไม่
}//end function del_cat
function add_topic(){
	global $user_login;
	$addarr=array(
	'group1'=>$user_login['Type'],
	'name'=>$_POST['name'],
	'detail'=>$_POST['detail'],
	'timeadd'=>date('Y-m-d H:i:s',time()),
	);
	
$chk_count=count($addarr);
$i=0;

foreach($addarr as $key=>$v){    
	$i++;
	$v=$this->db_input($v);
	if($i==$chk_count){
		$fields.="$key";
		$value.="'$v'";
	}else{
		$value.="'$v',";
	$fields.="$key,";
	}

}//จบ foreach
	$sql="INSERT INTO contents (".$fields.") values (".$value.")";
	$this->setQuery($sql);
	$result=$this->QueryReturn();
	if($result){
	echo"<meta http-equiv=\"refresh\" content=\"0;url=$PHPSELF?mod=content&msg=1\">";
}else{
		$error="ไม่สามารถเพิ่มข้อมูลได้".$this->mysqlError();
	echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n";
	exit(0);
}
}//end function add_produce


function edit_topic($topic_id){
	global $user_login;
$addarr=array(
	'ContentDetail'=>$_POST['ContentDetail'],
	'ContentAddTime'=>date('Y-m-d H:i:s',time()),
		);
$result=$this->Update($table='adt_content',$addarr,"where ContentID='$topic_id'");
	if($result==1){
	echo"<meta http-equiv=\"refresh\" content=\"0;url=$PHPSELF?mod=content&msg=2\">";
}else{
		$error="ไม่สามารถเพิ่มข้อมูลได้".$this->mysqlError();
	echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n";
	exit(0);
}
}//end function add_produce
function set_first_page(){
	$topic_id=$_GET['id'];
	global $user_login;
	$this->Query("UPDATE contents set show1='' WHERE group1='".$user_login['Type']."'");
$sql=$this->setQuery("UPDATE contents set show1='Yes' WHERE group1='".$user_login['Type']."' AND id='".$topic_id."'");
$result=$this->QueryReturn();

	if($result){echo $sql;
						echo"<meta http-equiv=\"refresh\" content=\"0;url=$PHPSELF?mod=content&msg=2\">";
					}else{
						$error="ไม่สามารถเพิ่มข้อมูลได้".$this->mysqlError();
						echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n";
						exit(0);
}
}//end function add_produce
function del_topic(){
global $user_login,$db;
$topic_id=$_GET['id'];

if ($_SESSION["la"] == 1){
$result=$this->Query("DELETE FROM tour WHERE id='$topic_id' ");
$result2=$this->Query("DELETE FROM time_schedule1 WHERE tour_id='$topic_id' ");
$result3=$this->Query("DELETE FROM tour_content WHERE content_tour_id='$topic_id' ");
$result4=$this->Query("DELETE FROM time_schedule_comment WHERE tour_id='$topic_id' ");
$result5=$this->Query("DELETE FROM tour_option WHERE tour_id='$topic_id' ");
}else{
$result=$this->Query("DELETE FROM tour_en WHERE id='$topic_id' ");
$result2=$this->Query("DELETE FROM time_schedule1_en WHERE tour_id='$topic_id' ");
$result3=$this->Query("DELETE FROM tour_content_en WHERE content_tour_id='$topic_id' ");
$result4=$this->Query("DELETE FROM time_schedule_comment_en WHERE tour_id='$topic_id' ");
$result5=$this->Query("DELETE FROM tour_option_en WHERE tour_id='$topic_id' ");
}
if($result==1){
echo"<meta http-equiv=\"refresh\" content=\"0;url=$PHPSELF?mod=tour&msg=3\">";	
}else{
	$error="ไม่สามารถลบข้อมูลได้";
	
	echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n";
	exit(0);
}
}//end function del_topic


function del_data_credit(){
global $user_login,$db;
$topic_id=$_GET['id'];

$result=$this->Query("DELETE FROM cadit_card WHERE id='$topic_id' ");


if($result==1){
echo"<meta http-equiv=\"refresh\" content=\"0;url=$PHPSELF?mod=tour&ac=cadit_card&msg=3\">";	
}else{
	$error="ไม่สามารถลบข้อมูลได้";
	
	echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n";
	exit(0);
}
}//end function del_data_credit

function del_word(){
	global $user_login;

	$id=$_GET['id'];
	$data=$this->getDataOneRow('tour',$topic_id,'id');
	unlink("../tour/word/".$data['fileload']."");
	
if($this->Query("UPDATE tour set fileload='' WHERE id='$id'")){
	echo"<meta http-equiv=\"refresh\" content=\"0;url=$PHPSELF?mod=tour&msg=2\">";
	}
}
function del_pdf(){
	global $user_login;

	$id=$_GET['id'];
	$data=$this->getDataOneRow('tour',$topic_id,'id');
	unlink("../tour/pdf/".$data['pdf']."");
	
if($this->Query("UPDATE tour set pdf='' WHERE id='$id'")){
	echo"<meta http-equiv=\"refresh\" content=\"0;url=$PHPSELF?mod=tour&msg=2\">";
	}
}
function del_rar(){
	global $user_login;

	$id=$_GET['id'];
	$data=$this->getDataOneRow('tour',$topic_id,'id');
	unlink("../tour/fileload/".$data['fileload']."");
	
if($this->Query("UPDATE tour set fileload='' WHERE id='$id'")){
	echo"<meta http-equiv=\"refresh\" content=\"0;url=$PHPSELF?mod=tour&msg=2\">";
	}
}
}//end class
?>

T1KUS90T
  root-grov@210.1.60.28:~$