<?php require "_header.php";
error_reporting(1); ?>
<script language="javascript" type="text/javascript">
	document.getElementById("main-content").style.display = 'none';
</script>
<style type="text/css">
	.table-report {
		font-family: Verdana, Geneva, sans-serif;
		font-size: 12px;
		text-align: left;
		border-right: 0px none;
		border-bottom: 0px none;
	}

	.table-report-inner {
		font-family: Verdana, Geneva, sans-serif;
		font-size: 12px;
	}

	.table-report tr {
		padding: 2px 2px 2px 2px;
	}

	.table-report td {
		padding: 2px 2px 2px 2px;
		border-top: 0px none;
		border-left: 0px none;
	}

	.table-report th {
		padding: 2px 2px 2px 2px;
		font-weight: bold;
		text-align: left;
		border-top: 0px none;
		border-left: 0px none;
	}

	.table-report-footer {
		font-family: Verdana, Geneva, sans-serif;
		font-size: 10px;
	}

	.college_name {
		font-family: QTAbbie;
		font-size: 24px;
		font-weight: bold;
		padding: 2px 2px 2px 2px;
		text-align: center;
	}

	.college_address {
		font-family: Tahoma, Geneva, sans-serif;
		font-size: 11px;
		text-align: center;
		padding: 2px 2px 2px 2px;
	}

	.report_name {
		font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
		font-size: 13px;
		background-color: #CCC;
		text-align: center;
		font-weight: bold;
		padding: 2px 2px 2px 2px;
	}

	.left {
		float: left;
		width: 50%;
	}

	.right {
		float: right;
		width: 50%;
	}

	.break {
		page-break-before: always;
	}
