=CURDATE()));"; $strsql="SELECT tblUEEvents.* FROM tblUEEvents WHERE ((tblUEEvents.uActive='Y' AND tblUEEvents.uDate>=CURDATE())) ORDER BY tblUEEvents.uDate, tblUEEvents.uTitle "; } else { $strcountsql="SELECT COUNT(*) FROM tblUEEvents WHERE ((tblUEEvents.uActive='Y' AND tblUEEvents.uCategory='".$category."' AND tblUEEvents.uDate>=CURDATE()));"; $strsql="SELECT tblUEEvents.* FROM tblUEEvents WHERE ((tblUEEvents.uActive='Y' AND tblUEEvents.uCategory='".$category."' AND tblUEEvents.uDate>=CURDATE())) ORDER BY tblUEEvents.uDate, tblUEEvents.uTitle "; } $result=mysqli_query($con,$strcountsql); if (mysqli_num_rows($result)==0) { } else { $row = mysqli_fetch_row($result); $numrows = $row[0]; $totalpages = ceil($numrows / $rowsperpage); if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) { $currentpage = (int) $_GET['currentpage']; } else { $currentpage = 1; } if ($currentpage > $totalpages) { $currentpage = $totalpages; } if ($currentpage < 1) { $currentpage = 1; } $offset = ($currentpage - 1) * $rowsperpage; $strsql=$strsql." LIMIT ".$offset.", ".$rowsperpage.";"; $result=mysqli_query($con,$strsql); if (mysqli_num_rows($result)==0) { echo "

No records Found!


"; } else { echo "
"; $fid=0; while($row = mysqli_fetch_array($result)) { $threeMonth=date('M', strtotime($row["uDate"])); $day=date('l', strtotime($row["uDate"])); $dayofmonth=date('j', strtotime($row["uDate"])); $year=date('Y', strtotime($row["uDate"])); $fullmonth=date('F', strtotime($row["uDate"])); echo "
"; echo "
"; echo "".strtoupper($threeMonth)."
"; echo "".$dayofmonth."
"; echo "".$year.""; echo "
"; if ($row["uImage"]=="" || $row["uImage"]==null) { if ($row["uLink"]=="" || $row["uLink"]==null) { echo "
".$row["uTitle"]." ".$day." ".$fullmonth." ".$dayofmonth.",  ".$row["uTime"]."
".$row["uDetail"]."
"; } else { echo "
".$row["uTitle"]." ".$day." ".$fullmonth." ".$dayofmonth.",  ".$row["uTime"]."
".$row["uDetail"]." read more..
"; } } else { if ($row["uLink"]=="" || $row["uLink"]==null) { echo "
".$row["uTitle"]." ".$day." ".$fullmonth." ".$dayofmonth.",  ".$row["uTime"]."
".$row["uDetail"]."
"; } else { echo "
".$row["uTitle"]." ".$day." ".$fullmonth." ".$dayofmonth.",  ".$row["uTime"]."
".$row["uDetail"]." read more..
"; } } echo "
"; $fid++; echo "
"; } $range = 10; echo "
"; if ($currentpage > 1) { echo ""; $prevpage = $currentpage - 1; echo ""; } for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) { if (($x > 0) && ($x <= $totalpages)) { if ($x == $currentpage) { echo ""; } else { echo ""; } } } if ($currentpage != $totalpages) { $nextpage = $currentpage + 1; echo ""; echo ""; } } echo "
First Previous [$x] $x Next Last



"; } mysqli_close($con); ?>