Пример #1
0
 /**
  * Display and process our Advanced Search form. On submit, we build a URL and redirect so our
  * regular search function processes it.
  */
 public function actionIndex()
 {
     $model = new AdvancedSearchForm();
     if (isset($_POST['AdvancedSearchForm'])) {
         $model->attributes = $_POST['AdvancedSearchForm'];
         if ($model->validate()) {
             $strQuery = "?";
             if ($model->cat > 0) {
                 $objCategory = Category::model()->findbyPk($model->cat);
                 $strQuery .= "cat=" . $objCategory->request_url . "&";
             }
             if ($model->q) {
                 $strQuery .= "q=" . $model->q . "&";
             }
             if ($model->startprice) {
                 $strQuery .= "startprice=" . $model->startprice . "&";
             }
             if ($model->endprice) {
                 $strQuery .= "endprice=" . $model->endprice . "&";
             }
             $strQuery = substr($strQuery, 0, -1);
             //Remove trailing character since it's not needed
             $this->redirect($this->createUrl('search/results') . $strQuery);
         }
     }
     $this->render('index', array('model' => $model));
 }
Пример #2
0
 /** Generate the advanced search page
  */
 public function advancedAction()
 {
     $form = new AdvancedSearchForm(array('disableLoadDefaultDecorators' => true));
     $this->view->form = $form;
     if ($this->getRequest()->isPost() && $form->isValid($_POST)) {
         if ($form->isValid($form->getValues())) {
             $params = array_filter($form->getValues());
             $params = $this->array_cleanup($params);
             $this->_flashMessenger->addMessage('Your search is complete');
             $this->_helper->Redirector->gotoSimple('results', 'search', 'database', $params);
         } else {
             $form->populate($this->_getAllParams());
         }
     }
 }
Пример #3
0
 /** Generate the advanced search page
  * @access public
  * @return void
  */
 public function advancedAction()
 {
     $form = new AdvancedSearchForm();
     $this->view->form = $form;
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($this->_request->getPost())) {
             $this->process($form->getValues());
         } else {
             $form->populate($this->_request->getPost());
         }
     }
 }
Пример #4
0
}
$fObj = new Form();
$action = whoami() . ".php";
/*set get method to prevent the confirmation data on back button's browser*/
$fObj->initForm($action, 'GET');
$fObj->setForm($form_dataHa);
$search_form = $fObj->getForm();
if (isset($_GET['s_AdvancedForm'])) {
    $form_AdvancedSearch = new AdvancedSearchForm(false, 'search.php');
    if ($form_AdvancedSearch->isValid()) {
        $AdvancedSearchAr = array('s_node_name' => $_GET['s_node_name'], 's_node_title' => $_GET['s_node_title'], 's_node_text' => $_GET['s_node_text'], 's_AdvancedForm' => $_GET['s_AdvancedForm']);
        $form_AdvancedSearch->fillWithArrayData($AdvancedSearchAr);
        $advancedSearch_form = $form_AdvancedSearch->getHtml();
    }
} else {
    $form_AdvancedSearch = new AdvancedSearchForm(false, 'search.php');
    $action = whoami() . ".php";
    $advancedSearch_form = $form_AdvancedSearch->getHtml();
}
$online_users_listing_mode = 2;
$online_users = ADALoggableUser::get_online_usersFN($sess_id_course_instance, $online_users_listing_mode);
// CHAT, BANNER etc
$banner = (include ROOT_DIR . "/include/banner.inc.php");
$SimpleSearchlabel = translateFN('Ricerca semplice');
$AdvanceSearchlabel = translateFN('Ricerca avanzata');
$Simple_searchLink = "<a href='#'onClick=simpleSearch()>{$SimpleSearchlabel}</a>";
$advanced_searchLink = "<a href='#'onClick=advancedSearch()>{$AdvanceSearchlabel}</a>";
/* 8.
costruzione della pagina HTML
*/
$imgAvatar = $userObj->getAvatar();