Al-HUWAITI Shell
Al-huwaiti


Server : LiteSpeed
System : Linux us-phx-web1202.main-hosting.eu 4.18.0-553.84.1.lve.el8.x86_64 #1 SMP Tue Nov 25 18:33:03 UTC 2025 x86_64
User : u615232177 ( 615232177)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /home/u615232177/domains/ellexsleevesapartments.com/public_html/admin1249/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/u615232177/domains/ellexsleevesapartments.com/public_html/admin1249/reservations_rejected.php
<?php session_start();
$page_name = basename($_SERVER['PHP_SELF']); 
include("headerstrict.php"); ?>
<title><?php echo $company_name; ?>, Admin, Reservations(Rejected)</title>

<!-- ======= Breadcrumbs ======= -->
<section id="breadcrumbs" class="breadcrumbs">
  <div class="container"> </div>
</section>
<?php 
	$stmt_a = $con -> prepare('SELECT id FROM reservations');
	$stmt_a -> execute(); 
	$stmt_a -> store_result(); 
	$stmt_a -> bind_result($aa); 
	$numrows_a = $stmt_a -> num_rows();

	$pending="Pending";
	$stmt_1 = $con -> prepare('SELECT id FROM reservations WHERE approved = ?');
	$stmt_1 -> bind_param('s',$pending);
	$stmt_1 -> execute(); 
	$stmt_1 -> store_result(); 
	$stmt_1 -> bind_result($a1); 
	$numrows_1 = $stmt_1 -> num_rows();

	$yes="Yes";
	$stmt_2 = $con -> prepare('SELECT id FROM reservations WHERE approved = ?');
	$stmt_2 -> bind_param('s',$yes);
	$stmt_2 -> execute(); 
	$stmt_2 -> store_result(); 
	$stmt_2 -> bind_result($a2); 
	$numrows_2 = $stmt_2 -> num_rows();

	$no="No";
	$stmt_3 = $con -> prepare('SELECT id FROM reservations WHERE approved = ?');
	$stmt_3 -> bind_param('s',$no);
	$stmt_3 -> execute(); 
	$stmt_3 -> store_result(); 
	$stmt_3 -> bind_result($a3); 
	$numrows_3 = $stmt_3 -> num_rows();
?>
<section id="contact" class="contact inner-page">
	<div class="container" data-aos="fade-up">

	<div class="section-title">
		<h2 style='color:crimson;'>Reservations(Rejected)</h2>
		<p>
			<p><a href='reservations.php'><span style='color:black;'>All<?php echo"($numrows_a)"; ?></span></a><br/>

			<a href='reservations_pending.php'><span style='color:royalblue;'>Pending - Blue<?php echo"($numrows_1)"; ?></span></a><br> 

			<a href='reservations_approved.php'><span style='color:forestgreen;'>Approved - Green<?php echo"($numrows_2)"; ?></span></a><br>

			<a href='reservations_rejected.php'><span style='color:crimson;'>Rejected - Crimson<?php echo"($numrows_3)"; ?></span></a><br>
		</p>

		</p>
	</div>
	<div class="row">
			<?php 
	$sql = "SELECT COUNT(id) FROM reservations WHERE approved='No' ORDER BY id DESC";
	$query = mysqli_query($con, $sql);
	$row = mysqli_fetch_row($query);
	//here we have the total row count
	$rows = $row[0];
	//number of results we want per page
	$page_rows = 400;
	//tells us the page number of our last page
	$last = ceil($rows/$page_rows);
	//this makes sure last cannot be less than 1
	if($last < 1){$last = 1;}
	//establish the page num variable
	$pagenum = 1;
	//Get pageum from $GET if it is present, else its 1
	if(isset($_GET['pn'])){
	$pagenum = preg_replace('#[^0-9]#', '', $_GET['pn']);
	}
	//below 1 or more than last page
	if($pagenum < 1){
	   $pagenum = 1;
	}else if ($pagenum > $last) {
		$pagenum = $last;
	}
	//this sets the range of rows to query for the chosen pagenum
	$limit = 'LIMIT ' .($pagenum - 1) * $page_rows .',' .$page_rows;
	//grabs one page worth of rows
	$sql = "SELECT * FROM reservations WHERE approved='No' ORDER BY id DESC $limit ";
	$query = mysqli_query($con, $sql);
	//this shows the user what page they on and total number
	$textline1 = "Messages $rows";
	$textline2 = "Page $pagenum of $last";
	//establish the pagination controls
	$paginationCtrls = "";
	//if there is more than one page worth of results
	if($last != 1){
		if($pagenum > 1){
			$previous = $pagenum - 1;
			//$paginationCtrls .='<a href="'.$_SERVER['PHP_SELF'].'?pn='.$previous.'">Previous</a> &nbsp';
			$paginationCtrls .='<li><a href="'.$_SERVER['PHP_SELF'].'?pn='.$previous.'">Prev</a></li>';
			//render clickable links to the left of target page number
			for($i = $pagenum-4; $i < $pagenum; $i++){
				if($i > 0){
					//$paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'?pn='.$i.'"></a> &nbsp; ';
					$paginationCtrls .= '<li><a href="'.$_SERVER['PHP_SELF'].'?pn='.$i.'">'.$i.'</a></li>';
				}
			}
		}
		//render target number bt not link
		//$paginationCtrls .= ''.$pagenum.' &nbsp; ';
		$paginationCtrls .= '<span class="pagination"><ul><li class="active"><a href="#">'.$pagenum.'</a></li></ul></span>';
		//render clickable number links to the right of target number
		for($i = $pagenum+1; $i <= $last; $i++){
			//$paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'?pn='.$i.'">'.$i.'</a> &nbsp; ';
			$paginationCtrls .= '<li><a href="'.$_SERVER['PHP_SELF'].'?pn='.$i.'">'.$i.'</a></li>';
			if($i >= $pagenum+4){
				break;
			}
		}
		//this does the same as above, only checking if we are on the last page
		if($pagenum != $last) {
			$next = $pagenum + 1;
			$paginationCtrls .= '<li><a href="'.$_SERVER['PHP_SELF'].'?pn='.$next.'">Next</a></li>';
		}
	}
	if(mysqli_num_rows($query) > 0){
		while ($row_back_deals = mysqli_fetch_array($query, MYSQLI_ASSOC)) {
			$reservation_id = $row_back_deals['reservation_id'];
			$name = $row_back_deals['name'];		
			$approved = $row_back_deals['approved'];
			if($approved == "Approved"){$c = "forestgreen";}
			if($approved == "No"){$c = "crimson";}
			if($approved == "Pending"){$c = "royalblue";}
			echo"		
				<div class='col-md-2'>
					<hr/>
						<a style='color:$c' href='reservation_details.php?u=$reservation_id'>$name</a>
					<hr/>
				</div>
			";
			
									
		}
	}
	else{echo"Nothing found";}				
						
					?>
        </div>
		
		<div class='double_line'></div>
			<div class="row">
				<div class="col-md-12">
					<ul class="pagination clearfix">
				 <?php 
						
						echo"$paginationCtrls<br/><br/>";
						echo "<div class='text_line'>$textline2</div>";
						
					?>
					</ul>
				</div>
			</div>
	
    </div>
</section><!-- End Contact Section -->
<?php include("footer.php"); ?>

Al-HUWAITI Shell