<?php session_start();
include("dbcon/connect.php");
if(!isset($_SESSION['delsuresultadminid'])){
	header("location:index.php");
}else{
	$ddd=mysqli_query($con,"select * from notification_admin where id='".$_SESSION['delsuresultadminid']."'");
	$adm=mysqli_fetch_assoc($ddd);
}


$msg='';
if(isset($_REQUEST['update_doc'])){
	
	$fay=mysqli_query($con,"select id from notification_result where matric_no='".trim($_POST['l_matric_no'])."' and degree='".trim($_POST['l_degree'])."' AND id !='".$_POST['l_id']."'");
	
	if(mysqli_num_rows($fay)==0){
		
		$qqq1=mysqli_query($con,"update notification_result set sname='".$_POST['l_sname']."', fname='".$_POST['l_fname']."', mname='".$_POST['l_mname']."', matric_no='".$_POST['l_matric_no']."', degree='".$_POST['l_degree']."', discipline='".$_POST['l_discipline']."', class_degree='".$_POST['l_class_degree']."', grad_session='".$_POST['l_grad_session']."', reg_by='".($adm['lastname'].' '.$adm['othernames'])."' where id='".$_POST['l_id']."'");
		
		if($qqq1){
			
			$msg= '<script type="text/javascript">
        swal({   
			title: "SUCCESS",   
             type: "success", 
			text: "Document Details Updated",
			confirmButtonColor: "#2ecd99",   
		},
		function(){
			window.location="generator.php";
		});
			</script>';
			
		}else{
			$msg= '<script type="text/javascript">
        swal({   
			title: "OOPS",   
             type: "warning", 
			text: "Unable to complete operation, please try again later",
			confirmButtonColor: "#ffaa00",   
			});
			</script>';
		}
		
	}else{
		$msg= '<script type="text/javascript">
        swal({   
			title: "OOPS",   
             type: "warning", 
			text: "Student notification of result already processed...",
			confirmButtonColor: "#ffaa00",   
			});
			</script>';
	}
}


if(isset($_GET['print']) && isset($_GET['token'])){

$doc_id = base64_decode($_GET['print']);

$aha = mysqli_query($con,"SELECT * FROM notification_result where id='$doc_id'");
$result = mysqli_fetch_assoc($aha);

//////************START**************/////
//////*************START*************/////


require_once('topdf/examples/tcpdf_include.php');
	
	class MYPDF extends TCPDF {


	public function Header() {
        // get the current page break margin
        $bMargin = $this->getBreakMargin();
        // get current auto-page-break mode
        $auto_page_break = $this->AutoPageBreak;
        // disable auto-page-break
        $this->SetAutoPageBreak(false, 0);
        // set bacground image
        $img_file = './img/watermark2.png';

//$this->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
        $this->Image($img_file, 0, 0, 0, 0, '', '', '', false, 300, 'C', false, false, 0);
        // restore auto-page-break status
        $this->SetAutoPageBreak($auto_page_break, $bMargin);
        // set the starting point for the page content
        $this->setPageMark();
    }

 // Page footer
    public function Footer() {
		
		global $date;
		
        // Position at 15 mm from bottom
        $this->SetY(-20);
        // Set font
        $this->SetFont('helvetica', 'I', 8);
        // Page number
		
    }




}
	
	
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);



$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Inspire Polytechnic');
$pdf->SetTitle('Inspire Polytechnic Student Notification of Result');
$pdf->SetSubject('Student Notification of Result Print-Out');
$pdf->SetKeywords('Inspire Polytechnic, Student Notification of Result, Student');

/*$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER); */

$pdf->setPrintFooter(false);

$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, ' Printed: Today, '.$date, '(Inspire University Student Notification of Result)', array(255, 255, 255), array(255, 255, 255));

$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
//$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(10, 10, 10);
$pdf->SetHeaderMargin(10);
//$pdf->SetFooterMargin(10);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);


if (@file_exists(dirname(__FILE__).'topdf/examples/lang/eng.php')) {
	require_once(dirname(__FILE__).'topdf/examples/lang/eng.php');
	$pdf->setLanguageArray($l);
}

$pdf->SetFont('dejavusans', '', 10);

