Răsfoiți Sursa

Edit HTML properties to make the session filter work - refs #7528

Imanol Losada 10 ani în urmă
părinte
comite
5699594282

+ 10 - 1
plugin/buycourses/js/buycourses.js

@@ -98,7 +98,16 @@ $(document).ready(function () {
         e.stopPropagation();
     });
 
-    $('#confirm_filter').click(function (e) {
+    $(".filter").click(function (e) {
+        var filterFields = $(this).siblings("input");
+        var filterFieldsData;
+        $.each(filterFields, function() {
+            console.log($(this));
+            //filterFieldsData.push($(this));
+
+        });
+
+
         var vcourse = $("#course_name").attr("value");
         var pmin = $("#price_min").attr("value");
         var pmax = $("#price_max").attr("value");

+ 1 - 1
plugin/buycourses/src/function.php

@@ -27,7 +27,7 @@ $tableUser = Database::get_main_table(TABLE_MAIN_USER);
 
 $plugin = BuyCoursesPlugin::create();
 $buy_name = $plugin->get_lang('Buy');
-
+error_log($_REQUEST['tab']);
 if ($_REQUEST['tab'] == 'sync') {
     $sql = "SELECT code, title FROM $tableCourse;";
     $res = Database::query($sql);

+ 8 - 8
plugin/buycourses/view/list.tpl

@@ -25,11 +25,11 @@ $(function() {
             <div class="form-content">
                 <h4>{{ 'SearchFilter'|get_plugin_lang('BuyCoursesPlugin') }}:</h4>
                 <label class="control-label">{{ 'CourseName'|get_lang }}:</label>
-                <input type="text" id="course_name" />
+                <input type="text" id="course" />
                 <label class="control-label">{{ 'MinimumPrice'|get_plugin_lang('BuyCoursesPlugin') }}:</label>
-                <input type="text" id="price_min" class="span1"/>
+                <input type="text" id="coursepricemin" class="span1"/>
                 <label class="control-label">{{ 'MaximumPrice'|get_plugin_lang('BuyCoursesPlugin') }}:</label>
-                <input type="text" id="price_max" class="span1"/>
+                <input type="text" id="coursepricemax" class="span1"/>
                     {% for category in categories %}
                         <label class="control-label">{{ 'Categories'|get_lang }}:</label>
                         <select id="courses_category">
@@ -38,7 +38,7 @@ $(function() {
                         </select>
                     {% endfor %}
                 <br>
-                 <input type="button" class="btn btn-primary" value="{{ 'Search'|get_lang }}" id="confirm_filter" />
+                 <input type="button" class="filter btn btn-primary" value="{{ 'Search'|get_lang }}" id="courses_filter" />
             </div>
         </div>
     </div>
@@ -99,11 +99,11 @@ $(function() {
             <div class="form-content">
                 <h4>{{ 'SearchFilter'|get_plugin_lang('BuyCoursesPlugin') }}:</h4>
                 <label class="control-label">{{ 'SessionName'|get_lang }}:</label>
-                <input type="text" id="course_name" />
+                <input type="text" id="session" />
                 <label class="control-label">{{ 'MinimumPrice'|get_plugin_lang('BuyCoursesPlugin') }}:</label>
-                <input type="text" id="price_min" class="span1"/>
+                <input type="text" id="sessionpricemin" class="span1"/>
                 <label class="control-label">{{ 'MaximumPrice'|get_plugin_lang('BuyCoursesPlugin') }}:</label>
-                <input type="text" id="price_max" class="span1"/>
+                <input type="text" id="sessionpricemax" class="span1"/>
                     {% for category in categories %}
                         <label class="control-label">{{ 'Categories'|get_lang }}:</label>
                         <select id="courses_category">
@@ -112,7 +112,7 @@ $(function() {
                         </select>
                     {% endfor %}
                 <br>
-                 <input type="button" class="btn btn-primary" value="{{ 'Search'|get_lang }}" id="confirm_filter" />
+                 <input type="button" class="filter btn btn-primary" value="{{ 'Search'|get_lang }}" id="sessions_filter" />
             </div>
         </div>
     </div>