403Webshell
Server IP : 119.59.102.212  /  Your IP : 3.149.249.184
Web Server : Apache/2
System : Linux narin 2.6.32-042stab142.1 #1 SMP Tue Jan 28 23:44:17 MSK 2020 x86_64
User : yangkam ( 1022)
PHP Version : 5.6.40
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/yangkam/domains/yangkam.go.th/public_html/coremain/module/gallery/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/yangkam/domains/yangkam.go.th/public_html/coremain/module/gallery/gallery_update.php
<?php
// Status Package Module
$status_module=select_query("status_module","cms_status_module","id","18");
if($status_module[0]!=1)	{	
	fieldset_no_module();
}
if ($_SESSION['dbname'] != "nversion_62") {
  $navig['gallery'] = "ภาพกิจกรรม";
  $navig['gallery_add'] = "ภาพทั้งหมด";
  navigator($navig);
  echo "<br>";
  bar_header("ภาพทั้งหมด");
  fieldset_top("ภาพกิจกรรม");
} else {
  $navig['gallery'] = "ผลงานที่ผ่านมา";
  $navig['gallery_add'] = "ภาพทั้งหมด";
  navigator($navig);
  echo "<br>";
  bar_header("ภาพทั้งหมด");
  fieldset_top("ภาพทั้งหมด");
}

import_request_variables('pG', 'p_');
//include_once("coremain/module/gallery/class.upload.php");
if($p_g_type!="")													{	     $g_type=trim($p_g_type);									}
if($p_id_update!="")												{	     $id_update=trim($p_id_update);						}
if($p_yearthai1!="")												{	     $yearthai1=trim($p_yearthai1);							}
if($p_id_hide!="")													{	     $id_hide=trim($p_id_hide);									}
if($p_id_show!="")												{	     $id_show=trim($p_id_show);								}
if($p_id_del!="")													{		 $id_del=trim($p_id_del);										}
if($p_block!="")														{		 $block=trim($p_block);										}
$array_allow_image = allow_image_type();

//###################### สำหรับ Admin
if ($_SESSION['admin_web'] == "admin" || ( id_top_permission("b"))) {
// Hide - Show port_gallery_record
  if ($id_hide != "") {
    $sql = "UPDATE port_gallery_record SET status='0'  WHERE id_record='$id_hide'";
    mysql_query($sql);
  }
  if ($id_show != "") {
    $sql = "UPDATE port_gallery_record SET status='1'  WHERE id_record='$id_show'";
    mysql_query($sql);
  }
// Delete port_gallery_record
  if ($id_del != "") {
    // delete port_gallery_record
    $sql = "SELECT pic FROM port_gallery_record WHERE id_record='$id_del'";
    $result = mysql_query($sql);
    while($data = mysql_fetch_array($result)){
      if ($data[0] != "") {
        if(file_exists("$_SESSION[web_name]/gallery/$data[0]")){
          unlink("$_SESSION[web_name]/gallery/$data[0]");
        }
        if(file_exists("$_SESSION[web_name]/gallery/$data[0]")){
          unlink("$_SESSION[web_name]/gallery/$data[0]");
        }
      }
    }
    $sql = "delete from port_gallery_record  where id_record='$id_del'";
    $result = mysql_query($sql);
  }

  if ($p_hiddata != "") {
    $hiddata = trim($p_hiddata);
  }
  $num = "'";
  $hiddata = ereg_replace('"', $num, $hiddata);

// Update
  if ($hiddata != "") {
    $sql = "UPDATE `port_gallery_topic` SET fulltexts ='$hiddata' ,'en_fulltexts'='$hiddata2' WHERE id_topic='$id_update'";
    $result = mysql_query($sql);
  }
}

// ################################ภาพกิจกรรม ###################################
$sql="SELECT * FROM `port_gallery_topic`  WHERE  id_topic='$id_update'"; 
$result=mysql_query($sql);
$data = mysql_fetch_array($result);

echo "$data[fulltexts]";	


 // เพิ่มรูปภาพกิจกรรม 