$tahoma_fontname = TCPDF_FONTS::addTTFfont('tahomabd.ttf', '', '', 32);
$pdf->AddFont($tahoma_fontname, '', 14, '', false);

$arial_fontname = TCPDF_FONTS::addTTFfont('arial.ttf', '', '', 32);
$pdf->AddFont($arial_fontname, '', 14, '', false);

$arialbd_fontname = TCPDF_FONTS::addTTFfont('arialbd.ttf', '', '', 32);
$pdf->AddFont($arialbd_fontname, '', 14, '', false);

$arlrdbd_fontname = TCPDF_FONTS::addTTFfont('arlrdbd.ttf', '', '', 32);
$pdf->AddFont($arlrdbd_fontname, '', 14, '', false);

$georgia_fontname = TCPDF_FONTS::addTTFfont('georgia.ttf', '', '', 32);
$pdf->AddFont($georgia_fontname, '', 14, '', false);

$madina_fontname = TCPDF_FONTS::addTTFfont('Madina.ttf', '', '', 32);
$pdf->AddFont($madina_fontname, '', 14, '', false);

$applebold_fontname = TCPDF_FONTS::addTTFfont('applebold.ttf', '', '', 32);
$pdf->AddFont($applebold_fontname, '', 14, '', false);

$pdf->AddPage();
$pdf->SetPrintFooter(true);

$style = array(
	'border' => 2,
	'vpadding' => 'auto',
	'hpadding' => 'auto',
	'fgcolor' => array(0,0,0),
	'bgcolor' => false,
	'position' =>'C',
	'module_width' => 1,
	'module_height' => 1
);

 $pdf->SetLineStyle( array( 'width' => 3, 'color' => array(42, 22, 111)));
$pdf->Rect(0, 0, $pdf->getPageWidth(), $pdf->getPageHeight()); 

	
$html='				
<div style="border-bottom:2px solid #d4d4f7;">
<table>
<tr>
<td style="width:10%;"></td>
<td style="width:80%;">
<h2 style="text-align:center; color:#1a79c1; font-family:'.$tahoma_fontname.'; font-size:22px; margin-bottom:-200px;">
<img src="img/header_logo.png" style="width:400px;">
</h2>

<br><br>

<h2 style="text-align:center; color:black; font-family:Arial; font-size:19px; margin-top:;">
<span style="text-align:center; margin-top:-10px;font-size:20px; color:#be1e20; font-family:'.$arialbd_fontname.'; font-weight:bolder;">OFFICE OF THE REGISTRAR</span>
<br>
<span style="text-align:center; margin-top:-10px;font-size:16px;color:black; font-family:'.$arialbd_fontname.';">(ACADEMIC OFFICE)</span>
</h2>
</td>
<td style="width:10%;"> </td>
</tr>
</table> 
</div>
<br><br><br>

<table>
<tr>
<td style="width:40%;">
<span style="text-align:center; font-size:13px; color:black; font-family:'.$arialbd_fontname.';">Our Ref No: <span style="text-decoration:underline;"> '.$result['ref_no'].' </span> </span>
</td>
<td style="width:20%;"></td>
<td style="width:40%;">
<span style="text-align:center; font-size:13px; color:black; font-family:'.$arialbd_fontname.';">Date: <span style="text-decoration:underline;"> '.explode(",",$result['date'])[0].' </span></span>
</td>
</tr>
</table> 

<br><br><br><br><br>

<div>
<h2 style="text-align:center; color:#be1e20; font-family:'.$georgia_fontname.'; font-size:20px;">NOTIFICATION OF RESULT</h2>
</div>

<br><br><br><br><br><br><br><br><br>

<h1 style="text-align:center; color:black; font-family:'.$madina_fontname.'; font-size:35px; font-weight:bold;">This is to certify that:</h1>

<br><br>

<div align="center">
<h2 style="text-decoration:; text-align:center; font-family:'.$arlrdbd_fontname.'; font-size:20px;">'.'    '.strtoupper($result['sname'].' '.$result['fname'].' '.$result['mname']).'    '.'</h2>
</div>

<br><br>

