转到下一页

时间:2014-08-22 18:43:56

标签: php jquery oracle pagination jquery-easyui

我想在php中使用jquery easyui对datagrid进行分页。数据导入正确,sql查询工作正常,即使第一页看起来很好,我可以选择页面上的行数,页面的计算很好,但是当我想从第一页移动到第二页时,在第二页,它只显示我一行。 这是我的代码:

$page = isset($_POST['page']) ? intval($_POST['page']) : 1; 
$rows = isset($_POST['rows']) ? intval($_POST['rows']) : 10;
$offset = ($page-1)*$rows;

$result = array();

$db_con = oci_connect('system', 'password1', 'dashboard');

$sql = "select count(*) from dash_omc_cases c, dash_omc_sap s where c.CASE_ID = s.CASE_ID"; $stid = oci_parse($db_con, $sql); oci_execute($stid);
$row = oci_fetch_row($stid); $result["total"] = $row[0];



 $sql =  select * from (
select ROW_NUMBER() OVER(order by c.CREATION_TIME desc) rn, c.case_id as NGM_ID,   
       s.NE_PRIORITAET as NE_PRIO,
       case substr(s.NE_ID, 2,1)
         when '0' then 'Zentrale'
         when '1' then 'Nord'
         when '2' then 'Nord' 
         when '3' then 'Ost'
         when '4' then 'Ost'
         when '5' then 'Mitte'
         when '6' then 'West'
         when '7' then 'Süd'
         when '8' then 'Mitte'
         when '9' then 'Süd'
         else          'Error'
       end as REGION,         
       c.STATUS_NGM as NGM_STATUS,
       s.AUFTRAG as AUFTRAG,
       s.NE_ID as NE_ID,
       s.STATUS as SAP_STATUS,
       substr(to_timestamp(to_char(Sysdate, 'YY/MM/DD HH24:MI:SS'), 'YY/MM/DD HH24:MI:SS') - to_timestamp(to_char(s.CREATION_TIME, 'YY/MM/DD HH24:MI:SS'), 'YY/MM/DD HH24:MI:SS'), 8,12) as DIFF_BEGINN_SAP_ENDE,
      case trim(s.KATEGORIE)
         when '1' then 'INSLA'
         when '2' then 'OUTSLA'
         else          s.KATEGORIE
       end as SLA,
       to_char(c.CREATION_TIME, 'YY/MM/DD HH24:MI:SS')
        as NGM_CREATION_TIME,
       case s.NE_PRIORITAET
         when 'A' then substr(to_char((to_timestamp(to_char((Sysdate + 6/24), 'YY/MM/DD HH24:MI:SS'), 'yyyy.mm.dd hh24:mi:ss') - to_timestamp(to_char(s.CREATION_TIME, 'yyyy.mm.dd hh24:mi:ss'), 'YY/MM/DD HH24:MI:SS')), 'dd hh24:mi:ss'),8,12)
         when 'B' then substr(to_char((to_timestamp(to_char((Sysdate + 1), 'YY/MM/DD HH24:MI:SS'), 'yyyy.mm.dd hh24:mi:ss') - to_timestamp(to_char(s.CREATION_TIME, 'YY/MM/DD HH24:MI:SS'), 'yyyy.mm.dd hh24:mi:ss')), 'dd hh24:mi:ss'), 8,12)
         when 'C' then substr(to_char((to_timestamp(to_char((Sysdate + 1), 'YY/MM/DD HH24:MI:SS'), 'yyyy.mm.dd hh24:mi:ss') - to_timestamp(to_char(s.CREATION_TIME, 'YY/MM/DD HH24:MI:SS'), 'yyyy.mm.dd hh24:mi:ss')), 'dd hh24:mi:ss'),8,12)
         else          substr(to_char((to_timestamp(to_char((Sysdate + 1), 'YY/MM/DD HH24:MI:SS'), 'yyyy.mm.dd hh24:mi:ss') - to_timestamp(to_char(s.CREATION_TIME, 'YY/MM/DD HH24:MI:SS'), 'yyyy.mm.dd hh24:mi:ss')), 'dd hh24:mi:ss'), 8,12)
        end as TIME_LEFT_OVERRUN,

       c.URSACHE_KURZ as URSACHE_KURZ,
       s.BEARBEITER as BEARBEITER
      from dash_omc_cases c, dash_omc_sap s
      where c.CASE_ID = s.CASE_ID
)where rn between %s and %s order by rn", $offset, $rows);

0 个答案:

没有答案
相关问题