if($_SESSION['admin_web']=="admin" || (id_top_permission("b"))){
?>
<!--<form  action='index.php?id_update=<?//= $id_update ?>&mod=gallery_update&path=gallery&id_hide=<?//= $data['id_record'] ?>&block=<?//= $block ?>' method='post' enctype='multipart/form-data' name='add' id='add' onSubmit='return checkadd()'>-->
<form id="fm_gallery" name="fm_gallery">
  <table width='98%' border='0' align='center' cellpadding='1' cellspacing='1'>
    <tr>
      <td colspan='2' align='center'>
        <b>Upload รูปเพิ่มเติม</b><br><br>
        
        <!--<INPUT TYPE='hidden' name='check_upload' value='1'>-->
        <input type="hidden" name="id_update" value="<?= $id_update ?>" />
        <input type="hidden" name="block" value="<?= $block ?>" />
      </td>
    </tr>
    <?php
      $option = array(
          'title' => 'Upload รูป',
          'description' => 'เลือกภาพกิจกรรม',
          'file_type' => 'image',
          'prefix' => 'pic',
          'extraHTML' => array(
              0 => array('type' => 'input', 'text' => 'คำอธิบายรูป', 'name' => 'explain', 'style' => 'width: 100%;')
            )
      );
      file_upload('userfile', 'gallery', 'fm_gallery', 'coremain/module/gallery/gallery_update_output.php', $option);
      
      button_text('Upload รูป', 'submit', 2, 'userfile', 'กรุณาเลือกรูปที่จะอัพโหลด !');
    ?>
  </table>
</form>
<?php } ?>

<table width='97%' border='0' cellpadding='0' cellspacing='0' align=center>
<?php
  $sql = ($_SESSION['admin_web']=="admin" || (id_top_permission("b"))) ?
          "SELECT * FROM `port_gallery_record`  WHERE  id_topic='$id_update' order by id_record" :
          "SELECT * FROM `port_gallery_record`  WHERE  id_topic='$id_update' and status='1' order by id_record";
  $result=mysql_query($sql);
  $count=2;
  $num = 0;
  while($data = mysql_fetch_array($result)){
    $count++;
    $mots=$count%3;
	//###################### คอลัมน์ที่ 1 ###############
	if($mots==0){ ?>
  <tr>
    <td width=33% align=center>
      <a href="javascript:void(0);" class="show_image" id="<?= $num.'#'.$id_update ?>" style="text-decoration: none;">
        <img src="<?php echo "$_SESSION[web_name]/gallery/$data[pic]"; ?> " class="img-corner" / width='100' height='80'>
      </a>
    <?php
      echo ($data['explain']!="") ? '<br/>'.$data['explain'] : "&nbsp;";
      
      if ($_SESSION['admin_web'] == "admin" || ( id_top_permission("b"))) {
        // show - hide
        if ($data['status'] == '1') { ?>
          <br><a href='index.php?id_update=<?= $id_update ?>&mod=gallery_update&path=gallery&id_hide=<?= $data['id_record'] ?>&block=<?= $block ?>'><img src='coremain/images/show.gif' border='0' title='ซ่อน'></a>
        <?php } else { ?>
          <br><a href='index.php?id_update=<?= $id_update ?>&mod=gallery_update&path=gallery&id_show=<?= $data['id_record'] ?>&block=<?= $block ?>'><img src='coremain/images/hide.gif' border='0' title='แสดง'></a>
        <?php }
        // delete ?>
        &nbsp;<a href='index.php?id_update=<?= $id_update ?>&mod=gallery_update&path=gallery&id_del=<?= $data['id_record'] ?>&block=<?= $block ?>' onclick='return goURL();'><img src='coremain/images/del1.gif' border='0' title='ลบข้อมูล'></a>
    <?php } ?>
    </td>
  <?php }
	//###################### คอลัมน์ที่ 2 ###############	
	else if($mots==1){ ?>
    <td width=33% align=center>
      <a href="javascript:void(0);" class="show_image" id="<?= $num.'#'.$id_update ?>" style="text-decoration: none;">
        <img src="<?php echo "$_SESSION[web_name]/gallery/$data[pic]"; ?>" class="img-corner" / width='100' height='80'>
      </a>
    <?php
      echo ($data['explain']!="") ? '<br/>'.$data['explain'] : "&nbsp;";
    
      // Admin
      if($_SESSION['admin_web']=="admin" || (id_top_permission("b"))){
		// show - hide
        if($data['status']=='1'){ ?>
          <br><a href='index.php?id_update=<?= $id_update ?>&mod=gallery_update&path=gallery&id_hide=<?= $data['id_record'] ?>&block=<?= $block ?>'><img src='coremain/images/show.gif' border='0' title='ซ่อน'></a>
        <?php }else{ ?>
          <br><a href='index.php?id_update=<?= $id_update ?>&mod=gallery_update&path=gallery&id_show=<?= $data['id_record'] ?>&block=<?= $block ?>'><img src='coremain/images/hide.gif' border='0' title='แสดง'></a>
        <?php }
			// delete ?>
      &nbsp;<a href='index.php?id_update=<?= $id_update ?>&mod=gallery_update&path=gallery&id_del=<?= $data['id_record'] ?>&block=<?= $block ?>' onclick='return goURL();'><img src='coremain/images/del1.gif' border='0' title='ลบข้อมูล'></a>
      <?php } ?>
    </td>
    <?php }
	//###################### คอลัมน์ที่ 3 ###############	
	else{ ?>
    <td width=33% align=center>
      <a href="javascript:void(0);" class="show_image" id="<?= $num.'#'.$id_update ?>" style="text-decoration: none;">
        <img src="<?php echo "$_SESSION[web_name]/gallery/$data[pic]"; ?>" class="img-corner" / width='100' height='80'>
      </a>
    <?php
      echo ($data['explain']!="") ? '<br/>'.$data['explain'] : "&nbsp;";
      
      // Admin
      if($_SESSION['admin_web']=="admin" || (id_top_permission("b"))){
        // show - hide
        if($data['status']=='1'){ ?>
          <br><a href='index.php?id_update=<?= $id_update ?>&mod=gallery_update&path=gallery&id_hide=<?= $data['id_record'] ?>&block=<?= $block ?>'><img src='coremain/images/show.gif' border='0' title='ซ่อน'></a>
        <?php }else{ ?>
          <br><a href='index.php?id_update=<?= $id_update ?>&mod=gallery_update&path=gallery&id_show=<?= $data['id_record'] ?>&block=<?= $block ?>'><img src='coremain/images/hide.gif' border='0' title='แสดง'></a>
        <?php }
			// delete ?>
          &nbsp;<a href='index.php?id_update=<?= $id_update ?>&mod=gallery_update&path=gallery&id_del=<?= $data['id_record'] ?>&block=<?= $block ?>' onclick='return goURL();'><img src='coremain/images/del1.gif' border='0' title='ลบข้อมูล'></a>
      <?php } ?>
    </td>
  </tr>
  <tr height='20'><td></td><td></td></tr>
  <?php }
  ++$num;
} ?>
</table>

