<?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: 3.6.2 Entire Grid Drag &#38; Dynamic Dropdown Help</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/362-entire-grid-drag-dynamic-dropdown-help</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/362-entire-grid-drag-dynamic-dropdown-help/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>newperson on 3.6.2 Entire Grid Drag &#38; Dynamic Dropdown Help</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/362-entire-grid-drag-dynamic-dropdown-help#p13429</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/362-entire-grid-drag-dynamic-dropdown-help#p13429</guid>
        	        	<description><![CDATA[<p>Thank you very much Tony this is now working.</p>
<p>Here is what it&#39;d look like (help other fellow new people)</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit952' value='Select Code' data-codeid='sfcode952' /></p>
<div class='sfcode' id='sfcode952'>
<p>jQuery(document).ready(<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; function() {<br />jQuery("#s4list").jqGrid({</p>
<p>...</p>
<p>});</p>
<p>....<br />$("#gbox_s4list").draggable()<br />});</p>
</div>
]]></description>
        	        	<pubDate>Tue, 29 Dec 2009 18:23:00 +0200</pubDate>
        </item>
        <item>
        	<title>tony on 3.6.2 Entire Grid Drag &#38; Dynamic Dropdown Help</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/362-entire-grid-drag-dynamic-dropdown-help#p13422</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/362-entire-grid-drag-dynamic-dropdown-help#p13422</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Using jQuery UI with draggable you can</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5329' value='Select Code' data-codeid='sfcode5329' /></p>
<div class='sfcode' id='sfcode5329'>
<p>$("#gbox_mygrid").draggable()</p>
</div>
<p>Where mygrid is the id of your grid</p>
<p>See the available options for the draggable here</p>
<p><a href="http://jqueryui.com/demos/draggable/" rel="nofollow" target="_blank">http://jqueryui.com/demos/draggable/</a></p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 29 Dec 2009 16:37:22 +0200</pubDate>
        </item>
        <item>
        	<title>newperson on 3.6.2 Entire Grid Drag &#38; Dynamic Dropdown Help</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/362-entire-grid-drag-dynamic-dropdown-help#p13394</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/362-entire-grid-drag-dynamic-dropdown-help#p13394</guid>
        	        	<description><![CDATA[<p>I am so sorry, you know what it is? I have been working on resizing my grid for the last few days and I was able to get that done. So I have that word stuck in my head. What I want to accomplish is &#8220;Drag&#8221; not resize.</p>
<p>Thanks for reading this once again.</p>
]]></description>
        	        	<pubDate>Mon, 28 Dec 2009 21:32:04 +0200</pubDate>
        </item>
        <item>
        	<title>tony on 3.6.2 Entire Grid Drag &#38; Dynamic Dropdown Help</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/362-entire-grid-drag-dynamic-dropdown-help#p13389</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/362-entire-grid-drag-dynamic-dropdown-help#p13389</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Little confused. What you actually want - resizing or drag and drop?</p>
<p>Reagrds</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 28 Dec 2009 19:34:21 +0200</pubDate>
        </item>
        <item>
        	<title>newperson on 3.6.2 Entire Grid Drag &#38; Dynamic Dropdown Help</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/362-entire-grid-drag-dynamic-dropdown-help#p13386</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/362-entire-grid-drag-dynamic-dropdown-help#p13386</guid>
        	        	<description><![CDATA[</p>
<p>Thank you very much</p>
<p>Regarding the resizing, I might be asking for too much but could you hold my hand on how to accomplish this? I tried looking at the 36 demo files and I went through all features on the demo page to see if this was something that was discussed and I was not able to find any already working examples.</p>
</p>
<p>Regarding the dynamic dropdown list, yes you did understand correctly. Here is a screen shot of what it would look like</p>
<p><a href="http://i47.tinypic.com/10q9ils.png"><img src="http://i47.tinypic.com/10q9ils.png" width="100"  style="vertical-align: bottom;" class="spUserImage" alt="DynamicDropdownList" /><img src="http://www.trirand.com/blog/wp-content/sp-resources/forum-themes/default/images/sp_Mouse.png" class=" sfmouseother" alt="Image Enlarger" /></a></p>
]]></description>
        	        	<pubDate>Mon, 28 Dec 2009 19:27:52 +0200</pubDate>
        </item>
        <item>
        	<title>tony on 3.6.2 Entire Grid Drag &#38; Dynamic Dropdown Help</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/362-entire-grid-drag-dynamic-dropdown-help#p13380</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/362-entire-grid-drag-dynamic-dropdown-help#p13380</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>If you want to drag the entrie grid you can use jQuery UI dragabble. This can be achieved easy.</p>
