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 :  E:/Inetpub/www/news/move/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : E:/Inetpub/www/news/move//fetch.php
<?php
session_start();
$uid=$_SESSION["uid"];
/* Database connection start */
include "db.php";
$table = "posts";


/* Database connection end */


// storing  request (ie, get/post) global array to a variable  
$requestData= $_REQUEST;


$columns = array( 
// column ของตารางในฐานข้อมูล
	0 =>'id',
	1 =>'title', 
	2 => 'views',
	3=> 'date'
);

// getting total number records without any search
$sql = "SELECT * FROM $table WHERE uid='$uid' ";
$query=mysqli_query($conn, $sql) or die("fetch.php: get $table");
$totalData = mysqli_num_rows($query);
$totalFiltered = $totalData;  // when there is no search parameter then total number rows = total number filtered rows.


$sql = "SELECT * FROM $table WHERE uid='$uid' ";
if( !empty($requestData['search']['value']) ) {   // if there is a search parameter, $requestData['search']['value'] contains search parameter
	$sql.=" AND ( title LIKE '%".$requestData['search']['value']."%' ";    
	$sql.=" OR views LIKE '".$requestData['search']['value']."%' ";

	$sql.=" OR date LIKE '%".$requestData['search']['value']."%' )";
}
$query=mysqli_query($conn, $sql) or die("fetch.php: get $table");
$totalFiltered = mysqli_num_rows($query); // when there is a search parameter then we have to modify total number filtered rows as per search result. 
$sql.=" ORDER BY ". $columns[$requestData['order'][0]['column']]."   ".$requestData['order'][0]['dir']."  LIMIT ".$requestData['start']." ,".$requestData['length']."   ";
/* $requestData['order'][0]['column'] contains colmun index, $requestData['order'][0]['dir'] contains order such as asc/desc  */	
$query=mysqli_query($conn, $sql) or die("fetch.php: get $table");

$data = array();
$i=1+$requestData['start'];
while( $row=mysqli_fetch_array($query) ) {  // preparing an array
	$nestedData=array(); 

	$nestedData[] = '<center>'.number_format($i).'</center>';
	$nestedData[] = '<a href=\'story.php?id='.$row[0].'\' target=\'_blank\'>'.$row["title"].'</a>';
	$nestedData[] = '
	<center>
		<div class=\'btn-group\'>
		<button type=\'button\' class=\'btn btn-info btn-xs\'>เลือก</button>
			<button type=\'button\' class=\'btn btn-info dropdown-toggle btn-xs\' data-toggle=\'dropdown\'>
				<span class=\'caret\'></span>
				<span class=\'sr-only\'>Toggle Dropdown</span>
			</button>
			<ul class=\'dropdown-menu\' role=\'menu\'>
				<li><a href=edit_news.php?id='.$row[0].'&uid='.$uid.'><span class=\'glyphicon glyphicon-edit\'></span> แก้ไข</a></li>
				<li><a href=photogallery.php?id='.$row[0].'&uid='.$uid.'><span class=\'glyphicon glyphicon-picture\'></span> Gallery</a></li>
				<li><a href=filems.php?id='.$row[0].'&uid='.$uid.'><span class=\'glyphicon glyphicon-paperclip\'></span> แนบไฟล์</a></li>
				<li class=\'divider\'></li>
				<li><a href=\'#\' data-toggle=\'modal\' data-target=\'#modal-del'.$row[0].'\'><span class=\'glyphicon glyphicon-trash\'></span> ลบ</a>
				</li>
			</ul>
	</div></center>

<div class=\'modal fade\' id=\'modal-del'.$row[0].'\'>
          <div class=\'modal-dialog\'>
            <div class=\'modal-content\'>
              <div class=\'modal-header\'>
                <button type=\'button\' class=\'close\' data-dismiss=\'modal\' aria-label=\'Close\'>
                  <span aria-hidden=\'true\'>&times;</span></button>
                <h4 class=\'modal-title\'>ลบข้อมูล</h4>
              </div>
	<form action=\'delete_news.php?id='.$row[0].'&uid='.$uid.'\' class=\'form-horizontal\' method=\'post\' name=\'Form1\' enctype=\'multipart/form-data\'>		  
              <div class=\'modal-body\'>
			  <div class=\'row clearfix\'>
				<div class=\'col-md-2\'>
				<center><img src=\'images/what.jpg\' width=\'70\'></center>
				</div>
				<div class=\'col-md-10\'><br>
					<p align=\'left\'>'.$row["title"].' จะถูกลบออกจากฐานข้อมูลไม่สามารถนำกลับมาใช้ได้ใหม่</p>
				</div>
              </div>
			  </div>
              <div class=\'modal-footer\'>
                <button type=\'button\' class=\'btn btn-default pull-left\' data-dismiss=\'modal\'>ยกเลิก</button>
                <button type=\'submit\' class=\'btn btn-danger\'>ลบข้อมูล</button>
              </div>
	</form>		  
            </div>
          </div>
</div>	
	
	';	
	$nestedData[] = $row["date"];
	$nestedData[] = '<center>'.number_format($row["views"]).'</center>';

	$data[] = $nestedData;
	$i++;
}



$json_data = array(
			"draw"            => intval( $requestData['draw'] ),   // for every request/draw by clientside , they send a number as a parameter, when they recieve a response/data they first check the draw number, so we are sending same number in draw. 
			"recordsTotal"    => intval( $totalData ),  // total number of records
			"recordsFiltered" => intval( $totalFiltered ), // total number of records after searching, if there is no searching then totalFiltered = totalData
			"data"            => $data   // total data array
			);

echo json_encode($json_data);  // send data as json format

?>

Youez - 2016 - github.com/yon3zu
LinuXploit