One Hat Cyber Team
Your IP :
216.73.216.84
Server IP :
50.6.229.107
Server :
Linux server.hostburly.com 5.14.0-611.38.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 10 17:21:28 EDT 2026 x86_64
Server Software :
Apache
PHP Version :
8.2.30
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
andjemzt
/
nportal.andjemztech.com
/
examAdmin
/
Edit File:
view_school.php
<? include("inc/header.php"); //include("inc/fxn.php"); ?> <link rel="stylesheet" href="pagination_css.css" type="text/css" /> <table border="1" cellpadding="5" cellspacing="0" width="100%"> <tr bgcolor="#999999"> <td><b>S/No</b></td><td><b>Branch Name</b></td><td><b>No. of Applicants</b></td><td><b>Assigned Officer</b></td><td><b>Assign Officer</b></td></tr> <? //include("inc/config_essay.php"); $sql2="SELECT * FROM branch"; $adjacents = 3; $result2=mysql_query($sql2); $total_pages=mysql_num_rows($result2); $targetpage = "view_school.php"; //your file name (the name of this file) $limit = 30; $page = $_GET['page']; if($page) $start = ($page - 1) * $limit; //first item to display on this page else $start = 0; $sql22="SELECT * FROM branch ORDER BY branch_name ASC LIMIT $start,$limit"; //$sql22="SELECT * FROM products,merchants WHEeRE accountid=agent_id AND (category LIKE '%$search%' OR products.keyword LIKE '%$search%') AND merchants.status='1' AND merchants.keyword !='' ORDER BY id DESC"; $result22 = mysql_query($sql22) or die(mysql_error()); $count22=mysql_num_rows($result22); if ($page == 0) $page = 1; //if no page var is given, default to 1. $prev = $page - 1; //previous page is page - 1 $next = $page + 1; //next page is page + 1 $lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up. $lpm1 = $lastpage - 1; //last page minus 1 /* Now we apply our rules and draw the pagination object. We're actually saving the code to a variable in case we want to draw it more than once. */ $pagination = ""; if($lastpage > 1) { $pagination .= "<div class=\"pagination\">"; if ($page > 1) $pagination.= "<a href=\"$targetpage?page=$prev&search2=$search\">� previous</a>"; else $pagination.= "<span class=\"disabled\">� previous</span>"; //pages if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up { for ($counter = 1; $counter <= $lastpage; $counter++) { if ($counter == $page) $pagination.= "<span class=\"current\">$counter</span>"; else $pagination.= "<a href=\"$targetpage?page=$counter&search2=$search\">$counter</a>"; } } elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some { //close to beginning; only hide later pages if($page < 1 + ($adjacents * 2)) { for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) { if ($counter == $page) $pagination.= "<span class=\"current\">$counter</span>"; else $pagination.= "<a href=\"$targetpage?page=$counter&search2=$search\">$counter</a>"; } $pagination.= "..."; $pagination.= "<a href=\"$targetpage?page=$lpm1\">$lpm1</a>"; $pagination.= "<a href=\"$targetpage?page=$lastpage\">$lastpage</a>"; } //in middle; hide some front and some back elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) { $pagination.= "<a href=\"$targetpage?page=1&search2=$search\">1</a>"; $pagination.= "<a href=\"$targetpage?page=2&search2=$search\">2</a>"; $pagination.= "..."; for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) { if ($counter == $page) $pagination.= "<span class=\"current\">$counter</span>"; else $pagination.= "<a href=\"$targetpage?page=$counter&search2=$search\">$counter</a>"; } $pagination.= "..."; $pagination.= "<a href=\"$targetpage?page=$lpm1\">$lpm1</a>"; $pagination.= "<a href=\"$targetpage?page=$lastpage\">$lastpage</a>"; } //close to end; only hide early pages else { $pagination.= "<a href=\"$targetpage?page=1\">1</a>"; $pagination.= "<a href=\"$targetpage?page=2\">2</a>"; $pagination.= "..."; for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++) { if ($counter == $page) $pagination.= "<span class=\"current\">$counter</span>"; else $pagination.= "<a href=\"$targetpage?page=$counter&search2=$search\">$counter</a>"; } } } //next button if ($page < $counter - 1) $pagination.= "<a href=\"$targetpage?page=$next&search2=$search\">next �</a>"; else $pagination.= "<span class=\"disabled\">next �</span>"; $pagination.= "</div>\n"; } $sno=$start; while ($row=mysql_fetch_array($result22)) { $sno++; $branchid=$row['branchid']; $app_no=applicantsNo($branchid); $officer_name=get22("admin_corp",$row['officer_id'],"id","surname")." ".get22("admin_corp",$row['officer_id'],"id","othernames"); //$no_of_app=noOfApplicants($school); $no_of_app=applicantsNo($branchid); echo "<tr> "; echo "<td>$sno</td><td>$row[branch_name]</td><td>$app_no</td><td>$officer_name</td><td><a href=assign_officer.php?branchid=$branchid>Assign Officer</a></td>"; echo "</tr>"; } ?> <?=$pagination?> </table> <? function applicantsNo($branch){ $sql=mysql_query("SELECT * FROM corp_reg_pay a,corp_mem b WHERE a.stud_id=b.stud_id AND a.status='Paid' AND b.branch_id='$branch'"); $count=mysql_num_rows($sql); return $count; } function get22($table,$value,$field,$output){ $sql=mysql_query("SELECT * FROM $table WHERE $field=$value"); $row=mysql_fetch_array($sql); return $row["$output"]; } ?> <? include("inc/footer.php"); ?>
Simpan