<?php require "_header.php"; ?>
<div id="report-content">

	<?php
	if ($_REQUEST["ID"] != "" && isset($_REQUEST["ID"])) {
		$certificate_no = Escape($_REQUEST["ID"]);
		$student_id = Escape($_REQUEST["student_id"]);
		$header_row_string = "";
		$limit = 1;
		$start = 0;
		$condition = "";
		$order_field = "";
		$order_type = "";

		if ($certificate_no != "") {
			$condition .= " and cm.certificate_no='$certificate_no'";
		}
		if ($student_id != "") {
			$condition .= " and cm.student_id='$student_id'";
		}

		$objmlhp = new MlhpCertificateMgmt();
		$out = $objmlhp->getAllRecords($limit, $start, $condition, $order_field, $order_type);
		if (dbRows($out)) {
			$row = dbArray($out);
			extract($row);
		}
	}

	if ($student_gender == 'Male') {
		$var = "His";
		$var2 = "his";
		$var3 = "him";
		$rel = "Son";
		$gn = "He";
	} else {
		$var = "Her";
		$var2 = "her";
		$var3 = "her";
		$char = "Miss.";
		$rel = "Daughter";
		$gn = "She";
		if ($marital_status == 'Married') {
			$char = "Mrs.";
			$rel = "Wife";
		}
	}

	if ($student_active == 'Yes') {
		$active = 'is';
	} else {
		$active = 'was';
	}

	$year_parts = explode('-', $year_name);
	$formatted_year = $year_parts[0] . '/' . substr($year_parts[1], -2);

	$withHeader = isset($_GET['withHeader']) ? $_GET['withHeader'] : 'false';
	?>

	<?php ob_start(); //starting for 
	?>
	<table width="90%" style="border:3px solid #000;" cellpadding="3" cellspacing="3" align="center" class="ver12">
		<?php if ($withHeader == 'true') { ?>
			<tr>
				<td colspan="4" align="center">
					<img src="<?php echo $SiteBaseUrl . $CollegeImagePath . $_SESSION["VedantnrCollegeLogo"]; ?>"
						alt="College Logo" style="width: 80px; height: auto; float: left; margin-right: 10px;">
						<div style="display: inline-block; vertical-align: middle;">
									<b style="font-size: 30px;"><?php echo $_SESSION["VedantnrCollegeName"]; ?></b><br>
									<?php echo $_SESSION["VedantnrCollegeAddress"]; ?><br>
									Phone: <?php echo $_SESSION["VedantnrCollegePhone"]; ?>&nbsp;&nbsp;
									Email: <?php echo $_SESSION["VedantnrCollegeEmail"]; ?>
								</div>
				</td>
				</td>
			</tr>

			<tr>
				<td colspan="2">
					<hr>
				</td>
			</tr>
		<?php } ?>
		<tr>
			<td colspan="4" style="text-align:center; font-size: 148%;">
				<h2><b><u>CRETIFICATE OF COMPLETION OF MIDDLE LEVEL<br> HEALTH PROVIDER(MLHP)LOGBOOK</u></b></h2>
			</td>
		</tr>
		<tr style="line-height:20px; ">
			<td style="text-align:left;">&nbsp;</td>
			<td style="text-align:right "><b>MLHP Certificate No : <u><?php print $certificate_no; ?></u></b></td>

		</tr>

		<tr style="line-height:12px">
			<td colspan="2">
				<p style="line-height: 1.6;">This is to certifiy that <?php echo $char; ?>
					<b><u><?php echo $student_name; ?></u></b>
					has successfully completed a training of Middle Level Health Provider(MLHP) abd logbook prescribed
					by Ministry of health and Family Welfare, Government of India in Post
					Basic <?php echo $branch_name; ?> <?php echo $formatted_year; ?> Form
					<b><u><?php echo $_SESSION["VedantnrCollegeName"]; ?>, Mota Sonela, Lunawada.</u></b>
				</p>
				<p style="line-height: 1.6;"> Under Provision of Indian Nursing Council Notification No. 1-2/NEC/2019,
					12th February 2019.</p>
			</td>
		</tr> <br />


		<tr style="line-height:45px">
			<td style="text-align:left" colspan="2">&nbsp;</td>
		</tr>
		<tr style="line-height:12px">
			<td style="text-align:left"><b>Date of Issue :
					<?php print date("d/m/Y", strtotime($mlhpcertificate_date)); ?></b></td>
		</tr>
		<tr>
			<td style="text-align:left"><b>Place : Mota Sonela, Lunawad.</b></td>
		</tr>
		<tr>
			<td style="text-align:left">&nbsp;</td>

			<td style="text-align:right"><b><span style="padding-right:68px;padding-top:50px;">PRINCIPAL,</span></br>
					<span
						style="padding-right:4px;padding-top:50px;"><?php echo $_SESSION['aCollegeName']; ?>,</span><br>
					<span style="padding-right:21px;padding-top:50px;">Mota Sonela, Lunawada.</span></b></td>
		</tr>
	</table>
	<br />

</div>
<?php $HtmlCode = ob_get_contents();
ob_end_flush();
$HtmlUrl = "student-mlhp-certificate-report-" . $_SESSION["VedantnrUserId"] . ".html";
$HtmlPath = "report/" . $HtmlUrl;
createHTMLReportPage($header_row_string, $HtmlUrl, $HtmlPath, $HtmlCode, false);
?>
<br />
<form name="frm" id="frm" action="" method="post" align="center">
	<input type="hidden" name="txtFile" id="txtFile" value="<?php echo $HtmlUrl; ?>" />
	<input type="button" name="btnPrint" id="btnPrint" value="Print" onClick="SetPageAction('PRINT');" />
	<input type="button" name="btnPdf" id="btnPdf" value="Create PDF" onclick="SetPageAction('PDF');" />
	<input type="button" name="btnHtml" id="btnHtml" value="Create HTML" onclick="SetPageAction('HTML');" />
	<input type="button" name="btnWord" id="btnWord" value="Create WORD" onclick="SetPageAction('WORD');" />
	<input type="button" name="btnExcel" id="btnExcel" value="Create EXCEL" onclick="SetPageAction('Excel');" />
</form>
<script language="javascript" type="text/javascript">
	function SetPageAction(varAction) {
		if (varAction == "PRINT") {
			document.frm.action = "print/create-print.php";
			document.frm.submit();
		}
		if (varAction == "PDF") {
			document.frm.action = "convertpdf/create-pdf.php";
			document.frm.target = "_blank";
			document.frm.submit();
		}
		else if (varAction == "HTML") {
			document.frm.action = "<?php echo $HtmlPath; ?>";
			document.frm.target = "_blank";
			document.frm.submit();
		}
		else if (varAction == "WORD") {
			document.frm.action = "convertword/create-word.php";
			document.frm.target = "_blank";
			document.frm.submit();
		}
		else if (varAction == "Excel") {
			document.frm.action = "convertword/create-excel.php";
			document.frm.target = "_blank";
			document.frm.submit();
		}
	}
</script>
<?php require "_footer.php"; ?>