// global $msg; // $msg->addError('NO_SEARCH_TEXT'); // // header('Location: index.php?id='.$ids); //} $coursesDAO = new CoursesDAO(); $userCoursesDAO = new UserCoursesDAO(); $courseCategoriesDAO = new CourseCategoriesDAO(); //$my_courses = array(); $search_text = trim($_GET['search_text']); $courses = $coursesDAO->getSearchResult($addslashes($search_text), $_GET['catid']); // handle submits if (isset($_GET['action'], $_GET['cid']) && $_SESSION['user_id'] > 0) { $cid = intval($_GET['cid']); if ($_GET['action'] == 'remove') { $userCoursesDAO->Delete($_SESSION['user_id'], $cid); } if ($_GET['action'] == 'add') { $userCoursesDAO->Create($_SESSION['user_id'], $cid, TR_USERROLE_VIEWER, 0); } $msg->addFeedback(ACTION_COMPLETED_SUCCESSFULLY); } // -- display results // no results found //if (!is_array($results)) //{ // $savant->assign('title', _AT("search_results")); // $savant->assign('search_text', $search_text); // $savant->assign('courses', ''); // $savant->display('home/index_course.tmpl.php'); // exit;