0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.145.40.234


Current Path : /var/www/html/oums/src/
Upload File :
Current File : /var/www/html/oums/src/sys_grid_data.php

<?php
	function grid_limit($mysql1)
	{
		require("sys_connect.php");
		require("sys_session.php");	
	
		if (!(isset($_POST['page_numb']))) 
		{
			$page_numb = 1;
		} 
		else 
		{
			$page_numb = intval($_POST['page_numb']);
		}
		
		$page_limt  = ($_POST["page_limt"] <> "" && is_numeric($_POST["page_limt"]) ) ? intval($_POST["page_limt"]) : 20;		

		$myres1 = mysqli_query($mycon,$mysql1);
		$mycnt1 = mysqli_num_rows($myres1);
		$last_page = ceil($mycnt1 / $page_limt);
	
		if ($page_numb < 1) 
		{
			$page_numb = 1;
		} 
		elseif ($page_numb > $last_page)  
		{
			$page_numb = $last_page;
		}
		
		if($last_page==0)
		{
			$lowr_limt = ($page_numb) * $page_limt;
		}
		else
		{
			$lowr_limt = ($page_numb-1) * $page_limt;
		}		
		return array($page_numb, $last_page, $page_limt, $lowr_limt);
	}
?>