<?php $this->load->view('header_frontinner'); 
 $this->load->view('security_front'); 
 error_reporting(0);
foreach($footer_data1 as $val_profile)
{
$can_image=$val_profile->image;
}
//code fro reports
$sel_jobname=mysql_query("select * from njobn_jobdetails where created_by='".$this->session->userdata('user_id')."'");
$fetch_jobname=mysql_fetch_array($sel_jobname);
$companyname=$fetch_jobname['cname'];
?>
  <div class="reports-section margin-top-30">
  <div class="section-welcome">
            	<div class="container">
				 <div class="nav-welcome">
                 <ol class="breadcrumb">
                      <li><a href="<?php echo base_url();?>front_end/employee_dashboard">Dashboard</a></li>
                      <li><a href="<?php echo base_url();?>front_end/reports">Reports</a></li>
                    </ol>
                    <a class="menubtn" href="#"><i class="fa fa-bars"></i></a>
                </div>
                	<div class="activity-reports-section">
                    	<h3>Reports</h3>
                        <span>
                        <input class="report-bg" type="button" value="Print" onclick="printreportsdata()">
                        </span>
                    </div>
                    <div class="reports-contan">
                    	 <ul class="nav nav-tabs">
                              <li class="active"><a data-toggle="tab" href="#reporte">Job Activity Report</a></li>
                              <li><a data-toggle="tab" href="#cv-activity">CV Database Activity Report</a></li>
                        </ul>
                        
                        <div class="tab-content">
                          <div id="reporte" class="tab-pane fade in active">
                             
                                   <!--<ul class="reference-section">
                                        <li class="col-md-4"><h4><?php echo $companyname;?><span>Account Reference:</span></h4></li>
                                        <li class="col-md-4"><p>Reporting period:<br>Current billing period<br>23 May 2016 - 31 May 2016</p></li>
                                   </ul>-->
                                   
                                   <div class="account-summaryg margin-top-15">
                                   		<h4>Account Summary</h4>
                                   </div>
                                   <ul class="summary-section margin-top-15">
                                   		<!--<li><h5>Downloads<span></span></h5></li>-->
                                       <!-- <li><h5>Searches<span>60</span></h5></li>-->
                                        <!--<li><h5><?php
									  $sel_cv_count=mysql_query("select * from cv_counters where candidate_id='".$val->job_id."'");
									  $number_couneter=mysql_num_rows($sel_cv_count);
									  echo $number_couneter;
									  ?><span>173</span></h5></li>-->
                                      <!-- <li><h5>Searches<span>60</span></h5></li>-->
                                        <li><h5 style="width:260px;">Views<span><?php
									  //echo "select * from jobview_counters where job_id='".$row['job_id']."'";
									  $sel_jobsdetail23=mysql_query("select * from njobn_jobdetails where created_by='".$this->session->userdata('user_id')."'");
									  while($fetch_job_ids=mysql_fetch_array($sel_jobsdetail23))
									  {
									  $sel_jobviews_count1=mysql_query("select * from jobview_counters where job_id='".$fetch_job_ids['job_id']."'");
									  $number_jobviewcouners1=mysql_num_rows($sel_jobviews_count1);
									  echo $fetch_job_ids['job_title'].':'.$number_jobviewcouners1.'<br>';
									  }
									  ?></span></h5></li>
                                   </ul>
                                 
                                  <div class="cvdownloads-section margin-top-30">
                                	<h5>Posted Jobs</h5>
                                    <!--<div class="right-dropdon">
                                        <label>Show me</label>
                                        <select>
                                            <option>25</option>
                                            <option>22</option>
                                            <option>20</option>
                                            <option>19</option>
                                        </select>
                                    </div>-->
                    			
                    
                    			<div class="table-section margin-top-45 mobile-space" id="active_jobs">
                                    <table class="table">
                                          <thead>
                                            <tr>
                                              <th style="width: 320px;">Job Title</th>
                                              <th>Views</th>
                                              <th>Applications</th>
                                              <th>Location</th>
                                              <th>Job Reference #</th>
                                              <th style="width: 160px;">Posted On</th>
                                              <th>Posted By</th>
                                            </tr>
                                          </thead>
                                          <tbody>
