Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * Manage all the client report features like add/edit/delete/list/sort/search
- *
- * Author : @Deepesh Kumar R
- *
- * @license http://www.phpgrid.org (/opt/lampp/htdocs/billing/phpgrid/LICENSE.txt)
- * @link http://www.phpgrid.org
- */
- // Include config for database connection
- Include "phpgrid/config.php";
- // If the session is not set then redirecting to login page
- if ($_SESSION['uname'] == ''){
- header('Location: index.php');
- }
- // include and create object
- include(PHPGRID_LIBPATH."inc/jqgrid_dist.php");
- $g = new jqgrid();
- // set few params
- $grid["caption"] = "Signup status report"; // Caption of the grid
- $grid["width"] = "1500"; // Width of the grid
- $g->set_options($grid);
- // set database table for CRUD operations
- $g->table = "client";
- // To select the values having display = 0 (Enabled clients)
- //$g->select_command = "select * from client where display=0";
- // $col["hidden"] = true; // don't show this column in list
- // Set the columns for grid report
- $col = array();
- $col["title"] = "SL NO:"; // caption of column
- $col["name"] = "id"; // grid column name, same as db field or alias from sql
- $cols[] = $col;
- $col = array();
- $col["title"] = "Bug No"; // caption of column
- $col["name"] = "bugNo"; // grid column name, same as db field or alias from sql
- $col["width"] = "70"; // Width of the column
- $col["editable"] = true; // this column is editable
- $col["editrules"] = array("number"=>true); // Numbers only allowed
- $cols[] = $col;
- $col = array();
- $col["title"] = "Client Name";
- $col["name"] = "clientName"; // grid column name, same as db field or alias from sql
- $col["width"] = "50";// Width of the column
- $col["editable"] = true; // this column is editable
- $col["editrules"] = array("required"=>true); // this field is required
- $cols[] = $col;
- $col = array();
- $col["title"] = "Case Id"; // caption of column
- $col["name"] = "caseId"; // grid column name, same as db field or alias from sql
- $col["editrules"] = array("number"=>true); // Numbers only allowed
- $col["width"] = "50"; // Width of the column
- $col["editable"] = true; // this column is editable
- $cols[] = $col;
- $col = array();
- $col["title"] = "FollowUp Date"; // caption of column
- $col["name"] = "followUpDate"; // grid column name, same as db field or alias from sql
- $col["editable"] = true; // this column is editable
- $col["editoptions"]["placeholder"] = "YYYY-MM-DD";
- //$col["editrules"] = array("required"=>true); // this field is required // Based on issue #104015 commenting the FollowUp Date validation and required field
- //$col["editrules"] = array("date"=>true); //validation for the date format
- $cols[] = $col;
- $col = array();
- $col["title"] = "SLA/Plan Change Status"; // caption of column // Based on issue #104015 changing the heading name
- $col["name"] = "slaStatus"; // grid column name, same as db field or alias from sql
- $col["editable"] = true; // this column is editable
- $col["editrules"] = array("required"=>true); // this field is required
- $col["edittype"] = "select";//For displaying dropdown
- $col["editoptions"] = array("value"=>'Yes:Yes;No:No;NA:NA', "multiple" => true);//options in dropdown
- $cols[] = $col;
- $col = array();
- $col["title"] = "NDA Status"; // caption of column
- $col["name"] = "ndaStatus"; // grid column name, same as db field or alias from sql
- $col["editable"] = true; // this column is editable
- $col["edittype"] = "select"; //For displaying dropdown
- $col["editoptions"] = array("value"=>'Yes:Yes;No:No;NA:NA', "multiple" => true); //options in dropdown
- $cols[] = $col;
- $col = array();
- $col["title"] = "Questionnaire"; // caption of column
- $col["name"] = "questionnaire"; // grid column name, same as db field or alias from sql
- $col["editable"] = true; // this column is editable
- $col["edittype"] = "select"; //For displaying dropdown
- $col["editoptions"] = array("value"=>'Yes:Yes;No:No;NA:NA', "multiple" => true); //options in dropdown
- $cols[] = $col;
- $col = array();
- $col["edittype"] = "";
- $col["title"] = "Payment Confirmed"; // caption of column
- $col["name"] = "paymentConfirmed"; // grid column name, same as db field or alias from sql
- $col["width"] = "50"; // Width of the column
- $col["editable"] = true; // this column is editable
- $col["edittype"] = "select"; //For displaying dropdown
- $col["editoptions"] = array("value"=>'Yes:Yes;No:No;NA:NA', "multiple" => true); //options in dropdown
- $cols[] = $col;
- $col = array();
- $col["title"] = "Hard Copy Updated"; // caption of column
- $col["name"] = "hardCopyUpdated"; // grid column name, same as db field or alias from sql
- $col["width"] = "50"; // Width of the column
- $col["editable"] = true; // this column is editable
- $col["edittype"] = "select"; //For displaying dropdown $col["editoptions"] = array("value"=>'yes:Yes;no:No', "multiple" => true); //options in dropdown
- $col["editoptions"] = array("value"=>'Yes:Yes;No:No;NA:NA', "multiple" => true); //options in dropdown
- $col = array();
- $col["title"] = "Escalated"; // caption of column
- $col["name"] = "escalated"; // grid column name, same as db field or alias from sql
- $col["width"] = "50"; // Width of the column
- $col["editable"] = true; // this column is editable
- $col["edittype"] = "select";//For displaying dropdown
- $col["editoptions"] = array("value"=>'billing:Billing;sales:Sales Team;teamlead:Team Lead;qm:QM;core:Core', "multiple" => true); //options in dropdown
- $cols[] = $col;
- $col = array();
- $col["title"] = "Comments"; // caption of column
- $col["name"] = "comments"; // grid column name, same as db field or alias from sql
- $col["editable"] = true; // this column is editable
- $col["edittype"] = "textarea";
- $cols[] = $col;
- $g->set_columns($cols);
- // Setting actions like add/eidt/ based on the role
- // Readonly user can only view the report
- if ($_SESSION['role'] == 'readonlyUser'){
- $g->set_actions(array(
- "add"=>false, // allow/disallow add
- "edit"=>false, // allow/disallow edit
- "delete"=>false, // allow/disallow delete
- "rowactions"=>false, // show/hide row wise edit/del/save option
- )
- );
- // Billing User can only add clients
- }else if ($_SESSION['role'] == 'billingUser'){
- $g->set_actions(array(
- "delete"=>false, // allow/disallow delete
- "rowactions"=>false, // show/hide row wise edit/del/save option
- )
- );
- }
- // render grid
- $out = $g->render("list1");
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <!-- these css and js files are required by php grid -->
- <link rel="stylesheet" type="text/css" media="screen" href="phpgrid/lib/js/themes/redmond/jquery-ui.custom.css"></link>
- <link rel="stylesheet" type="text/css" media="screen" href="phpgrid/lib/js/jqgrid/css/ui.jqgrid.css"></link>
- <script src="phpgrid/lib/js/jquery.min.js" type="text/javascript"></script>
- <script src="phpgrid/lib/js/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
- <script src="phpgrid/lib/js/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
- <script src="phpgrid/lib/js/themes/jquery-ui.custom.min.js" type="text/javascript"></script>
- <!-- these css and js files are required by php grid -->
- </head>
- <body>
- <div class="heading">
- <div class="left"><p>Welcome <b><font color='#68A3D5'><?php echo $_SESSION[uname]; ?></font></b></p></div><!--Welcome text-->
- <div class="right"><a href="loginList.php?action=logout"><font color='#68A3D5'><b>Logout</b></font></a></div><!--Logout link-->
- </div>
- <div style="margin:10px">
- <!-- display grid here -->
- <?php echo $out?>
- <!-- display grid here -->
- </div>
- <script>
- $(document).ready(function(){
- //Set time delay to highlight the colors
- setTimeout(function() {
- // For giving background color for Suspended client
- $("td[aria-describedby='list1_status']:contains('Suspended')").parent('tr').css({'background-image':'None','background':'url("")','background-color': 'Orange'});
- // For giving background color for Cancelled cleint
- $("td[aria-describedby='list1_status']:contains('Cancelled')").parent('tr').css({'background-image':'None','background':'url("")','background-color': 'Red'});
- }, 500);
- });
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment