D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafrica
/
result.dominicaninstitute.org
/
Filename :
newsession2.php
back
Copy
<?php if (!$_SESSION){ session_start(); } $acc=$_SESSION['acc']; $yto=$_SESSION['yto']; if(isset($acc) && ($acc=="administratoroftheduresult2018byto")){ include("Connecter/dataconn.php"); include("checkforpending.php"); ?> <?php if(isset($_POST['addsession']) || isset($_POST['sustainedses1']) || isset($_POST['donecourse'])){ $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){ $natasession=$sesjoy; $sql1="delete from tempcourses"; if (!mysql_query($sql1)){ echo("Unable to empty tempcourses: " . 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); } if($statusjoy==1){ include('dadmin.php'); exit(); } } else { include('dadmin.php'); exit(); } } ?> <?php if(isset($_POST['addsession'])) { $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("newsession1.php"); exit(); } $b=$a+1; $dses=$a."/".$b; $sql="select * from sessions where session='".$dses."'"; $result=mysql_query($sql); $num=mysql_num_rows($result); if($num>0){ $jkjk="Session <b>".$dses."</b> exists! It cannot be created again.<br>If you wish to make modifications to it, use the <b>Manage Old Session</b> menu."; include("newsession1.php"); exit(); } $sql="insert into sessions (session, status, stage) VALUES ('$dses', 'started', 0)"; if (mysql_query($sql)){ $natasession=$dses; $sql1="delete from tempcourses"; if (!mysql_query($sql1)){ echo("Unable to empty tempcourses: " . 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 { $jkjk="Unable to create the session: " . mysql_error(); include("newsession1.php"); exit(); } } ?> <?php if(isset($_POST['sustainedses1'])) { $natasession=$_POST['sustainedses1']; $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['donecourse'])) { $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">Enter Courses to be Taken 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="listcoursestobetaken.php?tab=<?php echo $row_dio1['sn']; ?>&ses=<?php echo $natasession; ?>">Add Courses to be Taken</a> </td></tr> <?php } while ($row_dio1 = mysql_fetch_assoc($dio1)); ?> </table> <?php } else { echo ("None Found!"); } ?> <p> </p><hr /> <form action="newsession3.php" method="post" name="form1" id="form1"> <div align="right"> <input name="doneallcourse" type="submit" id="doneallcourse" 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"); }?>