<?php
error_reporting(0);
$this->load->view('header_front');
$this->load->view('security_front');
$can_id = $this->session->userdata('user_id');
$sel_personal_information = mysql_query("select * from njobn_webusers where user_id='".$can_id."'");
$fetch_personal_data = mysql_fetch_array($sel_personal_information);
//count number rows for lookin for
$sel_looking_for = mysql_query("select * from njobn_candidate where candidate_id='".$can_id."'");
$fetch_candiate_image = mysql_fetch_array($sel_looking_for);
$candiimage_profile = $fetch_candiate_image['image'];
$num_rows_looking_for = mysql_num_rows($sel_looking_for);

//conut code for work hostory

$sel_work_history = mysql_query("select * from work_history where candidate_id='".$can_id."'");

$num_rows_work_history = mysql_num_rows($sel_work_history);

//conut code for work qualifications

$sel_qualifications = mysql_query("select * from qualifications where candidate_id='".$can_id."'");

$num_rows_qualifications = mysql_num_rows($sel_qualifications);

//conut code for  skills

$sel_skills = mysql_query("select * from candidate_skills where candidate_id='".$can_id ."'");

$num_rows_skills = mysql_num_rows($sel_skills);

//conut code for candidate_language

$sel_candidate_language = mysql_query("select * from candidate_language where candidate_id='".$can_id."'");

$num_rows_candidate_language = mysql_num_rows($sel_candidate_language);


//conut code for candidate_language

$sel_candidate_license = mysql_query("select * from candidate_license where candidate_id='" . $can_id . "'");
$num_rows_candidate_license = mysql_num_rows($sel_candidate_license);
//get job title
$sele_job_query = mysql_query("select * from njobn_jobdetails where job_id='" . $fetch_personal_data['job_id'] . "'");
$fetch_job_title = mysql_fetch_array($sele_job_query);
if ($fetch_personal_data['address'] != '') {
    $addressper = 5;
}
if ($fetch_personal_data['email'] != '') {
    $emailper = 5;
}
if ($fetch_personal_data['phone'] != '') {
    $phoneper = 5;
}
if ($fetch_personal_data['linkedin'] != '') {
    $linkedinper = 5;
}
if ($fetch_personal_data['facebook'] != '') {
    $facebookper = 5;
}
if ($fetch_personal_data['twitter'] != '') {
    $twitterper = 5;
}
if ($fetch_personal_data['upwork'] != '') {
    $upworkper = 5;
}
if ($candiimage_profile != '') {
    $imageper = 5;
}
if ($fetch_personal_data['summery'] != '') {
    $summeryper = 10;
}
if ($fetch_personal_data['cv_file'] != '') {
    $cv_fileper = 10;
}

if ($fetch_personal_data['cover_info'] != '') {
    $cover_infoper = 10;
}
if ($fetch_candiate_image['salary_from'] != 0 && $fetch_candiate_image['salary_to'] != 0) {
    $lookinforper = 5;
}
if ($num_rows_work_history > 0) {
    $workhistoryper = 5;
}
if ($num_rows_qualifications > 0) {
    $qualificationsper = '5';
}
if ($num_rows_skills > 0) {
    $skillsper = '5';
}
if ($num_rows_candidate_language > 0) {
    $languageper = '5';
}
if ($num_rows_candidate_license > 0) {
    $licenseper = '5';
}
$width = $addressper + $emailper + $phoneper + $linkedinper + $facebookper + $twitterper + $upworkper + $imageper + $summeryper + $cv_fileper + $cover_infoper + $lookinforper + $workhistoryper + $qualificationsper + $skillsper + $languageper + $licenseper;


//code for to get personal information

?>

<div class="container main-content">
  <div class="row">
    <div class="col-xs-12 col-sm-12 col-md-8 profile">
      <div class="panel panel-default panel-profile-header">
        <div class="profile-header-bg"></div>
        <div class="profile-header-info">
          <div class="row">
            <div class="col-sm-12 text-center">
              <?php

                            //code for to get web logo
                            foreach ($footer_data1 as $val_profile) {
                                $salary_from = $val_profile->salary_from;
                                $salary_to = $val_profile->salary_to;
                                $currency = $val_profile->currency;
                                $can_image = $val_profile->image;
								$perday = $val_profile->perday;
                            }
                            ?>
              <?php
                                if ($can_image != '') {
                                    ?>
              <div style="background-image: url('<?php echo base_url(); ?>assets/upload/<?php echo $can_image; ?>');" class="profile-photo" id="select_logo" ></div>
              <?php } else {
                        ?>
              <div style="background-image: url('<?php echo base_url(); ?>assets_front/images/JNJUKWebLogo.png');" class="profile-photo" id="select_logo" ></div>
              <?php }
                                ?>
              <?php

                                //code for to show first name and last name

                                foreach ($profile as $val_fname_lname) {

                                    $gre_job = $val_fname_lname->gre_job;

                                    ?>
              <p><?php echo $val_fname_lname->fname . ' ' . $val_fname_lname->lname; ?><br>
                <?php } ?>
                <?php

                            //code for to show email address and and phone

                            foreach ($profile as $val_adress_email_phone) {
                                $address=$val_adress_email_phone->address;
                                $phone=$val_adress_email_phone->phone;
                                $email=$val_adress_email_phone->email;
                                $linkedin=$val_adress_email_phone->linkedin;
                                $facebook=$val_adress_email_phone->facebook;
                                $twitter=$val_adress_email_phone->twitter;
                                $upwork=$val_adress_email_phone->upwork;
                            }
                            ?>
                <?php echo $phone;?>&nbsp; <br>
                <?php echo $email;?>&nbsp;<br>
              </p>
              <span id="newProfilePicLabel" class="new-pic-label"></span>
              <div id="newProfilePicFileHolder"><span class="file-input file-input-new">
                <form name="upload_image" id="upload_image" action="<?php echo base_url(); ?>front_end/upload_imageprofile" method="post" enctype="multipart/form-data">
                  <div class="col-sm-8" style="width: 100%;">
                    <button type="submit" style="width: 44%;margin-left: auto;margin-right: auto;" class="btn btn-primary btn-block" name="update">Change Profile Photo</button>
                  </div>
                  <div class="btn btn-primary btn-file" style="display: none;"> </div>
                  <input type="hidden" name="oldimageprofile" value="<?php echo $can_image; ?>"/>
                  <input type="file" id="image" name="image"/>
                </form>
                </span>
                <!--[if lt IE 10]><br><div class="alert alert-warning"><strong>Note:</strong> Your browser does not support multiple file upload. Try an alternative or more recent browser to access these features.</div><script>jQuery("#profilePhotoFileInput").removeClass('file-loading');</script><![endif]-->
              </div>
            </div>
          </div>
        </div>
      </div>
      <?php
//code for job ype lising
foreach ($get_job_types as $val_job_types) 
{
$arr[] = $val_job_types->job_type_id;
}

?>
      <form name="looking_for" id="profilePreferenceForm" method="post" action="<?php echo base_url(); ?>front_end/add_looking_for" onsubmit="return lookingforjob()">
        <div class="panel panel-default" id="profilePreference">
          <h3>Job Preference</h3>
          <div class="row">
            <div class="col-sm-10 col-sm-push-1">
              <div class="form-group">
                <p style="color:#FF0000;"> <?php echo $this->session->flashdata('looking_for_message'); ?></p>
                <label class="col-xs-12 col-sm-4 control-label">Availability</label>
                <div class="col-sm-8"> <input type="checkbox" name="alert_my_account" id="alert_my_account" value="1" <?php if($fetch_personal_data['alert_my_account']==1){?> checked="checked"<?php }?>
				
                  <label for="isavl"><strong>I can start work anytime</strong></label>
                  <br>
                  <p class="small-note">This will automatically turned OFF every week.<br>
                    Turn it ON to keep employer informed of your availability.</p>
                </div>
              </div>
              <div class="form-group">
                <label class="col-xs-12 col-sm-4 control-label">Job Type</label>
                <div class="col-sm-8"><strong>What job types you prefer?</strong>
                  <ul class="list-unstyled" >
                    <li>
                      <label for="jt_1">
                      <input type="checkbox" <?php if(in_array(5,$arr)){?> checked="checked" <?php } ?> name"job_type[]" id="job_type" value="5">
                      Full Time</label>
                    </li>
                    <li>
                      <label for="jt_1">
                      <input type="checkbox" <?php if (in_array(4, $arr)) { ?> checked="checked" <?php } ?> name="job_type[]" id="job_type" value="4">
                      Part Time</label>
                    </li>
                    <li>
                      <label for="jt_1">
                      <input type="checkbox" <?php if (in_array(3, $arr)) { ?> checked="checked" <?php } ?>name="job_type[]" id="job_type" value="3">
                      Contract</label>
                    </li>
                    <li>
                      <label for="jt_1">
                      <input type="checkbox" <?php if (in_array(2, $arr)) { ?> checked="checked" <?php } ?>name="job_type[]" id="job_type" value="2">
                      Temporary</label>
                    </li>
                    <li>
                      <label for="jt_1">
                      <input type="checkbox" <?php if (in_array(1, $arr)) { ?> checked="checked" <?php } ?>name="job_type[]" id="job_type" value="1">
                      Volunteer</label>
                    </li>
                    <li>
                      <label for="jt_1">
                      <input type="checkbox" <?php if (in_array(6, $arr)) { ?> checked="checked" <?php } ?>name="job_type[]" id="job_type" value="6">
                      Other </label>
                    </li>
                  </ul>
                </div>
              </div>
              <p>Expected Salary</p>
              <div class="form-group">
                <div class="col-xs-3 col-sm-3">
                  <div class="input-group"><span class="input-group-addon" id="addon-expcurr"></span>
                    <select class="form-control" id="exampleSelect1" name="currency">
                      <?php
														$querycurrency=$this->db->get('currency');
														$resultscurrency = $querycurrency->result();
														foreach ($resultscurrency as $rowcurrency)
														{?>
                      <option value="<?php echo $rowcurrency->skill_id;?>" <?php if($currency==$rowcurrency->skill_id){?> selected="selected" <?php }?>><?php echo $rowcurrency->skill_code;?></option>
                      <?php }?>
                    </select>
                  </div>
                </div>
                <div class="col-xs-3 col-sm-3">
                  <div class="input-group"><span class="input-group-addon" id="addon-expcurr"></span>
                    <input type="text" class="form-control" name="salary_from" id="salary_from" placeholder="250,00.00" value="<?php echo $salary_from; ?>" onkeyup="javascript:this.value=Comma(this.value);">
                  </div>
                  <span id="salary_from_error" class="reg_error"><?php echo form_error('salary_from'); ?></span> </div>
                <div class="col-xs-3 col-sm-3">
                  <div class="input-group"><span class="input-group-addon" id="addon-expcurr"></span>
                    <input type="text" class="form-control" name="salary_to" id="salary_to" placeholder="350,00.00" value="<?php echo $salary_to; ?>"  onkeyup="javascript:this.value=Comma(this.value);">
                  </div>
                  <span id="salary_to_error" class="reg_error"><?php echo form_error('salary_to'); ?></span> </div>
                <div class="col-xs-3 col-sm-3">
                  <select class="form-control" id="perday" name="perday" style="width: 110px;">
                    <option value="1" <?php if($perday==1){?> selected="selected" <?php }?>>Per Day</option>
                    <option value="2" <?php if($perday==2){?> selected="selected" <?php }?>>Per Week</option>
                    <option value="3" <?php if($perday==3){?> selected="selected" <?php }?>>Per Annum</option>
                  </select>
                </div>
              </div>
              <br>
              <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">Update Job Preference</button>
                </div>
              </div>
            </div>
          </div>
        </div>
      </form>
      <form name="work" id="profile-form" class="form-horizontal"  method="post" action="<?php echo base_url();?>front_end/add_personal_inforation" onsubmit="return fromwork()">
        <div class="panel panel-default" id="profileBasicinfo">
          <h3>Basic Information</h3>
          <p style="color:#FF0000;"> <?php echo $this->session->flashdata('myprofile_data');?></p>
          <div class="row">
            <div class="col-sm-10 col-sm-push-1">
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-fullname">First Name</label>
                <div class="col-sm-8">
                  <input type="text" value="<?php echo $fetch_personal_data['fname'];?>" name="fname" class="form-control" id="fname" onkeypress="return alphaOnly(event)" placeholder="Subject">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-fullname">Last  Name</label>
                <div class="col-sm-8">
                  <input type="text" name="lname" class="form-control" id="lname" value="<?php echo $fetch_personal_data['lname'];?>"  onkeypress="return alphaOnly(event)" size="width: 380px;" placeholder="Subject">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-email">Email address</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" id="email" name="email" value="<?php echo $fetch_personal_data['email'];?>" placeholder="Email" onkeypress="return alphaOnly(event)" >
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-mobile">Mobile Number</label>
                <div class="col-sm-8">
                  <input type="text" name="phone" class="form-control" value="<?php echo $fetch_personal_data['phone'];?>" id="phone"  placeholder="Phone Number">
                </div>
              </div>
			  
			  <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-mobile">Age</label>
                <div class="col-sm-8">
				<select class="form-control"  name="age" id="fage">
							  							   <option  value="">Select Age</option>
