<?php $this->load->view('header_frontinner');
//code for to get web logo			
//error_reporting(0);
$can_id=$this->session->userdata('user_id');
$tbl_name="njobn_webusers";	
$adjacents = 10;
$query = mysql_query("SELECT  * FROM $tbl_name WHERE user_type=1");
$total_pages = mysql_num_rows($query);
$targetpage = "candidate_dashboard"; 	//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
}
$sql = "SELECT * FROM $tbl_name WHERE user_type=1 LIMIT $start, $limit";
$result = mysql_query($sql);
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($result);
?>
<form name="job_order_from" method="request" action="<?php echo base_url();?>front_end/joblisting"> 
<div class="inner-cntnts">
            	<div class="container">
				<div class="section-welcome 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">Browse Candidates</a></li>
                    </ol>
                    <a class="menubtn" href="#"><i class="fa fa-bars"></i></a>
                </div>
				
                    <div class="profile-wrap margin-top-30">
                        <div class="row">
                        <div class="col-sm-12" >
                                <div class="tab-content">
								
								<div class="table-responsive">
								<p style="color:#FF0000;"> <?php echo $this->session->flashdata('short_list');?></p> 
          <table id="datatable-responsive" style="width: 100%;">
         <tbody>
		 <tr>
		   <td height="45" nowrap="" style="font-size:11px; font-family:Segoe UI;"><h3>Candidates Lists</h3></td>
		   <td align="center" style="font-size:10px;"></td>
		   <td align="center">&nbsp;</td>
		   <td align="center">&nbsp;</td>
		   </tr>
		 <?php
if(mysql_num_rows($result) > 0)
{
while($row = mysql_fetch_array($result))
{	
	?>
<tr style="border-bottom:1px solid gray;">
         <td width="236" height="93" nowrap="" style="font-size:11px; font-family:Segoe UI;">
		  <div class="customer-service-section">
         <h4><i class="fa fa-star" aria-hidden="true"></i><a style="color:#cd0329;margin-left: 13px;" href="<?php echo base_url();?>front_end/viewcandidate_dashboard?cand_id=<?php echo $row['user_id'];?>"><?php echo $row['fname'];?></a></h4></div> 
</td>
<td width="194" align="center"><?php
	$sel_job=mysql_query("select * from njobn_jobdetails where job_id='".$row['job_id']."'");
	$fethch_jobs=mysql_fetch_array($sel_job);
	echo $fethch_jobs['job_title'];
	?></td>
      <td width="157" align="center">&nbsp;</td>
      <td width="312" align="center">
	  <?php echo substr($row['summery'],0,100).'......';?>	 </td>
      </tr>
     <?php }
	 }
	 else
	 {?>
	  <tr style="border-bottom:1px solid gray;">
		   <td height="45" colspan="4" nowrap="" style="font-size:11px; font-family:Segoe UI;"><h3 style="color:#FF0000;">No Jobs Founds</h3></td>
		   </tr>
	 <?php }
	 ?>
	  <tr>
      <td height="28" colspan="4"><?=$pagination?>
</td>
      </tr>
      </tbody></table>
	  </div>
                            </div>
                        </div>
                    </div>
                    
                </div>
            </div>
        </div>

         
					</form>
        </div>
		
<?php $this->load->view('footer_front'); ?>