? 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/public_html/libs-bak/
File Upload :
Current File : /home/admin/public_html/libs-bak/backoff1.php

<?
class backoff extends MySql
{
	var $_Limit;
	var $_total;
	var $_Next_Page;
	var $_Start;
	var $_a;
	var $_z;
	var $_az;
	var $_link;
	var $_first_page_link;
	var $_previous_page_link;
	var $_last_page_link;
	var $_next_page_link;
	var $_Page;
	var $_total_links;
	function setOrder(){
			if($this->_Page==1){$count=$this->_total;return $count;}else{
			$cal_page=$this->_Page-1; 
			$perpage=$cal_page*$this->_Limit;
			$count=$this->_total-$perpage;
			return $count;
				}
	}
		function setOrderMin2Max(){
			if($this->_Page==1){$count=1; return $count;}else{
			$count=($this->_Page-1)*$this->_Limit;
			return $count;
				}

	}
	function setPage(){
	if($_GET['page']){$this->_Page = $_GET['page'];}else{$this->_Page = 1;}
	return $this->_Page;
	}
	function MakeLinkNavigator($MLlink, $MLget, $MLvalue, $what){
			$getQueryString = "";
			if (!empty($_SERVER['QUERY_STRING'])) {
				$params = explode("&", $_SERVER['QUERY_STRING']);
				$newParams = array();
				foreach ($params as $param) {
					if (stristr($param, $MLget) == false) {
						array_push($newParams, $param);
					}
				}//end foreach $params as $param
				if (count($newParams) != 0) {
					$getQueryString = "&" . implode("&", $newParams);
				}
			}//end if empty($_SERVER['.....
			$getQueryString = sprintf("%s=%s%s",$MLget , $MLvalue, $getQueryString);
			$this->_link = $MLlink."?".$getQueryString;
		//	$this->_link=$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
			if($what == 1){return $this->_link;}
			if($what == 0){return $newParams;}
		}//end function MakeLinkNavigato


		function total_links($total_link){
	if($total_link==""){
		$this->_total_links = 10;
	}else{ $this->_total_links=$total_link;}
			return 	$this->_total_links;
		}





function PageNavigator(){
 //Total links / navigator
	if($this->_total_links>$this->_Next_Page ){$this->_total_links=$this->_Next_Page;}
	$Ceil2total_links = ceil($this->_total_links/2);
	$Floor2total_links = floor($this->_total_links/2);

	$this->_first_page_link = $this->MakeLinkNavigator($_SERVER['PHP_SELF'], "page", 1, 1);
	$this->_previous_page_link = $this->MakeLinkNavigator($_SERVER['PHP_SELF'], "page", $this->_Page-1, 1);
	$this->_last_page_link = $this->MakeLinkNavigator($_SERVER['PHP_SELF'], "page", $this->_Next_Page , 1);
	$this->_next_page_link = $this->MakeLinkNavigator($_SERVER['PHP_SELF'], "page", $this->_Page+1, 1);

	$this->_a = 1;
	$this->_z = $this->_total_links;
	if( $this->_Next_Page<=$this->_total_links){
		$this->_z =  $this->_Next_Page;
	}else{
		if(isset($this->_Page) && ($this->_Page > $Ceil2total_links)){
			$this->_a = $this->_Page-$Floor2total_links;
			$this->_z = $this->_Page+$Floor2total_links;
		}
		if(isset($this->_Page) && ($this->_Page > ($this->_Limit-$Ceil2total_links))){
			$this->_a =  $this->_Next_Page-$this->_total_links+1;
			$this->_z =  $this->_Next_Page;
		}
	}
}//end function
function jump2page(){
	$output.="<form name=\"navigator1\" action=\"\" method='GET'>
Jump Page: 
<select style='width: 50px;' name=\"page\" id=\"page\" onChange=\"sort_data('x','x','x')\">";
		for($this->_az=1; $this->_az<= $this->_Next_Page; $this->_az++){
			if($this->_az==$this->_Page){$pgnr=' selected';}else{$pgnr='';}
			$output.= "<option value='{$this->_az}'{$pgnr}>{$this->_az}-{$this->_Next_Page}</option>";
		}
		$output.="</select>";
			if($_GET){
			foreach ($_GET as $key => $value){
				if($key != "Submit" && $key != "page"){
					$output.= "<input type='hidden' name='$key' value='$value'>\n";
				}
			}
		}
		$output.="</form>";
		return $output;
}//end jump
			function PageLink(){
				$output.="หน้า |&nbsp;&nbsp;";
$show_links=$this->_total_links;
//$perpage=10; $perpage=$this->_Limit
$total_links=ceil($this->_total/$this->_Limit);//ปัดขึ้น
$center_link=ceil($this->_total_links/2);

if($this->_Page<=$center_link){//แสดงในหน้าแรก
    for($i=1;$i<$show_links+1;$i++){
								$output.= " <a href='".$this->MakeLinkNavigator($_SERVER['PHP_SELF'], "page", $i, 1)."'>{$i}</a> &nbsp;";
	}
}else if($total_links-$this->_Page<$center_link){//แสดงหน้าสุดท้าย
   for($i=($total_links-$show_links+1);$i<$total_links+1;$i++){
									$output.= " <a href='".$this->MakeLinkNavigator($_SERVER['PHP_SELF'], "page", $i, 1)."'>{$i}</a> &nbsp;";
					}
}else{//แสดงหน้ากลาง
	for($i=$this->_Page-$center_link;$i<$this->_Page;$i++){
	
									$output.= " <a href='".$this->MakeLinkNavigator($_SERVER['PHP_SELF'], "page", $i, 1)."'>{$i}</a> &nbsp;";
	}
for($i=$this->_Page;$i<($this->_Page+$center_link);$i++){
					
											$output.= " <a href='".$this->MakeLinkNavigator($_SERVER['PHP_SELF'], "page", $i, 1)."'>{$i}</a> &nbsp;";
}
}

return $output;
	}//end LinkPage
		function  PageLink2(){
			$output.="หน้า |&nbsp;&nbsp;";
			for($i=$this->_a; $i<=$this->_z; $i++){
			if($this->_Page == $i){
				$output.= "<span id='this_page'>{$i}</span> &nbsp; ";
			}else{
				$output.= " <a href='".$this->MakeLinkNavigator($_SERVER['PHP_SELF'], "page", $i, 1)."'>{$i}</a> &nbsp;";
			}
		}

		return $output;
		}//end