<?php
for($fage=20;$fage<=60;$fage++)
{?>
<option  value="<?php echo $fage ?>" <?php if($fetch_personal_data['age']==$fage){?> selected="selected" <?php }?>><?php echo $fage;?></option>
<?php }?>
</select>
				
				
                  
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-mobile">Job Title</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" id="job_title" name="job_title" value="<?php echo $fetch_personal_data['job_title'];?>" placeholder="Job Title" onkeypress="return alphaOnly(event)">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-empstatus">Employment Status</label>
                <div class="col-sm-8">
                  <select class="form-control"  name="emp_satus" id="emp_satus" style="margin-top: -4px">
                    <option value="">Select One</option>
                    <option value="1" <?php if($fetch_personal_data['emp_satus']==1) {?> selected="selected" <?php }?>>Actively Seeking</option>
                    <option value="2" <?php if($fetch_personal_data['emp_satus']==2) {?> selected="selected" <?php }?>>Contract Role</option>
                    <option value="3" <?php if($fetch_personal_data['emp_satus']==3) {?> selected="selected" <?php }?>>Permanent Role</option>
                    <option value="4" <?php if($fetch_personal_data['emp_satus']==4) {?> selected="selected" <?php }?>>Part Time</option>
                    <option value="5" <?php if($fetch_personal_data['emp_satus']==5) {?> selected="selected" <?php }?>>Full Time</option>
                    <option value="6" <?php if($fetch_personal_data['emp_satus']==6) {?> selected="selected" <?php }?>>Redundant</option>
                  </select>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-empstatus">Nationailty</label>
                <div class="col-sm-8">
                  <select name="nationailty" class="form-control"id="nationailty">
                    <option value="">Select Nationailty</option>
                    <?php
	$sel_nationalities=mysql_query("select * from nationalities");
	while($fethch_nationalities=mysql_fetch_array($sel_nationalities))
	{
	?>
                    <option value="<?php echo $fethch_nationalities['id'];?>" <?php if($fetch_personal_data['nationailty']==$fethch_nationalities['id']) {?> selected="selected" <?php }?> ><?php echo $fethch_nationalities['name'];?></option>
                    <?php }?>
                  </select>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Linkedin</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" id="linkedin" name="linkedin" value="<?php echo $fetch_personal_data['linkedin'];?>"  placeholder="https://www.linkedin.com/test">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Facebook</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" id="facebook" name="facebook" value="<?php echo $fetch_personal_data['facebook'];?>"  placeholder="https://www.facebook.com/Kulachisoft-554490381260844/">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Linkedin</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" id="linkedin" name="linkedin" value="<?php echo $fetch_personal_data['linkedin'];?>"  placeholder="https://www.linkedin.com/test">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Twitter</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" id="twitter" name="twitter" value="<?php echo $fetch_personal_data['twitter'];?>"  >
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Upwork</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" id="upwork" name="upwork" value="<?php echo $fetch_personal_data['upwork'];?>"  >
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Address</label>
                <div class="col-sm-8">
                  <input type="text" name="address" class="form-control" id="address" value="<?php echo $fetch_personal_data['address'];?>"  placeholder="Address">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Town/City</label>
                <div class="col-sm-8">
                  <input type="text" name="city" id="city" onkeypress="return alphaOnly(event)" value="<?php echo $fetch_personal_data['city'];?>"  class="form-control" placeholder="Town/City">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Postal Code</label>
                <div class="col-sm-8">
                  <input type="text" name="postcode" id="postcode"  value="<?php echo $fetch_personal_data['postcode'];?>"  class="form-control" placeholder="444000">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Country</label>
                <div class="col-sm-8">
                  <?php
//get country name
	$sel_countries1=mysql_query("select * from countries where id='".$fetch_personal_data['country']."'");
	$fethch_counries1=mysql_fetch_array($sel_countries1);
