├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── constants.php ├── docs ├── doxygen │ ├── customdoxygen.css │ ├── doxy-boot.js │ ├── footer.html │ ├── header.html │ ├── html │ │ ├── _c_h_a_n_g_e_l_o_g.html │ │ ├── _c_h_a_n_g_e_l_o_g_8md.html │ │ ├── _r_e_a_d_m_e_8md.html │ │ ├── annotated.html │ │ ├── arrowdown.png │ │ ├── arrowright.png │ │ ├── bc_s.png │ │ ├── bdwn.png │ │ ├── classes.html │ │ ├── classphp__bs__grid.html │ │ ├── classphp__bs__grid_a1853e07eaa5a0cc8f8a682648be6199c_cgraph.map │ │ ├── classphp__bs__grid_a1853e07eaa5a0cc8f8a682648be6199c_cgraph.md5 │ │ ├── classphp__bs__grid_a1853e07eaa5a0cc8f8a682648be6199c_cgraph.png │ │ ├── classphp__bs__grid_a2ad3c171e07b2eb169751c7373593ff2_cgraph.map │ │ ├── classphp__bs__grid_a2ad3c171e07b2eb169751c7373593ff2_cgraph.md5 │ │ ├── classphp__bs__grid_a2ad3c171e07b2eb169751c7373593ff2_cgraph.png │ │ ├── classphp__bs__grid_abf5cf59f0f7da58533aadea7bd368ed8_cgraph.map │ │ ├── classphp__bs__grid_abf5cf59f0f7da58533aadea7bd368ed8_cgraph.md5 │ │ ├── classphp__bs__grid_abf5cf59f0f7da58533aadea7bd368ed8_cgraph.png │ │ ├── classphp__bs__grid_ae6bc3e22f941867fec0d806e3d653658_cgraph.map │ │ ├── classphp__bs__grid_ae6bc3e22f941867fec0d806e3d653658_cgraph.md5 │ │ ├── classphp__bs__grid_ae6bc3e22f941867fec0d806e3d653658_cgraph.png │ │ ├── closed.png │ │ ├── constants_8php.html │ │ ├── customdoxygen.css │ │ ├── doc.png │ │ ├── docs01-_columns_8md.html │ │ ├── docs10-_criteria-_t_e_x_t_8md.html │ │ ├── docs11-_criteria-_n_u_m_b_e_r_8md.html │ │ ├── docs12-_criteria-_l_o_o_k_u_p_8md.html │ │ ├── docs13-_criteria-_d_a_t_e_8md.html │ │ ├── docs14-_criteria-_a_u_t_o_c_o_m_p_l_e_t_e_8md.html │ │ ├── docs15-_criteria-_m_u_l_t_i_s_e_l_e_c_t___c_h_e_c_k_b_o_x_8md.html │ │ ├── docs19-_criteria-_define_8md.html │ │ ├── docs20-_advanced-_sorting_8md.html │ │ ├── doxy-boot.js │ │ ├── doxygen.css │ │ ├── doxygen.png │ │ ├── dynsections.js │ │ ├── files.html │ │ ├── folderclosed.png │ │ ├── folderopen.png │ │ ├── functions.html │ │ ├── functions_func.html │ │ ├── functions_vars.html │ │ ├── globals.html │ │ ├── globals_vars.html │ │ ├── graph_legend.html │ │ ├── graph_legend.md5 │ │ ├── graph_legend.png │ │ ├── index.html │ │ ├── jquery.js │ │ ├── md__data_projects_php_php_bs_grid_CHANGELOG.html │ │ ├── md__data_projects_php_php_bs_grid_docs_wiki-pages_docs01-Columns.html │ │ ├── md__data_projects_php_php_bs_grid_docs_wiki-pages_docs10-Criteria-TEXT.html │ │ ├── md__data_projects_php_php_bs_grid_docs_wiki-pages_docs11-Criteria-NUMBER.html │ │ ├── md__data_projects_php_php_bs_grid_docs_wiki-pages_docs12-Criteria-LOOKUP.html │ │ ├── md__data_projects_php_php_bs_grid_docs_wiki-pages_docs13-Criteria-DATE.html │ │ ├── md__data_projects_php_php_bs_grid_docs_wiki-pages_docs14-Criteria-AUTOCOMPLETE.html │ │ ├── md__data_projects_php_php_bs_grid_docs_wiki-pages_docs15-Criteria-MULTISELECT_CHECKBOX.html │ │ ├── md__data_projects_php_php_bs_grid_docs_wiki-pages_docs19-Criteria-Define.html │ │ ├── md__data_projects_php_php_bs_grid_docs_wiki-pages_docs20-Advanced-Sorting.html │ │ ├── nav_f.png │ │ ├── nav_g.png │ │ ├── nav_h.png │ │ ├── open.png │ │ ├── pages.html │ │ ├── php__bs__grid_8class_8php.html │ │ ├── search │ │ │ ├── all_0.html │ │ │ ├── all_0.js │ │ │ ├── all_1.html │ │ │ ├── all_1.js │ │ │ ├── all_2.html │ │ │ ├── all_2.js │ │ │ ├── all_3.html │ │ │ ├── all_3.js │ │ │ ├── all_4.html │ │ │ ├── all_4.js │ │ │ ├── all_5.html │ │ │ ├── all_5.js │ │ │ ├── all_6.html │ │ │ ├── all_6.js │ │ │ ├── all_7.html │ │ │ ├── all_7.js │ │ │ ├── all_8.html │ │ │ ├── all_8.js │ │ │ ├── all_9.html │ │ │ ├── all_9.js │ │ │ ├── all_a.html │ │ │ ├── all_a.js │ │ │ ├── classes_0.html │ │ │ ├── classes_0.js │ │ │ ├── close.png │ │ │ ├── files_0.html │ │ │ ├── files_0.js │ │ │ ├── files_1.html │ │ │ ├── files_1.js │ │ │ ├── files_2.html │ │ │ ├── files_2.js │ │ │ ├── files_3.html │ │ │ ├── files_3.js │ │ │ ├── files_4.html │ │ │ ├── files_4.js │ │ │ ├── functions_0.html │ │ │ ├── functions_0.js │ │ │ ├── functions_1.html │ │ │ ├── functions_1.js │ │ │ ├── functions_2.html │ │ │ ├── functions_2.js │ │ │ ├── functions_3.html │ │ │ ├── functions_3.js │ │ │ ├── functions_4.html │ │ │ ├── functions_4.js │ │ │ ├── functions_5.html │ │ │ ├── functions_5.js │ │ │ ├── functions_6.html │ │ │ ├── functions_6.js │ │ │ ├── mag_sel.png │ │ │ ├── nomatches.html │ │ │ ├── pages_0.html │ │ │ ├── pages_0.js │ │ │ ├── pages_1.html │ │ │ ├── pages_1.js │ │ │ ├── pages_2.html │ │ │ ├── pages_2.js │ │ │ ├── search.css │ │ │ ├── search.js │ │ │ ├── search_l.png │ │ │ ├── search_m.png │ │ │ ├── search_r.png │ │ │ ├── searchdata.js │ │ │ ├── variables_0.html │ │ │ ├── variables_0.js │ │ │ ├── variables_1.html │ │ │ └── variables_1.js │ │ ├── splitbar.png │ │ ├── sync_off.png │ │ ├── sync_on.png │ │ ├── tab_a.png │ │ ├── tab_b.png │ │ ├── tab_h.png │ │ ├── tab_s.png │ │ ├── tabs.css │ │ └── template_8php.html │ └── php_bs_grid.doxyfile ├── jsdoc │ ├── files.html │ ├── index.html │ └── symbols │ │ ├── $.fn.html │ │ ├── $.fn.php_bs_grid.html │ │ ├── $.html │ │ ├── _global_.html │ │ └── src │ │ ├── _data_2del_1_jquery.php_bs_grid.js.html │ │ └── _data_projects_php_php_bs_grid_jquery.php_bs_grid.js.html └── wiki-pages │ ├── docs01-Columns.md │ ├── docs10-Criteria-TEXT.md │ ├── docs11-Criteria-NUMBER.md │ ├── docs12-Criteria-LOOKUP.md │ ├── docs13-Criteria-DATE.md │ ├── docs14-Criteria-AUTOCOMPLETE.md │ ├── docs15-Criteria-MULTISELECT_CHECKBOX.md │ ├── docs19-Criteria-Define.md │ └── docs20-Advanced-Sorting.md ├── examples ├── common │ └── util_functions.php ├── example_common │ ├── ajax_get_vars.php │ ├── ajax_reset_all.php │ ├── criteria.php │ ├── index.js │ └── index.php └── example_using_session │ ├── ajax_get_vars.php │ ├── ajax_reset_all.php │ ├── criteria.php │ ├── index.js │ └── index.php ├── jquery.php_bs_grid.js ├── jquery.php_bs_grid.min.js ├── php_bs_grid.class.php ├── php_bs_grid.css ├── screenshots ├── Nexus-5X.png ├── desktop.png ├── iPad.png └── iPhone-6.png └── template.php /.gitignore: -------------------------------------------------------------------------------- 1 | # JetBrains PhpStorm IDE files ------------------------------------------------- 2 | /.idea/ -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | =========== 3 | 4 | php datagrid with jquery, jquery-ui and bootstrap frontend. Simple, secure, easy to use. 5 | 6 | Copyright Christos Pontikis http://www.pontikis.net 7 | 8 | Project page https://github.com/pontikis/php_bs_grid 9 | 10 | License [MIT](https://github.com/pontikis/php_bs_grid/blob/master/LICENSE) 11 | 12 | 13 | Upcoming Release 0.9.7 (XX XXX 2017) 14 | -------------------------- 15 | 16 | * phpexcel: sheet name cannot be longer than 31 characters - let the default sheet name #31 17 | 18 | Release 0.9.6 (16 July 2017) 19 | -------------------------- 20 | 21 | * bug fix - multiple autocomplete failed #30 22 | * skip_in_excel_export column option #29 23 | 24 | Release 0.9.5 (02 July 2017) 25 | -------------------------- 26 | 27 | * add operators to multiselect_checkbox (one or more of, not given) #22 28 | * add operators to autocomplete (equal, not given) #23 29 | * add not equal operator to lookup filters #27 30 | * ability to append/prepend element in filters #26 31 | * added ``showCriterion`` method 32 | * less or greater operators (date, number criteria) #24 33 | * Implement number criteria #2 34 | * use UTF-8 for column headers in PHPExcel (column header may contain html special chars) #21 35 | * documentation #20 36 | 37 | 38 | Release 0.9.4 (20 June 2017) 39 | -------------------------- 40 | 41 | * documentation #20 42 | * Fixed where SQL #19 43 | * pass serialized params from php to javascript #18 44 | * Save status to SESSION #17 45 | * Implement multiselect_checkbox criteria #11 46 | * Implement autocomplete criteria #14 47 | * Implement datetime criteria #15 48 | * Fixed WHERE statements (beyond filters applied by the user interface) #13 49 | * Added sort_simple_default_order column property #12 50 | 51 | 52 | Release 0.9.3 (15 May 2017) 53 | -------------------------- 54 | 55 | * trim filter values #10 56 | * filter min chars (after trim) #9 57 | * fix typo (th_class instead of td_class) in displayTableData #8 58 | 59 | 60 | Release 0.9.2 (14 Apr 2017) 61 | -------------------------- 62 | 63 | * bug fixed - Ajax error on press Enter (13) #7 64 | * Rows per page always visible (top row) #6 65 | 66 | 67 | Release 0.9.1 (13 Apr 2017) 68 | -------------------------- 69 | 70 | * bugs using [is_null] operators (fixed) #5 71 | * minified js version added 72 | 73 | 74 | Release 0.9.0 (10 Apr 2017) 75 | -------------------------- 76 | 77 | * Excel export added (CSV export removed) #4 78 | 79 | Release 0.8.0 (9 Apr 2017) 80 | -------------------------- 81 | 82 | Basic functionality #1 83 | 84 | * Customizable columns 85 | * Pagination 86 | * Simple column sorting 87 | * Advanced sorting 88 | * Filters (text, lookup, date) 89 | * Export (CSV) 90 | * Multilanguage 91 | * Support prepared statements 92 | * Responsive design 93 | 94 | 95 | Release 0.1.0 (3 Apr 2017) 96 | ------------------------- 97 | 98 | * just started 99 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Christos Pontikis 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # php_bs_grid 2 | 3 | php datagrid with jquery, jquery-ui and bootstrap frontend. Simple, secure, easy to use. 4 | 5 | Copyright Christos Pontikis http://www.pontikis.net 6 | 7 | Project page https://github.com/pontikis/php_bs_grid 8 | 9 | License [MIT](https://github.com/pontikis/php_bs_grid/blob/master/LICENSE) 10 | 11 | 12 | ## Features 13 | 14 | Displays database data in table format. 15 | 16 | * Customizable columns 17 | * Pagination 18 | * Simple column sorting 19 | * Advanced sorting 20 | * Filters 21 | * text 22 | * number 23 | * lookup 24 | * date 25 | * autocomplete 26 | * multiselect_checkbox 27 | * Export (Excel .xlsx) 28 | * Multilanguage 29 | * Databases supported: MySQL (or MariaDB), PostgreSQL 30 | * Prepared statements supported 31 | * Fixed WHERE sql supported 32 | * Responsive design 33 | * Fully customizable (open architecture based on templates) 34 | * Save status to $_SESSION 35 | 36 | ## Dependencies 37 | 38 | ### back-end 39 | * tested with php 5.6 and php 7 40 | * dacapo (database abstraction - MySQL, MariaDB, PostGreSQL) - https://github.com/pontikis/dacapo 41 | * PHPExcel is required for export https://github.com/PHPOffice/PHPExcel 42 | 43 | ### front-end 44 | * jquery https://jquery.com/ (tested with v3.2.1) 45 | * jquery-ui (datepicker, autocomplete) http://jqueryui.com/ (tested with v1.12.1) 46 | * jQuery UI Autocomplete HTML Extension http://github.com/scottgonzalez/jquery-ui-extensions (optional) 47 | * jQuery-Timepicker-Addon http://trentrichardson.com/examples/timepicker/ (tested with v1.6.3) 48 | * jQuery UI Touch Punch http://touchpunch.furf.com/ tested with v0.2.3 (optional) 49 | * twitter bootstrap http://getbootstrap.com/ (tested with v3.3.7) 50 | 51 | ## Files 52 | 53 | 1. ``php_bs_grid.class.php`` php class 54 | 2. ``jquery.php_bs_grid.js`` jquery plugin (minified version also available for production) 55 | 3. ``constants.php`` php constants to include 56 | 4. ``template.php`` default template 57 | 5. ``php_bs_grid.css`` default css file 58 | 59 | ## Documentation 60 | 61 | See ``docs/doxygen/html`` for html documentation of ``php_bs_grid`` class. 62 | 63 | See ``docs/jsdoc`` for html documentation of ``php_bs_grid`` jquery plugin. 64 | 65 | See also Github Wiki https://github.com/pontikis/php_bs_grid/wiki 66 | 67 | ## How to use 68 | 69 | See ``examples`` folder. 70 | 71 | In ``examples/example_common`` folder find an example where a hidden field (``dg_status``) is used to pass the serialized status of ``php_bs_grid`` to javascript using an ajax call (``ajax_get_vars.php``). 72 | 73 | In ``examples/example_using_session`` folder find an example where ``$_SESSION`` is used to keep the status of ``php_bs_grid``. You can pass ``php_bs_grid`` parameters to javascript using an ajax call (``ajax_get_vars.php``). Moreover, you can return to recent status (filters, pagination etc) after returning to datagrid page from another page. This is the recommended use of `php_bs_grid``. 74 | 75 | Custom functions included in ``examples/common/util_functions.php``. They have **nothing to do with** ``php_bs_grid`` functionality. I quote them just for rerefrence. 76 | 77 | ## See it in action 78 | 79 | Coming soon at http://www.pontikis.net/labs 80 | 81 | ## Screenshots 82 | 83 | Desktop: 84 | 85 |  86 | 87 | Nexus 5: 88 | 89 |  90 | 91 | iPhone 6: 92 | 93 |  94 | 95 | iPad: 96 | 97 |  98 | -------------------------------------------------------------------------------- /constants.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |