D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafrica
/
result.dominicaninstitute.org
/
Filename :
registerdcoursesadmin1.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 if (isset($_GET['deltab'])) { $deltab=$_GET['deltab']; $sql="delete from coursesregistered where sn = ".$deltab; $result=mysql_query($sql,$csn) or die(mysql_error()); } ?> <?php if(isset($_GET['chosecourse'])) { $a1=$_GET['code']; $a2=$_GET['who']; $sqlwork = "select * from coursesregistered where coursesn=$a1 and matric='$a2'"; $work = mysql_query($sqlwork); $num_work = mysql_num_rows($work); if($num_work <=0){ $sqlwork = "insert into `coursesregistered` (`coursesn`,`matric`,`archived`,`score`,`gp`,`gpa`) values ('$a1','$a2','No',NULL,0,0)"; $work = mysql_query($sqlwork); //echo $_GET['code'].'/'.$_GET['who']; } } ?> <?php if(isset($_GET['ses'])) { $natasession=$_GET['ses']; $progid=$_GET['tab']; $mat=strtoupper($_GET['who']); $level=$_GET['lev']; $de=$_GET['de']; $query_dio1 = "SELECT * FROM programmes where sn=".$progid; $dio1 = mysql_query($query_dio1, $csn) or die(mysql_error()); $row_dio1 = mysql_fetch_assoc($dio1); $query_dio2 = "SELECT * FROM departments where sn=".$row_dio1['departmentsn']; $dio2 = mysql_query($query_dio2, $csn) or die(mysql_error()); $row_dio2 = mysql_fetch_assoc($dio2); ?> <!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">Choose Courses for <?php echo($mat); ?> in Year: <?php echo($level); ?>, <?php echo($natasession); ?> Session</div> <hr /> <div class="headingbigger">Programme: <?php echo($row_dio1['namer']); ?> [<?php echo($row_dio2['namer']); ?>]</div> <?php $session=$natasession; $programmesn=$progid; ?> <div class="post2"> <?php //Loop for Each Semester in the Level/Year ?> <?php for($u=1;$u<=2;$u++){ $semester=$u; ?> <div class="headingnormal">Semester <?php echo($semester); ?></div><hr /> <table width="100%" border="1" cellpadding="3" cellspacing="2" frame="vsides" rules="rows"> <?php $query_vin = "SELECT *,r.sn as dsn FROM coursesregistered as r inner join coursestobetaken as t on r.coursesn=t.sn where t.programmesn=$programmesn and t.session='$session' and t.semester=$semester and t.de='$de' and r.matric='$mat'"; $vin = mysql_query($query_vin, $csn) or die(mysql_error());// and t.level=$level $num_vin=mysql_num_rows($vin); ?> <?php if($num_vin<1){ echo("<tr><td colspan='9' style='color:#990000;'>No Course Added Yet!</td></tr>"); } else { ?> <tr valign="top" style="background-color:#000; color:#FFF;"> <td width="20px"><b> </b></td> <td width="60px"><b>Code</b></td> <td><b>Course</b></td> <td><b>Unit</b></td> <td><b>Status</b></td> <td><b>Stand</b></td> <td><b>Stance</b></td> <td><b>Lecturer</b></td> <td width="90px"><b> </b></td> </tr> <?php $f=0; while($row_vin = mysql_fetch_assoc($vin)) { $f++; ?> <tr valign="top"> <td align="left"><?php echo($f); ?>.</td> <td align="left"><?php echo($row_vin['code']); ?></td> <td align="left"><?php echo($row_vin['namer']); ?></td> <td align="left"><?php echo($row_vin['unit']); ?></td> <td align="left"><?php echo($row_vin['status']); ?></td> <td align="left"><?php echo($row_vin['stand']); ?></td> <td align="left"><?php echo($row_vin['stance']); ?></td> <td align="left"><?php $sql="SELECT * FROM lecturers where sn = ".$row_vin['lecturersn']; $result = mysql_query($sql); $row = mysql_fetch_array($result); echo($row['namer']); ?></td> <td align="center"> <a href="registerdcoursesadmin1.php?tab=<?php echo $programmesn; ?>&ses=<?php echo $session; ?>&deltab=<?php echo($row_vin['dsn']); ?>&who=<?php echo $mat; ?>&lev=<?php echo $level; ?>">Delete</a> </td> </tr> <?php } } ?> </table> <?php $sql = "SELECT sum(unit) FROM coursesregistered as r inner join coursestobetaken as t on r.coursesn=t.sn where t.programmesn=$programmesn and t.session='$session' and t.level=$level and t.semester=$semester and t.de='$de' and r.matric='$mat'"; $result = mysql_query($sql); $row=mysql_fetch_array($result); ?> <?php if($num_vin>0){ ?> <div align="right" style="font-weight:bold; color:#22398f; font-size:14px; background-color:#b7c5f9; padding:5px 20px 5px 20px;">Total Units: <?php echo($row[0]); ?></div> <?php } ?> <table width="100%" border="1" cellpadding="3" cellspacing="2" frame="border" rules="none"> <tr valign="top"> <td width="50px" style="background-color:#000; color:#FFF; font-weight:bold;">Add Courses Here</td> <td> <div class="franca">Choose Courses from Below:</div> <form action="registerdcoursesadmin1.php" method="get" name="form1" id="form1"> <?php $sql = "SELECT * FROM coursestobetaken as a where archived='No' and programmesn=$programmesn and session='$session' and semester=$semester and de='$de' and code NOT IN (SELECT l.code as dcode FROM coursestobetaken as l inner join coursesregistered as r on r.coursesn=l.sn where l.programmesn=$programmesn and l.session='$session' and l.level=a.level and l.semester=$semester and l.de='$de' and r.matric='$mat') order by code asc"; // and level=$level, and l.level=$level $result = mysql_query($sql); ?> <b>Course:</b><select name="code" id="code"> <?php while($row = mysql_fetch_array($result)){ ?> <option value="<?php echo $row['sn']; ?>"><?php echo $row['namer']; ?> (<?php echo $row['code']; ?>)</option> <?php }?> </select> <div align="left"> <input name="chosecourse" type="submit" id="chosecourse" value=" Choose Course " /> <input name="ses" type="hidden" value="<?php echo($session); ?>" /> <input name="tab" type="hidden" value="<?php echo($programmesn); ?>" /> <input name="de" type="hidden" value="<?php echo($de); ?>" /> <input name="who" type="hidden" value="<?php echo($mat); ?>" /> <input name="lev" type="hidden" value="<?php echo($level); ?>" /> </div> </form> </td> </tr> </table> <div> </div> <div> </div> <div> </div> <div> </div> <?php //End of Loop for Each Semester in the Level/Year ?> <?php } ?> </div><div class="post-bot2"></div> <form action="registercoursesadmin1.php" method="post" name="form1" id="form1"> <div align="right"> <input name="findstudent" type="submit" id="findstudent" value=" Done " style="font-size:16px; font-weight:bold; color:maroon;" /> <input name="mat" type="hidden" value="<?php echo($mat); ?>" /> </div> </form> <!--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"); }?>