<span style="font-family:'.$applebold_fontname.'; font-size:15px; text-align:left;">with Matriculation Number <span style="font-weight:900;">'.strtoupper($result['matric_no']).'</span> having completed the approved course of study and having passed all the prescribed examinations, has under the authority of the Academic Board been awarded</span>


<div align="center">
<h2 style="text-decoration:; text-align:center; font-family:'.$arlrdbd_fontname.'; font-size:17px; line-height:1.3;">'.strtoupper($result['degree'].' IN '.$result['discipline']).'
</h2>
<br>
<h2 style="text-decoration:; text-align:center; font-family:'.$arlrdbd_fontname.'; font-size:17px; line-height:1.3;">
'.strtoupper($result['class_degree']).'
</h2>
<br>
<h2 style="text-decoration:; text-align:center; font-family:'.$arlrdbd_fontname.'; font-size:17px; line-height:1.3;">
'.strtoupper($result['grad_session']).' GRADUATION SESSION
</h2>

<span style="font-family:'.$applebold_fontname.'; font-size:15px; text-align:left;">This Notification of Result is issued to you in lieu of the certificate which will be ready in due couse.</span><br>
<span style="font-family:'.$applebold_fontname.'; font-size:15px; text-align:left;">Please accept our warm congratulations, on this laudably achievement.</span><br><br>
<span style="font-family:'.$applebold_fontname.'; font-size:15px; text-align:left;">Kindly note that this Notification of Result is valid for two years only.</span>

</div>

<br><br><br><br> <br><br><br><br> <br>

<table>
<tr>
<td style="width:40%; border-top:1px solid black;">
<span style="text-align:center; font-size:13px; color:black; font-family:'.$arialbd_fontname.'; font-size:16px;">RECTOR </span>
</td>
<td style="width:20%;"></td>
<td style="width:40%; border-top:1px solid black;">
<span style="text-align:center; font-size:13px; color:black; font-family:'.$arialbd_fontname.'; font-size:16px;">REGISTRAR </span>
</td>
</tr>
</table> 



					';



							
$pdf->writeHTML($html, true, false, true, false, '');

$nrr = array(" ","-","_","'","/",".",",");
$smatric = str_replace($nrr,'',$result['matric_no']);


$pdf->Output($smatric.'_NotificationOfResult.pdf', 'I');	



	
	/////////////////////////////////////////// END PRINTING ///////////////
	/////////////////////////////////////////// END PRINTING ///////////////
	/////////////////////////////////////////// END PRINTING ///////////////


//////**************END************/////
//////**************END************/////








	
}




?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<title>Records of Generated Notification of Results :: Lagos State University, Student Results Management System</title>
	<meta name="description" content="Inspire Polytechnic, Automated Student Notification of Result System" />
	<meta name="keyword" content="Inspire Polytechnic, Notification of Result, Student, Results Management System, Education" />
	<meta name="author" content="Dosumu Ololade"/>
    <link rel="icon" href="img/favicon.png">
	<link href="../<?php echo $host_folder;?>/vendors/bower_components/datatables/media/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
	<link href="../<?php echo $host_folder;?>/vendors/bower_components/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
		<link href="../<?php echo $host_folder;?>/vendors/bower_components/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet" type="text/css"/>
		
		<link href="../<?php echo $host_folder;?>/vendors/bower_components/dropify/dist/css/dropify.min.css" rel="stylesheet" type="text/css"/>
		
		<link href="../<?php echo $host_folder;?>/vendors/bower_components/select2/dist/css/select2.min.css" rel="stylesheet" type="text/css"/>
		<link href="../<?php echo $host_folder;?>/vendors/bower_components/bootstrap-select/dist/css/bootstrap-select.min.css" rel="stylesheet" type="text/css"/>
		
	<link href="../<?php echo $host_folder;?>/dist/css/style.css" rel="stylesheet" type="text/css">
		
		<script src="../<?php echo $host_folder;?>/sweetalert/dist/jquery-2.1.3.min.js"></script>
	<script src="../<?php echo $host_folder;?>/sweetalert/dist/sweetalert-dev.js"></script>
	<link rel="stylesheet" href="../<?php echo $host_folder;?>/sweetalert/dist/sweetalert.css">
	
	
</head>

