<?php /* $Id: Reports.tpl 3304 2007-10-25 17:31:55Z will $ */ ?>
<?php TemplateUtility::printHeader('Reports'); ?>
<?php TemplateUtility::printHeaderBlock(); ?>
<?php TemplateUtility::printTabs($this->active); ?>
    <div id="main">
        <?php TemplateUtility::printQuickSearch(); ?>

        <div id="contents">
            <table>
                <tr>
                    <td width="3%">
                        <img src="images/reports.gif" width="24" height="24" border="0" alt="Reports" style="margin-top: 3px;" />&nbsp;
                    </td>
                    <td><h2>Reports</h2></td>
                </tr>
            </table>
<link href="/rpms/cm/media_jquery/media/css/jquery.dataTables.css" rel="stylesheet" type="text/css"/>
<link href="/rpms/cm/media_jquery/extensions/FixedColumns/css/dataTables.fixedColumns.css" rel="stylesheet" type="text/css"/>

<script type="text/javascript" src="/rpms/cm/media_jquery/media/js/jquery.js"></script>
<script type="text/javascript" src="/rpms/cm/media_jquery/media/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="/rpms/cm/media_jquery/extensions/FixedColumns/js/dataTables.fixedColumns.js"></script>

            <p class="note">Candidate Master Report</p>
           <style type="text/css">
/*body {
font-family:arial;
/*margin:50px 100px;*/
}
a {
    color: #666;
    font-size: 11px;
    text-decoration: none;
}

a:hover {
    color: #37B0DD;
    font-size: 11px;
    text-decoration: none;
}

