<?php $this->load->view('header'); ?>
            <!-- sidebar menu -->
<?php $this->load->view('left_bar'); 
// Code for admin dasboard tada jobs 
//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
@date_default_timezone_set('UTC');
$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);

/*tada jobs - total shortlist jobs**********************************************************/
//query to count jobs
$select_employee=mysql_query("SELECT * FROM `shot_listjob`");
$shortlist_jobs=mysql_num_rows($select_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 Jobseekers</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 Clients/Companies</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>Shortlisted Jobs</span>
              <div class="count"><?php echo $shortlist_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> Expired 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>TADA 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>Shortlisted Jobs</p>
                            </td>
                            <td><?php echo $shortlist_jobs;?>%</td>
                          </tr>
                          <tr>
                            <td>
                              <p><i class="fa fa-square aero"></i>Jobseekers</p>
                            </td>
                            <td><?php echo $number_Candidate;?>%</td>
                          </tr>
                          <tr>
                            <td>
                              <p><i class="fa fa-square red"></i>Client/Companies</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();?>manage/admin_dashboard">Dashboard</a>
                      </li>
                      <li><i class="fa fa-calendar-o"></i><a href="<?php echo base_url();?>manage/web_setting">Settings</a>
                      </li>
                      <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>manage/user">Users</a>
                      </li>
                     <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>manage/groups">Groups</a>
                      </li>
					   <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>manage/privileges">Privileges</a>
                      </li>
					    <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>manage/jobs">Jobs</a>
                      </li>
					   </li>
					    <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>manage/logos">Silder Setting</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();?>manage/employeeuser">Client/Companies</a></li>
                      <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>manage/testimonials">Jobseekers</a></li>
                      <li><i class="fa fa-calendar-o"></i><a href="<?php echo base_url();?>manage/cms_pages">CMS</a></li>
                      <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>manage/languages">Languages</a></li>
                     <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>manage/languages">Skills</a></li>
					   
					    <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>manage/team">Team</a></li>
					    <li><i class="fa fa-bars"></i><a href="<?php echo base_url();?>manage/jobscategory">Job 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
					  //code for latest tada jobs
					  $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 substr($fetch_latest_jobs['job_des'],0,300).'......';?>
						   <?php
													  $fulldet=strip_tags($fetch_latest_jobs['job_des']);
													  $desvarib=substr($fulldet,0,100);
													  echo $desvarib;
													  ?>
						  
						  </td>
                          <td>
                            
							  
							  
					<?php if($fetch_latest_jobs['job_type']==5){ echo "Full Time";}?>
						 <?php if($fetch_latest_jobs['job_type']==4){ echo "Part Time";}?>
						 <?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']==1){ echo "Volunteer";}?>
						  <?php if($fetch_latest_jobs['job_type']==7){ echo "Permanent";}?>
						<?php if($fetch_latest_jobs['job_type']==6){ echo "Other";}?>

						  </td>
                        </tr>
                      <?php 
					  $j++;
					  if ($j == 6) 
					  {
						  break;
					  }
					  }?>
					  </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>Expired 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
					  //code for Expired tada jobs
					  $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 substr($fetch_exp_jobs['job_des'],0,300).'......';?>
<?php
$fulldet1=strip_tags($fetch_exp_jobs['job_des']);
$desvarib1=substr($fulldet1,0,100);
echo $desvarib1;
?>
						  
						  </td>
                          <td>
						  <?php if($fetch_exp_jobs['job_type']==5){ echo "Full Time";}?>
						 <?php if($fetch_exp_jobs['job_type']==4){ echo "Part Time";}?>
						 <?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']==1){ echo "Volunteer";}?>
						  <?php if($fetch_exp_jobs['job_type']==7){ echo "Permanent";}?>
						<?php if($fetch_exp_jobs['job_type']==6){ echo "Other";}?>
                            
						  </td>
                        </tr>
                      <?php 
					  $e++;
					  if ($e == 6) 
					  {
						  break;
					  }
					  }?>
					  </tbody>
                    </table>

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

          </div>


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

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