</style>
<div id="main-report">
	<?php
	if ($_SESSION['VedantnrCollegeId'] != "" && isset($_SESSION['VedantnrCollegeId'])) {
		$employee_isteaching = Escape($_REQUEST['employee_isteaching']);
		$employee_designation = Escape($_REQUEST['employeedesignation']);
		$branch_id = Escape($_REQUEST['branch_id_hid']);
		$order_by = $_REQUEST['hid_orderby'];

		$SQL_CONDITION = "";
		if ($employee_isteaching != "" && $employee_isteaching != "undefined") {
			$SQL_CONDITION .= " AND employee_isteaching = '" . $employee_isteaching . "'";
		}

		if ($employee_designation != "" && $employee_designation != "undefined") {
			$SQL_CONDITION .= " AND employee_designation = '" . $employee_designation . "'";
		}

		if ($branch_id != "" && $branch_id != "undefined") {
			$SQL_CONDITION .= " AND branch_id = '" . $branch_id . "'";
		}

		if ($order_by != "" && $order_by != "undefined") {
			$order_field = $order_by;
			$order_type = " ASC ";
		} else {
			$order_field = "designation_priority ASC,employee_name ";
			$order_type = " ASC ";
		}
		$SQL_CONDITION .= " AND employee_active = 'YES' ";
		if ($SQL_CONDITION != "") {
			$SQL_STUDENT .= $SQL_CONDITION;
		}
		//echo $SQL_STUDENT;
		$objEmployeeMgmt = new EmployeeMgmt();
		$RES_STUDENT = $objEmployeeMgmt->getAllRecords($limit, $start, $SQL_STUDENT, $order_field, $order_type);
		//$RES_STUDENT = dbQuery($SQL_STUDENT);
		if (dbRows($RES_STUDENT) > 0) {
			ob_start();
			if ($_REQUEST['report_type'] == 'report_type_list') { ?>
				<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>
				<center>
					<h4>Employee List Report</h4>
				</center>
				<table class="table-report" border="1" cellpadding="0" cellspacing="0" width="100%">
					<tr>
						<th style="text-align:center;" width="5%">Sr.</th>
						<th style="text-align:center;" width="20%">Full Name</th>
						<th style="text-align:center;" width="20%">Address</th>
						<th style="text-align:center;" width="5%">Birth Date</th>
						<th style="text-align:center;" width="5%">Joining Date</th>
						<th style="text-align:center;" width="10%">Department</th>
						<th style="text-align:center;" width="12%">Designation</th>
						<th style="text-align:center;" width="10%">Contact Detail</th>
						<!-- <th style="text-align:center;" width="10%">Mobile No</th> -->
						<th style="text-align:center;" width="5%">Bank A/C No. /Pancard No.</th>
						<!-- <th style="text-align:center;" width="5%">Pancard No.</th> -->
					</tr>
					<?php
					$i = 1;
					$temp = "";
					$temp1 = "";
					while ($row = dbArray($RES_STUDENT)) {
						extract($row);
						//print_r($row);exit;
		
						if ($employee_photo != "") {
							$imgfile = $SiteBaseUrl . $EmployeeImagePath . "/" . $employee_photo;
						} else {
							$imgfile = $SiteBaseUrl . $EmployeeImagePath . "default.gif";
						}

						if ($employee_isteaching == "No") {
							$teaching = "Non Teaching";
						} else {
							$teaching = "Teaching";
						}
						?>
						<tr>
							<td style="text-align:center;">&nbsp;<?php echo $i++; ?></td>
							<td style="text-align:left;">&nbsp;<?php echo $employee_name; ?></td>
							<td style="text-align:left;">&nbsp;<?php echo $employee_permaddress; ?></td>
							<td style="text-align:center;">&nbsp;<?php if ($employee_birthdate != '0000-00-00')
								echo date('d-m-Y', strtotime($employee_birthdate));
							else
								echo '-'; ?></td>
							<td style="text-align:center;">&nbsp;<?php
							if ($employee_deptjoindate != '0000-00-00')
								echo date('d-m-Y', strtotime($employee_deptjoindate));
							else
								echo '-'; ?></td>
							<td style="text-align:center;">&nbsp;<?php echo ($BranchName == "" ? $branch_name : $BranchName); ?></td>
							<td style="text-align:left;">&nbsp;<?php echo $employee_designation1; ?></td>
							<td style="text-align:center;">
								&nbsp;<?php echo $employee_emailid;
								echo "</br>";
								echo $employee_mobile . ($employee_phone != "" ? '<br/>' . $employee_phone : '') . ($employee_contactnores != "" ? '<br/>' . $employee_contactnores : ''); ?>
							</td>
							<!--  <td style="text-align:center;" >&nbsp;<?php echo $employee_mobile . ($employee_phone != "" ? '<br/>' . $employee_phone : '') . ($employee_contactnores != "" ? '<br/>' . $employee_contactnores : ''); ?></td> -->
							<td style="text-align:center;">&nbsp;<?php echo $employee_bankacno;
							echo "</br>";
							echo $employee_panno; ?>
							</td>
							<!-- <td style="text-align:center;">&nbsp;<?php echo $employee_panno; ?></td> -->
						</tr>
					<?php } ?>
				</table>
			<?php } else if ($_REQUEST['report_type'] == 'report_type_detail') {
				$RowCount = dbRows($RES_STUDENT);
				$LoopCount = 0;
				while ($row = dbArray($RES_STUDENT)) {
					$LoopCount++;
					extract($row);
					if ($employee_photo != "") {
						$imgfile = $SiteBaseUrl . $EmployeeImagePath . "/" . $employee_photo;
					} else {
						$imgfile = $SiteBaseUrl . $EmployeeImagePath . "default.gif";
					}

					if ($employee_isteaching == "No") {
						$teaching = "Non Teaching";
					} else {
						$teaching = "Teaching";
					}
					?>
						<img src="<?php echo $SiteBaseUrl . $CollegeImagePath . $_SESSION["VedantnrCollegeLogo"]; ?>" alt="College Logo"
							style="width: 80px; height: auto; float: left; margin-right: 10px;">
							<div class="college_name"><?php echo $_SESSION["VedantnrCollegeName"]; ?></div>
							<div class="college_address"><?php echo $_SESSION["VedantnrCollegeAddress"]; ?></div>
							<div class="college_address">
								Email: <?php echo $_SESSION["VedantnrCollegeEmail"]; ?>
								&nbsp;&nbsp;
								Phone: <?php echo $_SESSION["VedantnrCollegePhone"]; ?>
							</div>

						<center>
							<h4>Employee Detail Report</h4>
						</center><br />
						<table width="100%" align="center" class="report">
							<tr>
								<th width="22%" style="background-color:#CCC; text-align:left; padding-left:5px;">Employee Full Name: </th>
								<td colspan="2" style="text-align:left; padding-left:5px;"><?php print $employee_name; ?></td>
								<td rowspan="3" align="center" style="padding:10px 10px 10px 10px;"><img src=<?php echo $imgfile; ?>
										width="<?php echo $SiteImageWidth ?>" height="<?php echo $SiteImageHeight ?>" /></td>
							</tr>
							<tr>
								<th align="left" style="background-color:#CCC; text-align:left; padding-left:5px;">Current Address:</td>
								<td colspan="2" style="text-align:left; padding-left:5px;"><?php print $employee_curaddress; ?></td>
							</tr>
							<tr>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">Permanent Address:</th>
								<td colspan="2" style="text-align:left; padding-left:5px;"><?php print $employee_permaddress; ?></td>
							</tr>
							<tr>
								<th width="22%" style="background-color:#CCC; text-align:left; padding-left:5px;">Contact No:</th>
								<td style="text-align:left; padding-left:5px;"><?php print $employee_phone . ", " . $employee_mobile; ?>
								</td>
								<th width="25%" style="background-color:#CCC; text-align:left; padding-left:5px;">Nominee Name:</th>
								<td width="20%" style="text-align:left; padding-left:5px;"><?php print $employee_nominee; ?></td>
							</tr>
							<tr>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">Bank Account No:</th>
								<td style="text-align:left; padding-left:5px;"><?php print $employee_bankacno; ?></td>
								<th width="25%" style="background-color:#CCC; text-align:left; padding-left:5px;">Pan No:</th>
								<td width="20%" style="text-align:left; padding-left:5px;"><?php print $employee_panno; ?></td>
							</tr>
							<tr>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;"> Blood Group</th>
								<td style="text-align:left; padding-left:5px;"><?php print $employee_bloodgroup ?></td>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">Adhar Card No</th>
								<td style="text-align:left; padding-left:5px;"><?php print $employee_adharno; ?></td>
							</tr>
							<tr>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">Deptt:</th>
								<td style="text-align:left; padding-left:5px;">
								<?php echo ($BranchName == "" ? $branch_name : $BranchName); ?>
								</td>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">G.P.F/C.P.F Account No:</th>
								<td style="text-align:left; padding-left:5px;"><?php print $employee_gpfacno; ?></td>
							</tr>
							<tr>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">Email</th>
								<td style="text-align:left; padding-left:5px;"><?php print $employee_emailid; ?></td>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">Teaching Type:</th>
								<td style="text-align:left; padding-left:5px;"><?php print $teaching; ?></td>
							</tr>
							<tr>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">Designation:</th>
								<td style="text-align:left; padding-left:5px;"><?php print $employee_designation1; ?></td>
								<th align="left" style="background-color:#CCC; text-align:left; padding-left:5px;">Is Handicap</th>
								<td style="text-align:left; padding-left:5px;"><?php print $employee_ishandicap; ?></td>
							</tr>
							<tr>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">BirthDate</th>
								<td style="text-align:left; padding-left:5px;"><?php
								if ($employee_birthdate != '0000-00-00')
									echo date('d-m-Y', strtotime($employee_birthdate));
								else
									echo '-';
								?>
								</td>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">Category:</th>
								<td style="text-align:left; padding-left:5px;"><?php print $employee_category; ?></td>
							</tr>
							<tr>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">School Joining Date:</th>
								<td style="text-align:left; padding-left:5px;"><?php if ($employee_schooljoindate != '0000-00-00')
									echo date('d-m-Y', strtotime($employee_schooljoindate));
								else
									echo '-'; ?></td>
								<th align="left" style="background-color:#CCC; text-align:left; padding-left:5px;">Gender</th>
								<td style="text-align:left; padding-left:5px;"><?php print $employee_gender; ?></td>
							</tr>
							<tr>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">Increment Date:</th>
								<td style="text-align:left; padding-left:5px;"><?php if ($employee_incrdate != '0000-00-00')
									echo date('d-m-Y', strtotime($employee_incrdate));
								else
									echo '-'; ?></td>
								<th align="left" style="background-color:#CCC; text-align:left; padding-left:5px;">Dept. Joining Date:</th>
								<td style="text-align:left; padding-left:5px;"><?php if ($employee_deptjoindate != '0000-00-00')
									echo date('d-m-Y', strtotime($employee_deptjoindate));
								else
									echo '-'; ?></td>
							</tr>
							<tr>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">Basic Salary:</th>
								<td style="text-align:left; padding-left:5px;"><?php print $employee_basicsalary; ?></td>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">Retierment Date:</th>
								<td style="text-align:left; padding-left:5px;"><?php if ($employee_retddate != '0000-00-00')
									echo date('d-m-Y', strtotime($employee_retddate));
								else
									echo '-'; ?></td>
							</tr>
							<tr>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">Pay Type:</th>
								<td style="text-align:left; padding-left:5px;"><?php print $employee_regularorfixpay; ?></td>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">Is Working:</th>
								<td style="text-align:left; padding-left:5px;"><?php print $employee_active; ?></td>
							</tr>
							<tr>
								<th style="background-color:#CCC; text-align:left; padding-left:5px;">Pension Type</th>
								<td style="text-align:left; padding-left:5px;"><?php print $employee_pension; ?></td>
							</tr>
							<tr>
								<Th colspan="4" style="text-align:center;">Employee Qualification Infomation</b></Th>
							</tr>
							<tr>
								<td colspan="4">
									<table align="center" width="100%" class="report">
										<tr>
											<th width="20%" style="background-color:#CCC; text-align:left;">&nbsp;</th>
											<th width="25%"><b>Education Qualification</b></th>
											<th width="25%"><b>Professional Qualification</b></th>
											<th width="25%"><b>Other Qualification</b></th>
										</tr>
										<tr>
											<td style="background-color:#CCC; text-align:left;"><b>Degree:</b></td>
											<td> <?php print $employee_eduqualification; ?> </td>
											<td> <?php print $employee_profqualification; ?> </td>
											<td> <?php print $employee_otherqualification; ?> </td>
										</tr>
										<tr>
											<td style="background-color:#CCC; text-align:left;"><b>Subject:</b></td>
											<td> <?php print $employee_edusub; ?> </td>
											<td> <?php print $employee_profsub; ?> </td>
											<td> <?php print $employee_othersub; ?> </td>
										</tr>
										<tr>
											<td style="background-color:#CCC; text-align:left;"><b>University:</b></td>
											<td> <?php print $employee_eduuni; ?> </td>
											<td> <?php print $employee_profuni; ?> </td>
											<td> <?php print $employee_otheruni; ?> </td>
										</tr>
										<tr>
											<td style="background-color:#CCC; text-align:left;"><b>Obtained Class:</b></td>
											<td> <?php print $employee_eduobtclass; ?> </td>
											<td> <?php print $employee_profobtclass; ?> </td>
											<td> <?php print $employee_otherobtclass; ?> </td>
										</tr>
										<tr>
											<td style="background-color:#CCC; text-align:left;"><b>Year of passing:</b></td>
											<td> <?php print $employee_eduyear; ?> </td>
											<td> <?php print $employee_profyear; ?> </td>
											<td> <?php print $employee_otheryear; ?> </td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					<?php if ($RowCount != $LoopCount) { ?>
							<div class="break">&nbsp;</div>
					<?php } ?>

				<?php }
			}
		}//while loop over
		?>
		<?php
		$HtmlCode = ob_get_contents();
		ob_end_flush();
		$HtmlUrl = "employeelist-report.html";
		$HtmlPath = "report/" . $HtmlUrl;
		$header_row_string = "";
		createHTMLReportPage($header_row_string, $HtmlUrl, $HtmlPath, $HtmlCode, false);
		?>
		<br />
		<form name="frm" id="frm" action="" method="post">
			<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.target = "_blank";
					document.frm.submit();
				}
				else 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 } ?>
</div>
<?php
require "_footer.php";
?>