<?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'";
		}

		$objconduct = new conductCertificateMgmt();
		$out = $objconduct->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;">
									Managed by: Shree Shivshakti Eduction and Charitable Trust<br>
									<b style="font-size: 30px;"><?php echo $_SESSION["VedantnrCollegeName"]; ?></b><br>
									(ANM / GNM / B.Sc. Nursing / P.B.B.Sc.(N) / M.Sc.(N))<br>
									<?php echo $_SESSION["VedantnrCollegeAddress"]; ?><br>
									Phone: <?php echo $_SESSION["VedantnrCollegePhone"]; ?>&nbsp;&nbsp;
									Email: <?php echo $_SESSION["VedantnrCollegeEmail"]; ?>
								</div>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<hr>
				</td>
			</tr>
		<?php } ?>
		<tr>
			<td colspan="4" style="text-align:center; font-size: 148%;">
				<h2><b><u>COURSE COMPLETION AND CONDUCT CERTIFICATE</u></b></h2>
			</td>
		</tr>
		<tr style="line-height:20px; ">
			<td style="text-align:left;" colspan="4"><b>Date Of
					Admission:<?php print date("d/m/Y", strtotime($student_admdate)); ?></b></td>
		</tr>
		<tr style="line-height:20px; ">
			<td style="text-align:left;" colspan="4"><b>Enrollment No:- <?php print $student_gturegno; ?></b></td>

		</tr>

		<tr style="line-height:12px">
			<td colspan="2">
				<p style="line-height: 1.6;">This is to certified that <?php echo $char; ?>
					<b><u><?php echo $student_name; ?></u></b> <?php echo $rel; ?> of
					<b><u><?php echo $student_father; ?></u></b>
					has been satisfactory completed <?php echo $var2; ?>
					<b><u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</u>
					</b>years <b><u><?php echo $branch_name; ?></u></b> course. To the best of my knowledge and belief
					Course
					<b><u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</u>
					</b>to
					<b><u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</u>
					</b>.
				</p>
				<p style="line-height: 1.6;"><?php echo $gn; ?> bear good conduct and moral character. I have not
					noticed anything
					adverse against <?php echo $var2; ?> during the above period.
				</p>
			</td>
		</tr> <br />
		<tr style="line-height:45px">
			<td style="width:14%;border: 1px solid black; text-align: center;">
				photos with seal<img src="" height="100px" style="float: right;display: block;MARGIN-BOTTOM: 115PX;" />
			</td>
			<td style="text-align:left" colspan="2">&nbsp;</td>
		</tr>
	</table>
	<br />
</div>
<?php $HtmlCode = ob_get_contents();
ob_end_flush();
$HtmlUrl = "student-conduct-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"; ?>