Example #1
0
             case 'getcount':
                 $res = Product::getProvProdsCount($filter_str);
                 break;
         }
     } else {
         $start = (int) $_REQUEST['start'];
         $count = (int) $_REQUEST['count'];
         $order_str = "";
         if (isset($_REQUEST["sort_column_name"]) && isset($avaliable_fields[$_REQUEST["sort_column_name"]])) {
             $order_str = " order by " . $avaliable_fields[$_REQUEST["sort_column_name"]]["column_name"];
             if (isset($_REQUEST["sort_order"]) && (strtolower($_REQUEST["sort_order"]) == 'asc' || strtolower($_REQUEST["sort_order"]) == 'desc')) {
                 $order_str .= " " . strtolower($_REQUEST["sort_order"]);
             }
         }
         if ($count > 0) {
             $res = Product::getProvProdsByPage($start, $count, $filter_str, $order_str);
         }
     }
     break;
 case 'get_temp_prov_prods':
     $avaliable_fields = array("prod_name" => array("filter_type" => "text", "column_name" => "prod_name"), "price" => array("filter_type" => "float", "column_name" => "price"), "stock" => array("filter_type" => "int", "column_name" => "stock"), "prov_id" => array("filter_type" => "int", "column_name" => "prov_id"));
     $filter_str = "";
     if (isset($_REQUEST["filter_compare"]) && isset($_REQUEST["filter_values"]) && count($_REQUEST["filter_compare"]) && count($_REQUEST["filter_values"])) {
         $filter_str = buildFilterStr($avaliable_fields, $_REQUEST["filter_compare"], $_REQUEST["filter_values"]);
     }
     if ($_REQUEST['subaction']) {
         switch ($_REQUEST['subaction']) {
             case 'getcount':
                 $res = Product::getTempProvProdsCount($filter_str);
                 break;
         }