Пример #1
0
<br>
<ul id="sortable">
	
	<script>
		$(document).ready(function() {
			$(function() {
				$("#sortable").sortable();
				$("#sortable").disableSelection();
			});
		});
	</script>
	
	</ul>
	<br/>
	<?php 
$this->widget('zii.widgets.jui.CJuiAutoComplete', array('name' => 'addskillname', 'id' => 'addskillname', 'source' => Skillset::getNames(), 'htmlOptions' => array()));
?>
    <br>

	
	<?php 
$this->widget('bootstrap.widgets.TbButton', array('label' => 'Add Skill', 'type' => 'primary', 'htmlOptions' => array('data-toggle' => 'modal', 'data-target' => '#myModal', 'style' => 'width: 120px', 'id' => "addskill", 'style' => "margin-top: 5px; margin-bottom: 5px;width: 120px;")));
?>
	
</div>
</div>
</div>
<script>
	
$.MyNamespace={
		submit : "true"
Пример #2
0
 public function actionSearch()
 {
     // flag to display results in home
     $flag = 2;
     $bool = false;
     $keyword = "";
     $result = array();
     // words to search for
     if (isset($_GET['keyword'])) {
         $keyword = $_GET['keyword'];
     }
     // array to contain the results of the search
     $results = array();
     $result2 = array();
     // there are words to search
     if ($keyword != null) {
         // operators for boolean search mode
         if (preg_match('/("|-)/', $keyword)) {
             $bool = true;
         }
         if ($bool == true) {
             // search FULLTEXT IN BOOLEAN MODE to allow for operations such as ' ""'  and ' - '
             $results = Job::model()->findAllBySql("SELECT * FROM job WHERE MATCH(type,title,description,comp_name) AGAINST ('%" . $keyword . "%' IN BOOLEAN MODE) AND active = '1';");
         }
         if ($bool == false) {
             // search FULLTEXT IN NATURAL LANGUAGE MODE
             $results = Job::model()->findAllBySql("SELECT * FROM job WHERE MATCH(type,title,description,comp_name) AGAINST ('%" . $keyword . "%' IN NATURAL LANGUAGE MODE) AND active = '1';");
             //print_r ($result);
         }
         // location will be set to "Miami, Florida"
         $loc = "Miami, Florida";
         // call indeed API to get jobs query by user
         $result = $this->indeed($keyword, $loc);
         if ($result['totalresults'] == 0) {
             $result = "";
         }
         $result2 = $this->careerBuilder($keyword, $loc);
         if ($result2[0] == 0) {
             $result2 = "";
         }
     }
     // get user
     if (isset($_GET['user'])) {
         $username = $_GET['user'];
     } else {
         $username = Yii::app()->user->name;
     }
     // pass user
     $user = User::model()->find("username=:username", array(':username' => $username));
     // pass skills
     $skills = Skillset::getNames();
     // pass companies
     $companies = CompanyInfo::getNames();
     //print_r($result); return;
     // render search results, user, skills, companies and flag to job/home
     $this->render('home', array('result' => $result, 'cbresults' => $result2, 'jobs' => $results, 'user' => $user, 'companies' => $companies, 'skills' => $skills, 'flag' => $flag));
 }
Пример #3
0
	if (!User::isStudent(Yii::app()->user->name) & !Yii::app()->user->isGuest)
		$home = '/home/employerhome';
	else if (User::isStudent(Yii::app()->user->name))
		$home = '/home/studenthome';
	else 
		$home = '/site/index';
*/
?>
	<?php 
$search = "";
if (User::isCurrentUserAdmin(Yii::app()->user->name)) {
    $home = '/home/adminhome';
} else {
    if (User::isCurrentUserEmployer(Yii::app()->user->name)) {
        $home = '/home/employerhome';
        $search = '<form class="navbar-search pull-left" method="post" action="/JobFair/index.php/home/employersearch" >' . $this->widget('zii.widgets.jui.CJuiAutoComplete', array('name' => 'skillkeyword', 'source' => Skillset::getNames(), 'htmlOptions' => array('class' => 'search-query span2', 'placeholder' => 'Search Students by Skill')), true) . '<button type="submit" style="background-color:transparent ; border:0"  >
		<img src="/JobFair/images/ico/Search-icon.png"  height="25" width="25" style="margin:1px 0 0 5px"></button>
		</form>';
    } else {
        if (User::isCurrentUserStudent(Yii::app()->user->name)) {
            $home = '/home/studenthome';
            $search = '<form class="navbar-search pull-left" method="get" action="/JobFair/index.php/job/search">' . $this->widget('zii.widgets.jui.CJuiAutoComplete', array('name' => 'keyword', 'id' => 'keyword', 'value' => $_GET['keyword'], 'htmlOptions' => array('class' => 'search-query span2', 'style' => 'width: 250px', 'placeholder' => 'Search by Position, Skills, Company, Type')), true) . '<button type="submit" style="background-color:transparent ; border:0" >
		<img src="/JobFair/images/ico/Search-icon.png"  height="25" width="25" style="margin:1px 0 0 5px"></button>
		</form>';
        } else {
            $home = '/site/index';
        }
    }
}
?>
Пример #4
0
 public function actionSearch()
 {
     $flag = 1;
     $keyword = $_POST['keyword'];
     // Get words to search
     $pieces = trim($keyword);
     $pieces = explode(" ", $pieces);
     // split words to search
     $count = sizeof($pieces);
     // get number of word to search
     $query = '';
     for ($i = 0; $i < $count; $i++) {
         if ($i == $count - 1) {
             $query = $query . 'name like \'%' . $pieces[$i] . '%\'';
         } else {
             $query = $query . 'name like \'%' . $pieces[$i] . '%\' OR ';
         }
     }
     $criteria = new CDbCriteria();
     $criteria->condition = $query;
     $results = array();
     if ($keyword != null) {
         $skillsArray = Skillset::model()->findAll($criteria);
         foreach ($skillsArray as $sk) {
             if ($sk != null) {
                 $jobIds = JobSkillMap::model()->findAllByAttributes(array('skillid' => $sk->id));
                 // get all jobs with that skill
                 if ($jobIds != null) {
                     foreach ($jobIds as $ji) {
                         if ($ji != null) {
                             $jobid = $ji->jobid;
                             $duplicate = 0;
                             if (sizeof($results) > 0) {
                                 foreach ($results as $t) {
                                     if ($t != null) {
                                         if (strcmp($t->id, $jobid) == 0) {
                                             $duplicate = 1;
                                         }
                                     }
                                 }
                             }
                             if ($duplicate == 0) {
                                 $results[] = Job::model()->findByAttributes(array('id' => $jobid, 'active' => '1'));
                                 // search for skill only
                             }
                         }
                     }
                 }
             }
         }
         $compsArray = CompanyInfo::model()->findAll($criteria);
         foreach ($compsArray as $co) {
             if ($co != null) {
                 $comp_posts = Job::model()->findAllByAttributes(array('FK_poster' => $co->FK_userid));
                 if ($comp_posts != null) {
                     foreach ($comp_posts as $cp) {
                         $duplicate = 0;
                         if (sizeof($results) > 1) {
                             if ($cp != null) {
                                 foreach ($results as $t) {
                                     if ($t != null) {
                                         if ($t->id == $cp->id) {
                                             $duplicate = 1;
                                         }
                                     }
                                 }
                             }
                         }
                         if ($duplicate == 0) {
                             $results[] = Job::model()->findByAttributes(array('id' => $cp->id, 'active' => '1'));
                         }
                     }
                 }
             }
         }
     }
     if (isset($_GET['user'])) {
         $username = $_GET['user'];
     } else {
         $username = Yii::app()->user->name;
     }
     $user = User::model()->find("username=:username", array(':username' => $username));
     // pass user
     $skills = Skillset::getNames();
     // pass skills
     $companies = CompanyInfo::getNames();
     // pass companies
     $this->render('home', array('flag' => $flag, 'results' => $results, 'user' => $user, 'companies' => $companies, 'skills' => $skills));
     //$this->render('studentSearchResults',array('results'=>$results,'user'=>$user,'companies'=>$companies,'skills'=>$skills,));
 }