<body>
	<!--Preloader-->
	<div class="preloader-it">
		<div class="la-anim-1"></div>
	</div>
	<!--/Preloader-->
    <div class="wrapper theme-6-active pimary-color-green">
		<!-- Top Menu Items -->
		<nav class="navbar navbar-inverse navbar-fixed-top">
			<div class="mobile-only-brand pull-left">
				<div class="nav-header pull-left">
					<div class="logo-wrap">
						<a href="dashboard.php">
							<img class="brand-img" style="width:140px;" src="img/logo.png" alt="logo"/>
							
						</a>
					</div>
				</div>	
				<a id="toggle_nav_btn" class="toggle-left-nav-btn inline-block ml-20 pull-left" href="javascript:void(0);"><i class="zmdi zmdi-menu"></i></a>
				
			</div>
			<div id="mobile_only_nav" class="mobile-only-nav pull-right">
				<ul class="nav navbar-right top-nav pull-right">
					<li class="dropdown auth-drp">
						<a href="#" class="dropdown-toggle pr-0" data-toggle="dropdown"> <?php echo ucwords($adm['lastname']); ?> <img src="../<?php echo $host_folder;?>/img/avatar.png" alt="user_auth" class="user-auth-img img-circle"/><span class="user-online-status"></span></a>
						<ul class="dropdown-menu user-auth-dropdown" data-dropdown-in="flipInX" data-dropdown-out="flipOutX">
							<li>
								<a href="logout.php"><i class="zmdi zmdi-power"></i><span>Log Out</span></a>
							</li>
						</ul>
					</li>
				</ul>
			</div>	
		</nav>
		<!-- /Top Menu Items -->
		
		<!-- Left Sidebar Menu -->
		<div class="fixed-sidebar-left">
			<ul class="nav navbar-nav side-nav nicescroll-bar">
				<li class="navigation-header">
					<span>Portal Admin</span> 
					<i class="zmdi zmdi-more"></i>
				</li>
				
				<li>
					<a href="dashboard.php"><div class="pull-left"><i class="fa fa-dashboard mr-20"></i><span class="right-nav-text">Dashboard</span></div>
					<div class="clearfix"></div></a>
				</li>
				
				
					<li>
					<a href="generator.php" class="active"><div class="pull-left"><i class="fa fa-file-text-o mr-20"></i><span class="right-nav-text">Generated Docs</span></div> <div class="clearfix"></div></a>
				</li>
				
				<li><hr class="light-grey-hr mb-10"/></li>
				<li>
					<a href="profile.php"><div class="pull-left"><i class="fa fa-universal-access mr-20"></i><span class="right-nav-text">Profile</span></div><div class="clearfix"></div></a>
				</li>
				<li>
					<a href="logout.php"><div class="pull-left"><i class="fa fa-power-off mr-20"></i><span class="right-nav-text">Logout</span></div><div class="clearfix"></div></a>
				</li>
			</ul>
		</div>
		<!-- /Left Sidebar Menu -->
		
		
		
		
		<!-- Right Sidebar Backdrop -->
		<div class="right-sidebar-backdrop"></div>
		<!-- /Right Sidebar Backdrop -->

        <!-- Main Content -->
		<div class="page-wrapper">
            <div class="container-fluid pt-25">
					
					<div class="row">
					
					<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
						<div class="panel panel-success card-view pa-0">
							<div class="panel-wrapper collapse in">
								<div class="panel-body pa-0">
						<div align="center"><img src="img/logo1.png" style="width:250px; padding:13px;" class="img-responsive"></div>
									
								</div>
							</div>
						</div>
					</div>
					
					<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
						<div class="panel panel-default card-view ">
							<div class="panel-wrapper collapse in">
								<div class="panel-body pa-0">
									<div class="sm-data-box">
										<div class="container-fluid">
											<div class="row">
												<div style="margin-top:-12px;margin-bottom:-12px;" class="col-md-12 text-center pl-0 pr-0 data-wrap-left">
													<span class="txt-dark block counter" style="font-weight:600;">
													<i class="fa fa-cogs"></i> GENERATED DOCUMENTS</span>
												</div> 
												
											</div>	
										</div>
									</div>
								</div>
							</div>
						</div>
							
					</div>
					
				</div>
					
				<!-- Row -->
					<br>
				
				<div class="row">
					
					
					<div class="col-lg-12 col-xs-12">
					
					
					<div class="panel  panel-primary card-view">
					<div class="panel-heading">
									<div class="pull-left">
										<h6 class="panel-title" style="color:white; font-weight:bold; font-size:15px; margin-top:-10px; margin-bottom:-10px;">Generated Notification of Results</h6>
									</div> <div class="clearfix"></div>
									</div>
								
									<div class="panel-body"> 
									<div class="error"><?php echo $msg;?></div>
							
										<div class="table-responsive">

											<table id="example" class="table table-hover table-bordered mb-0">
											<thead>
											  <tr style="font-size:12px;">
												<th >#</th>
												<th>Action</th>
												<th>Ref No.</th>
												<th>Auth Code</th>
												<th>Gen Date</th>
												<th>FullName</th>
												<th>Matric No.</th>
												<th>Discipline</th>
												<th>Degree Awarded</th>
												<th>Class of Degree</th>
												<th>Session of Grad.</th>
												<th>Email</th>
												<th>Reg By</th>
												<th>Edit</th>
												<th>Del</th>
											  </tr>
											</thead>
											<tbody>
											<?php
												$nos=0;
			// ref_no 	sname 	fname 	mname 	matric_no 	discipline 	degree 	class_degree 	grad_session 	email 	reg_by 	date 	code 	 
				$kat=mysqli_query($con,"select * from notification_result order by id desc");
				while($sac=mysqli_fetch_assoc($kat)){
				$nos=$nos+1;
														
														echo '<tr style="font-size:12px;" id="'.$sac['id'].'">
														<td>'.$nos.'.</td>
														<td align="center">					
						<a href="?print='.base64_encode($sac['id']).'&token='.uniqid().'" class="btn btn-default" style="padding:7px 11px;">Print <i class="fa fa-print"></i></a>
											</td>
														<td>'.$sac['ref_no'].'</td>
														<td>'.$sac['code'].'</td> 
														<td>'.$sac['date'].'</td>
														<td>'.strtoupper($sac['sname'].' '.$sac['fname'].' '.$sac['mname']).'</td>
														<td>'.$sac['matric_no'].'</td>
														<td>'.$sac['discipline'].'</td>
														<td>'.$sac['degree'].'</td>
														<td>'.$sac['class_degree'].'</td>
														<td>'.$sac['grad_session'].'</td>
														<td>'.$sac['email'].'</td> 
														<td>'.$sac['reg_by'].'</td> 
						
						<td align="center">					
				        <a href="javascript:void(0)" 
						id="'.$sac['id'].'***'.$sac['sname'].'***'.$sac['fname'].'***'.$sac['mname'].'***'.$sac['matric_no'].'***'.$sac['discipline'].'***'.$sac['degree'].'***'.$sac['class_degree'].'***'.$sac['grad_session'].'" 
						data-toggle="modal" data-target="#modal_doc" class="edit_doc text-primary" style="font-size:19px;"><i class="fa fa-edit"></i></a>
											</td>
						
						<td align="center">					
						<a href="javascript:void(0)" id="'.$sac['id'].'" class="delete_doc text-danger" style="font-size:19px;"><i class="fa fa-trash"></i></a>
											</td>
														
														
														</tr>';
												}
												
											 ?>
											
											</tbody>
											</table>  
											
										</div>
									
											
									</div>
							</div>
					
					
					
					
					
					</div>
				
					
				</div>
				<!-- /Row -->
				
				<!-- id  sname 	fname 	mname 	matric_no 	discipline 	degree 	class_degree 	grad_session -->
				
				<div id="modal_doc" class="modal fade" tabindex="-1" data-backdrop="static" data-keyboard="false" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
											<div class="modal-dialog">
												<div class="modal-content">
												
													<div class="modal-header">
														<button type="button" class="close close_modal" data-dismiss="modal" aria-hidden="true">×</button>
														<h4 class="modal-title" style="font-size:20px; color:black;">Edit Document</h4>
													</div>
													<div class="modal-body">
														<form method="post">
														<input type="hidden" name="l_id" id="l_id">		

													<div class="row">
													<div class="form-group col-md-6">
                             <label class="control-label mb-5" for="email_de">Lastname</label>
												<input type="text" class="form-control" name="l_sname" id="l_sname" required>
                                                </div>
													<div class="form-group col-md-6">
                             <label class="control-label mb-5" for="email_de">Firstname</label>
												<input type="text" class="form-control" name="l_fname" id="l_fname" required>
                                                </div>
													<div class="form-group col-md-6">
                             <label class="control-label mb-5" for="email_de">Middlename</label>
												<input type="text" class="form-control" name="l_mname" id="l_mname">
                                                </div>
													<div class="form-group col-md-6">
                             <label class="control-label mb-5" for="email_de">Matric No.</label>
												<input type="text" class="form-control" name="l_matric_no" id="l_matric_no" required>
                                                </div>
													<div class="form-group col-md-6">
                             <label class="control-label mb-5" for="email_de">Discipline</label>
												<input type="text" class="form-control" name="l_discipline" id="l_discipline" required>
                                                </div>
													<div class="form-group col-md-6">
                             <label class="control-label mb-5" for="email_de">Awarded Degree</label>
												<input type="text" class="form-control" name="l_degree" id="l_degree" required>
                                                </div>
													<div class="form-group col-md-6">
                             <label class="control-label mb-5" for="email_de">Class of Degree</label>
												<input type="text" class="form-control" name="l_class_degree" id="l_class_degree" required>
                                                </div>
													<div class="form-group col-md-6">
                             <label class="control-label mb-5" for="email_de">Session of Graduation</label>
									<input type="text" class="form-control" name="l_grad_session" id="l_grad_session" required>
                                                </div>
												
													</div>
													
													<button type="submit" name="update_doc" value="<?php echo uniqid();?>" class="btn btn-primary pull-right">Update</button> <div class="clearfix"></div>
										
														</form>
													</div>
													<div class="modal-footer" style="border-top:1px solid lavender;">
						<button type="button" class="btn btn-danger btn-sm close_modal pull-left" data-dismiss="modal">Close</button>
						<div class="clearfix"></div>
													</div>
												</div>
											</div>
										</div>
				
				
			
			</div>
			<!-- Footer -->
			<footer class="footer container-fluid pl-30 pr-30">
				<div class="row">
					<div class="col-sm-12">
						<p style="text-align:center;"> &copy; Copyright <?php echo date("Y");?> Inspire Polytechnic. All right reserved</p>
					</div>
				</div>
			</footer>
			<!-- /Footer -->
			
		</div>
        <!-- /Main Content -->

    </div>
    <!-- /#wrapper -->
	
	<!-- JavaScript -->
	
    <!-- jQuery -->
    <script src="../<?php echo $host_folder;?>/vendors/bower_components/jquery/dist/jquery.min.js"></script>
	
	<script>
	jQuery().ready(function(){
		
		$("select#s_programme").change(function(){
			var s_prog = $(this).val();
			if(s_prog!=''){
			$.ajax({
						type: "POST",
                        url: "operation.php",
                        data: ({s_prog:s_prog}),
                        cache: false,
                        success: function(data){ 
							$("div.s_semester_result").html(data);
						 } 
 });
		}else{
			$("div.s_semester_result").html('<div class="form-group semester_result">\
                             <label class="control-label mb-5" for="email_de">Semester</label>\
												<select class="form-control" name="status" required >\
												<option value="">Select</option>\
												</select>\
                                                </div>');
		}
		});
		
		
		$("select#programme").change(function(){
			var prog = $(this).val();
			if(prog!=''){
			$.ajax({
						type: "POST",
                        url: "operation.php",
                        data: ({prog:prog}),
                        cache: false,
                        success: function(data){ 
							$("div.semester_result").html(data);
						 } 
 });
		}else{
			$("div.semester_result").html('<div class="form-group semester_result">\
                             <label class="control-label mb-5" for="email_de">Semester</label>\
												<select class="form-control" name="status" required >\
												<option value="">Select</option>\
												</select>\
                                                </div>');
		}
		});
		
		
$('#example').DataTable( {
		      "paging": true,
      "lengthChange": false,
      "searching": true,
      "ordering": false,
      "info": true,
      "autoWidth": false,
		dom: 'Blfrtip',
		buttons: [
			'excel', 'pdf', 'print'
		],
		
		"fnDrawCallback": function(oSettings){
			
		$("a.lecturer_log").click(function(){
		$("div.error").html('<div class="alert alert-info alert-dismissable">\
		<p class="pull-left" style="margin-bottom:-6px;"><i class="fa fa-spin fa-spinner"></i> Processing Request...</p><div class="clearfix"></div>\</div>');
			var lecturer_log = $(this).attr("id");
			$.ajax({
						type: "POST",
                        url: "operation.php",
                        data: ({lecturer_log:lecturer_log}),
                        cache: false,
                        success: function(data){ 
							$("div.error").html(data);
						 } 
 });
		});
			
		$("a.assigned_course").click(function(){
		$("div.error").html('<div class="alert alert-info alert-dismissable">\
		<p class="pull-left" style="margin-bottom:-6px;"><i class="fa fa-spin fa-spinner"></i> Processing Request...</p><div class="clearfix"></div>\</div>');
			var assigned_course = $(this).attr("id");
			$.ajax({
						type: "POST",
                        url: "operation.php",
                        data: ({assigned_course:assigned_course}),
                        cache: false,
                        success: function(data){ 
							$("div.error").html(data);
						 } 
 });
		});
			
			
			
				  $("a.delete_doc").click(function(){
		var delete_doc = $(this).attr("id");
		if(confirm("Are you sure you want to delete document?"))
		  {
			  $("div.error").html('<div class="alert alert-info alert-dismissable">\
		<p class="pull-left" style="margin-bottom:-6px;"><i class="fa fa-spin fa-spinner"></i> Processing Request...</p><div class="clearfix"></div>\</div>');
			$.ajax({
						type: "POST",
                        url: "operation.php",
                        data: ({delete_doc:delete_doc}),
                        cache: false,
                        success: function(data){ 
						$("div.error").html(' ');
							$("tr#"+delete_doc).animate({ backgroundColor: "#fbc7c7" }, "fast").animate({ opacity: "hide" }, "slow");
						 } 
 });
 }

return false;
	});
			
			
		$("a.edit_doc").click(function(){
			
		var edit_value=$(this).attr("id");
		
		//id  sname 	fname 	mname 	matric_no 	discipline 	degree 	class_degree 	grad_session
		
		var role_value=edit_value.split('***');
		$("input#l_id").val(role_value[0]);
		$("input#l_sname").val(role_value[1]);
		$("input#l_fname").val(role_value[2]);
		$("input#l_mname").val(role_value[3]);
		$("input#l_matric_no").val(role_value[4]);
		$("input#l_discipline").val(role_value[5]);
		$("input#l_degree").val(role_value[6]);
		$("input#l_class_degree").val(role_value[7]);
		$("input#l_grad_session").val(role_value[8]);
		});
			
			
			
		$("a.ass_role").click(function(){
			
		var ass_role=$(this).attr("id");
		
		var role_value=ass_role.split('_');
		$("input#staff_id").val(role_value[1]);
		$("input#depcode").val(role_value[5]);
		$("input#l_name").val(role_value[0]);
		$("input#l_department").val(role_value[3]);
		$("input#l_faculty").val(role_value[4]);
		$("input#l_role").val(role_value[2]);
		});
			
		
		$("a.edit_course").click(function(){
		var edit_course = $(this).attr("id");
		
		$("div.result").html('<div align="center"><i class="fa fa-spin fa-spinner fa-2x" style="color:gray;"></i></div>');
		
			$.ajax({
						type: "POST",
                        url: "operation.php",
                        data: ({edit_course:edit_course}),
                        cache: false,
                        success: function(data){ 
							$("div.result").html(data);
						 } 
 });
		
	});
		
		}
	} );
		
		
		$("form#form_submit1").on('submit',(function(e){
			e.preventDefault();
			
	$("div.search_result").html("<p class='text-primary' style='padding:5px; text-align:center;'><i class='fa fa-spin fa-spinner'></i> Processing Request...</p>");
	
				$.ajax({
						type: "POST",
                        url: "operation.php",
                        data: new FormData(this),
						contentType:false,
						processData:false,
                        cache: false,
                        success: function(data){ 
						$("div.search_result").html(data);
						}
    });			
	
	
		}));
		
		$("form#form_submit").on('submit',(function(e){
			e.preventDefault();
			
	$("div.msg").html("<p class='text-primary' style='padding:5px; text-align:center;'><i class='fa fa-spin fa-spinner'></i> Processing Request...</p>");
	
				$.ajax({
						type: "POST",
                        url: "operation.php",
                        data: new FormData(this),
						contentType:false,
						processData:false,
                        cache: false,
                        success: function(data){ 
						$("div.msg").html(data);
						}
    });			
	
	
		}));
		
		
	});
	</script>
	

    <!-- Bootstrap Core JavaScript -->
    <script src="../<?php echo $host_folder;?>/vendors/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
	<script src="../<?php echo $host_folder;?>/vendors/bower_components/dropify/dist/js/dropify.min.js"></script>
		<script src="../<?php echo $host_folder;?>/dist/js/form-file-upload-data.js"></script>
	
	<!-- Switchery JavaScript -->
		<script src="../<?php echo $host_folder;?>/vendors/bower_components/switchery/dist/switchery.min.js"></script>
		<script src="../<?php echo $host_folder;?>/vendors/bower_components/sweetalert/dist/sweetalert.min.js"></script>
		
		
		<!-- Data table JavaScript -->
	<script src="../<?php echo $host_folder;?>/vendors/bower_components/datatables/media/js/jquery.dataTables.min.js"></script>
	<script src="../<?php echo $host_folder;?>/vendors/bower_components/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
	<script src="../<?php echo $host_folder;?>/vendors/bower_components/datatables.net-buttons/js/buttons.flash.min.js"></script>
	<script src="../<?php echo $host_folder;?>/vendors/bower_components/jszip/dist/jszip.min.js"></script>
	<script src="../<?php echo $host_folder;?>/vendors/bower_components/pdfmake/build/pdfmake.min.js"></script>
	<script src="../<?php echo $host_folder;?>/vendors/bower_components/pdfmake/build/vfs_fonts.js"></script>
	
	<script src="../<?php echo $host_folder;?>/vendors/bower_components/datatables.net-buttons/js/buttons.html5.min.js"></script>
	<script src="../<?php echo $host_folder;?>/vendors/bower_components/datatables.net-buttons/js/buttons.print.min.js"></script>
	<!--<script src="dist/js/export-table-data.js"></script>-->
	
	
	<script type="text/javascript" src="../<?php echo $host_folder;?>/vendors/bower_components/moment/min/moment-with-locales.min.js"></script>
		<script src="../<?php echo $host_folder;?>/vendors/bower_components/mjolnic-bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>
		<script type="text/javascript" src="../<?php echo $host_folder;?>/vendors/bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
		<!--<script src="../<?php echo $host_folder;?>/dist/js/form-picker-data.js"></script>
		
		
		<script src="../<?php echo $host_folder;?>/dist/js/form-advance-data.js"></script>-->

	

	
	<!-- Slimscroll JavaScript -->
	<script src="../<?php echo $host_folder;?>/dist/js/jquery.slimscroll.js"></script>
	
	<!-- Fancy Dropdown JS -->
	<script src="../<?php echo $host_folder;?>/dist/js/dropdown-bootstrap-extended.js"></script>
	
	<!-- Switchery JavaScript -->
	<script src="../<?php echo $host_folder;?>/vendors/bower_components/switchery/dist/switchery.min.js"></script>
	
	<!-- Bootstrap Tagsinput JavaScript -->
	
		

	
		<script src="../<?php echo $host_folder;?>/vendors/bower_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js"></script>
	<script src="../<?php echo $host_folder;?>/dist/js/init.js"></script>
	
		<script src="../<?php echo $host_folder;?>/vendors/bower_components/select2/dist/js/select2.full.min.js"></script>
	<script src="../<?php echo $host_folder;?>/dist/js/form-advance-data.js"></script>
	
	<script src="../<?php echo $host_folder;?>/dist/js/dashboard-data.js"></script>



</body>

</html>