?>
                  <select name="country" class="form-control"id="country">
                    <option value="">Select Country</option>
                    <?php
	$sel_countries=mysql_query("select * from countries");
	while($fethch_counries=mysql_fetch_array($sel_countries))
	{
	?>
                    <option value="<?php echo $fethch_counries['id'];?>" <?php if($fetch_personal_data['country']==$fethch_counries['id']) {?> selected="selected" <?php }?> ><?php echo $fethch_counries['name'];?></option>
                    <?php }?>
                  </select>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-aboutme">Introduce yourself</label>
                <div class="col-sm-8">
                  <textarea id="profile-aboutme" class="form-control" name="summery" maxlength="300" rows="5"><?php echo $fetch_personal_data['summery']; ?></textarea>
                </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">Update Basic Information</button>
                </div>
              </div>
            </div>
          </div>
          <br>
        </div>
      </form>
      <div class="panel panel-default user-resume" id="profileResume">
        <h3>Resume</h3>
        <div class="row">
          <div class="col-sm-10 col-sm-push-1">
            <div id="resume-holder">
              <?php
									if($fetch_personal_data['cv_file'] !='')
									{?>
              <p><span class="glyphicon glyphicon-file"></span>&nbsp; <strong>CV-<?php echo $fetch_personal_data['fname'];?></strong>&nbsp;
                <button style="color:#000000" class="btn btn-transparent pull-right remove-resume" onclick="window.open('<?php echo base_url();?>front_end/download_cv?document=<?php echo $fetch_personal_data['cv_file'] ;?>')">&nbsp; Download CV</button>
              </p>
              <?php }?>
              <br />
              <div class="checkbox">
                <label for="prvc-0"><small>Suitable files are .doc, .docx, .pdf, .rtf and .txt. Files should be no larger than 1MB</small></label>
              </div>
              <hr>
            </div>
            <form name="upload_cv" id="resume-form" action="<?php echo base_url();?>front_end/upload_cv" method="post" enctype="multipart/form-data" >
              <div id="upload-resume-holder" class="text-center">
                <h2>Upload new resume</h2>
                <input type="hidden" name="cv_file" id="cv_file" value="<?php echo $fetch_personal_data['cv_file'] ;?>"/>
                <p style="color:#FF0000;"> <?php echo $this->session->flashdata('mesage_file_upoad');?></p>
                <div class="row">
                  <div class="col-sm-8 col-sm-push-2 text-center">
                    <div class="form-group"><span class="file-input file-input-new">
                      <div class="input-group ">
                        <div tabindex="-1" class="form-control file-caption  kv-fileinput-caption" style="    margin-top: 5px;
"> <span class="glyphicon glyphicon-file kv-caption-icon"></span>
                          <div class="file-caption-name"></div>
                        </div>
                        <br>
                        <br>
                        <div class="input-group-btn">
                          <div class="btn btn-default btn-file"> <i class="glyphicon glyphicon-folder-open"></i> &nbsp;Browse
                            <input type="file" id="image" name="image" />
                          </div>
                        </div>
                      </div>
                      </span>
                      <!--[if lt IE 10]><br><div class="alert alert-warning"><strong>Note:</strong> Your browser does not support multiple file upload. Try an alternative or more recent browser to access these features.</div><script>jQuery("#w0").removeClass('file-loading');</script><![endif]-->
                    </div>
                  </div>
                </div>
                <div id="resume-upload-message"></div>
                <div class="row">
                  <div class="col-sm-6 col-sm-push-3 text-center">
                    <input id="btn-upload-resume" type="submit" name="upload_resume" value="Upload Resume" class="btn btn-primary btn-upload-resume btn-block">
                  </div>
                </div>
                <br>
              </div>
            </form>
          </div>
        </div>
        <br>
      </div>
      <div class="panel panel-default work-experience" id="profileExperience">
        <h3>Experience</h3>
        <div class="row">
          <div class="col-sm-10 col-sm-push-1">
            <ul class="block-grid-xs-1 block-grid-sm-1">
              <li class="block-grid-item">
			  
