コード例 #1
0
 public function profileBuilderAction()
 {
     $params = $this->getRequest()->getParams();
     if (!empty($params) && isset($params['utm_source'])) {
         $client = PR_Session::getSession(PR_Session::SESSION_USER);
         $core = new PR_Api_Core_CandidateClass();
         $getUserArray = $core->getCandidateInfo($client['UserID']);
         $this->view->client = $getUserArray;
         $Candidateprofile_ID = $getUserArray["CandidateProfileID"];
         $getCandidates = $core->getCandidateProfile($Candidateprofile_ID);
         $this->view->getCandidates = $getCandidates;
         $this->view->step = $params['utm_source'];
         switch ($params['utm_source']) {
             case 'contact':
                 $core = new PR_Api_Core_CandidateClass();
                 $info = $core->getContactInfo($client['UserID']);
                 $this->view->stepCount = '1/5 Steps';
                 $this->view->info = $info;
                 $this->render('profile-builder/contact');
                 break;
             case 'education':
                 $core = new PR_Api_Core_CandidateClass();
                 $list = $core->getCandidateEducationList($client['UserID']);
                 $this->view->list = $list;
                 $this->view->stepCount = '2/5 Steps';
                 $this->render('profile-builder/education');
                 break;
             case 'employment':
                 $core = new PR_Api_Core_CandidateClass();
                 //$core->addjobfunction("9","JobFucntion","0.9");
                 $list = $core->getCandidateEmployments($client['UserID']);
                 $this->view->list = $list;
                 if (isset($params["id"]) || !empty($params["id"])) {
                     $id = $params["id"];
                     $jobfunctions = $core->get_jobfuntion($id);
                     $employment = $core->getCandidateEmployment($id);
                     $this->view->jobfunctions = $jobfunctions;
                     $this->view->employment = $employment;
                     $totalPercentage = $core->totalPercentage($id);
                     $totalprcent = round($totalPercentage["totalPercentage"] * 100, 2);
                     $this->view->totalPercentage = $totalprcent;
                 }
                 //$core->deleteJobFunction(5,2);
                 $getjob = $core->getjobfunctions();
                 $this->getjob = $getjob;
                 $this->view->stepCount = '3/5 Steps';
                 $this->render('profile-builder/employment');
                 //echo "tetst:<pre>";print_r($employment);echo("</pre>");
                 break;
             case 'skills':
                 $tree = '';
                 $core = new PR_Api_Core_CandidateClass();
                 // -----------------Attribute-----------------------------
                 $html = '';
                 $attr_p0_list = $core->get_attribute_p0($Candidateprofile_ID);
                 if (!empty($attr_p0_list)) {
                     foreach ($attr_p0_list as $attr_p0Info) {
                         //$select = (!empty($attr_p0Info['Candidate_ProfileID']))? 'select':'deselect';
                         if (!empty($attr_p0Info['Candidate_ProfileID'])) {
                             $select = 'select';
                             $disable = '';
                         } else {
                             $select = 'deselect';
                             $disable = 'disabled';
                         }
                         $src = !empty($attr_p0Info['Candidate_ProfileID']) ? URL_THEMES . 'images/trees/ico_colapse.png' : URL_THEMES . 'images/trees/ico_expand.png';
                         $toggle = URL_THEMES . 'images/trees/ico_sub_sm.png';
                         $html .= "<div class='col-md-12' style='margin:0;padding:0; color: #5d629c'><div class='tree'><ul>";
                         $html .= "<li>\n                                            <img data-id='" . $attr_p0Info['ID'] . "' data-status='" . $select . "' class='img-parent-attr' src='" . $src . "'/>\n                                            <a href='#' style='color:#5d629c'><strong>" . $attr_p0Info['AttributeCategory'] . "</strong></a>\n                                        <span><img class='img-toggle' src='" . $toggle . "'/></span>";
                         $AttributeID_Parents = $core->get_attribute_parent($Candidateprofile_ID, $attr_p0Info['ParentAttributeID'], $attr_p0Info['AtttributeCategoryID']);
                         //$AttributeID_Parents = $core->get_attribute_parent($Candidateprofile_ID, 0, 5);
                         if (!empty($AttributeID_Parents)) {
                             foreach ($AttributeID_Parents as $attrInfo) {
                                 $sel = "<div class='col-md-2'></div>";
                                 if (!empty($attrInfo['TemplateID'])) {
                                     $option = "";
                                     foreach ($attrInfo['TemplateID'] as $TemplateIDInfo) {
                                         if ($TemplateIDInfo['Value'] == $attrInfo['Value']) {
                                             $selected1 = 'selected="selected"';
                                         } else {
                                             $selected1 = '';
                                         }
                                         $option .= "<option value='" . $TemplateIDInfo['Value'] . "' " . $selected1 . " >" . $TemplateIDInfo['Description'] . "</option>";
                                     }
                                     $sel = " <select class='form-control attr-value'  style='color:#5d629c' " . $disable . "> " . $option . "</select>";
                                 }
                                 $Track = '';
                                 if ($attrInfo['TrackYearsOfExperience'] && $attrInfo['TrackLevelofInterest']) {
                                     $selected = '';
                                     $option_exp = '';
                                     for ($i = 1; $i < 6; $i++) {
                                         if ($i == $attrInfo['LevelofInterest']) {
                                             $selected = 'selected="selected"';
                                         } else {
                                             $selected = '';
                                         }
                                         $option_exp .= "<option value='" . $i . "' " . $selected . ">" . $i . "</option>";
                                     }
                                     $Track = "<div class='col-md-2' style='padding-right:0; color:#706d67;line-height:34px'>Years of Experience </div>\n                                                                  <div class='col-md-1' style='padding:0'><input type='text' style='color:#706d67' " . $disable . " class='form-control attr-YoE' value='" . $attrInfo['YearsofExperience'] . "'></div>\n                                                                  <div class='col-md-2' style='text-align:right;color:#706d67;line-height:34px'>Level of Interest</div>\n                                                                  <div class='col-md-1' style='padding:0'>\n                                                                    <select class='form-control attr-LevelofInterest' style='color:#706d67' " . $disable . ">\n                                                                            '.{$option_exp}.'\n                                                                    </select>\n                                                                  </div>";
                                 }
                                 $html .= "<ul style='margin-top:10px' class='attr-attr'>\n                                                            <li>\n                                                                <div class='col-md-12' style='padding:0'>\n                                                                    <div style='line-height:34px;padding:0;margin-bottom:10px' attr-id=" . $attrInfo['ID'] . " class='col-md-4 attrid'>" . $attrInfo['Attribute'] . "</div>\n                                                                    <div class='col-md-2' style='padding:0; margin-bottom:10px'>\n                                                                        " . $sel . "\n                                                                    </div>\n                                                                    " . $Track . "\n                                                               </div>\n\n                                                            </li>\n\n                                                        </ul>";
                                 $html .= $this->attribute_child($Candidateprofile_ID, $attrInfo['ID'], $disable);
                             }
                         }
                         $html .= "</li></ul></div></div>";
                     }
                 }
                 $this->view->html = $html;
                 /*echo "<pre>";
                   print_r($skills);
                   echo "</pre>"; die(); */
                 //-------------------- end attribute---------------------//
                 /*$skills = $core->getListAll_CandidateSkills($client['UserID']);
                   if(!empty($skills)){
                       foreach($skills as $item){
                           $select = (!empty($item['CandidateProfileID']) && !empty($item['UserID'])) ? 'select':'deselect';
                           $src = (!empty($item['CandidateProfileID']) && !empty($item['UserID'])) ?  URL_THEMES.'images/trees/ico_colapse.png' : URL_THEMES.'images/trees/ico_expand.png';
                           $toggle = URL_THEMES .'images/trees/ico_sub_sm.png';
                           //Tree View
                           $tree .= "<div class='col-md-4' style='margin:0;padding:0'><div class='tree'><ul>";
                           $tree .= "<li>
                                       <img data-id='".$item['SkillID']."' data-status='".$select."' class='img-parent' src='".$src."'/>
                                       <a href='#'><strong>" . $item['SkillName'] . "</strong></a>
                                       <span><img class='img-toggle' src='".$toggle."'/></span>";
                           $tree .= $this->skillChilds($item['SkillID'], $item['Level']+1);
                           $tree .= "</li></ul></div></div>";
                       }
                   }
                   $this->view->tree = $tree; */
                 $this->view->stepCount = '4/5 Steps';
                 $this->render('profile-builder/skills');
                 break;
             case 'portfolio':
                 $core = new PR_Api_Core_CandidateClass();
                 $list = $core->getListCandidatePortfolio($client['UserID']);
                 $this->view->list = $list;
                 $this->view->stepCount = '5/5 Steps';
                 $this->render('profile-builder/portfolio');
                 break;
             case 'success':
                 $this->view->stepCount = 'Completed';
                 $this->render('profile-builder/success');
                 break;
             default:
                 $this->render('profile-builder/index');
                 break;
         }
     } else {
         $this->render('profile-builder/index');
     }
 }