<?php $this->load->view('header'); ?>
            <!-- sidebar menu -->
<?php $this->load->view('left_bar'); 
//query to count Total jobs
$selcect_total_jobs=mysql_query("select * from njobn_jobdetails");
$number_total_jobs=mysql_num_rows($selcect_total_jobs);
//query to count Active Jobs
$today_date=date("Y-m-d");
$selcect_active_jobs=mysql_query("SELECT * FROM `njobn_jobdetails` WHERE `exp_date` > '".$today_date."'");
$number_active_jobs=mysql_num_rows($selcect_active_jobs);
//query to count exp jobs
$selcect_exp_jobs=mysql_query("SELECT * FROM `njobn_jobdetails` WHERE `exp_date` < '".$today_date."'");
$number_exp_jobs=mysql_num_rows($selcect_exp_jobs);
//query to count Candidate
$selcect_Candidate=mysql_query("SELECT * FROM `njobn_webusers` WHERE user_type=1");
$number_Candidate=mysql_num_rows($selcect_Candidate);
//query to count employee
$selcect_employee=mysql_query("SELECT * FROM `njobn_webusers` WHERE user_type=2");
$number_employee=mysql_num_rows($selcect_employee);
?>
           
        <!-- page content -->
        <div class="right_col" role="main">
          <!-- top tiles -->
          <div class="row tile_count">
            <div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
              <span class="count_top"><i class="fa fa-user"></i> Total Jobs</span>
              <div class="count"><?php echo $number_total_jobs;?></div>
              
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
              <span class="count_top"><i class="fa fa-clock-o"></i> Active Jobs</span>
              <div class="count"><?php  echo $number_active_jobs;?></div>
              
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
              <span class="count_top"><i class="fa fa-user"></i>Total Candidate's</span>
              <div class="count green"><?php echo $number_Candidate;?></div>
              
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
              <span class="count_top"><i class="fa fa-user"></i>Total Employee's</span>
              <div class="count"><?php echo $number_employee; ?></div>
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
              <span class="count_top"><i class="fa fa-user"></i> Total Short List Jobs</span>
              <div class="count">2</div>
              
            </div>
            <div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
              <span class="count_top"><i class="fa fa-user"></i> Expire Jobs</span>
              <div class="count"><?php echo $number_exp_jobs;?> </div>
            </div>
          </div>
          <!-- /top tiles -->

         

          <div class="row">

<div class="col-md-4 col-sm-4 col-xs-12">
              <div class="x_panel tile fixed_height_320 overflow_hidden">
                <div class="x_title">
                  <h2>JOB-N-JOB Activity Graph</h2>
                  
                  <div class="clearfix"></div>
                </div>
                <div class="x_content">
                  <table class="" style="width:100%">
                    <tr>
                      <th style="width:37%;">
                        <p></p>
                      </th>
                      <th>
                        <div class="col-lg-7 col-md-7 col-sm-7 col-xs-7">
                          <p class=""></p>
                        </div>
                        <div class="col-lg-5 col-md-5 col-sm-5 col-xs-5">
                          <p class=""></p>
                        </div>
                      </th>
                    </tr>
                    <tr>
                      <td>
                        <canvas id="canvas1" height="140" width="140" style="margin: 15px 10px 10px 0"></canvas>
                      </td>
                      <td>
                        <table class="tile_info">
                          <tr>
                            <td>
                              <p><i class="fa fa-square blue"></i>Total Jobs</p>
                            </td>
                            <td><?php echo $number_total_jobs;?>%</td>
                          </tr>
                          <tr>
                            <td>
                              <p><i class="fa fa-square green"></i>Active Jobs</p>
                            </td>
                            <td><?php echo $number_active_jobs;?>%</td>
                          </tr>
                          <tr>
                            <td>
                              <p><i class="fa fa-square purple"></i>Short Listed Jobs</p>
                            </td>
                            <td>2%</td>
                          </tr>
                          <tr>
                            <td>
                              <p><i class="fa fa-square aero"></i>Candidate's</p>
                            </td>
                            <td><?php echo $number_Candidate;?>%</td>
                          </tr>
                          <tr>
                            <td>
                              <p><i class="fa fa-square red"></i>Employee's</p>
                            </td>
                            <td><?php echo $number_employee ;?>%</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </div>
              </div>
            </div>
            

            


            <div class="col-md-4 col-sm-4 col-xs-12">
              <div class="x_panel tile fixed_height_320">
                <div class="x_title">
                  <h2>Quick Links</h2>
                  
                  <div class="clearfix"></div>
                </div>
                <div class="x_content">
                  <div class="dashboard-widget-content">
                    <ul class="quick-list">
					 <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>">Dashboard</a>
                      </li>
                      <li><i class="fa fa-calendar-o"></i><a href="<?php echo base_url();?>index.php/manage/web_setting">Settings</a>
                      </li>
                      <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>index.php/manage/user">Users</a>
                      </li>
                     <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>index.php/manage/groups">Groups</a>
                      </li>
					   <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>index.php/manage/privileges">Privileges</a>
                      </li>
					    <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>index.php/manage/jobs">Jobs</a>
                      </li>
					   </li>
					    <li><i class="fa fa-bars"></i><a href="#">Shot Lited Jobs</a>
                      </li>
					  
                    </ul>

                    
                  </div>
                </div>
              </div>
            </div>
			<div class="col-md-4 col-sm-4 col-xs-12">
              <div class="x_panel tile fixed_height_320">
                <div class="x_title">
                  <h2>Other Links</h2>
                  
                  <div class="clearfix"></div>
                </div>
                <div class="x_content">
                  <div class="dashboard-widget-content">
                    <ul class="quick-list">
					 <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>index.php/manage/email_templates">Email Templates</a>
                      </li>
                      <li><i class="fa fa-calendar-o"></i><a href="<?php echo base_url();?>index.php/manage/cms_pages">CMS</a>
                      </li>
                      <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>index.php/manage/languages">Languages</a>
                      </li>
                     <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>index.php/manage/languages">Skills</a>
                      </li>
					   <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>index.php/manage/testimonials">Testimonials</a>
                      </li>
					    <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>index.php/manage/team">Team</a>
                      </li>
					   </li>
					    <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>index.php/manage/jobscategory">Jobs Industries</a>
                      </li>
					  
                    </ul>

                    
                  </div>
                </div>
              </div>
            </div>
			<div class="col-md-6 col-sm-6 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Latest Jobs</h2>
                    
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">

                    <table class="table">
                      <thead>
                        <tr>
                          <th>#</th>
                          <th>Company Name</th>
                          <th>Job description</th>
                          <th>Job Type</th>
                        </tr>
                      </thead>
                      <tbody>
					  <?php
					  $j=1;
					  while($fetch_latest_jobs=mysql_fetch_array($selcect_total_jobs))
					  {?>
                        <tr>
                          <th scope="row"><?php echo $j; ?></th>
                          <td><?php echo $fetch_latest_jobs['company_name'];?></td>
                          <td><?php echo $fetch_latest_jobs['job_des'];?></td>
                          <td>
                              <?php if($fetch_latest_jobs['job_type']==1){ echo "Permanent";}?>
                              <?php if($fetch_latest_jobs['job_type']==2){ echo "Contract";}?>
                              <?php if($fetch_latest_jobs['job_type']==3){ echo "Temporary";}?>
                              <?php if($fetch_latest_jobs['job_type']==4){ echo "Part Time";}?>	

						  </td>
                        </tr>
                      <?php 
					  $j++;
					  }?>
					  </tbody>
                    </table>

                  </div>
                </div>
              </div>
			  <div class="col-md-6 col-sm-6 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Expire jobs</h2>
                    
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">

                    <table class="table">
                      <thead>
                        <tr>
                          <th>#</th>
                          <th>Company Name</th>
                          <th>Job description</th>
                          <th>Job Type</th>
                        </tr>
                      </thead>
                      <tbody>
					  <?php
					  $e=1;
					  while($fetch_exp_jobs=mysql_fetch_array($selcect_exp_jobs))
					  {?>
                        <tr>
                          <th scope="row"><?php echo $e; ?></th>
                          <td><?php echo $fetch_exp_jobs['company_name'];?></td>
                          <td><?php echo $fetch_exp_jobs['job_des'];?></td>
                          <td>
                              <?php if($fetch_exp_jobs['job_type']==1){ echo "Permanent";}?>
                              <?php if($fetch_exp_jobs['job_type']==2){ echo "Contract";}?>
                              <?php if($fetch_exp_jobs['job_type']==3){ echo "Temporary";}?>
                              <?php if($fetch_exp_jobs['job_type']==4){ echo "Part Time";}?>	

						  </td>
                        </tr>
                      <?php 
					  $e++;
					  }?>
					  </tbody>
                    </table>

                  </div>
                </div>
              </div>

          </div>


          
        </div>
        <!-- /page content -->

        <!-- footer content -->
<?php $this->load->view('footer'); ?>
