D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafrica
/
result.dominicaninstitute.org
/
Filename :
result_status.php
back
Copy
<?php include("Connecter/dataconn.php"); /*ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);*/ if(!($_SESSION['dtype'] == "exams" || $_SESSION['dtype'] == "records" || $_SESSION['dtype'] == "faculty")){ Header("Refresh: 0; url=dadmin.php"); } $success = ''; $error = ''; $ss=''; $level=''; $semester='';$faculty=''; $dept=''; $course=''; if(isset($_POST['submitButt'])){ $record_err = false; $faculty_err = false; $studnum = $_POST['studnum']; for($i=1; $i<=$studnum; $i++){ $temp = 'checkbox'.$i; if(isset($_POST[$temp])) $status = 'A'; else $status = 'NYA'; $temp2 = 'ssn'.$i; $ssn = $_POST[$temp2]; $sdate = date("Y-m-d G:i:s"); if($_SESSION['dtype'] == "exams"){ $scol = 'dept_status'; $scolup = 'dept_update_date'; $temp6 = "facs".$i; if($_POST[$temp6] == "A"){ $error = "One or more records could not be saved."; continue; } } if($_SESSION['dtype'] == "records"){ $scol = 'sen_status'; $scolup = 'sen_update_date'; $temp3 = "facs".$i; if($_POST[$temp3] == "NYA"){ $error = "One or more records could not be saved."; continue; } } if($_SESSION['dtype'] == "faculty"){ $scol = 'fac_status'; $scolup = 'fac_update_date'; $temp4 = "depts".$i; $temp5 = "sens".$i; if($_POST[$temp4] == "NYA" || $_POST[$temp5] == 'A'){ $error = "One or more records could not be saved."; continue; } } $sql = "update coursesregistered set $scol='$status', $scolup='$sdate' where sn=$ssn"; $result = mysql_query($sql); if($result) $success = "Record was saved successfully"; elseif($error == '') $error = "Oooops! Something went wrong, please contact ICT admin."; } } if($_POST['ss'] != '') $ss = $_POST['ss']; if($_POST['level'] != '') $level = $_POST['level']; if($_POST['semester'] != '') $semester = $_POST['semester']; if($_POST['faculty'] != '') $faculty = $_POST['faculty']; if($_POST['dept'] != '') $dept = $_POST['dept']; if($_POST['course'] != ''){ $course = $_POST['course']; } $acc=$_SESSION['acc']; $yto=$_SESSION['yto']; ?> <!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> <link rel="stylesheet" href="CSS/jquery-ui.css"> <link href="CSS/sweetalert.css" rel="stylesheet" type="text/css"> <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--> <form action="" method="post" name="form1" id="form1"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center"> <div class="block1"> <table width="100%" border="0" cellspacing="3" cellpadding="3"> <tr> <td width="10%" align="right"><strong>SESSION</strong></td> <td width="17%" align="left"> <?php $year1 = date('Y'); $start_year = $year1-3; $prev_ss = ($year1-1).'/'.$year1; ?> <select name="ss" id="ss" onchange="submitForm()"> <?php for($i=$start_year; $i<$year1; $i++){ $sess = $i.'/'.($i+1); ?> <option value="<?php echo $sess;?>" <?php if($ss !='' && $ss == $sess) echo "selected"; elseif($prev_ss == $sess && $ss == '') echo "selected"; ?>><?php echo $sess;?></option><?php }?> </select> </td> <td width="13%" align="right"><strong>FACULTY</strong></td> <td width="60%" align="left"> <select name="faculty" id="faculty" onchange="submitFormFac()"> <option value="">Select Faculty</option> <?php if(($_SESSION['dtype'] == "faculty" || $_SESSION['dtype'] == "exams") && $_SESSION['fac_id']>0 ){ $fac_id = $_SESSION['fac_id']; $str = "where sn='$fac_id'"; $faculty = $fac_id; } elseif($_SESSION['dtype'] != 'records' && $_SESSION['fac_id'] <=0){ Header("Refresh: 0; url=dadmin.php"); } $sqlfac = "select * from faculties $str"; $fac = mysql_query($sqlfac); //$row_fac = mysql_fetch_assoc($fac); $m = 0; while($row_fac = mysql_fetch_assoc($fac)){ //if($m == 0 && $faculty =='') //$fac_temp = $row_fac['sn']; ?> <option value="<?php echo $row_fac['sn']; ?>" <?php if($faculty !='' && $faculty == $row_fac['sn']) echo "selected"; ?>><?php echo $row_fac['namer']; ?></option> <?php $m++; }//$num_fac--;?> </select></td> </tr> <tr> <td align="right"><strong>LEVEL</strong></td> <td align="left"><select name="level" id="level" onchange="submitForm()"> <?php $lev = 1; while($lev <=4){ ?> <option value="<?php echo $lev; ?>" <?php if($level !='' && $level == $lev){ echo "selected";}elseif($lev == 1 && $level =='') echo "selected";?>><?php echo $lev; ?>00 Level</option> <?php $lev += 1; }?> </select></td> <td align="right"><strong>DEPARTMENT</strong></td> <td align="left"> <select name="dept" id="dept" onchange="submitForm()"> <option value="">Select Department</option> <?php if($faculty != ''){ if($_SESSION['dtype'] == "exams" && $_SESSION["prog_id"]>0){ $dept_id = $_SESSION["prog_id"]; $str = "and sn='$dept_id'"; //$dept = $dept_id; } elseif($_SESSION['dtype'] != 'exams' && $_SESSION['dept_id'] <=0){ Header("Refresh: 0; url=dadmin.php"); } $sqldept = "select * from departments where facultysn='$faculty' $str"; $depti = mysql_query($sqldept); //$row_dept = mysql_fetch_assoc($depti); $m=0; while($row_dept = mysql_fetch_assoc($depti)){ //if($m == 0 && !isset($dept)) //$dept_temp = $row_dept['sn'];//to track the first dept ID for course selection ?> <option value="<?php echo $row_dept['sn']; ?>" <?php if($dept !='' && $dept == $row_dept['sn']) echo "selected";?>><?php echo $row_dept['namer']; ?></option> <?php $m++; }//$num_fac--; } ?> </select></td> </tr> <tr> <td align="right"><strong>SEMESTER</strong></td> <td align="left"><select name="semester" id="semester" onchange="submitForm()"> <?php for($i=1; $i<3; $i++){ ?> <option value="<?php echo $i; ?>" <?php if($semester !='' && $semester == $i){ echo "selected";}elseif($i==1 && $semester == '') echo "selected"; ?>><?php if($i == 1) echo "First Semester"; else echo "Second Semester"; ?></option> <?php }?> </select></td> <td align="right"><strong>COURSE</strong></td> <td align="left"> <select name="course" id="course" onchange="submitForm()"> <option value="">Select Course</option> <?php /*if($ss !=''){ $ss_temp = $ss; $lev_temp = $level; $sem_temp = $semester; $fac_temp = $faculty; $dept_temp = $dept; }*/ /*else{ $ss_temp = (date('Y')-1).'/'.date('Y'); $lev_temp = 1; $sem_temp = 2; }*/ if($faculty !='' && $dept !='' ){ $sqlcourse = "select b.sn, a.namer, a.code, b.lecturersn from courses as a, coursestobetaken as b, coursesregistered as c, programmes as d where a.sn=b.course_id and b.sn=c.coursesn and b.programmesn=d.sn and semester='$semester' and session='$ss' and level='$level' and d.departmentsn='$dept' group by code ORDER BY `a`.`code` ASC"; $courses = mysql_query($sqlcourse); //$row_course = mysql_fetch_assoc($courses); //$total = mysql_num_rows($courses); $m = 0; while($row_course = mysql_fetch_assoc($courses)){ if($m == 0 && $course == ''){ $course_temp = $row_course['sn'];//to track the first course ID for student name selection $lec_temp = $row_course['lecturersn']; } if($course !='' && $course == $row_course['sn']){ $course_temp = $course; $lec_temp = $row_course['lecturersn']; } ?> <option value="<?php echo $row_course['sn']; ?>" <?php if($course !='' && $course == $row_course['sn']) echo "selected"; ?>><?php echo $row_course['namer']?></option> <?php $m++; }//$num_fac--; } ?> </select></td> </tr> </table> </div></td> </tr> <?php if($faculty !='' && $dept !='' && $course !=''){?> <tr> <td align="center"><table width="100%" border="0" cellspacing="3" cellpadding="3"> <tr> <td width="10%" align="right" valign="middle" scope="col"><strong>LECTURER:</strong></td> <td width="28%" align="left" valign="middle" scope="col"> <?php $sqllec = "select * from lecturers where sn ='$lec_temp'"; $lec = mysql_query($sqllec); $row_lec = mysql_fetch_assoc($lec); echo $row_lec['namer']; ?> </td> <td width="62%" align="left" scope="col" style="color:#F00"><strong>KEYS:</strong>- FAC- Faculty, SEN- Senate, A- Approved, NYA- Not Yet Approved.</td> </tr> <tr> <td colspan="3" align="right" valign="middle" scope="col"><hr /></td> </tr> </table></td> </tr> <?php } ?> <tr> <td align="center"> <?php if($faculty !='' && $dept !='' && $course !=''){?> <div class="block2"> <table width="100%" border="1" cellspacing="3" cellpadding="3" style="border-collapse:collapse"> <tr> <td width="6%" rowspan="2" align="center" bgcolor="#CCCCCC" style="font-weight: bold">S/NO</td> <td width="45%" rowspan="2" align="left" bgcolor="#CCCCCC" style="font-weight: bold">STUDENT'S NAME</td> <td width="7%" rowspan="2" align="center" bgcolor="#CCCCCC" style="font-weight: bold">CA 40%</td> <td width="8%" rowspan="2" align="center" bgcolor="#CCCCCC" style="font-weight: bold">EXAM 60%</td> <td width="7%" rowspan="2" align="center" bgcolor="#CCCCCC" style="font-weight: bold">TOTAL 100%</td> <td colspan="3" align="center" bgcolor="#999999" style="font-weight: bold">APPROVAL STATUS</td> <td width="7%" colspan="3" align="center" bgcolor="#CCCCCC" style="font-weight: bold">ACTION</td> </tr> <tr> <td width="6%" align="center" bgcolor="#CCCCCC" style="font-weight: bold">DEPT</td> <td width="6%" align="center" bgcolor="#CCCCCC" style="font-weight: bold">FAC</td> <td width="6%" align="center" bgcolor="#CCCCCC" style="font-weight: bold">SEN</td> <td align="center" bgcolor="#FFBBDD" style="font-weight: bold">All <input type="checkbox" name="checkAll" id="checkAll" style="font-size:10px" /></td> </tr> <?php //if($faculty !='' && $dept !='' && $course !=''){ $sqlstud = "select a.sn, a.ca, a.exam, a.dept_status, a.fac_status, a.sen_status, surname, firstname, othernames, a.score from coursesregistered as a, coursestobetaken as b, students as c where b.sn='$course_temp' and a.coursesn=b.sn and a.matric=c.matric order by surname"; $stud = mysql_query($sqlstud); //$row_stud = mysql_fetch_assoc($stud); $k=1; while($row_stud = mysql_fetch_assoc($stud)){ ?><tr> <td align="center"><?php echo $k;?></td> <td align="left"><?php echo $row_stud['surname'].' '.$row_stud['firstname'].' '.$row_stud['othernames'];?></td> <td align="center"><?php echo $row_stud['ca'];?></td> <td align="center"><?php echo $row_stud['exam'];?></td> <td align="center"><?php echo $row_stud['score'];?></td> <td align="center" bgcolor="#00CC00"><?php echo $row_stud['dept_status'];?><input type="hidden" name="depts<?php echo $k; ?>" value="<?php echo $row_stud['dept_status'];?>" /></td> <td align="center" bgcolor="#FFAC84"><?php echo $row_stud['fac_status'];?><input type="hidden" name="facs<?php echo $k; ?>" value="<?php echo $row_stud['fac_status'];?>" /></td> <td align="center" bgcolor="#64B1FF"><?php echo $row_stud['sen_status'];?><input type="hidden" name="sens<?php echo $k; ?>" value="<?php echo $row_stud['sen_status'];?>" /></td> <td align="center"><input type="checkbox" name="checkbox<?php echo $k; ?>" id="checkbox<?php echo $k; ?>" <?php if($_SESSION['dtype'] == "exams" && $row_stud['dept_status'] == 'A'){ echo " checked='checked' value='A' "; } elseif($_SESSION['dtype'] == "records" && $row_stud['sen_status'] == 'A'){ echo " checked='checked' value='A' "; } elseif($_SESSION['dtype'] == "faculty" && $row_stud['fac_status'] == 'A'){ echo " checked='checked' value='A' "; }?> /> <input type="hidden" name="ssn<?php echo $k; ?>" value="<?php echo $row_stud['sn'];?>" /> </td> </tr> <?php $k++; } ?><input type="hidden" name="studnum" value="<?php echo ($k-1)?>" /> <tr> <td align="center"> </td> <td align="center"> </td> <td align="center" bgcolor="#CCCCCC"><span style="font-weight: bold">CA</span></td> <td align="center" bgcolor="#CCCCCC"><span style="font-weight: bold">EXAM</span></td> <td align="center" bgcolor="#CCCCCC"><span style="font-weight: bold">TOTAL</span></td> <td align="center" bgcolor="#CCCCCC" style="font-weight: bold">DEPT</td> <td align="center" bgcolor="#CCCCCC" style="font-weight: bold">FAC</td> <td align="center" bgcolor="#CCCCCC" style="font-weight: bold">SEN</td> <td align="center"> </td> </tr> <tr> <td colspan="9" align="center"> </td> </tr> <tr> <td colspan="9" align="right"> <table width="100%" border="0" cellspacing="3" cellpadding="3"> <tr> <td width="89%" scope="col" style="color: #F00"><strong>Please note:</strong> Result not yet approved by the faculty cannot be approved by the senate and result not yet approved by the department cannot be approved by the faculty.</td> <td width="11%" align="right" scope="col"><input onclick="submitFormStatus()" type="submit" name="submitButt" id="button" value="Submit" style="font-size:25px" /></td> </tr> </table> </td> </tr> </table></div></form> <?php } ?> </td> </tr> <tr> <td align="center"> </td> </tr> <tr> <td align="center"> </td> </tr> </table> <!--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> <script src="js/jquery-ui.js"></script> <script src="js/jquery.blockUI.js"></script> <script src="js/sweetalert.js"></script> <script src="js/sweetalert.min.js"></script> <script type="text/javascript"> function submitForm() { var mylink = "images/busy.gif"; $('div.block1').block({ message: '<h3><img src="'+mylink+'" /> Please wait... </h3>', css: { border: '1px solid #fff' } }); $('#form1').submit(); return; } function submitFormFac() { var mylink = "images/busy.gif"; $('div.block1').block({ message: '<h3><img src="'+mylink+'" /> Please wait... </h3>', css: { border: '1px solid #fff' } }); document.getElementById("dept").options.length = 0; $('#form1').submit(); return; } function submitFormStatus() { var mylink = "images/busy.gif"; $('div.block2').block({ message: '<h3><img src="'+mylink+'" /> Please wait... </h3>', css: { border: '1px solid #fff' } }); //$('#form1').submit(); //return; } $("#checkAll").click(function () { $('input:checkbox').not(this).prop('checked', this.checked); }); </script> <?php if($error != ''){ ?> <script type="text/javascript"> $(document).ready(function() { sweetAlert({title: "ERROR!", text: "<?php echo $error;?>", type: "warning"}) }); </script>"; <?php } ?> <?php if($success != ''){ ?> <script type="text/javascript"> $(document).ready(function() { sweetAlert({title: "Congrats!", text: "<?php echo $success;?>", type: "success"}) }); </script>"; <?php } ?>