Forum



02:08

16/05/2010

Hi everybody!
Well i just got a search problem and i hope someone can help me.
This is my code:
Html Code:
<table id="list"></table>
<div id="pager"></div>JS Code:
jQuery(document).ready(function(){
jQuery("#list").jqGrid({
url:'ERP_Tabla.php',
datatype: 'xml',
mtype: 'GET',
colNames:['ID Usuario','Usuario', 'Contrasena','Ultimo Ingreso'],
colModel :[
{name:'id_usuario', index:'id_usuario', width:150},
{name:'usuario', index:'usuario', width:90},
{name:'contrasena', index:'contrasena', width:150, align:'right'},
{name:'ultimo_ingreso', index:'ultimo_ingreso', width:80, align:'right'},
],
pager: jQuery('#pager'),
rowNum:10,
rowList:[10,20,30],
sortname: 'id_usuario',
sortorder: 'desc',
viewrecords: true,
autowidth: true,
caption: 'KND ERP'
}).navGrid('#pager',{edit:false,add:false,del:false});
});PHP Code:
<?php
//include the information needed for the connection to MySQL data base server.
// we store here username, database and password
include("Scripts/ERPD_Conexion.php");$page = $_GET['page'];
$limit = $_GET['rows'];
$sidx = $_GET['sidx'];
$sord = $_GET['sord'];
if(!$sidx) $sidx =1;
// connect to the MySQL database server
$db = new MySQL();
$result = $db -> consulta("SELECT COUNT(*) AS count FROM usuario");
$row = $db -> fetch_array($result);
$count = $row['count'];
if( $count > 0 && $limit > 0) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;$start = $limit*$page - $limit;
if($start <0) $start = 0;
$SQL = "SELECT * FROM usuario ORDER BY $sidx $sord LIMIT $start , $limit";
$result = $db -> consulta( $SQL );
header("Content-type: text/xml;charset=utf-8");
$s = "<?xml version='1.0' encoding='utf-8'?>";
$s .= "<rows>";
$s .= "<page>".$page."</page>";
$s .= "<total>".$total_pages."</total>";
$s .= "<records>".$count."</records>";
// be sure to put text data in CDATA
while($row = $db -> fetch_array($result)) {
$s .= "<row id='". $row['id_usuario']."'>";
$s .= "<cell><![CDATA[". $row['id_usuario']. "]]></cell>";
$s .= "<cell><![CDATA[". $row['usuario']. "]]></cell>";
$s .= "<cell><![CDATA[". $row['contrasena']. "]]></cell>";
$s .= "<cell><![CDATA[". $row['ultimo_ingreso']."]]></cell>";
$s .= "</row>";
}
$s .= "</rows>";
echo $s;
?>
Now when i try to search some data, the JQGrid doesn't return me nothing i tried everything, but i can't figure out which is the problem if someone could help me, i will be very happy.
PS: Excuse me, iif my english is very bad
![]()
.
03:31

04/11/2009

03:12

16/05/2010

the Parameters are
and returns me:
i have 2 record, when i search some information returns me both.
maybe when i import the scripts is the problem, i don't know, this is how i import:
<link rel="stylesheet" type="text/css" media="screen" href="../styles/themes/ui.jqgrid.css" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/i18n/grid.locale-sp.js"></script>
<script type="text/javascript" src="js/jquery.jqGrid.min.js"></script>
<script type="text/javascript" src="../JS/jquery-ui-1.8.1.custom.min.js"></script>
Most Users Ever Online: 715
Currently Online:
188 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66