<?php require "_header.php";
error_reporting(1); ?>
<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'";
		}

		$objmidwifery = new midwiferyCertificateMgmt();
		$out = $objmidwifery->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 MIDWIFERY<br>&<br>GYNAECOLOGICAL NURSING</u></b></h2>
			</td>
		</tr>
		<tr style="line-height:12px">
			<td colspan="1">
				<p style="line-height: 1.6;">This is to certify that <?php echo $char; ?>
					<b><u><?php echo $student_name; ?></u></b>
					has attended the cases as under during <?php echo $var2; ?> MIdwifery and gynaecological Nursing
					training at our
					institution during <?php echo $var2; ?>
					<b><u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</u></b>
					<?php echo $branch_name; ?> course in the academic year <b><u><?php echo $year_name; ?></u></b>
					(theory 140hrs. + Practical 560hrs. in third year)
				</p>
			</td>
		</tr> <br />
		<tr>
			<td colspan="2" align="center">
				<table width="90%"  cellpadding="3" cellspacing="3" align="center" class="ver12">
					<tr>
						<td>1.</td>
						<td>Normal delivery witnessed before conducting personally</td>
						<td>-</td>
						<td>30</td>
					</tr>
					<tr>
						<td>2.</td>
						<td>Deliveries personally conducted</td>
						<td>-</td>
						<td>20</td>
					</tr>
					<tr>
						<td>3.</td>
						<td>Postnatal care to mothers and their newborns</td>
						<td>-</td>
						<td>30</td>
					</tr>
					<tr>
						<td>4.</td>
						<td>Antenatal cases examined</td>
						<td>-</td>
						<td>30</td>
					</tr>
					<tr>
						<td>5.</td>
						<td>Vaginal examination carried out</td>
						<td>-</td>
						<td>05</td>
					</tr>
					<tr>
						<td>6.</td>
						<td>Episiotomy Suturing Performed</td>
						<td>-</td>
						<td>05</td>
					</tr>
					<tr>
						<td>7.</td>
						<td>Skin Suturing done for first degree tear</td>
						<td>-</td>
						<td>02</td>
					</tr>
					<tr>
						<td>8.</td>
						<td>Abnormal vaginal deliveries witnessed/Forceps/Vacuum</td>
						<td>-</td>
						<td>02</td>
					</tr>
					<tr>
						<td>9.</td>
						<td>Caesarean Section Witnessed</td>
						<td>-</td>
						<td>05</td>
					</tr>
					<tr>
						<td>10.</td>
						<td>Group health teaching for Antenatal & Postnatal mothers</td>
						<td>-</td>
						<td>10</td>
					</tr>
					<tr>
						<td>11.</td>
						<td >Care Studies
								<tr>
									<td>&nbsp;&nbsp;&nbsp;&nbsp;i.</td>
									<td>Personally delivered cases</td>
									<td>-</td>
									<td>15</td>
								</tr>
								<tr>
									<td>&nbsp;&nbsp;&nbsp;&nbsp;ii.</td>
									<td>Postnatal care studies</td>
									<td>-</td>
									<td>05</td>
								</tr>
								<tr>
									<td>&nbsp;&nbsp;&nbsp;&nbsp;iii.</td>
									<td>Antenatal care studies</td>
									<td>-</td>
									<td>30</td>
								</tr>
						</td>
					</tr>
			</table>
		</td>
	</tr>
	<tr style="line-height:12px">
		<td colspan="1">
			<p style="line-height: 1.6;">The candidate was posted in Cottage Hospital Lunawada, Mahisager,
				& Community Heaith center, Lunawada Taluka for Midwifery and Obstetrical Nursing Clinical Experience.
			</p>
		</td>
	</tr>
	</table>
	<br />
</div>
<?php $HtmlCode = ob_get_contents();
ob_end_flush();
$HtmlUrl = "student-midwifery-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"; ?>