<?php
//code for list exp in tadajobs
foreach ($work_history as $val_work_history) {
?>
                  <div class="row">
                    <div class="col-xs-12 col-sm-9"><strong><?php echo $val_work_history->job_title; ?></strong><br><?php echo $val_work_history->cname; ?><br>
                      <span class="experience-date"> <?php
                    if ($val_work_history->fmonth == 1) {
                        echo "January";
                    } elseif ($val_work_history->fmonth == 2) {
                        echo "February";
                    } elseif ($val_work_history->fmonth == 3) {
                        echo "March";
                    } elseif ($val_work_history->fmonth == 4) {
                        echo "April";
                    } elseif ($val_work_history->fmonth == 5) {
                        echo "May";
                    } elseif ($val_work_history->fmonth == 6) {
                        echo "June";
                    } elseif ($val_work_history->fmonth == 7) {
                        echo "July";
                    } elseif ($val_work_history->fmonth == 8) {
                        echo "August";
                    } elseif ($val_work_history->fmonth == 9) {
                        echo "September";
                    } elseif ($val_work_history->fmonth == 10) {
                        echo "October";
                    } elseif ($val_work_history->fmonth == 11) {
                        echo "Novemeber";
                    } elseif ($val_work_history->fmonth == 12) {
                        echo "December";
                    }

                    ?> - <?php echo ' ' . $val_work_history->fyear; ?>
                                                        <?php
                                                        if ($val_work_history->currently == 1) {
                                                            echo "- Present";
                                                        } else {
                                                            ?>
                                                            -
                                                            <?php
                                                            if ($val_work_history->tmonth == 1) {
                                                                echo "January";
                                                            } elseif ($val_work_history->tmonth == 2) {
                                                                echo "February";
                                                            } elseif ($val_work_history->tmonth == 3) {
                                                                echo "March";
                                                            } elseif ($val_work_history->tmonth == 4) {
                                                                echo "April";
                                                            } elseif ($val_work_history->tmonth == 5) {
                                                                echo "May";
                                                            } elseif ($val_work_history->tmonth == 6) {
                                                                echo "June";
                                                            } elseif ($val_work_history->tmonth == 7) {
                                                                echo "July";
                                                            } elseif ($val_work_history->tmonth == 8) {
                                                                echo "August";
                                                            } elseif ($val_work_history->tmonth == 9) {
                                                                echo "September";
                                                            } elseif ($val_work_history->tmonth == 10) {
                                                                echo "October";
                                                            } elseif ($val_work_history->tmonth == 11) {
                                                                echo "Novemeber";
                                                            } elseif ($val_work_history->tmonth == 12) {
                                                                echo "December";
                                                            }
                                                            ?>
                                                            <?php echo ' ' . $val_work_history->tyear;
                                                        }
                                                        ?> </span></div>
                    <div class="col-sm-3 text-right hidden-xs">
         <button style="color:#000000;" class="btn btn-transparent remove-experience" onclick="var tmp=confirm('Are you sure you want to remove this?'); if (tmp){window.location='<?php echo base_url(); ?>front_end/delete_workhistory?id=<?= $val_work_history->work_id; ?>';}"><span class="glyphicon glyphicon-trash"></span>&nbsp; remove</button>
                    </div>
                  </div>
                  <div class="row">
                    <div class="col-xs-12 col-sm-12">
                      <p class="desc"> <?php echo $val_work_history->details; ?></p>
                    </div>
                  </div>
				  <hr>
                 <?php } ?>
              </li>
            </ul>
           
            <div class="profile-addform" id="work-exp-addform" style="display: block;">
              <h4 class="text-center">Add Work Experience</h4>
              <br>
 <form name="work" method="post" id="add-work-exp-form" action="<?php echo base_url(); ?>front_end/add_work_hostory" onsubmit="return fromwork_add()">
                <div class="form-group text-left required">
                  <label class="control-label" for="exp_job">Job Title</label>
				   <input type="text" class="form-control" id="job_title12" name="job_title" placeholder="Job Title" onkeypress="return alphaOnly(event)">
                  <span id="exp_job_help" class="help-block"></span></div>
                <div class="form-group text-left required">
                  <label class="control-label" for="exp_company">Company Name</label>
                    <input type="text" id="cname" name="cname" class="form-control" placeholder="Company name" onkeypress="return alphaOnly(event)">
                  <span id="exp_company_help" class="help-block"></span></div>
                <div class="form-group text-left">
                  <label class="control-label" for="exp_work_period_start">Working Period</label>
                  <div class="col-sm-12">
                    <div class="row">
                      <div class="col-sm-3">
                        <div class="form-group required"><small>
                          <label class="control-label" for="exp_start">From Month</label>
                          </small>
<select class="form-control" name="fmonth" id="fmonth">
<option value="">Month</option>
<?php
for ($fm = 1; $fm < 13; $fm++) {
?>
<option value="<?php echo $fm; ?>">
<?php
if ($fm == 1) {
echo "January";
} elseif ($fm == 2) {
echo "February";
} elseif ($fm == 3) {
echo "March";
} elseif ($fm == 4) {
echo "April";
} elseif ($fm == 5) {
echo "May";
} elseif ($fm == 6) {
echo "June";
} elseif ($fm == 7) {
echo "July";
} elseif ($fm == 8) {
echo "August";
} elseif ($fm == 9) {
echo "September";
} elseif ($fm == 10) {
echo "October";
} elseif ($fm == 11) {
echo "Novemeber";
} elseif ($fm == 12) {
echo "December";
} ?>
</option>
<?php } ?>
</select>
                          <span id="exp_start_help" class="help-block"></span></div>
                      </div>
					  <div class="col-sm-3">
                        <div class="form-group required"><small>
                          <label class="control-label" for="exp_start">From Year</label>
                          </small>
 <select class="form-control" name="fyear" id="fyear">
<option value=" ">Year</option>
<?php

$endyear=date('Y');
for ($fy = 2000; $fy <= $endyear; $fy++) {
?>
<option
value="<?php echo $fy; ?>"><?php echo $fy; ?></option>
<?php } ?>
</select>
                          <span id="exp_start_help" class="help-block"></span></div>
                      </div>
					  <div class="col-sm-3">
                        <div class="form-group required"><small>
                          <label class="control-label" for="exp_start">End Month</label>
                          </small>
