D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafrica
/
result.dominicaninstitute.org
/
Filename :
managedsession.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("checkforpending2.php"); ?> <?php if(!isset($_POST['doneallstudent'])){ include("checkforpending.php"); } ?> <?php if(isset($_POST['managesession']) || isset($_POST['sustainedses']) || isset($_GET['sustainedses'])){ ?> <?php if(isset($_POST['doneallstudent'])) { $natasession=$_POST['sustainedses']; $sql1="delete from studentsexisting where session='$natasession'"; if (!mysql_query($sql1)){ echo("Unable to delete from studentsexisting: " . mysql_error()); exit(); } $sql1="insert into studentsexisting (matric,programmesn,yearofentry,archived,session,level,status,de) select matric,programmesn,yearofentry,archived,session,level,status,de from tempstudents"; if (!mysql_query($sql1)){ echo("Unable to populate studentsexisting: " . mysql_error()); exit(); } $tire="update sessions set status='opened',stage=2 where session='$natasession'"; $diotire = mysql_query($tire, $csn) or die(mysql_error()); } ?> <?php if(isset($_POST['sustainedses'])) { $dses=$_POST['sustainedses']; $sqljoy="select * from sessions where session='".$dses."'"; $resultjoy=mysql_query($sqljoy); $numjoy=mysql_num_rows($resultjoy); $rowjoy=mysql_fetch_array($resultjoy); } ?> <?php $sqljoy="select * from semesters where semester='first_semester'"; $resultjoy=mysql_query($sqljoy); $numjoy=mysql_num_rows($resultjoy); $semester=mysql_fetch_array($resultjoy); if(isset($_GET['semester'])) { $wha=$_GET['semester']; $dses=$_GET['sustainedses']; if($wha=='open'){ $sql="update semesters set status='opened' where semester='first_semester'"; $result=mysql_query($sql); } if($wha=='stop'){ $sql="update semesters set status='ended' where semester='first_semester'"; $result=mysql_query($sql); } if($wha=='final'){ $sql="update semesters set status='sealed' where semester='first_semester'"; $result=mysql_query($sql); } } ?> <?php if(isset($_GET['tab'])) { $wha=$_GET['tab']; $dses=$_GET['sustainedses']; if($wha=='open'){ $sql="update sessions set status='opened' where session='$dses'"; $result=mysql_query($sql); } if($wha=='stop'){ $sql="update sessions set status='ended' where session='$dses'"; $result=mysql_query($sql); } if($wha=='final'){ $sql="update sessions set status='sealed' where session='$dses'"; $result=mysql_query($sql); } } ?> <?php if(isset($_GET['sustainedses'])) { $dses=$_GET['sustainedses']; $sqljoy="select * from sessions where session='".$dses."'"; $resultjoy=mysql_query($sqljoy); $numjoy=mysql_num_rows($resultjoy); $rowjoy=mysql_fetch_array($resultjoy); } ?> <?php if(isset($_POST['managesession'])) { $a=$_POST['session']; if (!is_numeric($a) || substr($a,0,1)=='0' || substr($a,0,1)=='.') { $jkjk="You did not enter a Valid Session! <b>".$a."</b> is not valid!"; include("managesession.php"); exit(); } $b=$a+1; $dses=$a."/".$b; $sqljoy="select * from sessions where session='".$dses."'"; $resultjoy=mysql_query($sqljoy); $numjoy=mysql_num_rows($resultjoy); $rowjoy=mysql_fetch_array($resultjoy); if($numjoy<1){ $jkjk="Session <b>".$dses."</b> does NOT exists! It cannot be managed/edited.<br>If you wish to create it, use the <b>Prepare New Session</b> menu."; include("managesession.php"); exit(); } } ?> <?php if($rowjoy['status']=='started'){ include("dadmin.php"); 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">Manage Session</div> <hr /> <?php if($rowjoy['status']=='opened'){ ?><a href="managedsession.php?tab=stop&sustainedses=<?php echo($dses); ?>">Stop Course Registration</a><br /><?php } ?> <?php if($rowjoy['status']=='ended'){ ?><a href="managedsession.php?tab=open&sustainedses=<?php echo($dses); ?>">Open Course Registration</a><br /><?php } ?> <?php if($semester['status']=='opened'){ ?><a href="managedsession.php?semester=stop&sustainedses=<?php echo($dses); ?>">Stop First Semester Course Registration</a><br /><?php } ?> <?php if($semester['status']=='ended'){ ?><a href="managedsession.php?semester=open&sustainedses=<?php echo($dses); ?>">Open First Semester Course Registration</a><br /><?php } ?> <br /> <?php if($rowjoy['status']=='opened' || $rowjoy['status']=='ended'){ ?> <a href="managecourses.php?sustainedses=<?php echo($dses); ?>">Manage Courses to be Taken & Lecturers teaching Courses</a><br /><?php } ?> <?php if($rowjoy['status']=='opened' || $rowjoy['status']=='ended'){ ?> <a href="managestudents.php?sustainedses=<?php echo($dses); ?>">Manage Students taking Courses</a><br /><?php } ?> <br /> <?php if($rowjoy['status']=='opened' || $rowjoy['status']=='ended'){ ?><a href="finalizeconfirm.php?tab=final&sustainedses=<?php echo($dses); ?>">Vet/Finalize Session</a><br /><?php } ?> <?php if($rowjoy['status']=='sealed'){ ?><b>Session is Vetted, Sealed and Finalized.</b><br /><?php } ?> <!--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"); }?>