Guest User

Untitled

a guest
Feb 13th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. <?php
  2. /**
  3. * PHP Grid Component
  4. *
  5. * @author Abu Ghufran <gridphp@gmail.com> - http://www.phpgrid.org
  6. * @version 1.5.2
  7. * @license: see license.txt included in package
  8. */
  9.  
  10. /**
  11. * To support non-mysql databases (even mysql), see adodb lib documentation below:
  12. * http://phplens.com/lens/adodb/docs-adodb.htm#connect_ex
  13. * http://phplens.com/lens/adodb/docs-adodb.htm#drivers
  14. *
  15. * For oracle, extension of oci8 should be enabled in php.ini
  16. *
  17. */
  18. $db_conf = array();
  19. $db_conf["type"] = "oci8"; // mysql,oci8(for oracle),mssql,postgres,sybase
  20. $db_conf["server"] = "127.0.0.1:1521";
  21. $db_conf["user"] = "system";
  22. $db_conf["password"] = "asd";
  23. $db_conf["database"] = "xe";
  24.  
  25. include("../../lib/inc/jqgrid_dist.php");
  26. $g = new jqgrid($db_conf);
  27.  
  28. // set few params
  29. $grid["caption"] = "Sample Grid";
  30. $grid["rowNum"] = 15;
  31. $g->set_options($grid);
  32. $g->set_actions(array("inlineadd"=>true,
  33. "export_pdf"=>true, // export pdf button
  34. "autofilter" => true, // show/hide autofilter for search
  35. "search" => "advance" // show single/multi field search condition (e.g. simple or advance)
  36. ));
  37.  
  38.  
  39. $g->table = "cat";
  40.  
  41. $col = array();
  42. $col["title"] = "Table"; // caption of column
  43. $col["name"] = "TABLE_NAME";
  44. $col["search"] = true;
  45. $col["editable"] = true;
  46. $cols[] = $col;
  47.  
  48. $col = array();
  49. $col["title"] = "Type";
  50. $col["name"] = "TABLE_TYPE";
  51. $col["search"] = true;
  52. $col["editable"] = true;
  53. $cols[] = $col;
  54.  
  55. $g->set_columns($cols);
  56.  
  57. // render grid
  58. $out = $g->render("list1");
  59. ?>
  60. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  61. <html>
  62. <head>
  63. <link rel="stylesheet" type="text/css" media="screen" href="../../lib/js/themes/redmond/jquery-ui.custom.css"></link>
  64. <link rel="stylesheet" type="text/css" media="screen" href="../../lib/js/jqgrid/css/ui.jqgrid.css"></link>
  65.  
  66. <script src="../../lib/js/jquery.min.js" type="text/javascript"></script>
  67. <script src="../../lib/js/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
  68. <script src="../../lib/js/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
  69. <script src="../../lib/js/themes/jquery-ui.custom.min.js" type="text/javascript"></script>
  70. </head>
  71. <body>
  72. You must have Oracle Server installed for this demo. Also set database crendentials in this demo.
  73. <div style="margin:10px">
  74. <?php echo $out?>
  75. </div>
  76. </body>
  77. </html>
Add Comment
Please, Sign In to add comment