<select class="form-control" id="tmonth"
                                                                                        name="tmonth">
                                                                                    <option value="">Month</option>
                                                                                    <?php
                                                                                    for ($tm = 1; $tm < 12; $tm++) {
                                                                                        ?>
                                                                                        <option
                                                                                            value="<?php echo $tm; ?>">
                                                                                            <?php
                                                                                            if ($tm == 1) {
                                                                                                echo "January";
                                                                                            } elseif ($tm == 2) {
                                                                                                echo "February";
                                                                                            } elseif ($tm == 3) {
                                                                                                echo "March";
                                                                                            } elseif ($tm == 4) {
                                                                                                echo "April";
                                                                                            } elseif ($tm == 5) {
                                                                                                echo "May";
                                                                                            } elseif ($tm == 6) {
                                                                                                echo "June";
                                                                                            } elseif ($tm == 7) {
                                                                                                echo "July";
                                                                                            } elseif ($tm == 8) {
                                                                                                echo "August";
                                                                                            } elseif ($tm == 9) {
                                                                                                echo "September";
                                                                                            } elseif ($tm == 10) {
                                                                                                echo "October";
                                                                                            } elseif ($tm == 11) {
                                                                                                echo "Novemeber";
                                                                                            } elseif ($tm == 12) {
                                                                                                echo "December";
                                                                                            } ?>
                                                                                        </option>
                                                                                    <?php } ?>
                                                                                </select>
                          <span id="exp_start_help" class="help-block"></span></div>
                      </div>
					  <div class="col-sm-3">
                        <div class="form-group required"><small>
                          <label class="control-label" for="exp_start">End Year</label>
                          </small>
 <select class="form-control" id="tyear"
                                                                                        name="tyear">
                                                                                    <option value="">Year</option>
                                                                                    <?php
                                                                                    $endyear=date('Y');
                                                                                    for ($ty = 2000; $ty <= $endyear; $ty++) {
                                                                                        ?>
                                                                                        <option
                                                                                            value="<?php echo $ty; ?>"><?php echo $ty; ?></option>
                                                                                    <?php } ?>
                                                                                </select>
                          <span id="exp_start_help" class="help-block"></span></div>
                      </div>
                      <div class="col-sm-2 hidden-xs"></div>
                      
                    </div>
                  </div>
                </div>
                <div class="form-group no-gutter">
   <input type="checkbox" name="currently" id="currently" value="1"><label for="exp_present" class=""> I am currently work here</label>
                </div>
                <div class="form-group text-left">
                  <label for="exp_desc">Job Key Responsibilities</label>
                  <textarea id="exampleTextarea" class="form-control" name="details" maxlength="600" rows="5" placeholder="List down your key job role &amp; responsibilities"></textarea>
                  <span id="exp_desc_help" class="help-block"></span></div>
                <br>
                <div class="row no-gutter">
                  <div class="col-xs-4 col-sm-4">
                    <button type="submit" id="btn-work-exp-form" class="btn btn-primary btn-block">Save</button>
                  </div>
                  <div class="col-xs-4 col-sm-4 text-right" style="float:right">
                    <button type="reset" id="btn-work-exp-form" class="btn btn-primary btn-block" >Cancel</button>
                  </div>
                </div>
              </form>
            </div>
          </div>
        </div>
        <br>
      </div>
      <div class="panel panel-default work-experience" id="profileEducation">
        <h3>Education</h3>
		 <p style="color:#FF0000;"> <?php echo $this->session->flashdata('qualifications_secure_data'); ?></p>
        <div class="row">
          <div class="col-sm-10 col-sm-push-1">
            <ul class="block-grid-xs-1 block-grid-sm-1">
              <li class="block-grid-item">
                     <?php

                                                    foreach ($qualifications_data as $val_qualifications_data) {
                                                        ?>

                                                       
                                                            <?php if ($val_qualifications_data->type == 2) {
                                                                echo "Matriculation/O-Level";
                                                            }

                                                            if ($val_qualifications_data->type == 3) {
                                                                echo "Intermediate/A-Level";
                                                            }

                                                            if ($val_qualifications_data->type == 4) {
                                                                echo "Bachelors";
                                                            }

                                                            if ($val_qualifications_data->type == 5) {
                                                                echo "Masters";
                                                            }

                                                            if ($val_qualifications_data->type == 6) {
                                                                echo "MPhil/MS";
                                                            }

                                                            if ($val_qualifications_data->type == 7) {
                                                                echo "PHD/Doctorate";
                                                            }

                                                            if ($val_qualifications_data->type == 8) {
                                                                echo "Certification";
                                                            }

                                                            if ($val_qualifications_data->type == 9) {
                                                                echo "Diploma";
                                                            }

                                                            if ($val_qualifications_data->type == 10) {
                                                                echo "Short Course";
                                                            } ?>
                  <div class="row">
                    <div class="col-xs-12 col-sm-9"><strong><?php echo $val_qualifications_data->subject; ?></strong>
                      <p><?php echo $val_qualifications_data->school_name; ?><br>
                        <?php echo $val_qualifications_data->fyear; ?> - <?php echo $val_qualifications_data->tyear; ?><br>
						<?php echo $val_qualifications_data->grade; ?> </p>
                    </div>
                    <div class="col-sm-3 text-right hidden-xs">
                    <button style="color:#000000;" class="btn btn-transparent remove-experience" onclick="var tmp=confirm('Are you sure you want to remove this?'); if (tmp){window.location='<?php echo base_url(); ?>front_end/delete_qualifications?id=<?= $val_qualifications_data->qualifications_id; ?>';}"><span class="glyphicon glyphicon-trash"></span>&nbsp; remove</button>
                    </div>
                  </div>
                  <div class="row">
                    <div class="col-xs-12 col-sm-12">
                      <p class="desc"> <?php echo $val_qualifications_data->qualifications_details; ?></p>
                    </div>
                  </div>
                  <hr>
               <?php } ?>
              </li>
            </ul>
            <div class="row">
              <div class="col-sm-6 col-sm-push-3 text-center"><br>
<a href="#" class="btn btn-primary btn-block show-edu-form" id="show-edu-form" style="display: none;">Add Education</a></div>
            </div>
            <div class="profile-addform" id="education-addform" style="display: block;">
              <h4 class="text-center">Add Education</h4>
              <br>
