<?php
session_start();
// ============ this file shows a detailed payment report for selected school in a pdf format
include("../../asset/theme/css/myfunc.php");
include("../../php_crud/my_class.php");
require_once("../../asset/custom/mpdf/mpdf.php");
$obj=new my_class();
// ============
$branch_id=$_SESSION['LOGIN_BRANCH'];
$selected_session = $_SESSION['ADMISSION_SESSION'];
$selected_form_id=addslashes(trim($_GET['admission_form_id']));

$service_provider_details = $obj->View_branch_details_By_Cond($branch_id,'I');
$service_provider_name = $service_provider_details->insName;
$service_provider_code = $service_provider_details->insCodeName; 
$service_provider_logo = $service_provider_details->_logo_location;
$service_provider_address = $service_provider_details->_address;
$service_provider_thana = $service_provider_details->thana_name ;
$service_provider_district = $service_provider_details->distrinc_name;
$service_provider_division = $service_provider_details->division_name;
$service_provider_web = $service_provider_details->_web_address !='' ? $service_provider_details->_web_address : '' ;
$service_provider_email = $service_provider_details->_email_add !='' ? '&nbsp;'. $service_provider_details->_email_add : '' ;

$invoice_number = '';
$candidate_name = '';
$date_of_birth='';
$detailed_id_as_class='';
$class_name='';
$department_name='';
$photo='';

$table_name = '_students_admission_form';
$column = '*';
$where_cond="admission_form_id=".$selected_form_id;
$can_info = $obj->Details_By_Cond($table_name, $where_cond);

$invoice_number = $can_info['_invoice_number'];
$candidate_name = $can_info['_candidate_name'];
$date_of_birth = $can_info['_date_of_birth'];
$detailed_id_as_class = $can_info['_class'];
$can_branch_id = $can_info['branch_id'];
$photo='../../'.$can_info['_std_photo'];


$class_id='';
$dept_id='';
$table_name="_student_admission_details";
$where_cond="_id=".$detailed_id_as_class;
$class_info=$obj->Details_By_Cond($table_name,$where_cond);
$class_id=$class_info['_class_id'];
$dept_id=$class_info['_dept_id'];

$setup_table_name="_int_institute_setup";
$where_cond="_id=".$class_id;
$class_info=$obj->Details_By_Cond($setup_table_name,$where_cond);
$class_name = $class_info['_name'];

$where_cond="_id=".$dept_id;
$class_info=$obj->Details_By_Cond($setup_table_name,$where_cond);
$department_name = $class_info['_name'];

$inst_logo_full_path='../../'.$service_provider_logo;
?>
<style type="text/css">
i{
	cursor:pointer;
}
</style>
<?php if($_SESSION['add']=='Y'){ 
$html="<html><head></head><body>
<div class='row-fluid' style='margin:0px auto;'>
	 <div class='span9 admit-card' style='float:none; min-height:300px; overflow: hidden;' >
		<div class='span12 admit-header' style='margin-bottom: 0px;'>
			<div id='ins_logo_image_holder' style='font-family: Tahoma, Geneva, sans-serif; text-align: center; margin-top:5px;'>
				<img src='$inst_logo_full_path' style='width: 77px;height: 74px;' title='logo' alt='' id='image' />
			</div>
			<div id='ins_info_holder' style='margin-top:-12px;font-family: Tahoma, Geneva, sans-serif; text-align:center'>
				<h4 style='font-size: 20px;text-align: center;margin-bottom: 3px; margin-top: 20px;'>$service_provider_name
					($service_provider_code)</h4>
				<h5 style='margin-top:-30px; text-align:center;font-size:14px;'>$service_provider_address<br>$service_provider_thana, $service_provider_district, $service_provider_division</h5>
				<h5 style='margin-bottom:10px; text-align:center;font-size:12px;'>$service_provider_web  $service_provider_email</h5>
			</div>	
			<div id='heading_holder' style='margin-top:20px; margin-bottom:-6px;'>
				<h2 style='font-family: Tahoma, Geneva, sans-serif; text-align:center; margin-top:3px;'> Admit Card </h2>
			</div>
        </div>
		<div class='span12 admit-body' style='margin-left:0px; width: 100%;'>
            <div class='hr hr8 hr-double'></div>
                <div class='body-content' style='width:100%'>
                    <div class='span12' style='width: 100%;'>   
                        <div class='body-left' style='float:left;width:65%; margin-left:5px'>
                            <p>
                                <strong><span style='float: left; width: 165px;'>Application No </span><span class='separator'>:&nbsp;</span> </strong>
								$selected_form_id
							</p>
                            <p>
                                <strong><span style='float: left; width: 165px;'>Name </span><span class='separator'>:&nbsp;</span> </strong>
								$candidate_name
                            </p>
                            <p>
                                <strong><span style='float: left; width: 165px;'>Date Of Birth </span><span class='separator'>:&nbsp;</span> </strong>
								$date_of_birth
							</p>
                            <p>
                                <strong><span style='float: left; width: 165px;'>Class </span><span class='separator'>: &nbsp;</span> </strong>   
								$class_name
                            </p> 
							<p>
								<strong><span style='float: left; width: 165px;'>Department </span><span class='separator'>: &nbsp;</span> </strong>
								$department_name
							</p>
                            <p>
                                <strong><span style='float: left; width: 165px;'>Exam Date and Time</span> 
                                    <span class='separator'>:&nbsp;</span> </strong>  
                            </p>
                            <p>
                                <strong><span style='float: left; width: 165px;'>Exam Center </span><span class='separator'>:&nbsp;</span> </strong>  
								$service_provider_name
							</p>
                           
                        </div>
                        <div class='body-right' style='margin-top:12px; float:left; width:34%'>
                            <img src='$photo' style='border:2px solid #787878;' width='150' height='150' />
                        </div>
                    </div>
                </div>
            </div>
			<div class='span12 admit-footer' style='margin-top:20px; margin-left:0px'>
                <div class='hr hr8 hr-double'></div>
                <h3 style='text-align:center; margin-top:0px; text-decoration:underline' > General Instruction For Admissions </h3>
                <ol style=''>
                    <li>Applicants Must Keep this admid card with them at the time of examination and should preserve it for future requirents. They have to bring ball point pen, pencil and eraser. </li>
                    <li>Calculator will not be allowed at examingation hall. </li>
                    <li>Mobile Phone or any other communicative device is strictly prohibited at examination hall. </li>
                    <li>Candidate will have to report at the examination hall 30 minuts before the examinaion start. </li>
                </ol>
            </div>
	 ";
$html=$html."</div>
</div></body></html>";
$print_date=date("d/m/Y");
$foothtml="<div><table width='100%'>
		<tr>
		<td>Powered by <b>Leotech</b></td>
		<td style='text-align: center;' width='60%;'>{PAGENO}</td>
		<td><b>Date:</b>&nbsp;$print_date</td>
		</tr>
		</table></div>";
$mpdf = new mPDF();
$mpdf->SetDisplayMode('fullpage');
$mpdf->SetWatermarkImage('../../'.$service_provider_logo);
$mpdf->showWatermarkImage = true;
$mpdf->setFooter($foothtml);
$mpdf->WriteHTML($html);
$mpdf->Output();
//exit();
}?>