<?php require "_header.php";?>
<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;
	}	
	.college_name{
		font-family:QTAbbie;
		font-size:22px;	
		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;
	}
</style>
<div id="main-report">
<?php
if($_REQUEST['group_name'] == "")
{
?>
	<script language="javascript" type="text/javascript">
		location.href='report-employee-list.php';
	</script>
<?php
}
elseif($_SESSION['VedantnrCollegeId']!="" && isset($_SESSION['VedantnrCollegeId'])) 
{ 
	ob_start();
	$group_name 	  = Escape($_REQUEST['group_name']);
	$designation	 = Escape($_REQUEST['designation']);
	$order_by = $_REQUEST['hid_orderby'];
	
	$condition  = "";
	
	
	//$SQL_STUDENT = "SELECT * FROM cms_contact WHERE college_id = ".$_SESSION["VedantnrCollegeId"];
	
	
	if($group_name != "All")
	{
		$condition .= " AND group_name = '".$group_name."'";
	}
	
	
	if($designation != "All")
	{
		$condition .= " AND designation = '".$designation."'";
	}
	
	
	if($order_by != "" && $order_by != "undefined")
	{
		$condition .= " ORDER BY ".$order_by." ASC ";
	}
	else
	{
		$condition .= " ORDER BY group_name ASC ";
	}
	$condition .= " ,name ASC ";
	

	
//	$RES_STUDENT = dbQuery($SQL_STUDENT);
	$objContactMgmt = new ContactMgmt();
		$RES_STUDENT = $objContactMgmt->getemployeelist($condition);
	if(dbRows($RES_STUDENT)>0){?>
    <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>Contact Detail List</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="10%">Joining Date</th>
            <th style="text-align:center;" width="10%">Branch</th>
            <th style="text-align:center;" width="8%">Designation</th>
            <th style="text-align:center;" width="8%">Mobile No</th>
            <th style="text-align:center;" width="10%">Email</th>
            <th style="text-align:center;" width="8%">Bank A/C No.</th>
            <th style="text-align:center;" width="8%">Pancard No.</th>
            <th style="text-align:center;" width="7%">Biometric Code</th>
            <th style="text-align:center;" width="6%">Bus Facility</th>
        </tr>
		<?php
		$i = 1;
		$temp = "";
		$temp1="";
		while($REC_STUDENT = dbArray($RES_STUDENT)){
			 ?>
            <tr>
				<td style="text-align:center;">&nbsp;<?php echo $i++; ?></td>
                <td style="text-align:left;">&nbsp;<?php echo $REC_STUDENT['name']; ?></td>
                <td style="text-align:center;">&nbsp;<?php 
				if($REC_STUDENT['joining_date']!='0000-00-00')
					echo date('d-m-Y',strtotime($REC_STUDENT['joining_date'])); 
				else
					echo '-'; ?></td>
                <td style="text-align:center;">&nbsp;<?php echo $REC_STUDENT['group_name']; ?></td>
                <td style="text-align:center;">&nbsp;<?php 
				if($REC_STUDENT['designation']!='')
					echo $REC_STUDENT['designation']; 
				else
					echo '-'; ?></td>
                <td style="text-align:center;">&nbsp;<?php 
				if($REC_STUDENT['mobile_no1']!='')
					echo $REC_STUDENT['mobile_no1']; 
				else
					echo '-'; ?></td>
                <td style="text-align:left;" >&nbsp;<?php echo $REC_STUDENT['email']; ?></td>
                <td style="text-align:center;">&nbsp;<?php 
				if($REC_STUDENT['bankacno']!='')
					echo $REC_STUDENT['bankacno']; 
				else
					echo '-'; ?></td>
                <td style="text-align:center;">&nbsp;<?php 
				if($REC_STUDENT['pancardno']!='')
					echo $REC_STUDENT['pancardno']; 
				else
					echo '-'; ?></td>
                <td style="text-align:center;">&nbsp;<?php 
				if($REC_STUDENT['biometriccode']!='')
					echo $REC_STUDENT['biometriccode']; 
				else
					echo '-'; ?></td>
                <td style="text-align:center;">&nbsp;<?php 
				if($REC_STUDENT['busfacility'] == 1)
					echo 'Yes'; 
				else
					echo 'No'; ?></td>
                
       		</tr><?php
		}
		?>
     <!--   <tr>
                    <td colspan="11" >
                    <table class="table-report-footer" cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td align="left" style="border:solid 0px red;" width="76%">Created by <b><?php echo $_SESSION["VedantnrUserName"]; ?></b> </td>
                            <td align="right" style="border:solid 0px red;" width="24%">Developed By <b>Aum Imagineering Pvt.Ltd.</b></td>
                        </tr>
                    </table>
                    </td>        
					</tr> -->
		</table>
		<?php
	}
	else{
		echo "NO DATA FOUND!";	
	}
	
?>

<?php
	$HtmlCode = ob_get_contents();
	ob_end_flush();
	$header_row_string="";
	$HtmlUrl = "employeelist-report.html";
	$HtmlPath =	"report/".$HtmlUrl;
	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";
?>
