if (is_array($careers) and !empty($careers)) { $career_t = array(); foreach ($careers as $career) { $career_t[$career->id] = $career->career_name; } $smarty->assign('career', $career_t); } $experiences = Experience::find_all(); if (is_array($experiences) and !empty($experiences)) { $experience_t = array(); foreach ($experiences as $experience) { $experience_t[$experience->id] = $experience->experience_name; } $smarty->assign('experience', $experience_t); } $categories = Category::find_all(); if (is_array($categories) and !empty($categories)) { $category_t = array(); foreach ($categories as $category) { $category_t[$category->id] = $category->cat_name; } $smarty->assign('category', $category_t); } ///when button is press run this if (isset($_POST['bt_add'])) { $_SESSION['add_job']['job_ref'] = $job->job_ref = $_POST['txt_ref_code']; $job->var_name = $job->mod_write_check($_POST['txt_job_title'], $old_var_name); $_SESSION['add_job']['job_title'] = $job->job_title = strip_html(stripHTMLTags($_POST['txt_job_title'])); $_SESSION['add_job']['job_desc'] = $job->job_description = allowedTags($_POST['txt_job_desc']); $_SESSION['add_job']['job_postion'] = $job->job_postion = $_POST['txt_position']; $_SESSION['add_job']['salary'] = $job->job_salary = $_POST['txt_salary'];
public function actionEdit($fid = null) { $active_user = User::require_active_user(); $this->setLayoutVar('active_user', $active_user); $this->setVar('active_user', $active_user); //Edit — <?php echo $torrent->title; if (is_null($fid)) { throw new Lvc_Exception('Null fid on edit action'); } if ($torrent = Torrent::find(array('fid' => $fid))) { if ($torrent->has_access(array('user' => $active_user))) { if (!empty($this->post['submit'])) { $result = Torrent::edit($fid, $this->post['title'], $this->post['description'], $this->post['category_cid'], $active_user); if ($result['status']) { Flash::set('success', $result['message']); $this->redirect('/torrent/' . $fid); die; } else { $this->setVar('fail_message', $result['message']); } } $categories = Category::find_all(); $this->setVar('categories', $categories); $this->setVar('torrent', $torrent); $this->setLayoutVar('pageHead', 'Edit — ' . $torrent->title); $this->setLayoutVar('pageTitle', 'Edit - ' . $torrent->title); } else { throw new Lvc_Exception('Unauthorized user: '******' tried to edit torrent: ' . $torrent->fid); } } else { throw new Lvc_Exception('Torrent Not Found: ' . $fid); } }
} } if (isset($_GET['action']) && $_GET['action'] == "add") { if (isset($_POST['bt_add'])) { $category = new Category(); $category->cat_name = $_POST['txt_cat']; if ($category->save()) { $session->message("New Category added."); redirect_to($_SERVER['PHP_SELF']); die; } else { $message = join("<br />", $category->errors); } } } $category = Category::find_all(); $manage_lists = array(); if ($category && is_array($category)) { $i = 1; foreach ($category as $list) { $manage_lists[$i]['id'] = $list->id; $manage_lists[$i]['cat_name'] = $list->cat_name; $i++; } $smarty->assign('manage_lists', $manage_lists); } $query = ""; if (!empty($_GET)) { foreach ($_GET as $key => $data) { if (!empty($data) && $data != "" && $key != "page" && $key != "bt_search") { $query .= "&" . $key . "=" . $data;
public function getCategories() { $allCategories = Category::find_all(); return $allCategories; }