<?php
foreach($query_date_reports as $val)
{	
?>                   
                                            <tr>
                                              <td>
											  <a style="color:#cd0329" href="<?php echo base_url();?>front_end/viewjobreport?id=<?php echo $val->job_id;?>"><?php echo $row['job_title'];?></a></td>
                                              <td><?php
									  //echo "select * from jobview_counters where job_id='".$row['job_id']."'";
									  $sel_jobviews_count=mysql_query("select * from jobview_counters where job_id='".$val->job_id."'");
									  $number_jobviewcouners=mysql_num_rows($sel_jobviews_count);
									  echo $number_jobviewcouners;
									  ?></td>
                                              <td style="color: #ce0229;">
										<a style="color: #ce0229;" href="<?php echo base_url();?>front_end/viewapplication?job_id=<?php echo $val->job_id;?>">	  
											  <?php
									  $sel_apllicatons_count=mysql_query("select * from candidate_listjobs where job_id='".$val->job_id."'");
									  $number_applciations=mysql_num_rows($sel_apllicatons_count);
									  
									  echo $number_applciations;
									  ?></a></td>
                                              <td><?php
	$sel_countries=mysql_query("select * from countries where id='".$val->job_location_id."'");
	$fethch_counries=mysql_fetch_array($sel_countries);
	echo $fethch_counries['name'];
	?></td>
                                              <td><?php echo $val->job_refernce;?></td>
                                              <td> <?php  $post_date=date('F d Y',strtotime($val->date)); 
											echo $post_date;
									  ?></td>
<td><?php
$sel_users=mysql_query("select * from njobn_webusers where user_id='".$val->created_by."'");
$fethch_users=mysql_fetch_array($sel_users);
echo $fethch_users['email'];
?></td>
                                            </tr>
					<?php
					
					}
				
				 ?>
                                          </tbody>
                                    </table>
                                  
                    			</div>
                                 
                              </div>
                           </div>
                          <div id="cv-activity" class="tab-pane fade">
                            <div id="reporte" class="tab-pane fade in active">
                              <div class="row">
                                   <!--<ul class="reference-section">
                                    <li class="col-md-4"><h4><?php echo $companyname;?><span>Account Reference:</span></h4></li>
                                    <li class="col-md-4"><p>Reporting period:<br>Current billing period<br>23 May 2016 - 31 May 2016</p></li>
                                  
                                   </ul>-->
                                   <!--<div class="account-summaryg margin-top-15">
                                   		<h4>Account summary</h4>
                                   </div>-->
                                   <!--<ul class="summary-section margin-top-15">
                                   		<li><h5>Downloads<span>
										<?php
										//code for cv download
										$selc_qyery_down=mysql_query("select * from cv_counters where download_by='".$this->session->userdata('user_id')."'");
										echo mysql_num_rows($selc_qyery_down);
										?>
										</span></h5></li>
                                       
                                        <li><h5>Views<span><?php
										//code for cv download
										$selc_qyery_view=mysql_query("select * from cv_counters where view_by='".$this->session->userdata('user_id')."'");
										echo mysql_num_rows($selc_qyery_view);
										?></span></h5></li>
                                   </ul>-->
                                   <!--<div class="account-breakdown">
                                   		<h5>Account breakdown</h5>
                                        <span> Filter CV Database activity by:</span>
                                        <div class="summary-all">
                                        	<a href="#">All</a>
                                            <a href="#">User</a>
                                        </div>
                                   </div>-->
                                   
                                    <!--<div class="account-contact margin-top-15">
                                   		<h3>CV Database activity by company</h3>
                                   </div>-->
                                   
                                    <!--<div class="account-search margin-top-15">
                                   		<h4><?php echo $companyname;?></h4>
                                   </div>-->
                                   <!--<ul class="summary-section margin-top-15">
                                   		<li><h5>Downloads<span><?php
										//code for cv download
										$selc_qyery_compnydown=mysql_query("select * from cv_counters where download_by!=''");
										echo mysql_num_rows($selc_qyery_compnydown);
										?></span></h5></li>
                                        <li><h5>Views<span><?php
										//code for cv download
										$selc_qyery_compnyview=mysql_query("select * from cv_counters where view_by!=''");
										echo mysql_num_rows($selc_qyery_compnyview);
										?></span></h5></li>
                                   </ul>-->
                                   
                                   <div class="account-contact margin-top-30">
                                   		<h3>Account Summary</h3>
                                   </div>
                                   <?php
								   foreach($get_users_cvrecords as $cvviews)
								   {?>
                                    <div class="account-search margin-top-15">
                                   		<h4><?php echo  $cvviews->fname.' '.$cvviews->fname;?></h4>
                                   </div>
                                   <ul class="summary-section margin-top-20">
                                   		<li><h5>Downloads<span><?php 
										$selc_qyery_userdown=mysql_query("select * from cv_counters where download_by='".$cvviews->user_id."'");
										echo mysql_num_rows($selc_qyery_userdown);?></span></h5></li>
                                  <!-- <li><h5>Searches<span>2</span></h5></li>-->
                                        <li><h5>Views<span><?php 
										$selc_qyery_userview=mysql_query("select * from cv_counters where view_by='".$cvviews->user_id."'");
										echo mysql_num_rows($selc_qyery_userdown);?></span></h5></li>
                                   </ul>
                                   <?php }?>
                              </div>
                               <div class="cvdownloads-section margin-top-30">
                                	<h5>CV downloads & views</h5>
                                    <!--<div class="right-dropdon">
                                        <label>Show me</label>
                                        <select>
                                            <option>25</option>
                                            <option>22</option>
                                            <option>20</option>
                                            <option>19</option>
                                        </select>
                                    </div>-->
                    			</div>
                    
                    			<div class="table-section-tab-2 margin-top-45 mobile-space">
                                    <table class="table">
                                          <thead>
                                            <tr>
                                              <th>Recruiter Name</th>
                                             <!-- <th>Company</th>-->
                                              <th>Action</th>
                                              <th>Date</th>
                                              <th>Candidate Name</th>
                                              <th>Current Job Title</th>
                                              
                                            </tr>
                                          </thead>
                                          <tbody>
										  
										   <?php
								   foreach($showcvdownloadslist as $showcvdownlods)
								   {
								   //get the user info
								   //echo "select * from njobn_webusers where user_type=2 AND user_id='".$showcvdownlods->view_by."'";
								   $sel_rec=mysql_query("select * from njobn_webusers where user_type=2 AND user_id='".$showcvdownlods->view_by."'");
								   $fetch_usersname=mysql_fetch_array($sel_rec);
								   $sel_cand=mysql_query("select * from njobn_webusers where user_type=1 AND user_id='".$showcvdownlods->candidate_id."'");
								   $fetch_candname=mysql_fetch_array($sel_cand);
								   //get user job ttile
								   $sle_jobdetails_user=mysql_query("select * from njobn_jobdetails where job_id='".$fetch_candname['job_id']."'");
								   $fetch_job_data=mysql_fetch_array($sle_jobdetails_user);
								   ?>
                                            <tr>
                                              <td><?php echo $fetch_usersname['fname'].' '.$fetch_usersname['lname'];?></td>
                                            <!--  <td><?php echo $fetch_usersname['cname'];?></td>-->
                                              <td><?php 
											  if($showcvdownlods->view_by!='')
											  {echo "Viewed";}
											  else{echo "Panding";}
											  ?></td>
                                              <td><?php  $exp_date=date('F d Y',strtotime($showcvdownlods->date)); 
											echo $exp_date;
									  ?></td>
                                              <td><?php echo $fetch_candname['fname'].' '.$fetch_candname['lname'];?></td>
                                              <td><?php echo $fetch_job_data['job_title'];?></td>
                                             
                                            </tr>
                                      <?php }?>
                                            
                                          </tbody>
                                    </table>
                                  
                    			</div>
                           </div>
                          </div>
                        </div> 
                    </div>
                  
                    
                </div>
				</div>
            </div>
            </div></br>
<?php $this->load->view('footer_front'); ?>