<?php $this->load->view('header_front');
//code for to get web logo			
error_reporting(0);
$can_id=$this->session->userdata('user_id');
//code for job title
$tbl_name="njobn_webusers";	
$shortlisted = mysql_query("SELECT * FROM $tbl_name WHERE user_type=1 AND cv_status=1");
$total_number_shortlisted = mysql_num_rows($shortlisted);
$pendingquery = mysql_query("SELECT * FROM $tbl_name WHERE user_type=1 AND cv_status=0");
$total_number_pending = mysql_num_rows($pendingquery);
$rejected_query = mysql_query("SELECT * FROM $tbl_name WHERE user_type=1 AND cv_status=2");
$total_number_rejected = mysql_num_rows($rejected_query);
$adjacents = 10;
$criteria=$this->input->get('job_title');

$query23 = mysql_query("SELECT * FROM $tbl_name WHERE user_type=1 AND cv_status=1");
$total_pages = mysql_num_rows($query23);
$targetpage = "shortlisted"; 	//your file name  (the name of this file)
$limit = 15; 
if(isset($_GET['page'])!='')
{								//how many items to show per page
$page = $_GET['page'];
}
else
{
$page = 0;
}
if($page) 
{
$start = ($page - 1) * $limit; 			//first item to display on this page
}
else
{
$start = 0;								//if no page var is given, set start to 0
}
$query23 = mysql_query("SELECT * FROM $tbl_name WHERE user_type=1 AND cv_status=1 LIMIT $start, $limit");

