<?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">Wilayat Wise Report</p>
            <p class="note" align="right"><a href="http://orpicrecruitment.com/rpms/index.php?m=reports">Back to Reports</a>
           <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{ transform: rotate(270deg);-webkit-transform: rotate(270deg);height:100px; }
.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; }
</style>
<br>
           
  <?php 
  include('dbinfo.php');
  ?>
  
  <table width="200" border="1" class="home-table">
  <tr>
    <th>Wilayat</th>
    <?php $rsWilayat = mysql_query("SELECT * FROM cm_wilayat");
    $wilayat_cnt = mysql_num_rows($rsWilayat);
    while($rwWilayat = mysql_fetch_array($rsWilayat)){
    $wilayat_name = $rwWilayat['wilayat'];
    $wilayat_id = $rwWilayat['id'];
    $wilayatArray[$wilayat_id] = $wilayat_name;
    }
    foreach($wilayatArray as $key=>$val){
    ?>
    <th><?php echo $val;?></th>
    <?php } ?>
    <th>Total</th>
    </tr>
    
    <?php
    $rsJobTitle = mysql_query("SELECT * FROM joborder");
    while($rwJobTitle = mysql_fetch_array($rsJobTitle)){
    $joborder_id = $rwJobTitle['joborder_id'];
    ?>
    <tr>
    <td><?php echo $rwJobTitle['title'];?></td>
    <?php foreach($wilayatArray as $k=>$v){
    $qry19 = mysql_query("SELECT * FROM candidate a, candidate_joborder b WHERE b.joborder_id='$joborder_id' AND b.site_id=1 AND b.date_created NOT LIKE '0000%' AND a.wilayat='$k' AND a.candidate_id=b.candidate_id AND a.site_id=1");
   $res19 = mysql_num_rows($qry19);
     ?>
    <td><?php echo $res19;?></td>
    <?php }?>
    <td>34</td>
  </tr>
  <?php } ?>

</table> 
<script>
$(document).ready(function() {
    var table = $('#example').DataTable( {
        scrollY:        "300px",
        scrollX:        true,
        scrollCollapse: true,
        paging:         false
    } );
 
    new $.fn.dataTable.FixedColumns( table, {
        leftColumns: 1,
    } );
} );
</script>     
  </div>
    </div>
    <div id="bottomShadow"></div>
<?php TemplateUtility::printFooter(); ?>