input {
background:#f1f1f1;
border:1px solid #ccc;
padding:5px;
font-size:11px;
}
 
 .home-table { background:none; border:1px solid #c4c4c4; cellpadding:0;  border-spacing:0;  border-collapse:collapse; width:98%; margin:0 auto 20px auto; box-shadow: 6px 10px 15px #CCCCCC;}
.home-table th{ background: #CCCCCC; url(images/table-bg.png) repeat-x top left; border:1px solid; padding:8px 10px !important; text-align:left; font-size:12px; border-color:#116b85; color:#ffffff; vertical-align: middle; margin:10px; }
.home-table td{ background:white; border:1px solid; padding:6px 10px !important; font-size:11px; color:#000000; vertical-align: middle;}
/*.home-table tbody tr:nth-child(odd) td{ background-color: #f7f7f7 !important; }*/
.home-table td:first-child { text-align:left; }*/


th, td { white-space: nowrap; }
    div.dataTables_wrapper {
        width: 800px;
        margin: 0 auto;
    }

</style>
<br>

             <table id="example" class="stripe row-border order-column" cellspacing="0" width="100%">
              <thead>
  <tr>
    <th>Applicant ID</th>
    <th>Registered On</th>
    <th>Fname</th>
    <th>Mname</th>
    <th>Lname</th>
    <th>Gender</th>
    <th>DOB</th>
    <th>National ID</th>
    <th>GSM</th>
    <th>Email</th>
    <th>Region</th>
    <th>Wilayat</th>
    <th>Qualification</th>
    <th>Discipline</th>
    <th>Year of Passing</th>
    <th>University</th>
    <th>Institute</th>
    <th>GPA</th>
    <th>Position Applying</th>
    <th>Current Status</th>
    <th>Activity Remarks</th>
  </tr>
  </thead>
  <tbody>
  <?php 
  include('dbinfo.php');
  $rsCandidate = mysql_query("SELECT a.applicant_id, a.candidate_id, a.date_created, a.first_name, a.middle_name, a.last_name, a.gender, a.dob, a.national_id, a.gsm, a.region, a.wilayat, a.email1, a.qualification, a.discipline, a.year, a.university, a.institute, a.gpa, b.joborder_id, b.status FROM candidate a, candidate_joborder b WHERE a.candidate_id=b.candidate_id AND a.site_id=1 AND a.site_id=b.site_id AND b.joborder_id!=0 order by a.candidate_id desc");
  while($rwCandidate = mysql_fetch_array($rsCandidate )){
  $candidate_id = $rwCandidate['candidate_id'];
  $joborder_id = $rwCandidate['joborder_id'];
  
$quali = $rwCandidate['qualification'];
if($quali ==1){
$qualif = 'Diploma';
}else if($quali ==2){
$qualif = 'Bachelors';
}
																
$gen = $rwCandidate['gender'];
if($gen ==1){
$gender = 'Male';
}else if($gen ==2){
$gender = 'Female';
}
								
$univ = $rwCandidate['gender'];
if($univ ==1){
$univers = 'Omani University';
}else if($univ ==2){
$univers = 'Foreign University';
}	
								
$disc = $rwCandidate['discipline'];
$rsDisc = mysql_query("SELECT * FROM cm_discipline WHERE id='$disc'");
$rwDisc = mysql_fetch_assoc($rsDisc);
$discipline = $rwDisc['discipline'];
							
$regi = $rwCandidate['region'];
$rsRegi = mysql_query("SELECT * FROM cm_region WHERE id='$regi'");
$rwRegi = mysql_fetch_assoc($rsRegi);
$region = $rwRegi['region'];
							
$wila = $rwCandidate['wilayat'];
$rsWila = mysql_query("SELECT * FROM cm_wilayat WHERE id='$wila'");
$rwWila = mysql_fetch_assoc($rsWila);
$wilayat = $rwWila['wilayat'];
						
$rsJobOrderName = mysql_query("SELECT * FROM joborder WHERE joborder_id='$joborder_id'");
$rwJobOrderName = mysql_fetch_assoc($rsJobOrderName);
$jobordername = $rwJobOrderName['title'];

$rsRemark = mysql_query("SELECT * FROM activity WHERE joborder_id='$joborder_id' AND data_item_id='$candidate_id' AND site_id=1");
$rwRemark = mysql_fetch_assoc($rsRemark);
$remark = $rwRemark['notes'];

$cand_status = $rwCandidate['status'];
$rsStatus = mysql_query("SELECT * FROM candidate_joborder_status WHERE candidate_joborder_status_id='$cand_status' AND is_enabled=1");
$rwStatus = mysql_fetch_assoc($rsStatus );
$status = $rwStatus['short_description'];

 		$datArray[$ref]['applicant']        = $rwCandidate['applicant_id'];
                $datArray[$ref]['datecreated']      = substr($rwCandidate['date_created'],0,10);
                $datArray[$ref]['fname']  = $rwCandidate['first_name'];
                $datArray[$ref]['mname'] = $rwCandidate['middle_name'];
                $datArray[$ref]['lname']     = $rwCandidate['last_name'];
                $datArray[$ref]['gender']   = $gender;
                $datArray[$ref]['dob']        = $rwCandidate['dob'];
                $datArray[$ref]['nationalid']      = $rwCandidate['national_id'];
                $datArray[$ref]['gsm']  = $rwCandidate['gsm'];
                $datArray[$ref]['email'] = $rwCandidate['email1'];
                $datArray[$ref]['region']     = $region;
                $datArray[$ref]['wilayat']   = $wilayat;
                $datArray[$ref]['quali']        = $qualif;
                $datArray[$ref]['disc']      = $discipline;
                $datArray[$ref]['year']  = $rwCandidate['year'];
                $datArray[$ref]['univers'] = $univers;
                $datArray[$ref]['institute']     = $rwCandidate['institute'];
                $datArray[$ref]['gpa']   = $rwCandidate['gpa'];
                $datArray[$ref]['position'] = $jobordername;
                $datArray[$ref]['status']     = $status;
                $datArray[$ref]['remark']   = $remark;
                $ref++;

  ?>
  <tr>
    <td><?php echo $rwCandidate['applicant_id'];?></td>
    <td><?php echo substr($rwCandidate['date_created'],0,10);?></td>
    <td><?php echo $rwCandidate['first_name'];?></td>
    <td><?php echo $rwCandidate['middle_name'];?></td>
    <td><?php echo $rwCandidate['last_name'];?></td>
    <td><?php echo $gender;?></td>
    <td><?php echo $rwCandidate['dob'];?></td>
    <td><?php echo $rwCandidate['national_id'];?></td>
    <td><?php echo $rwCandidate['gsm'];?></td>
    <td><?php echo $rwCandidate['email1'];?></td>
    <td><?php echo $region;?></td>
    <td><?php echo $wilayat;?></td>
    <td><?php echo $qualif;?></td>
    <td><?php echo $discipline;?></td>
    <td><?php echo $rwCandidate['year'];?></td>
    <td><?php echo $univers;?></td>
    <td><?php echo $rwCandidate['institute'];?></td>
    <td><?php echo $rwCandidate['gpa'];?></td>
    <td><?php echo $jobordername;?></td>
    <td><?php echo $status;?></td>
    <td><?php echo $remark;?></td>
  </tr>
  
  <?php } ?>
  </tbody>
</table>      
  </div>
    </div>
    <div id="bottomShadow"></div>
<script>
$(document).ready(function() {
    var table = $('#example').DataTable( {
        scrollY:        "300px",
        scrollX:        true,
        scrollCollapse: true,
        paging:         false
    } );
 
    new $.fn.dataTable.FixedColumns( table, {
        leftColumns: 1,
    } );
} );
</script>
<?php TemplateUtility::printFooter(); ?>
