Last active
April 19, 2018 11:54
-
-
Save gridphp/59449c4a5cbcd3fb8ce555b4992f565b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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