		function total_record(){
		$output.="ทั้งหมด&nbsp;".$this->_total."&nbsp;Record&nbsp;&nbsp;&nbsp;";
		$output.="หน้า {$this->_Page} / ".$this->_Next_Page."";
		return $output;
		}//end function jum2page
	
		function PreNext(){
	if( $this->_Next_Page > 1){
		if($this->_Page>1){
			$output.= "<a href='{$this->_first_page_link}'>First&nbsp;</a>";
			$output.= "<a href='{$this->_previous_page_link}'>Previous&nbsp;&nbsp;</a>";
		}else{	$output.= "First&nbsp;";
			$output.= "Previous&nbsp;&nbsp;";
		}
		if($this->_Page< $this->_Next_Page){
			$output.= "<a href='{$this->_next_page_link}'>Next&nbsp;</a>";
			$output.= "<a href='{$this->_last_page_link}'>Last</a>";
		}else{	$output.= "Next&nbsp;";
			$output.= "Last";
		}
	}else{$output.= "First&nbsp;";
			$output.= "Previous&nbsp;&nbsp;";
			$output.= "Next&nbsp;";
			$output.= "Last";
	}//end if $this->_Next_Page>1
	return $output;
}
function PerPageDropList(){
//$this->_link=$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
$list=array("5","10","15","20","25","30","35","40","45","50");
$output="
<form method=\"GET\" action=\"\" name=\"listpage\">
 <select size=\"1\" name=\"limit\"  onchange=\"document.listpage.submit()\">";
foreach($list as $key=>$value){
if($value==$this->_Limit){$pgnr=' selected';}else{$pgnr='';}
$output.= "<option value='{$value}'{$pgnr}>{$value}</option>";
}
if (!in_array($this->_Limit, $list)) {
	$output.="<option value='$this->_Limit' selected>$this->_Limit</option";
}
$output.="</select>";
if($_GET){
			foreach ($_GET as $key => $value){
				if($key != "Submit"&&$key!="limit"){
					$output.= "<input type='hidden' name='$key' value='$value'>\n";
				}
			}
		}
$output.="</form>";
return $output;
}
function set_per_page(){
	$output.="<form method=\"GET\" action=\"\" name=\"listpage2\">
	<table width=\"180\"><tr><td width=\"80\" align=\"left\"># Per Page</td><td width=\"100\" align=\"left\">
	<input type='textbox' name='limit' size=3 value=\"$this->_Limit\">
	<input type='Submit' value='  Ok  '>";
	if($_GET){
			foreach ($_GET as $key => $value){
				if($key != "Submit"&&$key!="limit"){
					$output.= "<input type='hidden' name='$key' value='$value'>\n";
				}
			}
		}
	$output.="</td></tr></table></form>";
return $output;
}
function setLimit($limit){
	global $_Limit;
	$this->_Limit=$_GET['limit'];
	if($this->_Limit==""){$this->_Limit=$_Limit;}
	if($this->_Limit==""){$this->_Limit=$limit;}
	$_SESSION['_Limit']=$this->_Limit;
	return $this->_Limit;
}

}//end class
?>

T1KUS90T
  root-grov@210.1.60.28:~$