Browse Source

Fixing session search form in admin/index.php

Julio Montoya 13 years ago
parent
commit
85cb3e7c4a
2 changed files with 10 additions and 5 deletions
  1. 4 4
      main/admin/index.php
  2. 6 1
      main/admin/session_list.php

+ 4 - 4
main/admin/index.php

@@ -172,10 +172,10 @@ if (api_get_setting('use_session_mode') == 'true') {
 	$blocks['sessions']['icon']  = Display::return_icon('session.png', get_lang('Sessions'), array(), ICON_SIZE_SMALL, false);
 	$blocks['sessions']['label'] = api_ucfirst(get_lang('Sessions'));
 	
-	$search_form = ' <form method="POST" action="session_list.php">
-								<input class="span3" type="text" name="keyword" value="">
-								<button class="search" type="submit">'.get_lang('Search').'</button>
-		            		</form>';
+	$search_form = ' <form method="GET" action="session_list.php">
+                        <input class="span3" type="text" name="keyword" value="">
+                        <button class="search" type="submit">'.get_lang('Search').'</button>
+                    </form>';
 	$blocks['sessions']['search_form'] = $search_form;	
 	$items = array();
 	$items[] = array('url'=>'session_list.php', 	'label' => get_lang('ListSession'));

+ 6 - 1
main/admin/session_list.php

@@ -31,7 +31,12 @@ $tool_name = get_lang('SessionList');
 Display::display_header($tool_name);
 
 //jqgrid will use this URL to do the selects
-$url            = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_sessions';
+$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_sessions';
+if (isset($_REQUEST['keyword'])) {
+    //Begin with see the searchOper param
+    $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_sessions&_search=true&rows=20&page=1&sidx=&sord=asc&filters=&searchField=name&searchString='.Security::remove_XSS($_REQUEST['keyword']).'&searchOper=bw';    
+}
+
 
 //The order is important you need to check the the $column variable in the model.ajax.php file 
 $columns        = array(get_lang('Name'), get_lang('NumberOfCourses'), get_lang('SessionCategoryName'),