fixed datatable query
This commit is contained in:
+2
-1
@@ -855,9 +855,10 @@ Request.JSONF = function(options){//oke
|
||||
var post_data = {};
|
||||
$(vars.data).map(function(key, item){
|
||||
var keyval = item.split("=");
|
||||
if (keyval[0] == 'SID') keyval[1] = parseInt(Math.random() * 99999999);
|
||||
if (keyval[0] == 'Cari_Jual') keyval[1] = decodeURI(keyval[1]);
|
||||
return post_data[keyval[0]] = keyval[1];
|
||||
});
|
||||
post_data['SID'] = parseInt(Math.random() * 99999999);
|
||||
opsi.serverSide = true;
|
||||
opsi.ajax = {
|
||||
url: vars.url,
|
||||
|
||||
+2
-2
@@ -252,13 +252,13 @@ final class Table {
|
||||
$t_order = ($i_order[0]['dir']=="asc") ? "ASC" : "DESC";
|
||||
$i_order = $i_order[0]['column'];
|
||||
}
|
||||
if ($i_length > $record) $i_length = -1;
|
||||
if (($i_length > $record) || (($i_start+1) >= $record)) $i_length = -1;
|
||||
$sql_limit = ($i_start>=0 && $i_length != -1) ? " LIMIT ".$i_start.", ".$i_length : "";
|
||||
$sql_order = ($this->__afield[$i_order]) ? " ORDER BY ".$this->__afield[$i_order]." ".$t_order : "";
|
||||
|
||||
$adata['data'] = [];
|
||||
$this->__cdb->Query("SELECT ".$this->__tfield." FROM ".$this->__ttable.$this->__twhere.$sql_order.$sql_limit);
|
||||
//$adata['sql'] = "SELECT ".$this->__tfield." FROM ".$this->__ttable.$this->__twhere.$sql_order.$sql_limit;
|
||||
$adata['sql'] = "SELECT ".$this->__tfield." FROM ".$this->__ttable.$this->__twhere.$sql_order.$sql_limit;
|
||||
while ($this->__cdb->Next()) {
|
||||
$abaris = [];
|
||||
$aoption = ['button'=>[]];
|
||||
|
||||
Reference in New Issue
Block a user