public function insertRecord($record) { $jobkeys = $this->getAllJobsKey(); $cBom = new CompaniesBom(); $companies = $cBom->getAllCompanyNames(); $this->getConnection()->beginTransaction(); $company = $cBom->getCompanyIDByCompanyName($record->company); if (is_null($company)) { $data = new stdClass(); $data->name = $record->company; $cBom->insertRecord($data); $record->company_id = $this->getConnection()->getLastInsertID(); } else { $record->company_id = $company->company_id; } unset($record->company); // checks if job key is already existing on our database if (in_array($record->jobkey, $jobkeys)) { $condition = array('jobkey' => $record->jobkey); echo "Update " . $record->jobkey . "<br>"; unset($record->formattedlocation, $record->date, $record->onmousedown, $record->formattedlocationfull, $record->jobkey, $record->formattedrelativetime); var_dump($this->getConnection()->update("jobs", $record, $condition)); } else { $record->date_posted = Calendar::formatStringToSQLDateAndTime($record->date); $record->date_created = Calendar::getSQLDateTime(); echo "Insert " . $record->jobkey . "<br>"; unset($record->formattedlocation, $record->date, $record->onmousedown, $record->formattedlocationfull, $record->formattedrelativetime); var_dump($this->getConnection()->insert("jobs", $record)); } return $this->getConnection()->commitTransaction(); }
public function info($param) { $cBom = new CompaniesBom(); $jBom = new JobsBom(); $company = $cBom->getCompanyByCompanyName($param); $template = new Core_Template("default", "companies", "info"); $template->setAttribute("company", $company); $template->setAttribute("latest_jobs", $jBom->getJobsByCompanyName($company->name)); }
public function index() { $jBom = new JobsBom(); $cBom = new CompaniesBom(); $template = new Core_Template("default", "default"); $template->setAttribute("records", $jBom->getAllRecentJobs()); $template->setAttribute("companies", $cBom->getRecentActiveCompanies()); $template->setAttribute("trending_jobs", $jBom->getTrendingJobs()); $template->setAttribute("featured_company", $cBom->getFeaturedCompany()); }
public function index() { $cBom = new CompaniesBom(); $template = new Core_Template("default", "search", "advance"); $template->setAttribute("companies", $cBom->getRecentActiveCompanies()); }