D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafrica
/
result.dominicaninstitute.org
/
Filename :
registercoursesadmin.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($_POST['donecourse'])) { $natasession=$_POST['session']; $progid=$_POST['progid']; $level=$_POST['level']; $de=$_POST['de']; $sqlwork="select * from studentsexisting where programmesn=$progid and session='$natasession' and level=$level and de='$de' and status='good' and archived='No'"; $work=mysql_query($sqlwork); $num_work2=mysql_num_rows($work); //If there are students if($num_work2>0){ while($rowwork=mysql_fetch_array($work)) { $mat2=$rowwork['matric']; //Go through registered courses for all $query_vin = "SELECT *,r.sn as dsn,t.sn as dcode FROM coursesregisteredall as r inner join coursestobetaken as t on r.coursesn=t.sn where t.programmesn=$progid and t.session='$natasession' and t.level=$level and t.de='$de'"; $vin = mysql_query($query_vin, $csn) or die(mysql_error()); $num_vin=mysql_num_rows($vin); //if any exists if($num_vin>0){ while($row_vin=mysql_fetch_array($vin)){ $a1=$row_vin['dcode']; $sqlwork2="select * from coursesregistered where coursesn=$a1 and matric='$mat2'"; $work2=mysql_query($sqlwork2); $num_work3=mysql_num_rows($work2); if($num_work3==0){ $sql="insert into coursesregistered (coursesn,matric,archived) values ($a1,'$mat2','No')"; $result=@mysql_query($sql); } } } } } } ?> <!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"); ?> <script> function byto() { var mySession = document.getElementById('session').value; var ses = 1; ses = parseInt(mySession); ses = ses + 1; if(isNaN(ses)){ document.getElementById('session2').value = ''; } else { document.getElementById('session2').value = ses; } } function isNumber(evt) { evt = (evt) ? evt : window.event; var charCode = (evt.which) ? evt.which : evt.keyCode; if (charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } return true; } </script> </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">Register for Courses</div><hr /> <p style="color:#990000"><b>Please click the session and level you want to register courses for:</b></p> <?php if(isset($jkjk)){ echo("<p align='center' style='color:#ff0000'>".$jkjk."</p>"); } else { ?> <p align="center">Enter the session, level and semester below:</p> <?php } ?> <form action="registerdcoursesadmin.php" method="get" name="form1" id="form1"> <table width="100%"> <tr valign="top"><td width="150" style="font-weight:bold; text-align:right">Session:</td> <td style="font-size:9px;"><input name="session" id="session" size="2" type="text" maxlength="4" onkeyup="byto()" onkeypress="return isNumber(event)" onchange="byto()" /> <span style="font-weight:bold; font-size:16px;">/</span> <input name="session2" id="session2" size="2" type="text" maxlength="4" readonly="readonly" /></td></tr> <tr valign="top"><td width="150" style="font-weight:bold; text-align:right">Level:</td> <td style="font-size:9px;"><input name="level" id="level" size="1" type="text" maxlength="1" onkeypress="return isNumber(event)" /></td></tr> <tr valign="top"><td width="150" style="font-weight:bold; text-align:right">Entry Mode:</td> <td style="font-size:9px;"> <label> <input type="radio" name="de" value="" id="de_0" checked="checked" /> <b>UTME</b></label> <label> <input type="radio" name="de" value="DE" id="de_1" /> <b>Direct Entry</b></label> </td></tr> <tr valign="top"><td width="150" style="font-weight:bold; text-align:right">Programme of Study:</td> <td style="font-size:9px;"> <?php $sql = "SELECT *,programmes.sn as feli1,programmes.namer as feli2,departments.namer as feli3 FROM programmes inner join departments on programmes.departmentsn = departments.sn where programmes.archived='No'"; $result = mysql_query($sql); ?> <select name="programmesn" id="programmesn"> <?php while($row = mysql_fetch_array($result)){ ?> <option value="<?php echo $row['feli1']; ?>"><?php echo $row['feli2']; ?> [<?php echo $row['feli3']; ?>]</option> <?php }?> </select> </td></tr> <tr valign="top"> <td style="text-align:right; font-size:10px;" colspan="2"><a href="dadmin.php">Cancel</a> <input name="checksession" type="submit" id="checksession" value=" Check Session " /> </td> </tr> </table> </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"); }?>