<?php $this->load->view('header_front');?>
<link type="text/css" rel="stylesheet" href="<?php echo base_url();?>assets_front/css/cvstyle.css">

<?php
$can_id=$_GET['cand_id'];
error_reporting(0);
$this->load->view('security_front');
$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

?>
<link type="text/css" rel="stylesheet" href="<?php echo base_url();?>assets_front/css/cvstyle.css">
</br></br></br></br>
<div class="container main-content">
  <div class="row">
    <div class="col-xs-12 col-sm-12 col-md-8 profile">
  
<div id="cv" class="instaFade">
	<div class="mainDetails">
	 <?php

                            //code for to get web logo
                                $salary_from=$fetch_candiate_image['salary_from'];
                                $salary_to= $fetch_candiate_image['salary_to'];
                                $currency= $fetch_candiate_image['currency'];
                                $can_image= $fetch_candiate_image['image'];
								$perday= $fetch_candiate_image['perday'];
                            
                            ?>
              <?php
                                if ($can_image != '') {
                                    ?>
	
		<div id="headshot" class="quickFade">
			<img src="<?php echo base_url(); ?>assets/upload/<?php echo $can_image; ?>" alt="Alan Smith" />
		</div>
		
		 <?php } else {
                        ?>
						<div id="headshot" class="quickFade">
			<img src="<?php echo base_url(); ?>assets_front/images/JNJUKWebLogo.png" alt="Alan Smith" />
		</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;

                                    ?>
		
		<div id="name">
			<h1 class="quickFade delayTwo" style="font-size: 22px;"><?php echo $val_fname_lname->fname . ' ' . $val_fname_lname->lname; ?></h1>
			
			<h2 class="quickFade delayThree" style="font-size: 12px;
    margin-top: 9px;
    font-weight: bold;"><?php echo $val_fname_lname->job_title;?></h2>
		</div>
		
		<div id="contactDetails" class="quickFade delayFour">
			<ul>
				<li>Email: <a href="mailto:<?php echo $val_fname_lname->email;?>" target="_blank"><?php echo $val_fname_lname->email;?></a></li>
				<li>Mobile:<?php echo $val_fname_lname->phone;?></li>
				<li>Country: <?php
//get country name
	$sel_countries1=mysql_query("select * from countries where id='".$fetch_personal_data['country']."'");
	$fethch_counries1=mysql_fetch_array($sel_countries1);
    {

	echo $fethch_counries1['name'];
	}
	?></li>
				
				<li>Town/City:<?php echo $val_fname_lname->city;?></li>
				
				
			</ul>
		</div>
		<div class="clear"></div>
	</div>
	
	<div id="mainArea" class="quickFade delayFive">
		<section>
			<article>
				<div class="sectionTitle">
					<h1>Career Summary </h1>
				</div>
				
				<div class="sectionContent">
					<p><?php echo $val_fname_lname->summery;?></p>
				</div>
			</article>
			<div class="clear"></div>
		</section>
		<?php }?>
		
		<section>
			<div class="sectionTitle">
				<h1>Work Experience</h1>
			</div>
			
			<div class="sectionContent">
			<?php
//code for list exp in tadajobs
foreach ($work_history as $val_work_history) {
?>
				<article>
					<h2>Job Title at Company</h2>
					<p class="subDetails"> <?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;
                                                        }
                                                        ?></p>
					<p><?php echo $val_work_history->details; ?></p>
				</article>
				<?php } ?>
				
			</div>
			<div class="clear"></div>
		</section>
		
		
		<section>
			<div class="sectionTitle">
				<h1>Key Skills</h1>
			</div>
			
			<div class="sectionContent">
				<ul class="keySkills">
				<?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);
?>
					<li><?php echo $fetch_skilll_name['skill_name']; ?></li>
					<?php } ?>
				</ul>
			</div>
			<div class="clear"></div>
		</section>
		
		<section>
			<div class="sectionTitle">
				<h1>I am interested in </h1>
			</div>
			
			<div class="sectionContent">
				<ul class="keySkills">
				<?php