<form name="qualifications_data" method="post" action="<?php echo base_url(); ?>front_end/add_qualifications" onsubmit="return qualification_work()" id="add-education-form">
              
                <div class="form-group text-left required">
                  <label class="control-label" for="edu_level">Education Level</label>
                   <select class="form-control" name="type" id="type">
				<option value="0">Select One
				</option>
				<option value="1">
					Non-Matriculation
				</option>
				<option value="2">
					Matriculation/O-Level
				</option>
				<option value="3">
					Intermediate/A-Level
				</option>
				<option value="4">Bachelors</option>
				<option value="5">Masters</option>
				<option value="6">MPhil/MS</option>
				<option value="7">PHD/Doctorate
				</option>
				<option value="8">Certification
				</option>
				<option value="9">Diploma</option>
				<option value="10">Short Course
				</option>
			</select>
                  <span id="edu_level_help" class="help-block"></span></div>
                <div class="form-group text-left required">
                  <label class="control-label" for="edu_inst">School / Institute</label>
 <input type="text" name="school_name"  id="school_name" onkeypress="return alphaOnly(event)"class="form-control" placeholder="School / College name">
                  <span id="edu_inst_help" class="help-block"></span></div>
				<div class="form-group text-left">
                  <label class="control-label" for="edu_certname">Diploma / Certificate Name / Degree</label>
<input type="text" name="subject" class="form-control" id="subject" onkeypress="return alphaOnly(event)" placeholder="Diploma / Certificate Name / Degree">
                  <span id="edu_certname_help" class="help-block"></span></div>
                
				<div class="form-group text-left required">
                  <label class="control-label" for="edu_inst">GPA/Grade/Percentage</label>
   <input type="text" name="grade" class="form-control" id="grade" placeholder="GPA/Grade/Percentage" >
                  <span id="edu_inst_help" class="help-block"></span></div>  
                <div class="form-group text-left">
                  <label for="edu_yearstart">School Period</label>
                  <div class="col-sm-12">
                    <div class="row">
                      <div class="col-sm-5">
                        <div class="form-group required"><small>
                          <label class="control-label" for="edu_start">Start Year</label>
                          </small>
                          <select class="form-control"
                                                                                        name="fyear" id="fyear">
                                                                                    <?php
                                                                                    $endyear=date('Y');
                                                                                    for ($fy = 1901; $fy <= $endyear; $fy++) {
                                                                                        ?>
                                                                                        <option
                                                                                            value="<?php echo $fy; ?>"><?php echo $fy; ?></option>
                                                                                    <?php } ?>
                                                                                </select>
                          <span id="edu_start_help" class="help-block"></span></div>
                      </div>
                      <div class="col-sm-2 hidden-xs"></div>
                      <div class="col-sm-5">
                        <div class="form-group required"><small>
                          <label class="control-label" for="edu_end">End Year</label>
                          </small>
                         <select class="form-control"
                                                                                        name="tyear" id="tyear">
                                                                                    <?php
                                                                                    
                                                                                    for ($ty = 1901; $ty <= $endyear; $ty++) {
                                                                                        ?>
                                                                                        <option
                                                                                            value="<?php echo $ty; ?>"><?php echo $ty; ?></option>
                                                                                    <?php } ?>
                                                                                </select>
                          
                          <span id="edu_end_help" class="help-block"></span></div>
                      </div>
                    </div>
                  </div>
                </div>
				
				
                <div class="form-group text-left">
                  <label for="exp_desc">Description</label>
                   <textarea class="form-control" id="qualifications_details" rows="3" name="qualifications_details"></textarea>
                  <span id="exp_desc_help" class="help-block"></span></div>
                <br>
                <div class="row no-gutter">
                  <div class="col-xs-4 col-sm-4">
                    <button type="submit" id="btn-edu-form-save" class="btn btn-primary btn-block">Save</button>
                  </div>
                  <div class="col-xs-4 col-sm-4 text-right" style="float:right">
                    <button type="reset" id="btn-work-exp-form" class="btn btn-primary btn-block" >Cancel</button>
                  </div>
                </div>
              </form>
            </div>
          </div>
        </div>
        <br>
      </div>
      <form name="skills_data" method="post" action="<?php echo base_url(); ?>front_end/add_skillsdata" onsubmit="return skills_dataform()">
        <div class="panel panel-default" id="profileSkills">
          <h3>Skills</h3>
          <div class="row">
            <div class="col-sm-10 col-sm-push-1">
              <?php
//code for to get web logo
foreach ($skilss_data as $val_skilss_data) {
//get code for skill name
$skill_name = mysql_query("select * from skills where skill_id='" . $val_skilss_data->skill_id . "'");
$fetch_skilll_name = mysql_fetch_array($skill_name);
?>
              <span class="tagcloud"><?php echo $fetch_skilll_name['skill_name']; ?></span> <img src="../assets/images/cancel.png" onclick="var tmp=confirm('Are you sure you want to remove this skill?'); if (tmp){window.location='<?php echo base_url(); ?>front_end/delete_skill?id=<?= $val_skilss_data->id; ?>';}" style="cursor:pointer;margin-left: -9px;"/>
              <?php } ?>
            </div>
          </div>
		  </br>
		  </br>
          <div class="form-group">
            <label class="col-sm-4 control-label" for="profile-birthday"></label>
            <div class="col-sm-4">
			<select name="job_skills[]" data-placeholder="Choose Skills..." class="form-control chosen-select" multiple="multiple" style="height: 45px;width:525px;" id="job_skills">
<option value=""></option>
<?php
$sel_skills = mysql_query("select * from skills");
while ($fethch_skills = mysql_fetch_array($sel_skills)) {
?>
<option value="<?php echo $fethch_skills['skill_id']; ?>"><?php echo $fethch_skills['skill_name']; ?></option>
<?php } ?>
</select>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-6 col-sm-push-3 text-center"><br>
              <button type="submit" id="btn-edu-form-save" class="btn btn-primary btn-block">Add Skills</button>
            </div>
          </div>
          <br>
        </div>
      </form>
      <form name="language_form" id="language_form" method="post" onsubmit="return add_language_form()" action="<?php echo base_url(); ?>front_end/add_language"  >
        <div class="panel panel-default" id="profileSkills">
          <h3>Languages</h3>
          <div class="row">
            <div class="col-sm-10 col-sm-push-1">
              <?php
