MFYZ ,
I finally got the script setup and it runs great…good job
. Some things to consider:
If you can provide an update on the pagination above, it would be appreciated.
MFYZ ,
I finally got the script setup and it runs great…good job
. Some things to consider:
If you can provide an update on the pagination above, it would be appreciated.
Great script. It worked immediately when I plugged in my database and all the params. It would be great if column ASC and DESC could be applied to existing search results instead of reverting back to all.
I’m able to just add “&grid[order]=COLUMNNAME&grid[sort]=desc” to the end of a search result URL to get that functionality.
If you could advise me on how to the best way to incorporate that in to the column links, I think that would be a great update to this great script.
Thanks and great job!
Fixed the pagination view for IE and Chrome users. The pagination at bottom was not properly showing. All you have to do is open grid.php go to the code under:
// link style pagination
for ($i=1; $i <= $rows[pageCount]; $i++){
$gridHTML .= '<li'.( $i == $rows[page] ? '<span class="selected">'. $i .'</span>':'<a href="'. str_replace('__page__', $i, $params[pageLink]) .'">'. $i .'</a>' ).''; }
and add the right bracket to the first
"<li"
so that it reads
$gridHTML .= '<li>' ignore the li at end of this block...(automatically appended by code canyon) --></li>
Firefox automatically closes the li by adding a right bracket whereas IE and Chrome does not causing the pagination to bunch up.
Hi, Gonna have to agree with “7676_King” comment there are lots and lots of erros in this script – over 250 actually.
Your reply “those are not errors” is incorrect they are PHP notices which may not be critical but they are errors as far as PHP is concerned and should have been fixed before putting this script into the public domain.
The errors are occurring because you have not quoted the array key val names plus you have confusingly combined double and single quotes.
More serious problems: 1. subscript out of range 2. use of short tags – which to less seasoned PHP devs will render the script useless since grid.php wont even run!!
PHP must make intelligent assumptions as to what you meant to use ‘constant or variables index’s
You have also referenced many data items before checking they are set i.e. isset(data-item) or exist or check for empty()
Switching Notices off is bad practice and not recommended even though you can ignore them you should attend to them especially when ‘Selling’ a script to the general public without mention of issues.
However, i’m using it and ive converted it to a PHP5 compliant class – some nice logic in there, so thanks for the work done.
Friend bought the script but not configured it works see the error:
$value){ $paramsfields = array( ucfirst(str_replace(’_’, ’ ’, $key)), false, true, true ); $fields[] = $key; } } // default where clause if has if( $params[where] ) $where[] = $params[where]; // default order $order = $_GETgrid; if( !$order && $params[order] ) $order = $params[order]; $sort = $_GETgrid; if( !$sort && $params[sort] ) $sort = $params[sort]; // search if( $_GETgrid ){ // search field is searchable? if( $paramsfields[search_field] ][3] true ){ // adding where array $where[] = mysql_real_escape_string($_GETgrid) . ' like " '. $_GETgrid .' "'; } } // getting paged rows $rows = pagedrows(array( 'table' => $params[table], 'fields' => $fields, 'limit' => $params[limit], 'order' => mysql_real_escape_string($order) .' '. mysql_real_escape_string($sort), 'where' => ( $where ? (count($where) 1 ? $where0:implode(’ and ’, $where)):false ), ‘page’ => ( $params[page] ? $params[page] : $_GET[page] ) )); // post process if( $params[‘do’] && $rows[results] ){ foreach ($rows[results] as $key => $value){ eval(’$rowsresults = ’. $params[‘do’] .’($value);’); } } // search form foreach ($params[fields] as $key => $field){ if( $field3 == true ) $searchables[] = $key; } if( $params[searchable] && $searchables ){ // formu basalim $gridHTML .= ‘ ’; $gridHTML .= ‘
Hi mfyz,
Bought your script, though am having a little problem hope you can help me…
the script is used as displayed :
www.domain.com/index.php?file=main&file=list
the data are displayed thats is great. the only problem is when i use the search, the page redirect to:
index.php?grid[search_field]=name&grid[search]=john
not to :
index.php?file=main&file=list&grid[search_field]=name&grid[search]=john
can you help me please
con you please help in the area where does the search : example ‘where’ => ‘userid = ”$userid”’,
the userid come’s from a session id and also how can i combined 2 fields
‘address, zip, state’ => array(‘Address’, 200, true, true),
Thank you i will really apreciated ..
I should have read the comments, I bought this to easily edit a table. The picture of the item is very misleading. I spent over an hour setting it up only to find that you can not edit the data. 
Of course you can edit the data! All you need to do is add the appropriate links in the postProcess function so when the grid is displayed, the ‘edit’ links appear.
Your links should point to your own functions for data deletion as the grid class has no way of knowing what data you are using or if you even need an edit link.
im confused.i edited the table=>
and aray(
array( /*
field | name | width | sortable | searchable | database
—-—---—-—-—---—---—-—-—-—--+-—-—--
defaults: | 100px | true | false | true
—-—---—-—-—---—---—-—-—-—--+-—-——*/
‘P_ID’ => array(‘P_ID’, 30),
‘NomProf’ => array(‘NomProf’, 120),
//’konum’ => array(‘URL’, 200, true, true),
//’zaman’ => array(‘Date’, 125, true, true),
//’ip’ => array(‘IP’, 80),
// ‘actions’ => array(‘Actions’, 100, false, false, false) // this is a manual field
),
‘order’ => ‘P_ID’, // default order (should be one of your field name)
‘sort’ => ‘desc’, // order direction (should be `asc` or `desc`)
‘where’ => ‘zaman like “2009%”’, // filter (this filter will be applied always)
‘do’ => ‘postProcessFunction’, // post processor for every row
‘limit’ => 20,
‘searchable’ => true
it still shows no results….
Because you forgot the example code in where parameter. ‘where’ => ‘zaman like “2009%”’, That code filters your results with zaman field but it probably doesn’t exist in your database, so you get no results.
Also make sure post process function doesn’t deletes any field from row array and returns row at the end. IF you’re not using post processing, you shouldn’t pass as parameter. It can cause problems.
ok i got it going..now trying to figure out a delete field
hi mfyz.. it get me confused..where should I start with ..which part of the code should I edit or which php file to be adjusted that could suit to my own database..? I’m quite new to PHP ..
Thanks…
still no reply..where’s the author?
hi mfyz.. Ok, I managed to do this but the problem is why the table only showing only single line data whereby the table contains 2 more lines that should be shown? Help me please. Thanks..
Can you paste the grid code you’re running (just the parameters you used is enough)?
Can you check parameters to make sure you’re setting only and right parameteres? Most of the time, problems caused because of unnecessary, missing parameter or wrong usage.
There is a list of parameters explained in the documentation: http://projects.mfyz.com/grid/documentation/usage.html
It’s okay mfyz..
I managed to get it running..Thanks for the reply.
Hi mfyz, When running the script, I found an error after I deleting the parameter : ‘where’ => ‘zaman like “2009%”’, // filter (this filter will be applied always).
The error is Notice: Undefined index: where in “mydomain.com/demopage/codes/grid.php on line 94
Notice: Undefined variable: where in “mydomain.com/demopage/codes/grid.php on line 127
So, what’s the problem actually happened here?
Hope to get reply from you soon?
Thank You For Your Usefull PHP Code. It speed up my projects.
Best,
Pourang
the pageselect is working? i tryed some browser but when i choose page 2, 3.. and so on, its not loading the data. (im testing with the codecanyon demo too and its not refreshing the table neighter)
How can i get the search function onto the home page?
Also, the drop down menu with all the page numbers, when you click a new page number, it doesn’t change pages… how can i get this to work?
COPYRIGHT © 2012 ENVATO| TERMS OF USAGE| SUPPORT/HELP| ICONS BY TANGO + WEFUNCTION + FAMFAMFAM
Adobe®, Flash®, Flex®, Fireworks®, Photoshop®, Illustrator®, InDesign® and After Effects® are registered trademarks of Adobe Systems Incorporated.
159 Purchases
40 Comments