error_reporting(0);
$sle_sectors=mysql_query("select * from candidate_industeries where candidate_id='".$can_id."'");
while ($fetch_data_sectors=mysql_fetch_array($sle_sectors))
{
$industeries_ids=$fetch_data_sectors['industeries_id'];
$sle_sectors23=mysql_query("select * from njobn_jobs_category where jobs_category_id='".$industeries_ids."'");
while ($fetch_data_sectors23=mysql_fetch_array($sle_sectors23))
{?>
					<li><?php echo $fetch_data_sectors23['jobs_category_title']; ?></li>
					<?php 
}
}
?>
				</ul>
			</div>
			<div class="clear"></div>
		</section>
		
		<section>
			<div class="sectionTitle">
				<h1>Employment Status </h1>
			</div>
			
			<div class="sectionContent">
				<ul class="keySkills">
				
					<li> <?php if($fetch_personal_data['emp_satus']==1) {?> Actively Seeking <?php }?>
                   <?php if($fetch_personal_data['emp_satus']==2) {?> Contract Role <?php }?>
                   <?php if($fetch_personal_data['emp_satus']==3) {?> Permanent Role <?php }?>
                    <?php if($fetch_personal_data['emp_satus']==4) {?> Part Time<?php }?>
                    <?php if($fetch_personal_data['emp_satus']==5) {?>Full Time<?php }?>
                    <?php if($fetch_personal_data['emp_satus']==6) {?> Redundant <?php }?></li>
				
				</ul>
			</div>
			<div class="clear"></div>
		</section>
		
		<section>
			<div class="sectionTitle">
				<h1>Job Type </h1>
				<?php
//code for job ype lising
foreach ($get_job_types as $val_job_types) 
{
$arr[] = $val_job_types->job_type_id;
}

?>
			</div>
			
			<div class="sectionContent">
				<ul class="keySkills">
				
					<li><?php if(in_array(5,$arr)){?> Full Time <?php } ?></li>
				     <li><?php if(in_array(4,$arr)){?> Part Time  <?php } ?></li>
					 <li><?php if(in_array(3,$arr)){?>  Contract <?php } ?></li>
					 <li><?php if(in_array(2,$arr)){?> Temporary  <?php } ?></li>
					  <li><?php if(in_array(1,$arr)){?> Volunteer  <?php } ?></li>
					  
					  <li><?php if(in_array(6,$arr)){?> Other  <?php } ?></li>
				</ul>
			</div>
			<div class="clear"></div>
		</section>
		<section>
			<div class="sectionTitle">
				<h1>Languages</h1>
			</div>
			
			<div class="sectionContent">
				<ul class="keySkills">
				 <?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";
}

?>
					<li><?php echo $languages_name . ' : ' . ' ' .$type_name;?></li>
					 <?php } ?>
				</ul>
			</div>
			<div class="clear"></div>
		</section>
		
		<section>
			<div class="sectionTitle">
				<h1>Education</h1>
			</div>
			
			<div class="sectionContent">
			  <?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";
                                                            } ?>
				<article>
					<h2><?php echo $val_qualifications_data->school_name; ?></h2>
					<p class="subDetails"><?php echo $val_qualifications_data->subject; ?> (<?php echo $val_qualifications_data->fyear; ?> - <?php echo $val_qualifications_data->tyear; ?>)</p>
					<p><?php echo $val_qualifications_data->qualifications_details; ?></p>
				</article>
				<?php }?>
				
			</div>
			<div class="clear"></div>
		</section>
		
	</div>
</div>
    </div>
    <!-- sidebar -->
    
	<!-- sidebar -->
    <?php $this->load->view('frontleftbar'); ?>
    <!-- /.sidebar -->
    <!-- /.sidebar -->
  </div>
</div>
</div>
<!--CONTENT-AREA-->
<!--CONTENT-OUTER-->
</div>
<?php $this->load->view('footer_front'); ?>
