D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafrica
/
result.dominicaninstitute.org
/
Filename :
recordstudentsearchrecord.php
back
Copy
<?php if (!$_SESSION){ session_start(); } $acc=$_SESSION['acc']; $yto=$_SESSION['yto']; if(isset($acc) && ($acc=="records")){?> <?php include("Connecter/dataconn.php"); ?> <?php if (isset($_GET['deltab'])) { $_GET['deltab']=trim($_GET['deltab']); $deltab=$_GET['deltab']; $sql=sprintf("delete from students where matric = '%s'", mysql_real_escape_string($deltab)); $result=mysql_query($sql,$csn) or die(mysql_error()); $sql=sprintf("delete from studentsexisting where matric = '%s'", mysql_real_escape_string($deltab)); $result=mysql_query($sql,$csn) or die(mysql_error()); $sql=sprintf("delete from coursesregistered where matric = '%s'", mysql_real_escape_string($deltab)); $result=mysql_query($sql,$csn) or die(mysql_error()); } if (isset($_GET['arhtab'])) { unset($temp); if(isset($_GET['arhtab'])){ $_GET['arhtab']=trim($_GET['arhtab']); if(preg_match('/^[0-9]/u',$_GET['arhtab'])){ settype($_GET['arhtab'], 'int'); $temp=(int)$_GET['arhtab']; } } if(!isset($temp)){echo "Sorry! Wrong Data!"; exit();} $deltab=$temp; $sql=sprintf("update students set archived='Yes' where sn = %s", mysql_real_escape_string($deltab)); $result=mysql_query($sql,$csn) or die(mysql_error()); } if (isset($_GET['unarhtab'])) { unset($temp); if(isset($_GET['unarhtab'])){ $_GET['unarhtab']=trim($_GET['unarhtab']); if(preg_match('/^[0-9]/u',$_GET['unarhtab'])){ settype($_GET['unarhtab'], 'int'); $temp=(int)$_GET['unarhtab']; } } if(!isset($temp)){echo "Sorry! Wrong Data!"; exit();} $deltab=$temp; $sql=sprintf("update students set archived='No' where sn = %s", mysql_real_escape_string($deltab)); $result=mysql_query($sql,$csn) or die(mysql_error()); } ?> <?php $added=""; $ss=""; include("searchstringer.php"); $ss=substr($ss,5); $ss="Displaying Students » " . $ss; if(isset($_POST['dmonth'])){ $sooo=$_POST['dyear']; $dooo=$_POST['dmonth']; if($dooo=='namer'){ $added=$added. " order by surname ".$sooo.", firstname ".$sooo.", othernames ".$sooo; } else { $added=$added. " order by " . $dooo . " " . $sooo; } } if(isset($_GET['sea'])){ $added=stripslashes($_GET['sea']); $ss=$_GET['ss']; } if($added==""){ $added=" order by yearofentry desc, surname asc, firstname asc, othernames asc"; } $query_dio1 = "SELECT * FROM students where archived='No'" . $added; $dio1 = mysql_query($query_dio1, $csn) or die(mysql_error()); $row_dio1 = mysql_fetch_assoc($dio1); $totalRows_dio1 = mysql_num_rows($dio1); $numm = mysql_num_rows($dio1); $loop=25; if (isset($_GET['start'])){ $dstart=$_GET['start']; $dstart=$dstart-1; } else { $dstart=0; } if (!isset($_GET['start'])){ $start=1; $finish=($start + $loop)-1; if ($finish > $numm){ $finish=$numm; } $ii = ($start - 1); } else { $start=$_GET['start']; $finish=($start + $loop)-1; if ($finish > $numm){ $finish=$numm; } $ii = ($start - 1); } if (isset($_GET['pager'])){ $dstart=$_GET['pager']; $dstart=$dstart-1; $start=$_GET['pager']; $finish=($start + $loop)-1; if ($finish > $numm){ $finish=$numm; } $ii = ($start - 1); } $query_dio1 = "SELECT * FROM students where archived='No'" . $added . " limit ".$dstart.",".$loop; $dio1 = mysql_query($query_dio1, $csn) or die(mysql_error()); $row_dio1 = mysql_fetch_assoc($dio1); $totalRows_dio1 = mysql_num_rows($dio1); ?> <?php $query_dio2 = "SELECT * FROM students where archived='Yes'" . $added; $dio2 = mysql_query($query_dio2, $csn) or die(mysql_error()); $row_dio2 = mysql_fetch_assoc($dio2); $totalRows_dio2 = mysql_num_rows($dio2); //echo($added); //exit(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <?php include("head.php"); ?> </head> <body> <?php include("top.php"); ?> <?php include("dtable0.php"); ?> <?php include("nav.php"); ?> <?php include("dtable1.php"); ?> <?php include("topcontainer.php"); ?> <!--Content Goes Here--> <div class="headingbiggest">Students</div> <hr /> <div class="headingbigger"><?php echo($ss); ?></div> <p style="color:#990000"><b>Existing Students</b></p> <div class="post"> <?php if ($totalRows_dio1>0) { //added $gv=$start; $gv--; //added ?> <table width="98%"> <?php do { ?><tr valign="top"> <?php //added $gv++; ?> <td style="border-bottom:1px solid #333333;"><?php echo $gv; ?></td> <?php //added ?> <td style="border-bottom:1px solid #333333;"><?php echo $row_dio1['yearofentry']; ?><?php if($row_dio1['de']=='DE'){ echo(" [DE]"); } ?></td> <td style="border-bottom:1px solid #333333;"><?php echo strtoupper($row_dio1['surname']); ?>, <?php echo $row_dio1['firstname']; ?> <?php echo $row_dio1['othernames']; ?></td> <td style="border-bottom:1px solid #333333;"><?php echo $row_dio1['matric']; ?></td> </tr> <?php } while ($row_dio1 = mysql_fetch_assoc($dio1)); ?> </table> <?php } else { echo ("None Found!"); } ?> <!--Begins here 2--> <div align="center"> <div> </div> <table width="100%" border="0" align="center" cellspacing="2" cellpadding="4"> <tr> <td style="background-color:#dddddd; color:#990000;" width="15px"> <?php if($start==1){ echo("First"); } else { echo("<a href='" . $_SERVER['PHP_SELF'] . "?start=1&sea=" . urlencode($added) . "&ss=" . urlencode($ss)); echo("'>First</a>"); } ?> </td> <td style="background-color:#dddddd; color:#990000;" width="15px"> <?php if($start==1){ echo("Previous"); } else { $cc=$start-$loop; echo("<a href='" . $_SERVER['PHP_SELF'] . "?start=$cc&sea=" . urlencode($added) . "&ss=" . urlencode($ss)); echo("'>Previous</a>"); } ?> </td> <td style="background-color:#dddddd; color:#990000;"><?php echo("Record(s) $start to $finish of $numm record(s)");?></td> <td style="background-color:#dddddd; color:#990000;" width="140px"> <form action="<?php echo($_SERVER['PHP_SELF']); ?>" method="get"> <b>Page: </b><select name="pager" id="pager"> <?php $d=ceil($numm/$loop); for($i=1; $i<=$d; $i++){ $e=(($i-1)*$loop)+1; ?> <option value="<?php echo($e); ?>" <?php if($e==$start){echo('selected="selected"');} ?> ><?php echo($i); ?></option> <?php } ?> </select> <input type="submit" value="Go" name="submitpager" /> <input type="hidden" name="sea" value="<?php echo($added); ?>" /> <input type="hidden" name="ss" value="<?php echo($ss); ?>" /> </form> </td> <td style="background-color:#dddddd; color:#990000;" width="15px"> <?php if($finish==$numm){ echo("Next"); } else { $cc=$finish+1; echo("<a href='" . $_SERVER['PHP_SELF'] . "?start=$cc&sea=" . urlencode($added) . "&ss=" . urlencode($ss)); echo("'>Next</a>"); } ?> </td> <td style="background-color:#dddddd; color:#990000;" width="15px"> <?php if($finish==$numm){ echo("Last"); } else { $cc=(($numm-($numm % $loop))+1); echo("<a href='" . $_SERVER['PHP_SELF'] . "?start=$cc&sea=" . urlencode($added) . "&ss=" . urlencode($ss)); echo("'>Last</a>"); } ?> </td> </tr></table> </div> <!--End here 2--> </div><div class="post-bot"></div> <p style="color:#990000"><b>Archived Students</b></p> <div class="post"> <?php if ($totalRows_dio2>0) { ?> <table width="98%"> <?php do { ?><tr valign="top"> <td style="border-bottom:1px solid #333333;"><?php echo $row_dio2['yearofentry']; ?></td> <td style="border-bottom:1px solid #333333;"><?php echo strtoupper($row_dio2['surname']); ?>, <?php echo $row_dio2['firstname']; ?> <?php echo $row_dio2['othernames']; ?></td> <td style="border-bottom:1px solid #333333;"><?php echo $row_dio2['matric']; ?></td> <td width="75px"> <a href="studentsearchrecord.php?unarhtab=<?php echo $row_dio2['sn']; ?>&sea=<?php echo(urlencode($added)); ?>&ss=<?php echo(urlencode($ss)); ?>">UnArchive</a> </td></tr> <?php } while ($row_dio2 = mysql_fetch_assoc($dio2)); ?> </table> <?php } else { echo ("None Found!"); } ?> </div><div class="post-bot"></div> <p><a href="dadmin.php">Back to Admin Page</a></p> <!--Content Ends Here--> <?php include("bottomcontainer.php"); ?> <?php include("dtable2.php"); ?> <?php include("side.php"); ?> <?php include("dtable3.php"); ?> <?php include("foot.php"); ?> </body> </html> <?php } else { include("ddadmin.php"); }?>