<?php fieldset_down(); ?>


<script language="JavaScript">
  
  var arrData = [
    { name: 'web_name', value: '<?= $_SESSION['dbname'] ?>' },
    { name: 'folder', value: '<?= $_SESSION['web_name'] ?>' }
  ];
  $('.show_image').click(function(){
    var arr = $(this).attr('id').split('#');
    arrData.push({ name: 'startrow', value: arr[0]});
    arrData.push({ name: 'id_top', value: arr[1]});
    
    show_gallery(arrData);
  });
  
  function show_gallery(arrData){
    var dialog = 'dialog-popup';
    var popup = $('#'+dialog);
    showDialog(dialog);
    popup.dialog('option', 'title', 'รายละเอียด');
    
    $.ajax({
      type: 'post',
      url: 'coremain/module/gallery/gallery_show.php',
      data: arrData,
      success: function(result){
        popup.html(result);
      }
    });
  }
  
<!--
function goURL() {
var blnLink
blnLink = confirm("Click OK เพื่อยืนยันการลบข้อมูล?")
if (!blnLink) { return false; }
return true;
}
//-->	
</script>

<script language="javascript">
//function checkadd() {
//if(document.add.userfile1.value=="") {
//alert("กรุณาเลือกรูปที่จะอัพโหลด") ;
//document.add.userfile1.focus() ;
//return false ;}
//else 
//return true ;
//}
</script>

Youez - 2016 - github.com/yon3zu
LinuXploit