<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class candidate_profile extends CI_Model {

    public function __construct() {
        parent::__construct();
    }
    function  job_details(){
        $this->db->select('*');
        $this->db->from('job_details');
        $this->db->where('demo','1');
        $this->db->order_by('job_id','desc');
        $query = $this->db->get();
        if ($query->num_rows() > 0) {
            return $query->result();
        } else {
            return '';
        }
    }
    function post_details($job_code, $fname, $mobile, $lname, $dob, $email, $industry, $current_location, $resume, $class10_p, $school_year, $school, $school_city, $class12_p, $college_year, $college_name, $college_city, $graduation_p, $graduation_year, $univercity_name, $univercity_city, $employer_name,$roles_responsibilitie,$duration_from,$total_exp_year,$total_exp_month,$course_name, $modeofdelivery, $course_name1, $training_center_name, $course_name2, $center_location, $course_name3,$profile_img_name) {
        $data = array(
            'job_code' => $job_code,
            'fname' => $fname,
            'mobile' => $mobile,
            'lname' => $lname,
            'dob' => $dob,
            'email' => $email,
            'industry' => $industry,
            'current_location' => $current_location,
            'resume1' => $resume,
            'profile_pick_name'=>$profile_img_name,
            'class10_p' => $class10_p,
            'school_year' => $school_year,
            'school' => $school,
            'school_city' => $school_city,
            'class12_p' => $class12_p,
            'college_year' => $college_year,
            'college_name' => $college_name,
            'college_city' => $college_city,
            'graduation_p' => $graduation_p,
            'graduation_year' => $graduation_year,
            'univercity_name' => $univercity_name,
            'univercity_city' => $univercity_city,
            'employer_name'=>$employer_name,
            'roles_responsibilitie'=>$roles_responsibilitie,
            'datepickerexp_frm'=>$duration_from,
//            'datepickerexp_to'=>$duration_to,
            'total_exp_year'=>$total_exp_year,
            'total_exp_month'=>$total_exp_month,
            'course_name ' => $course_name,
            'modeofdelivery' => $modeofdelivery,
            'course_name1' => $course_name1,
            'training_center_name' => $training_center_name,
            'course_name2' => $course_name2,
            'center_location' => $center_location,
            'course_name3' => $course_name3,
            'status1' => '1'
        );
        $this->db->insert('offer_candidate_profile',$data);
    }
     function get_center($mode){
        $this->db->distinct();
         $this->db->select('Center_Name');
         $this->db->from('tbl_educational_centers');
         $this->db->like('Mode_of_Delivery',$mode);
          $query = $this->db->get();
        if ($query->num_rows() > 0) {
            return $query->result();
        } else {
            return '';
        }
     }
     function get_center_location($center_name,$mode){
       //  echo $center_name.'  and',$mode;exit;
          $this->db->select('City');
         $this->db->from('tbl_educational_centers');
         
         $this->db->where('Center_Name',$center_name);
         $this->db->like('Mode_of_Delivery',$mode);
          $query = $this->db->get();
        if ($query->num_rows() > 0) {
            return $query->result();
        } else {
            return '';
        }
     }
     function solution(){
         $this->db->distinct();
         $this->db->select('solution');
         $this->db->from('sap');
          $query = $this->db->get();
        if ($query->num_rows() > 0) {
            return $query->result();
        } else {
            return '';
        }
     }
     function getsolution_short_text($solution){
         $this->db->distinct();
         $this->db->select('solution_short_text');
         $this->db->from('sap');
          $this->db->where('solution',$solution);
          $query = $this->db->get();
        if ($query->num_rows() > 0) {
            return $query->result();
        } else {
            return '';
        }
     }
     function getsolution_long_text($solution,$solution_short_text){
         //$this->db->distinct();
         $this->db->select('*');
         $this->db->from('sap');
          $this->db->where('solution',$solution);
          $this->db->where('solution_short_text',$solution_short_text);
          $query = $this->db->get();
        if ($query->num_rows() > 0) {
            return $query->result();
        } else {
            return '';
        }
     }
     function getsolution_product_name($solution_longtext){
        // $this->db->distinct();
         $this->db->select('*');
         $this->db->from('sap');
          //$this->db->where('solution',$solution);
          $this->db->where('id',$solution_longtext);
          $query = $this->db->get();
        if ($query->num_rows() > 0) {
            return $query->result();
        } else {
            return '';
        }
     }
     function get_file_name($job_id){
         $this->db->select('*');
        $this->db->from('job_details');
        $this->db->where('job_id',$job_id);
        $query = $this->db->get();
        if ($query->num_rows() > 0) {
            return $query->result();
        } else {
            return '';
        }
         
     }
     function get_curriculan($job_id){
          $this->db->select('*');
        $this->db->from('job_curriculam_fee');
        $this->db->where('job_id',$job_id);
        $query = $this->db->get();
        if ($query->num_rows() > 0) {
            return $query->result();
        } else {
            return '';
        }
            
     }
}

?>