if ($page == 0) $page = 1;					//if no page var is given, default to 1.
$prev = $page - 1;							//previous page is page - 1
$next = $page + 1;							//next page is page + 1
$lastpage = ceil($total_pages/$limit);		//lastpage is = total pages / items per page, rounded up.
$lpm1 = $lastpage - 1;						//last page minus 1
$pagination = "";
if($lastpage > 1)
{	
$pagination .= "<div class=\"pagination\">";
if ($page > 1) 
$pagination.= "<ul>
                    	<li><a href=\"$targetpage?page=$prev\"> Previous</a></li>";
else
$pagination.= "<li><a href=\"$targetpage?page=$prev\">Previous</a></li>";	
if ($lastpage < 7 + ($adjacents * 2))	//not enough pages to bother breaking it up
{	
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<li><a href=\"$targetpage?page=$counter\">$counter</a></li>";
else
$pagination.= "<li><a href=\"$targetpage?page=$counter\">$counter</a></li>";					
}
}
elseif($lastpage > 5 + ($adjacents * 2))	//enough pages to hide some
{
if($page < 1 + ($adjacents * 2))		
{
for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
{
if ($counter == $page)
$pagination.= "<li><a href=\"$targetpage?page=$counter\">$counter</a></li>";
else
$pagination.= "<li><a href=\"$targetpage?page=$counter\">$counter</a></li>";					
}
$pagination.= "<li><a href=\"$targetpage?page=$lpm1\">$lpm1</a><li>";
$pagination.= "<li><a href=\"$targetpage?page=$lastpage\">$lastpage</a></li>";		
}
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
{
$pagination.= "<li><a href=\"$targetpage?page=1\">1</a></li>";
$pagination.= "<li><a href=\"$targetpage?page=2\">2</a></li>";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
{
if ($counter == $page)
$pagination.= "<li><a href=\"$targetpage?page=$counter\">$counter</li></a>";
else
$pagination.= "<li><a href=\"$targetpage?page=$counter\">$counter</a></li>";					
}
$pagination.= "<li><a href=\"$targetpage?page=$lpm1\">$lpm1</a>";
$pagination.= "<li><a href=\"$targetpage?page=$lastpage\">$lastpage</a></li>";		
}
else
{
$pagination.= "<li><a href=\"$targetpage?page=1\">1</a></li>";
$pagination.= "<li><a href=\"$targetpage?page=2\">2</a></li>";
$pagination.= "...";
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<li><a href=\"$targetpage?page=$counter\">$counter</a></li>";
else
$pagination.= "<li><a href=\"$targetpage?page=$counter\">$counter</a></li>";					
}
}
}
if ($page < $counter - 1) 
$pagination.= "<li><a href=\"$targetpage?page=$next\">Next</a></li>";
else
$pagination.= "<li><a href=\"$targetpage?page=$next\">Next</a></li>";
$pagination.= "</ul></div>\n";		
}
$number_wew=mysql_num_rows($query23);
?>		
<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/browse_candidates">CV Bank DataBase</a></li>
					   <li><a href="<?php echo base_url();?>front_end/shortlisted">Short Listed (<?php echo  $total_number_shortlisted ;?>)</a></li>
					   <li><a href="<?php echo base_url();?>front_end/pending">Pending (<?php echo  $total_number_pending ;?>)</a></li>
					   <li><a href="<?php echo base_url();?>front_end/rejected">Rejected (<?php echo  $total_number_rejected ;?>)</a></li>
                    </ol>
                    
                </div>
                	<div class="activity-reports-section recruiters" style="margin-bottom:8px;">
                    	<h3>Shortlisted jobseekers</h3>
                    </div>
					 
					
					
                        <!--<div class="col-sm-12 boder-buttem-section">
                        </div>-->
                        <div class="reports-contan">
                           
                           <!--<ul class="summary-section recruiters-bg margin-top-15">
                           
                            	<li><h4>Posted job ads<span>19</span></h4></li>
                                <li><h5>Standerd<span>19</span></h5></li>
                                <li><h5>Featured<span>0</span></h5></li>
                                <li><h5>Premium<span>0</span></h5></li>
                                <li><h4>views<span>4612</span></h4></li>
                                <li><h4>Application<span>444</span></h4></li>
                           </ul>-->
                          <div class="cvdownloads-section margin-top-30">
					<p style="color:#FF0000;"> <?php echo $this->session->flashdata('mesagejobpost');?></p> 
                            <!--<h5>Bulk actions</h5>
                            <div class="right-dropdon recruiter-cont">
                                <label>SHighlight jobs available to:</label>
                                <select>
                                    <option>25</option>
                                    <option>22</option>
                                    <option>20</option>
                                    <option>19</option>
                                </select>
                            </div>-->
                   
            
                        <div class="tab-recruiter margin-top-45 mobile-space">
                            <table width="100%" class="table">
                                  <thead>
                                    <tr>
									<th></th>
                                      <th>Name</th>
                                      <th>Career Summary</th>
									  <th>Skills</th>
									 
                                    </tr>
                                  </thead>
                                  <tbody>
								  	 <?php
	 while($row=mysql_fetch_array($query23))
{
	
$sel_looking_for = mysql_query("select * from njobn_candidate where candidate_id='".$row['user_id']."'");
$fetch_candiate_image = mysql_fetch_array($sel_looking_for);
$candiimage_profile = $fetch_candiate_image['image'];

	 
	 
	 ?>
	 <tr>
									<td> <?php
                                if ($candiimage_profile!= '') {
                                    ?>
              <div style="background-image: url('<?php echo base_url(); ?>assets/upload/<?php echo $candiimage_profile; ?>');width:76px;height:71px;" class="profile-photo" id="select_logo" ></div>
              <?php } else {
                        ?>
              <div style="background-image: url('<?php echo base_url(); ?>assets_front/images/JNJUKWebLogo.png');width:76px;height:71px;" class="profile-photo" id="select_logo" ></div>
              <?php }
                                ?> </br>
								
				
				<a href="<?php echo base_url();?>front_end/senduseremail?user_id=<?php echo $row['user_id'];?>" class="link" onclick="return confirm('Are you sure to send email?');" style="color:#FFFFFF;">
                <img src="../assets/img/mail.png"> Send Email</a>
				
								
								</td>
                                      <td>
                                      	 
										 
										  <a style="color:#FFFFFF;" href="<?php echo base_url();?>front_end/viewcandidate_dashboard?cand_id=<?php echo $row['user_id'];?>"><?php echo $row['fname'].' '.$row['lname'].' '.'<label>'.'Age:'.$row['age'].'</label>';?>
</br>
<?php echo $row['job_title'];?>
</br>
</br>
<?php $sel_qualifications = mysql_query("select * from qualifications where candidate_id='".$row['user_id']."'");
while($fetch_quifictaions=mysql_fetch_array($sel_qualifications))
{
echo $fetch_quifictaions['school_name'].'<br>'; 
}
?>
										  
										  </a>
										 
                                      </td>
									  <td><?php 
$sel_work_history = mysql_query("select * from work_history where candidate_id='".$row['user_id']."'");
while($fecth_work_his=mysql_fetch_array($sel_work_history))
{
echo $fecth_work_his['job_title'].' '.$fecth_work_his['cname'].'<br>'; 
}
?></td>
                                      <td><?php 
				  
				  /*$sel_skill = mysql_query("SELECT * FROM candidate_skills WHERE candidate_id='".$user_id."'");*/
				  $this->db->where('candidate_id',$row['user_id']);
				  $query44=$this->db->get('candidate_skills');
				  $skills_data = $query44->result();
				  foreach($skills_data as $val)
				  {
					  $skill_name=mysql_query("select * from skills where skill_id='".$val->skill_id."'");
					  $fetch_skill_name=mysql_fetch_array($skill_name);
					  echo $fetch_skill_name['skill_name']."</br>";
				  } ?></td>
                                      
                                    </tr>
									
									 <?php }?>
	
	   <tr>
      <td height="28" colspan="4"><?=$pagination?></td></tr>
                                  </tbody>
                            </table>
                          
                        </div>
                        
                     </div> 
                  </div>
              </div>
			  </div>
           </div>
		   
            </div></br>		
		
		
		
		
<?php $this->load->view('footer_front'); ?>