<?php $this->load->view('header_front');	
foreach($footer_data1 as $val_profile)
{
$can_image=$val_profile->image;
}
$sel_update_data23=mysql_query("select * from njobn_webusers where user_id='".$this->session->userdata('user_id')."'");
$fetch_data_user_update23=mysql_fetch_array($sel_update_data23);
?>
  <div class="reports-section margin-top-30">
  
            	<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/manage_users">Manage Clients</a></li>
                    </ol>
                  
                </div>
                	<div class="users-reports-section">
                    	<h3>Client/Company</h3>
                        <div class="job_expiry">
                        	<!--<span>job expiry reminder:</span>-->
                            <ol class="breadcrumb">
							
                             <!-- <li><a href="#">ON</a></li>
                              <li><a href="#">Turn off</a></li>-->
							  <!--<li><a href="<?php echo base_url();?>front_end/manage_users">Add user</a></li>-->
                            </ol>
                        </div>
                    </div>
                    
					<?php if(isset($_GET['user_id'])!='')
					{
					$sel_update_data=mysql_query("select * from njobn_webusers where user_id='".$_GET['user_id']."'");
					$fetch_data_user_update=mysql_fetch_array($sel_update_data);
					?>
					
					<form id="recruiters" name="recruiters" class="form-horizontal"  method="post" onSubmit="return update_recruitersform()" action="<?php echo base_url();?>front_end/update_recuter_users">
					<input type="hidden" name="user_id" id="user_id" value="<?php echo $_GET['user_id'];?>" />
        
        <div class="panel panel-default" id="profileBasicinfo">
          <h3 style="text-align:center;">Update Client / Company</h3>
		  <div  id="recsucccessDiv" class="reg_error" style="margin-top: 0px;margin-bottom: 9px;padding-left: 9px;"></div> 
<div  id="recerrorDiv" class="reg_error"></div> 
<div  id="recsucccessDiv" class="reg_error"></div>
<p style="color:#FF0000;text-align: center;"> <?php echo $this->session->flashdata('succesmessage');?></p>
          <div class="row">
            <div class="col-sm-8 col-sm-push-1">
              
              
              <div class="form-group">
                <label class="col-sm-4 control-label" for="new-password">First Name</label>
                <div class="col-sm-8">
                 <input class="form-control"  value="<?php echo  $fetch_data_user_update['fname'];?>" placeholder="First Name" name="recfname" id="recfname" type="text" ><span id="recfname_error" class="reg_error">Enter your first name </span> 
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="confirm-password">Last Name</label>
                <div class="col-sm-8">
                  <input placeholder="Last Name" class="form-control" value="<?php echo  $fetch_data_user_update['lname'];?>" name="reclname" id="reclname" type="text" > 	<span id="reclname_error" class="reg_error">Enter your last name</span></div>
              </div>
			  
			  
			  
			  <div class="form-group">
                <label class="col-sm-4 control-label" for="confirm-password">Company Name</label>
                <div class="col-sm-8">
                  <input placeholder="Company Name" class="form-control" value="<?php echo  $fetch_data_user_update['cname'];?>"  name="reccname" id="reccname" type="text" ><span id="reccname_error" class="reg_error">Enter Company Name</span></div>
              </div>
			  
			  
			  <div class="form-group">
                <label class="col-sm-4 control-label" for="confirm-password">Phone Number</label>
                <div class="col-sm-8">
                  <input placeholder="Phone Number" class="form-control" value="<?php echo  $fetch_data_user_update['phone'];?>" name="recphone" id="recphone" type="text" ><span id="recphone_error" class="reg_error">Enter phone number</span></div>
              </div>
			  
			  <div class="form-group">
                <label class="col-sm-4 control-label" for="confirm-password">Email</label>
                <div class="col-sm-8">
                  <input placeholder="Email"  class="form-control" value="<?php echo  $fetch_data_user_update['email'];?>" name="recemail" id="recemail" type="text" ><span id="recemail_error" class="reg_error">Enter your email address</span>
			  <span id="recemail_error_valid" class="reg_error">Enter email address is not valid</span>
				<span id="emailall" class="reg_error"></span>
								<input type="hidden" name="recerror_email_exit" id="recerror_email_exit" value="" />
								</div>
              </div>
			  
			  <div class="form-group">
                <label class="col-sm-4 control-label" for="confirm-password">Password</label>
                <div class="col-sm-8">
                  <input placeholder="Password"  class="form-control" name="rec1password" id="rec1password" type="password" value="" maxlength="8" >
										<span id="recpass_error" class="reg_error">Enter your password</span>
								</div>
              </div>
			 <div class="form-group">
                <label class="col-sm-4 control-label" for="confirm-password"> Confirm Password</label>
                <div class="col-sm-8">
                 <input placeholder="Confirm Password" name="reccpassword" class="form-control"  id="reccpassword" maxlength="8" type="password" >
				<span id="reccpass_error" class="reg_error">Enter confirm password</span>
			   <span id="recnot_error" class="reg_error">confirm password does not match</span>
								</div>
              </div>
			  <div class="form-group">
                <label class="col-sm-4 control-label" for="confirm-password"> Confirm Password</label>
                <div class="col-sm-8">
				<select  name="user_satus" id="user_satus" style="margin-bottom: 10px;border-radius: 0px;">
						<option value="1" <?php if($fetch_data_user_update['user_satus']==1){?> selected="selected" <?php }?> >Active</option>
						<option value="2" <?php if($fetch_data_user_update['user_satus']==2){?> selected="selected" <?php }?>>Deactive</option>
										</select>
								</div>
              </div>
			  <div class="form-group">
                <label class="col-sm-4 control-label" for="confirm-password">Grant this user access to:</label>
                <div class="col-sm-8">
				
				 <div class="lable-section">
<label><input <?php if($fetch_data_user_update['standard_jobs']==1){?> checked="checked"  <?php }?> type="checkbox" name="standard_jobs" id="standard_jobs" value="1">Post Job</label>
<?php
if($fetch_data_user_update23['subuser']!=1){?>
<label><input <?php if($fetch_data_user_update['featured_jobs']==1){?> checked="checked"  <?php }?>  type="checkbox" name="featured_jobs" id="featured_jobs" value="1">Add Job</label>
<label><input <?php if($fetch_data_user_update['premium_jobs']==1){?> checked="checked"  <?php }?> type="checkbox" name="premium_jobs" id="premium_jobs" value="1">View CVs</label>
<label><input type="checkbox" name="licences_jobs" id="licences_jobs" value="1" <?php if($fetch_data_user_update['licences_jobs']==1){?> checked="checked"  <?php }?>>Download CVs</label>
<?php }?>
 </div>
				
				
								</div>
								</div>
						<div class="form-group">
                <label class="col-sm-4 control-label">&nbsp;</label>
                <div class="col-sm-8">
                  <button type="submit" class="btn btn-primary btn-block" name="update">Update Client / Company</button>
                </div>
              </div>		
								
              </div>
			  
              
              
			 
            </div>
			
          </div>
		  
          <br>
        </div>
      </form>
					
					
					
					<?php }
					else
					{?>
					
					<form id="recruiters" name="recruiters" class="form-horizontal" action="<?php echo base_url();?>front_end/insert_regestartionbyrecter"   method="post" onSubmit="return reg_recruitersform3()">
        
        <div class="panel panel-default" id="profileBasicinfo">
          <h3 style="text-align:center">Add Client / Company</h3>
		  <div  id="recsucccessDiv" class="reg_error" style="margin-top: 0px;margin-bottom: 9px;padding-left: 9px;"></div> 
<div  id="recerrorDiv" class="reg_error"></div> 
<div  id="recsucccessDiv" class="reg_error"></div>
<p style="color:#FF0000;text-align: center;"> <?php echo $this->session->flashdata('succesmessage');?></p>
          <div class="row">
            <div class="col-sm-8 col-sm-push-1">
              
              
              <div class="form-group">
                <label class="col-sm-4 control-label" for="new-password">First Name</label>
                <div class="col-sm-8">
                 <input class="form-control"  value="" placeholder="First Name" name="recfname" id="recfname" type="text" ><span id="recfname_error" class="reg_error">Enter your first name </span> 
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="confirm-password">Last Name</label>
                <div class="col-sm-8">
                  <input placeholder="Last Name" class="form-control" value="" name="reclname" id="reclname" type="text" > 	<span id="reclname_error" class="reg_error">Enter your last name</span></div>
              </div>
			  
			  
			  
			  <div class="form-group">
                <label class="col-sm-4 control-label" for="confirm-password">Company Name</label>
                <div class="col-sm-8">
                  <input placeholder="Company Name" class="form-control" value=""  name="reccname" id="reccname" type="text" ><span id="reccname_error" class="reg_error">Enter Company Name</span></div>
              </div>
			  
			  
			  <div class="form-group">
                <label class="col-sm-4 control-label" for="confirm-password">Phone Number</label>
                <div class="col-sm-8">
                  <input placeholder="Phone Number" class="form-control" value="" name="recphone" id="recphone" type="text" ><span id="recphone_error" class="reg_error">Enter phone number</span></div>
              </div>
			  
			  <div class="form-group">
                <label class="col-sm-4 control-label" for="confirm-password">Email</label>
                <div class="col-sm-8">
                  <input placeholder="Email"  class="form-control" value="" name="recemail" id="recemail" type="text" ><span id="recemail_error" class="reg_error">Enter your email address</span>
			  <span id="recemail_error_valid" class="reg_error">Enter email address is not valid</span>
				<p style="color:#FF0000;"> <?php echo $this->session->flashdata('emailmessage');?></p>
								<input type="hidden" name="recerror_email_exit" id="recerror_email_exit" value="" />
								</div>
              </div>
			  
			  <div class="form-group">
                <label class="col-sm-4 control-label" for="confirm-password">Password</label>
                <div class="col-sm-8">
                  <input placeholder="Password"  class="form-control" name="rec1password" id="rec1password" type="password" value="" maxlength="8" />
										<span id="recpass_error" class="reg_error">Enter your password</span>
								</div>
              </div>
			 <div class="form-group">
                <label class="col-sm-4 control-label" for="confirm-password"> Confirm Password</label>
                <div class="col-sm-8">
                 <input placeholder="Confirm Password" name="reccpassword" class="form-control"  id="reccpassword" maxlength="8" type="password" >
				<span id="reccpass_error" class="reg_error">Enter confirm password</span>
			   <span id="recnot_error" class="reg_error">confirm password does not match</span>
								</div>
              </div>
			  <div class="form-group">
                <label class="col-sm-4 control-label" for="confirm-password">Select Status</label>
                <div class="col-sm-8">
				<select  name="user_satus" id="user_satus" style="margin-bottom: 10px;border-radius: 0px;">
						<option value="1">Active</option>
						<option value="2">Deactive</option>
										</select>
								</div>
              </div>
			  <div class="form-group">
                <label class="col-sm-4 control-label" for="confirm-password">Grant this user access to:</label>
                <div class="col-sm-8">
				
				 <div class="lable-section">
<label><input  type="checkbox" name="standard_jobs" id="standard_jobs" value="1" checked="checked" />Post Job</label>
<?php
if($fetch_data_user_update23['subuser']!=1){?>
<label><input   type="checkbox" name="featured_jobs" id="featured_jobs" value="1">Add Job</label>
<label><input  type="checkbox" name="premium_jobs" id="premium_jobs" value="1">View CVs</label>
<label><input type="checkbox" name="licences_jobs" id="licences_jobs" value="1">Download CVs</label>
<?php }?>
 </div>
				
				
								</div>
              </div>
			  
              <br>
              <div class="form-group">
                <label class="col-sm-4 control-label">&nbsp;</label>
                <div class="col-sm-8">
                  <button type="submit" class="btn btn-primary btn-block" name="update">Add Client / Company</button>
                </div>
              </div>
            </div>
          </div>
          <br>
        </div>
      </form>
					<?php }
					?>
					
                    <div class="users-table">
                    
                    <!--<div class="userstab-section">
                     	<h4>Users</h4>
                        <h5>Products</h5>
                    </div>-->
                    
                    	<div class="table-section margin-top-45 mobile-space">
						<div class="table-responsive">
                                    <table width="100%" class="table" id="datatable-responsive">
                                          <thead>
                                            <tr>
                                             
                                              <th style="width: 243px;text-align: center;">Name</th>
											  <th style="width: 150px;text-align: center;">Email</th>
                                              <th style="width: 150px;text-align: center;">Post Job</th>
                                              <th style="text-align: center;">Add User</th>
                                              <th style="text-align: center;">View CVs</th>
                                              <th style="text-align: center;">Download CVs</th>
                                             <!-- <th>Candidates By Email</th>
                                              <th>CV Match</th>-->
                                              <th style="width: 90px;text-align: center;">Status</th>
                                              <th style="text-align: center;">Action</th>
                                            </tr>
                                          </thead>
                                          <tbody>
                                            <?php
											$sel_data=mysql_query("select * from njobn_webusers where created_by='".$this->session->userdata('user_id')."'");
                                            if(mysql_num_rows($sel_data) > 0)
											{
											while($fetch_get_data=mysql_fetch_array($sel_data))
											{?>
                                            <tr <?php if($fetch_get_data['user_satus']==1){?> class="table-section-color" <?php }?>>
                                              <td>
                                        <span>
										<?php echo $fetch_get_data['fname'].' '.$fetch_get_data['lname'].'<br>';?>										</span>										</td>
											  <td>
                                        <span>
										<?php echo $fetch_get_data['email'];?></span></td>
                                              <td style="text-align: center;">
											  <?php
											  if($fetch_get_data['standard_jobs']==1)
											  {?>
											  <img src="<?php echo base_url();?>assets_front/images/table-icon.png" alt="image"/>
											  <?php }
											  ?>											  </td>
                                              <td style="text-align: center;"> 
											  <?php
											  if($fetch_get_data['featured_jobs']==1)
											  {?>
											  <img src="<?php echo base_url();?>assets_front/images/table-icon.png" alt="image"/>
											  <?php }?>											  </td>
                                              <td style="text-align: center;"> 
											  <?php
											  if($fetch_get_data['premium_jobs']==1)
											  {?>
											  <img src="<?php echo base_url();?>assets_front/images/table-icon.png" alt="image"/>
											  <?php }?></td>
                                              <td style="text-align: center;"> <?php
											  if($fetch_get_data['licences_jobs']==1)
											  {?>
											  <img src="<?php echo base_url();?>assets_front/images/table-icon.png" alt="image"/>
											  <?php }?></td>
                                              <!--<td> <?php
											  if($fetch_get_data['email_jobs']==1)
											  {?>
											  <img src="<?php echo base_url();?>/assets_front/images/table-icon.png" alt="image"/>
											  <?php }?></td>-->
                                              <!--<td> 
											  <?php
											  if($fetch_get_data['match_jobs']==1)
											  {?>
											  <img src="<?php echo base_url();?>/assets_front/images/table-icon.png" alt="image"/>
											  <?php }?>											  </td>-->
                                              <td style="text-align: center;">
											  <?php
											  if($fetch_get_data['user_satus']==1){ echo "Active";}
											  if($fetch_get_data['user_satus']==2){ echo "Deactive";}
											  ?></td>
 											  <td style="text-align: center;"><a href="<?php echo base_url();?>front_end/manage_users?user_id=<?php echo $fetch_get_data['user_id'];?>" style="color:#FFFFFF;">Edit</a></td>
                                            </tr>
											<?php }
											}
											else
											{?>
											<tr>
	  <td style="font-size:11px; font-family:Segoe UI;width: 23%;">
	  <h3 style="font-size: 18px;">No Client/Company found.</h3></td>
	  <td></td>
	  <td></td>
	  <td></td>
	  <td></td>
	  <td></td>
	  <td></td>
	  <td></td>
	 
		   </tr>
											
											<!--<tr>
											<td colspan="9"><p style="color:#FF0000;text-align:center">No Records Found</p></td>
											</tr>-->
											<?php }
											?>
                                          </tbody>
                                    </table>
									</div>
									
                                  
           			  </div>
                    </div>
					
                </div>
				</form>
            </div>
            </div></br>

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