D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafrica
/
result.dominicaninstitute.org
/
Filename :
newsession3.php
back
Copy
<?php if (!$_SESSION){ session_start(); } $acc=$_SESSION['acc']; $yto=$_SESSION['yto']; if(isset($acc) && ($acc=="administratoroftheduresult2018byto")){?> <?php include("Connecter/dataconn.php"); ?> <?php include("checkforpending.php"); ?> <?php if(isset($_POST['doneallcourse']) || isset($_POST['sustainedses2']) || isset($_POST['donestudent'])){ $joyd=1; } else { $joyd=1; $sql="select * from sessions where status='started'"; $result=mysql_query($sql); $num=mysql_num_rows($result); if($num>0){ $row=mysql_fetch_array($result); $statusjoy=$row['stage']; $sesjoy=$row['session']; if($statusjoy==0){ include('dadmin.php'); exit(); } if($statusjoy==1){ $natasession=$sesjoy; $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) select matric,programmesn,yearofentry,archived,de 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(); } $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); } } else { include('dadmin.php'); exit(); } } ?> <?php if(isset($_POST['doneallcourse'])) { $natasession=$_POST['ses']; $nata=substr($natasession,0,4); $natb=$nata-1; $natb=$natb."/".$nata; $sql = "update sessions set stage=1 where session='$natasession'"; $result = mysql_query($sql, $csn); $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) select matric,programmesn,yearofentry,archived,de 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(); } $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['sustainedses2'])) { $natasession=$_POST['sustainedses2']; $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); } ?> <!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="liststudentsassigned.php?tab=<?php echo $row_dio1['sn']; ?>&ses=<?php echo $natasession; ?>">Assign Students</a> </td></tr> <?php } while ($row_dio1 = mysql_fetch_assoc($dio1)); ?> </table> <?php } else { echo ("None Found!"); } ?> <p> </p><hr /> <form action="newsession.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="ses" 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("ddadmin.php"); }?>