if (!SaveSearch::already_existed($employee_id, $reference)) {
         $save_search = new SaveSearch();
         $save_search->fk_employee_id = $employee_id;
         $save_search->reference_name = $reference_name;
         $save_search->reference = $reference;
         if ($save_search->save()) {
             $message = "<div class='success'>" . format_lang('success', 'save_search') . "</div>";
         } else {
             $message = "<div class='error'>" . format_lang('errormsg', 62) . "</div>";
         }
     } else {
         $message = "<div class='error'>" . format_lang('errormsg', 63) . "</div>";
     }
 } elseif ($_GET['action'] == 'search' && isset($_REQUEST['search_id'])) {
     $id = (int) $_REQUEST['search_id'];
     $found = SaveSearch::find_by_id($id);
     if ($found) {
         redirect_to(BASE_URL . "search/?" . urldecode(urldecode($found->reference)));
         die;
     }
     redirect_to(BASE_URL . "save_search/");
     die;
 } elseif ($_GET['action'] == 'delete' && isset($_GET['search_id'])) {
     $id = (int) $_REQUEST['search_id'];
     $save_search = new SaveSearch();
     $save_search->fk_employee_id = $employee_id;
     $save_search->id = $id;
     if ($save_search->delete_saveSearch()) {
         $message = "<div class='success'>" . format_lang('success', 'delete_success') . "</div>";
     } else {
         $message = "<div class='error'>" . format_lang('errormsg', 64) . "</div>";