//code for languages selection
foreach ($get_can_languages as $val_can_languages) 
{
//code to show locations name

$sel_query_languages = mysql_query("select * from languages where language_id='" . $val_can_languages->language_id . "'");
$fetch_get_languages = mysql_fetch_array($sel_query_languages);
$languages_name = $fetch_get_languages['language_name'];
if ($val_can_languages->type == 1) {
$type_name = "Basic";
}
if ($val_can_languages->type == 2) {
$type_name = "Intermediate";
}
if ($val_can_languages->type == 3) {
$type_name = "Fluent";
}

?>
              <span class="tagcloud"><?php echo $languages_name . ' : ' . ' ' .$type_name;?></span> <img src="../assets/images/cancel.png" onclick="var tmp=confirm('Are you sure you want to remove this language?'); if (tmp){window.location='<?php echo base_url(); ?>front_end/delete_language?id=<?= $val_can_languages->language_id ?>';}" style="cursor:pointer;margin-left: -9px;"/>
              <?php } ?>
            </div>
          </div>
		  <br />
          <div class="form-group">
            <label class="col-sm-4 control-label" for="profile-birthday"></label>
            <div class="col-sm-4">
			<select name="p_language[]" data-placeholder="Choose languages..." class="form-control chosen-select" multiple="multiple" style="height: 45px;width:525px;" id="p_language">
<option value=""></option>
<?php
$sel_languages = mysql_query("select * from languages");
while ($fethch_languages = mysql_fetch_array($sel_languages)) {
?>
<option value="<?php echo $fethch_languages['language_id']; ?>"><?php echo $fethch_languages['language_name']; ?></option>
<?php } ?>
</select>
            </div>
          </div>
		  <br />
		  <br />
          <div class="form-group">
            <label class="col-sm-4 control-label" for="profile-birthday"></label>
            <div class="col-sm-3">
              
                <label>
                <input type="radio" name="type" id="type" value="1" checked="checked">
                Basic</label>
                <label>
                <input type="radio" name="type" id="type" value="2"> Intermediate</label>
                <label>
                <input type="radio" name="type" id="type" value="3">Fluent</label>
             
            </div>
          </div>
		  
          <div class="row">
            <div class="col-sm-6 col-sm-push-3 text-center"><br>
              <button type="submit" id="btn-edu-form-save" class="btn btn-primary btn-block">Add Language</button>
            </div>
          </div>
          <br>
        </div>
      </form>
	   <form name="language_form" id="language_form" method="post" action="<?php echo base_url(); ?>front_end/add_sectors_for"  >
        <div class="panel panel-default" id="profileSkills">
          <h3>Sectors</h3>
           <p style="color:#FF0000;"> <?php echo $this->session->flashdata('mesage_sec'); ?> </p>
		  <div class="row">
            <div class="col-sm-10 col-sm-push-1">
<?php

error_reporting(0);
foreach ($get_can_sectors as $val_secors) {
//get name of secors
$sle_sectors = mysql_query("select * from njobn_jobs_category where jobs_category_id='". $val_secors->industeries_id ."'");
$fetch_data_sectors = mysql_fetch_array($sle_sectors);
$this->db->where('candidate_id', $val_secors->candidate_id);
$query = $this->db->get('candidate_industeries');
$setors_counter = $query->num_rows();
?>
 <input type="hidden" name="sectors_counter" id="sectors_counter" value="<?php echo $setors_counter; ?> "/>
              <span class="tagcloud"><?php echo $fetch_data_sectors['jobs_category_title']; ?></span> <img src="../assets/images/cancel.png" onclick="var tmp=confirm('Are you sure you want to remove this sector?'); if (tmp){window.location='<?php echo base_url(); ?>front_end/delete_sector?id=<?= $val_secors->industeries_id; ?>';}" style="cursor:pointer;margin-left: -9px;"/>
              <?php } ?>
            </div>
          </div>
		  <br />
          <div class="form-group">
            <label class="col-sm-4 control-label" for="profile-birthday"></label>
            <div class="col-sm-4">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/docsupport/prism.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/docsupport/chosen.css">
<select name="secters[]" data-placeholder="Choose Industry sectors..." class="form-control chosen-select" multiple="multiple" style="height: 45px;width:525px;" id="secters">
<option value=""></option>
<?php
$sel_industeries = mysql_query("select * from njobn_jobs_category");
while ($fethch_induteries = mysql_fetch_array($sel_industeries)) {
?>
<option value="<?php echo $fethch_induteries['jobs_category_id']; ?>"><?php echo $fethch_induteries['jobs_category_title']; ?></option>
<?php } ?>
</select>
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>-->
<script src="<?php echo base_url(); ?>assets/docsupport/chosen.jquery.js" type="text/javascript"></script>
<script src="<?php echo base_url(); ?>assets/docsupport/prism.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var config = {
'.chosen-select': {},
'.chosen-select-deselect': {allow_single_deselect: true},
'.chosen-select-no-single': {disable_search_threshold: 10},
'.chosen-select-no-results': {no_results_text: 'Oops, nothing found!'},
'.chosen-select-width': {width: "95%"}
}
for (var selector in config) {
$(selector).chosen(config[selector]);
}

</script>
            </div>
          </div> 
          <div class="row">
            <div class="col-sm-6 col-sm-push-3 text-center"><br>
              <button type="submit" id="btn-edu-form-save" class="btn btn-primary btn-block">Add Sectors</button>
            </div>
          </div>
          <br>
        </div>
      </form>
	  
    </div>
    <!-- sidebar -->
    <?php $this->load->view('frontleftbar'); ?>
    <!-- /.sidebar -->
  </div>
</div>
<!--CONTENT-AREA-->
<!--CONTENT-OUTER-->
</div>
<?php $this->load->view('footer_front'); ?>
