D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafrica
/
result.dominicaninstitute.org
/
Filename :
registerdcourses.php
back
Copy
<?php if (!$_SESSION){ session_start(); } $_SESSION['ss'] = $_GET['ses']; $_SESSION['level'] = $_GET['lev']; $acc=$_SESSION['acc']; $yto=$_SESSION['yto']; if(isset($acc) && ($acc=="studentoftheuniversity2015byto")){?> <?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' and score>40"; $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); } else { $sqlwork2="select * from coursestobetaken where sn=$a1"; $work2=mysql_query($sqlwork2); $row_work2=mysql_fetch_array($work2); $tia="<span style='color:#ff0000;font-weight:bold;'>Warning!</span> The Course: <b>".$row_work2['namer']."</b> is previously registered for!"; } } ?> <?php if(isset($_GET['ses'])) { $natasession=$_GET['ses']; $progid=$_GET['tab']; $mat=$_GET['who']; $level=$_GET['lev']; $de=$_GET['de']; $_SESSION["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); $query_temp = "SELECT d.namer as faculty, c.namer as department, b.namer as program, a.namer as degree FROM programmes as a, programs as b, departments as c, faculties as d where d.sn=c.facultysn and b.sn=c.deptsn and b.facultysn=d.sn and c.sn=a.departmentsn and a.sn='$progid'"; $diotemp = mysql_query($query_temp, $csn) or die(mysql_error()); $row_temp = mysql_fetch_assoc($diotemp); $_SESSION['faculty'] = $row_temp['faculty']; $_SESSION['dept'] = $row_temp['program']; $_SESSION['prog'] = $row_temp['department']; $_SESSION['degree'] = $row_temp['degree']; ?> <!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" style="color:#990000;">Choose Courses for Session: <?php echo($natasession); ?>, Year: <?php echo($level); ?></div> <hr /> <div class="headingbigger">Programme: <?php echo($row_dio1['namer']); ?> [<?php echo($row_dio2['namer']); ?>]</div> <?php if(isset($tia)){ ?> <div align="center" style="padding:15px;"> <div style="padding:20px; background-color:#CCC; width:80%; text-align:center;"> <?php echo($tia); ?> </div></div> <?php } ?> <?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"> <?php $sqljoy="select * from semesters where semester='first_semester'"; $resultjoy=mysql_query($sqljoy); $numjoy=mysql_num_rows($resultjoy); $sem=mysql_fetch_array($resultjoy); $sem_status = $sem['status']; ?> <?php if(($sem['status']=='ended') && ($semester==1)){?> <a>Locked</a> <?php } else { ?> <a href="registerdcourses.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> <?php } ?> </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.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="registerdcourses.php" method="get" name="form1" id="form1"> <?php //$sql = "SELECT * FROM coursestobetaken where archived='No' and programmesn=$programmesn and session='$session' and semester=$semester and level=$level 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=$level and l.semester=$semester and l.de='$de' and r.matric='$mat') order by code asc"; $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"; $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 style="display: flex";> <div style="text-align:center; font-size:20px; margin-right:10px"><a href="courseregprev.php"><input name="donecourse" type="submit" id="donecourse" value="First Semester Preview" style="font-size:20px; font-weight:bold; color:maroon;" /></a></div> <div style="text-align:center; font-size:20px"><a href="courseregprev1.php"><input name="donecourse" type="submit" id="donecourse" value="Second Semester Preview" style="font-size:20px; font-weight:bold; color:maroon;" /></a></div> </div> </div><div class="post-bot2"></div> <form action="registercourses.php" method="post" name="form1" id="form1"> <div align="right"> <input name="donecourse" type="submit" id="donecourse" value=" Done " style="font-size:16px; font-weight:bold; color:maroon;" /> <input name="ses" type="hidden" value="<?php echo($session); ?>" /> <input name="tab" type="hidden" value="<?php echo($programmesn); ?>" /> </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("dstu.php"); } ?> <?php } else { include("student.php"); }?>