<p>You can apply the draggable to the following element - gbox_mygrid - where mygrid is the id of the gird.</p>
<p>The gbox_mygrid&#160; is a common div, where all the jqGrid related things are inserted.</p>
<p>About the drop down - if I understand right - just wait for the upcomming jqGrid PHP framework, which will be of beta soon.</p>
<p>This can be done just with 1 line of code.</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 28 Dec 2009 18:26:47 +0200</pubDate>
        </item>
        <item>
        	<title>newperson on 3.6.2 Entire Grid Drag &#38; Dynamic Dropdown Help</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/362-entire-grid-drag-dynamic-dropdown-help#p13375</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/362-entire-grid-drag-dynamic-dropdown-help#p13375</guid>
        	        	<description><![CDATA[<p>Hello, I am trying to implement dragging the entire Grid and a dynamic dropdown on my new grid if anyone can point me out in the right direction. I have searched the forums and found that most topics are for dnd which seems to only be for columns and subgrids. And the dropdown option seems to be in asp.net and I don&#39;t use that I am using php. Thanks in advance!</p>
<p>Here is my code</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9540' value='Select Code' data-codeid='sfcode9540' /></p>
<div class='sfcode' id='sfcode9540'>
<p>&#60;body&#62;</p>
<p>&#60;table id=&#8221;s4list&#8221; &#62;&#60;/table&#62;<br />&#60;div id=&#8221;s4pager&#8221;&#62;&#60;/div&#62;<br />&#60;script src=&#8221;jqgrid/js/search4.js&#8221; type=&#8221;text/javascript&#8221;&#62;&#60;/script&#62;</p>
<p>&#60;/body&#62;</p>
<p>file:search4.js</p>
<p>jQuery(document).ready(<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; function() {<br />jQuery(&#8221;#s4list&#8221;).jqGrid({<br />&#160;&#160; &#160;&#160;&#160; url:&#39;jqgrid/search_adv.php?q=1&#39;,<br />&#160;&#160;&#160; datatype: &#8220;json&#8221;,<br />&#160;&#160;&#160; width: 500,<br />&#160;&#160; &#160;&#160;&#160; colNames:[&#39;Store&#39;,&#39;Business Unit&#39;, &#39;SKU Count&#39;, &#39;Date&#39;],<br />&#160;&#160; &#160;&#160;&#160; colModel:[<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;Store&#39;,index:&#39;store_number&#39;, width:65, searchoptions:{sopt:[&#39;eq&#39;,&#39;ne&#39;,&#39;lt&#39;,&#39;le&#39;,&#39;gt&#39;,&#39;ge&#39;]}},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;Businness Unit&#39;,index:&#39;bu&#39;, width:80, align:&#8221;right&#8221;,searchoptions:{sopt:[&#39;eq&#39;,&#39;ne&#39;,&#39;lt&#39;,&#39;le&#39;,&#39;gt&#39;,&#39;ge&#39;]}},<br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;SKU Count&#39;,index:&#39;item_count&#39;, width:80,align:&#8221;right&#8221;,searchoptions:{sopt:[&#39;eq&#39;,&#39;ne&#39;,&#39;lt&#39;,&#39;le&#39;,&#39;gt&#39;,&#39;ge&#39;]}},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;Date&#39;,index:&#39;datetime&#39;, width:90, align:&#8221;right&#8221;,searchoptions:{sopt:[&#39;eq&#39;,&#39;ne&#39;,&#39;lt&#39;,&#39;le&#39;,&#39;gt&#39;,&#39;ge&#39;]}},<br />&#160;&#160; &#160;&#160;&#160; ],<br />&#160;&#160; &#160;&#160;&#160; rowNum:30,<br />&#160;&#160; &#160;&#160;&#160; mtype: &#8220;POST&#8221;,<br />&#160;&#160; &#160;&#160;&#160; rowList:[30,40,60],<br />&#160;&#160; &#160;&#160;&#160; pager: &#39;#s4pager&#39;,<br />&#160;&#160; &#160;&#160;&#160; sortname: &#39;item_count&#39;,<br />&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160; rownumbers: true,<br />&#160;&#160;&#160; gridview : true,<br />&#160;&#160;&#160; sortorder: &#8220;asc&#8221;,<br />&#160;&#160;&#160; caption:&#8221;SKU Count of stores databases&#8221;<br />}); </p>
<p>jQuery(&#8221;#s4list&#8221;).jqGrid(&#39;navGrid&#39;,&#39;#s4pager&#39;,<br />{<br />&#160;&#160;&#160; edit:false,add:false,del:false,search:true,refresh:true<br />},<br />{}, // edit options<br />{}, // add options<br />{}, //del options<br />{multipleSearch:true} // search options<br />);</p>
<p>jQuery(&#8221;#s4list&#8221;).jqGrid(&#39;gridResize&#39;,{minWidth:350,maxWidth:800,minHeight:80, maxHeight:350});</p>
<p>});</p>
</p>
<p>PHP &#62; MySQL DB</p>
</p>
<p>&#60;?php<br />include(&#8221;dbconfig.php&#8221;);<br />// coment the above lines if php 5<br />//include(&#8221;JSON.php&#8221;);<br />//$json = new Services_JSON();<br />// end comment<br />$examp = $_REQUEST["q"]; //query number</p>
<p>$page = $_REQUEST[&#39;page&#39;]; // get the requested page<br />$limit = $_REQUEST[&#39;rows&#39;]; // get how many rows we want to have into the grid<br />$sidx = $_REQUEST[&#39;sidx&#39;]; // get index row &#8211; i.e. user click to sort<br />$sord = $_REQUEST[&#39;sord&#39;]; // get the direction<br />if(!$sidx) $sidx =1;</p>
<p>$wh = &#8220;&#8221;;<br />$searchOn = Strip($_REQUEST[&#39;_search&#39;]);<br />if($searchOn==&#39;true&#39;) {<br />&#160;&#160;&#160; $searchstr = Strip($_REQUEST[&#39;filters&#39;]);<br />&#160;&#160;&#160; $wh= constructWhere($searchstr);<br />&#160;&#160;&#160; //echo $wh;<br />}<br />function constructWhere($s){<br />&#160;&#160;&#160; $qwery = &#8220;&#8221;;<br />&#160;&#160;&#160; //[&#39;eq&#39;,&#39;ne&#39;,&#39;lt&#39;,&#39;le&#39;,&#39;gt&#39;,&#39;ge&#39;,&#39;bw&#39;,&#39;bn&#39;,&#39;in&#39;,&#39;ni&#39;,&#39;ew&#39;,&#39;en&#39;,&#39;cn&#39;,&#39;nc&#39;]<br />&#160;&#160;&#160; $qopers = array(<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#39;eq&#39;=&#62;&#8221; = &#8220;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#39;ne&#39;=&#62;&#8221; &#60;&#62; &#8220;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#39;lt&#39;=&#62;&#8221; &#60; &#8220;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#39;le&#39;=&#62;&#8221; &#60;= &#8220;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#39;gt&#39;=&#62;&#8221; &#62; &#8220;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#39;ge&#39;=&#62;&#8221; &#62;= &#8220;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#39;bw&#39;=&#62;&#8221; LIKE &#8220;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#39;bn&#39;=&#62;&#8221; NOT LIKE &#8220;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#39;in&#39;=&#62;&#8221; IN &#8220;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#39;ni&#39;=&#62;&#8221; NOT IN &#8220;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#39;ew&#39;=&#62;&#8221; LIKE &#8220;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#39;en&#39;=&#62;&#8221; NOT LIKE &#8220;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#39;cn&#39;=&#62;&#8221; LIKE &#8221; ,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#39;nc&#39;=&#62;&#8221; NOT LIKE &#8221; );<br />&#160;&#160;&#160; if ($s) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $jsona = json_decode($s,true);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(is_array($jsona)){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $gopr = $jsona[&#39;groupOp&#39;];<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $rules = $jsona[&#39;rules&#39;];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $i =0;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; foreach($rules as $key=&#62;$val) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $field = $val[&#39;field&#39;];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $op = $val[&#39;op&#39;];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $v = $val[&#39;data&#39;];<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if($v &#38;&#38; $op) {<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $i++;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; // ToSql in this case is absolutley needed<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $v = ToSql($field,$op,$v);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if ($i == 1) $qwery = &#8221; AND &#8220;;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; else $qwery .= &#8221; &#8221; .$gopr.&#8221; &#8220;;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; switch ($op) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; // in need other thing<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; case &#39;in&#39; :<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; case &#39;ni&#39; :<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160; $qwery .= $field.$qopers[$op].&#8221; (&#8221;.$v.&#8221;)&#8221;;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160; break;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; default:<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160; $qwery .= $field.$qopers[$op].$v;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; }<br />&#160;&#160;&#160; return $qwery;<br />}<br />function ToSql ($field, $oper, $val) {<br />&#160;&#160;&#160; // we need here more advanced checking using the type of the field &#8211; i.e. integer, string, float<br />&#160;&#160;&#160; switch ($field) {<br />&#160;&#160;&#160; &#160;&#160;&#160; case &#39;store_number&#39;:<br />&#160;&#160;&#160; &#160;&#160;&#160; case &#39;bu&#39;:<br />&#160;&#160;&#160; &#160;&#160;&#160; case &#39;item_count&#39;:<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; return intval($val);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; break;<br />/*&#160;&#160;&#160; &#160;&#160;&#160; case &#39;datetime&#39;:<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; return floatval($val);<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; //mysql_real_escape_string is better<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if($oper==&#39;bw&#39; &#124;&#124; $oper==&#39;bn&#39;) return &#8220;&#39;&#8221; . addslashes($val) . &#8220;%&#39;&#8221;;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; else if ($oper==&#39;ew&#39; &#124;&#124; $oper==&#39;en&#39;) return &#8220;&#39;%&#8221; . addcslashes($val) . &#8220;&#39;&#8221;;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; else if ($oper==&#39;cn&#39; &#124;&#124; $oper==&#39;nc&#39;) return &#8220;&#39;%&#8221; . addslashes($val) . &#8220;%&#39;&#8221;;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; else return &#8220;&#39;&#8221; . addslashes($val) . &#8220;&#39;&#8221;;<br />&#160;&#160;&#160; }<br />}</p>
<p>//echo $wh;<br />// connect to the database<br />$db = mysql_connect($dbhost, $dbuser, $dbpassword)<br />or die(&#8221;Connection Error: &#8221; . mysql_error());</p>
<p>mysql_select_db($database) or die(&#8221;Error conecting to db.&#8221;);</p>
<p>switch ($examp) {<br />&#160;&#160;&#160; case 1:<br />&#160;&#160;&#160; &#160;&#160;&#160; //Mysql Statement to retrieve Counts from a given table. must modify to meet my needs&#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; $result = mysql_query(&#8221;SELECT COUNT(*) AS count FROM store_item_monitor WHERE 1 = 1&#8243;.$wh);<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;];</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; }<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 &#8211; $limit; // do not put $limit*($page &#8211; 1)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ($start&#60;0) $start = 0;<br />&#160;&#160;&#160; &#160;&#160;&#160; //MYSQL Select Statement Needs to be modified to meet my needs<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $SQL = &#8220;SELECT record, store_number, item_count, bu, datetime FROM store_item_monitor WHERE 1 = 1&#8243;.$wh.&#8221; ORDER BY &#8220;.$sidx.&#8221; &#8220;.$sord. &#8221; LIMIT &#8220;.$start.&#8221; , &#8220;.$limit;<br />&#160;&#160;&#160; &#160;&#160;&#160; $result = mysql_query( $SQL ) or die(&#8221;Could not execute query.&#8221;.mysql_error());<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;]=$row[record];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $responce-&#62;rows[$i][&#39;cell&#39;]=array($row[store_number],$row[bu],$row[item_count],$row[datetime]);<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); // coment if php 5<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo json_encode($responce);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;<br />&#160;&#160;&#160; case 3:<br />}<br />mysql_close($db);</p>
<p>function Strip($value)<br />{<br />&#160;&#160;&#160; if(get_magic_quotes_gpc() != 0)<br />&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; if(is_array($value))&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if ( array_is_associative($value) )<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; foreach( $value as $k=&#62;$v)<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $tmp_val[$k] = stripslashes($v);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $value = $tmp_val; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; else&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; for($j = 0; $j &#60; sizeof($value); $j++)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $value[$j] = stripslashes($value[$j]);<br />&#160;&#160;&#160; &#160;&#160;&#160; else<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $value = stripslashes($value);<br />&#160;&#160;&#160; }<br />&#160;&#160;&#160; return $value;<br />}<br />function array_is_associative ($array)<br />{<br />&#160;&#160;&#160; if ( is_array($array) &#38;&#38; ! empty($array) )<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; for ( $iterator = count($array) &#8211; 1; $iterator; $iterator&#8211; )<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ( ! array_key_exists($iterator, $array) ) { return true; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return ! array_key_exists(0, $array);<br />&#160;&#160;&#160; }<br />&#160;&#160;&#160; return false;<br />}<br />?&#62;</p>
</div>
]]></description>
        	        	<pubDate>Mon, 28 Dec 2009 17:47:06 +0200</pubDate>
        </item>
</channel>
</rss>