-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite for Mssql adapter; Oracle adapter added;
Fixed empty ORDER BY; Massive comments review Html rendering replaced with 'classic' version. If you want previous 'document.write' version - change '$this->render_html' to 'js'.
- Loading branch information
WR
committed
Jan 1, 2012
1 parent
ee93be0
commit 4ab80f0
Showing
4 changed files
with
234 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/** | ||
* Oracle adapter for jqGridPHP | ||
*/ | ||
|
||
abstract class jqGrid_Adapter_Oracle extends jqGrid | ||
{ | ||
protected $do_limit = false; | ||
protected $where_empty = '1=1'; | ||
|
||
protected function buildFields($cols) | ||
{ | ||
$fields = parent::buildFields($cols); | ||
|
||
if($this->limit > -1) | ||
{ | ||
$fields .= ', rownum AS _rownum'; | ||
} | ||
|
||
return $fields; | ||
} | ||
|
||
protected function buildQueryRows($q) | ||
{ | ||
$query = parent::buildQueryRows($q); | ||
|
||
if($this->limit > -1) | ||
{ | ||
$offset_min = max($this->page * $this->limit - $this->limit, 0) + 1; | ||
$offset_max = $offset_min + $this->limit; | ||
|
||
$query = " | ||
SELECT * | ||
FROM ($query) a | ||
WHERE _rownum BETWEEN $offset_min AND $offset_max | ||
"; | ||
} | ||
|
||
return $query; | ||
} | ||
} |
Oops, something went wrong.