Skip to content

Instantly share code, notes, and snippets.

@gridphp gridphp/cedric-slash-demo
Last active Apr 19, 2018

Embed
What would you like to do?
<?php
// include db config
include_once("../../config.php");
$db_conf = array();
$db_conf["type"] = "pdo";
$db_conf["server"] = "mysql:host=localhost";
$db_conf["user"] = PHPGRID_DBUSER; // username
$db_conf["password"] = PHPGRID_DBPASS; // password
$db_conf["database"] = PHPGRID_DBNAME2; // database
// include and create object
include("../../lib/inc/jqgrid_dist.php");
$g = new jqgrid($db_conf);
$grid["caption"] = "Test";
$g->set_options($grid);
$g->table = "yourtable";
$g->select_command = "SELECT
FILE_NAME,
SUBSTRING_INDEX(FILE_NAME,
'\\nt4\\applications\\prod\\hde\\atn\\',
-1) AS path
FROM yourTable";
$g->select_command = str_replace('\\','\\\\',$g->select_command);
$out_master = $g->render("list1");
?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<link rel="stylesheet" type="text/css" media="screen" href="../../lib/js/themes/redmond/jquery-ui.custom.css"></link>
<link rel="stylesheet" type="text/css" media="screen" href="../../lib/js/jqgrid/css/ui.jqgrid.css"></link>
<script src="../../lib/js/jquery.min.js" type="text/javascript"></script>
<script src="../../lib/js/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="../../lib/js/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="../../lib/js/themes/jquery-ui.custom.min.js" type="text/javascript"></script>
<!-- END THEME LAYOUT STYLES -->
<link rel="shortcut icon" href="favicon.ico" />
</head>
<!-- END HEAD -->
<body>
<div>
<?php
echo $out_master; ?>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.