D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafrica
/
result.dominicaninstitute.org
/
Filename :
managestudents.php
back
Copy
<?php if (!$_SESSION){ session_start(); } $acc=$_SESSION['acc']; $yto=$_SESSION['yto']; if(isset($acc) && ($acc=="administratoroftheduresult2018byto")){ include("Connecter/dataconn.php"); include("checkforpending2.php"); ?> <?php if(!isset($_POST['donestudent'])){ include("checkforpendingb.php"); } ?> <?php if(isset($_GET['sustainedses']) || isset($_POST['donestudent']) || isset($_GET['returnstudent'])){ $joyd=1; ?> <?php if(isset($_GET['sustainedses'])){ $natasession=$_GET['sustainedses']; $nata=substr($natasession,0,4); $natb=$nata-1; $natb=$natb."/".$nata; $sql1="delete from tempstudents"; if (!mysql_query($sql1)){ echo("Unable to empty tempstudents: " . mysql_error()); exit(); } //Bring in Freshers $sql1="insert into tempstudents (matric,programmesn,yearofentry,archived,de,session,level,status) select matric,programmesn,yearofentry,archived,de,'',0,'' from students where archived='No' and yearofentry='$nata'"; if (!mysql_query($sql1)){ echo("Unable to populate tempstudents 1: " . mysql_error()); exit(); } $sql1="update tempstudents set session='$natasession', level=1, status='good' where de=''"; if (!mysql_query($sql1)){ echo("Unable to update tempstudents 1: " . mysql_error()); exit(); } $sql1="update tempstudents set session='$natasession', level=2, status='good' where de='DE'"; if (!mysql_query($sql1)){ echo("Unable to update tempstudents 2: " . mysql_error()); exit(); } //Bring in Old Students $sql1="insert into tempstudents (matric,programmesn,yearofentry,archived,de,level,status,session) select matric,programmesn,yearofentry,archived,de,level,status,session from studentsexisting where archived='No' and session='$natb'"; if (!mysql_query($sql1)){ echo("Unable to populate tempstudents 2: " . mysql_error()); exit(); } $sql1="update tempstudents set level=level+1 where status='good' and session='$natb'"; if (!mysql_query($sql1)){ echo("Unable to update tempstudents 3: " . mysql_error()); exit(); } $sql1="update tempstudents set session='$natasession' where status='good' or status='suspend'"; if (!mysql_query($sql1)){ echo("Unable to update tempstudents 4: " . mysql_error()); exit(); } $sql1="delete from tempstudents where session<>'$natasession'"; if (!mysql_query($sql1)){ echo("Unable to delete from tempstudents: " . mysql_error()); exit(); } //Begin to touch the present $sql1="select * from studentsexisting where archived='No' and session='$natasession'"; $result1=mysql_query($sql1); while($row1=mysql_fetch_array($result1)){ $sql2="update tempstudents set status='".$row1['status']."' where matric='".$row1['matric']."' and programmesn='".$row1['programmesn']."' and yearofentry='".$row1['yearofentry']."' and session='".$row1['session']."' and level='".$row1['level']."' and de='".$row1['de']."'"; $result2=@mysql_query($sql2); } //End to touch the present $sql="select * from programmes"; $result=mysql_query($sql); $row=mysql_fetch_array($result); $num=mysql_num_rows($result); if($num>0){ do { $sql1="delete from tempstudents where programmesn=".$row['sn']." and level>".$row['numberofyears']; if (!mysql_query($sql1)){ echo("Unable to delete overaged-students from tempstudents: " . mysql_error()); exit(); } } while($row=mysql_fetch_array($result)); } $sql1="delete from tempprogrammes"; if (!mysql_query($sql1)){ echo("Unable to empty tempprogrammes: " . mysql_error()); exit(); } $sql1="insert into tempprogrammes select * from programmes where archived='No'"; if (!mysql_query($sql1)){ echo("Unable to populate tempprogrammes: " . mysql_error()); exit(); } $query_dio1 = "SELECT * FROM tempprogrammes where archived='No' order by namer"; $dio1 = mysql_query($query_dio1, $csn) or die(mysql_error()); $row_dio1 = mysql_fetch_assoc($dio1); $totalRows_dio1 = mysql_num_rows($dio1); } ?> <?php if(isset($_POST['donestudent'])) { $prog=$_POST['tab']; $sql = "update tempprogrammes set archived='Yes' where sn=$prog"; $result = @mysql_query($sql, $csn); $sql = "select count(*) from tempprogrammes where archived='No'"; $result = @mysql_query($sql, $csn); $row=mysql_fetch_array($result); $joyd=$row[0]; $natasession=$_POST['ses']; $query_dio1 = "SELECT * FROM tempprogrammes order by namer"; $dio1 = mysql_query($query_dio1, $csn) or die(mysql_error()); $row_dio1 = mysql_fetch_assoc($dio1); $totalRows_dio1 = mysql_num_rows($dio1); $tire="update sessions set status='editstu',stage=0 where session='$natasession'"; $diotire = mysql_query($tire, $csn) or die(mysql_error()); } ?> <?php if(isset($_GET['returnstudent'])) { $sql = "select count(*) from tempprogrammes where archived='No'"; $result = @mysql_query($sql, $csn); $row=mysql_fetch_array($result); $joyd=$row[0]; $natasession=$_GET['ses']; $query_dio1 = "SELECT * FROM tempprogrammes order by namer"; $dio1 = mysql_query($query_dio1, $csn) or die(mysql_error()); $row_dio1 = mysql_fetch_assoc($dio1); $totalRows_dio1 = mysql_num_rows($dio1); } ?> <!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">Assign Students to Semesters in <?php echo($natasession); ?> Session</div> <hr /> <p style="color:#990000"><b>Existing Programmes of Study</b></p> <div class="post"> <?php if ($totalRows_dio1>0) { ?> <table width="98%"> <tr valign="top"><td><b>Programme</b></td><td><b>Done</b></td><td width="180px"><b> </b></td></tr> <?php do { ?><tr valign="top"> <td style="border-bottom:1px solid #333333;"><?php echo $row_dio1['namer']; ?> <?php $heat="select * from departments where sn=".$row_dio1['departmentsn']; $heatresult=mysql_query($heat); $heatrow=mysql_fetch_array($heatresult); echo(" (".$heatrow['namer'].")"); ?> </td> <td style="border-bottom:1px solid #333333;"><?php echo $row_dio1['archived']; ?></td> <td> <a href="liststudentsassigned2.php?tab=<?php echo $row_dio1['sn']; ?>&ses=<?php echo $natasession; ?>&checker=REAL">Assign Students</a> </td></tr> <?php } while ($row_dio1 = mysql_fetch_assoc($dio1)); ?> </table> <?php } else { echo ("None Found!"); } ?> <p> </p><hr /> <form action="managedsession.php" method="post" name="form1" id="form1"> <div align="right"> <input name="doneallstudent" type="submit" id="doneallstudent" value=" Done " style="font-size:16px; font-weight:bold;" <?php if($joyd>0){ echo('disabled="disabled"'); } ?> /> <input name="sustainedses" type="hidden" value="<?php echo($natasession); ?>" /> </div> </form> </div><div class="post-bot"></div> <!--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("dadmin.php"); }?> <?php } else { include("ddadmin.php"); }?>