<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: Help for search with nav button</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/help-for-search-with-nav-button</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/help-for-search-with-nav-button/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Help for search with nav button</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/help-for-search-with-nav-button#p5740</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/help-for-search-with-nav-button#p5740</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Did you see <span id="postdata" style="background-color: yellow;">_search: true<br /></span></p>
<p>If this is true the serch is activated and you can use the above parameters.</p>
<p>If <span id="postdata" style="background-color: yellow;">_search:false </span>you are not in search and you can use a condition for this - right?</p>
<p>Why not read the docs?</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 01 Apr 2009 04:26:26 +0300</pubDate>
        </item>
        <item>
        	<title>missa on Help for search with nav button</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/help-for-search-with-nav-button#p5739</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/help-for-search-with-nav-button#p5739</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>I know. I work on jqgrid since 1 month. I work with a simple cod and now, my boss want that I programm the search function!</p>
<p>That&#39;s why I want some help, because i don&#39;t understand why I can&#39;t use post data for search.</p>
<p>When I use gestpost data, it&#39;s written :</p>
<p><span id="postdata" style="background-color: yellow;">nd: 1238577429279,_search: true,rows: 10,page: 1,sidx: cod_banque,sord: asc,searchField: num_inform,searchOper: eq,searchString: 1116,</span></p>
<p>that&#39;s why in my programm, i want use these three parameters (<span id="postdata" style="background-color: yellow;">searchField: ,searchOper: ,searchString)</span></p>
<p>If an another method exists to success my search can you explain me please.</p>
<p>It&#39;s very important. I don&#39;t only copy out you cod but I use it to success my programm.</p>
<p>thank you for your help!</p>
<p>Regards</p>
<p>Aurore</p>
]]></description>
        	        	<pubDate>Wed, 01 Apr 2009 04:20:58 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Help for search with nav button</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/help-for-search-with-nav-button#p5735</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/help-for-search-with-nav-button#p5735</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Sorry but we consider here a jqGrid problems and not PHP code. The examples are just examples. I recommend to begin just with very simple data and code.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 01 Apr 2009 04:02:37 +0300</pubDate>
        </item>
        <item>
        	<title>missa on Help for search with nav button</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/help-for-search-with-nav-button#p5731</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/help-for-search-with-nav-button#p5731</guid>
        	        	<description><![CDATA[<p>hello, I want use the button "search" in the navigation bar but nothing work. I use "getpostdata&#39; to see what is post.</p>
<p>bellow, it&#39;s my programm.</p>
</p>
<p>&#60;?php</p>
<p>include($_SERVER[&#39;DOCUMENT_ROOT&#39;]."/paiement/include/dbconfig.php");<br />include($_SERVER[&#39;DOCUMENT_ROOT&#39;]."/paiement/include/JSON.php");</p>
<p>$json = new Services_JSON();</p>
<p>$page = $_GET[&#39;page&#39;]; // get the GETed page</p>
<p>$limit = $_GET[&#39;rows&#39;];$sidx = $_GET[&#39;sidx&#39;];<br />$sidx = $_GET[&#39;sidx&#39;]; <br />$sord = $_GET[&#39;sord&#39;]; <br />if(!$sidx) $sidx =1;</p>
<p><strong>$wh ="";<br />$where_recherche = "";<br />$where_recherche_count = "";</strong></p>
<p>if(isset($_REQUEST[&#39;searchField&#39;])){<br />&#160;&#160;&#160; $field = $_REQUEST[&#39;searchField&#39;]; <br />&#160;&#160;&#160; switch ($field) {<br />&#160;&#160;&#160; case "num_inform":<br />&#160;&#160;&#160; &#160;&#160;&#160; $field = "fofacent.".$field;<br />&#160;&#160;&#160; &#160;&#160;&#160; break;<br />&#160;&#160;&#160; case "nom_banque":<br />&#160;&#160;&#160; &#160;&#160;&#160; $field&#160; = "fobanque.".$field;<br />&#160;&#160;&#160; &#160;&#160;&#160; break;<br />&#160;&#160;&#160; default:<br />&#160;&#160;&#160; &#160;&#160;&#160; $field = "";<br />&#160;&#160;&#160; &#160;&#160;&#160; break;&#160;&#160;&#160; <br />&#160;&#160;&#160; }&#160;&#160;&#160; &#160;&#160;&#160; <br />}&#160;&#160;&#160; <br />else {<br />&#160;&#160;&#160; $field = "fofacent.num_inform";<br />}</p>
<p>if (isset($_REQUEST[&#39;searchString&#39;])) {<br />&#160;&#160;&#160; $value = $_REQUEST[&#39;searchString&#39;]; <br />}<br />else {<br />&#160;&#160;&#160; $value = "1665";<br />}</p>
<p><strong>if (isset($_REQUEST[&#39;searchOper&#39;])) {<br />&#160;&#160;&#160; $oper = $_REQUEST[&#39;searchOper&#39;]; <br />&#160;&#160;&#160; switch ($oper) {<br />&#160;&#160;&#160; &#160;&#160;&#160; case "eq":<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if(is_numeric($value)) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $wh = " = ".$value;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; } else {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $wh = " = &#39;".$value."&#39;";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; break;<br />&#160;&#160;&#160; &#160;&#160;&#160; case "ne":<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if(is_numeric($value)) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $wh = " &#60;&#62; ".$value;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; } else {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $wh = " &#60;&#62; &#39;".$value."&#39;";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; break;<br />&#160;&#160;&#160; &#160;&#160;&#160; case "lt":<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if(is_numeric($value)) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $wh = " &#60; ".$value;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; } else {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $wh = " &#60; &#39;".$value."&#39;";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; break;<br />&#160;&#160;&#160; &#160;&#160;&#160; case "le":<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if(is_numeric($value)) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $wh = " &#60;= ".$value;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; } else {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $wh = " &#60;= &#39;".$value."&#39;";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; break;<br />&#160;&#160;&#160; &#160;&#160;&#160; case "gt":<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if(is_numeric($value)) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $wh = " &#62; ".$value;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; } else {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $wh = " &#62; &#39;".$value."&#39;";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; break;<br />&#160;&#160;&#160; &#160;&#160;&#160; case "ge":<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if(is_numeric($value)) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $wh = " &#62;= ".$value;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; } else {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $wh = " &#62;= &#39;".$value."&#39;";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; break;<br />&#160;&#160;&#160; &#160;&#160;&#160; case "bw":<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $wh = " LIKE &#39;".$value."%&#39;";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; break;<br />&#160;&#160;&#160; &#160;&#160;&#160; case "ew":<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $wh = " LIKE &#39;%".$value."&#39;";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; break;<br />&#160;&#160;&#160; &#160;&#160;&#160; case "cn":<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $wh = " LIKE &#39;%".$value."%&#39;";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; break;<br />&#160;&#160;&#160; &#160;&#160;&#160; default :<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $wh = "";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; break;<br />&#160;&#160;&#160; }<br />&#160;&#160;&#160; $where_recherche = " AND ".$field.$wh;<br />&#160;&#160;&#160; $where_recherche_count = $field.$wh;<br />}<br />else {<br />&#160;&#160;&#160; $oper = " = ";<br />&#160;&#160;&#160; $wh = $oper.$value;<br />&#160;&#160;&#160; $where_recherche = " AND ".$field.$wh;<br />&#160;&#160;&#160; $where_recherche_count = $field." ".$oper." &#39;".$value."&#39;";<br />}</strong></p>
<p>// Connection vers la base de donn&#233;es<br />$db = mysql_connect($dbhost, $dbuser, $dbpassword)<br />or die("Connection Error: " . mysql_error());</p>
<p>mysql_select_db($database) or die("Error conecting to db.");<br />&#160;&#160;&#160; &#160;&#160;&#160; $result = mysql_query("SELECT COUNT(*) AS count FROM fofacent WHERE ".$where_recherche_count);<br />&#160;&#160;&#160; &#160;&#160;&#160; $row = mysql_fetch_array($result,MYSQL_ASSOC);<br />&#160;&#160;&#160; &#160;&#160;&#160; $count = $row[&#39;count&#39;];&#160;&#160;&#160; &#160;&#160;&#160; </p>
<p>&#160;&#160;&#160; &#160;&#160;&#160; if( $count &#62;0 ) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $total_pages = ceil($count/$limit);<br />&#160;&#160;&#160; &#160;&#160;&#160; } else {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $total_pages = 0;<br />&#160;&#160;&#160; &#160;&#160;&#160; }&#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ($page &#62; $total_pages) $page=$total_pages;<br />&#160;&#160;&#160; &#160;&#160;&#160; $start = $limit*$page - $limit; // Ne pas mettre $limit*($page - 1)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ($start&#60;0) $start = 0;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $SQL = "SELECT fofacent.cod_typfac, fofacent.cod_etafac, fofacent.dat_annee, fofacent.cod_banque, fobanque.nom_banque, fofacent.cod_fourni, fofacent.nom_foureg, fotypfac.cod_sens, fofacent.mnt_reg, fournis.cod_devise,fofacent.dat_echean, fofacent.num_facfou, fofacent.num_inform, fofacent.num_factur, fofacent.cod_etat FROM fofacent, fobanque, fotypfac, fournis WHERE (fobanque.cod_banque = fofacent.cod_banque AND fotypfac.cod_typfac = fofacent.cod_typfac AND FOURNIS.COD_ETAFOU = FOFACENT.COD_ETAFOU AND FOURNIS.COD_FOURNI = FOFACENT.COD_FOURNI ".$where_recherche.") ORDER BY ".$sidx." ".$sord. " LIMIT ".$start." , ".$limit;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $result = mysql_query( $SQL ) or die("Could not execute query.".mysql_error());<br />&#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $responce-&#62;page = $page;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $responce-&#62;total = $total_pages;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $responce-&#62;records = $count;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $i=0;<br />&#160;&#160;&#160; &#160;&#160;&#160; while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $responce-&#62;rows[$i][&#39;id&#39;]=array($row[&#39;num_factur&#39;].&#39;-&#39;.$row[&#39;cod_etafac&#39;].&#39;-&#39;.$row[&#39;cod_typfac&#39;].&#39;-&#39;.$row[&#39;dat_annee&#39;]); //D&#233;finition de la cl&#233; de l&#39;enregistrement r&#233;ccup&#233;r&#233;&#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $responce-&#62;rows[$i][&#39;cell&#39;]=array($row[&#39;cod_banque&#39;],$row[&#39;nom_banque&#39;],$row[&#39;cod_fourni&#39;],$row[&#39;nom_foureg&#39;],$row[&#39;cod_sens&#39;],$row[&#39;mnt_reg&#39;],$row[&#39;cod_devise&#39;],$row[&#39;dat_echean&#39;],$row[&#39;num_facfou&#39;],$row[&#39;num_inform&#39;]); <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $i++;<br />&#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; echo $json-&#62;encode($responce);//envoie des informations du GRID<br />mysql_close($db);<br />?&#62;</p>
</p>
<p>I don&#39;t uderstand how can I do my search. nothing work.</p>
<p>If you have an idea?!!</p>
<p><span style="color: #ff0000;">thank you for your help?</span>!</p>
<p><span style="color: #ff0000;">Regards</span></p>
]]></description>
        	        	<pubDate>Wed, 01 Apr 2009 03:34:03 +0300</pubDate>
        </item>
</channel>
</rss>