How to add location and title in search form


Replace codes in file /app/View/Elements/website_search.ctp to the following:


<form role="form" method="get" class="well" action="<?php echo Router::url('/', true) ?>"> 
    <div class="form-group"> 
        <div class="col-md-6">
            <input name="location" type="text" class="form-control" id="location" placeholder="Search for location" value="<?php echo $this->request->query('location'); ?>" />
        </div>
        <div class="col-md-3">
            <!--<input name="term" type="text" class="form-control" id="search" placeholder="Search for title, description, company, location, country..." value="<?php echo $this->request->query('term'); ?>">-->
            <input name="title" type="text" class="form-control" id="title" placeholder="Search for title" value="<?php echo $this->request->query('title'); ?>" />
        </div>                
        <div class="col-md-1">
            <button type="submit" class="btn btn-primary">Go</button>
        </div>
    </div>                    
</form>

Fix search by location issue:

Add the following codes in files /app/Controller/PagesController.php after line 365:

 if (isset($this->request->query['location'])) {
            $this->Paginator->settings['conditions']['Job.location like'] = '%' . $this->request->query['location'] . '%';
        }