Skip to content

Instantly share code, notes, and snippets.

View gridphp's full-sized avatar

Abu gridphp

View GitHub Profile
<?php
/**
* PHP Grid Component
*
* @author Abu Ghufran <gridphp@gmail.com> - https://www.gridphp.com
* @version 2.8.2
* @license: see license.txt included in package
*/
/*
@gridphp
gridphp / example-all.php
Created August 19, 2024 19:57
View dialog - textarea paragraphs display
<?php
/**
* PHP Grid Component
*
* @author Abu Ghufran <gridphp@gmail.com> - http://www.phpgrid.org
* @version 2.0.0
* @license: see license.txt included in package
*/
// include db config
@gridphp
gridphp / dropdown-conditional-disable.php
Last active July 30, 2024 01:55
Disable certain dropdown option based on row data, Line 161: Demo disables dropdown option with id:1 when row's tax field > 50
<?php
/**
* PHP Grid Component
*
* @author Abu Ghufran <gridphp@gmail.com> - http://www.phpgrid.org
* @version 2.0.0
* @license: see license.txt included in package
*/
// include db config
@gridphp
gridphp / Gridphp.php
Last active June 2, 2024 15:46
Laravel Gridphp Integration - Sample Files - https://www.gridphp.com/laravel-datagrid/
<?php
namespace App;
// use one of these as dbtype: mysqli,oci8(for oracle),mssqlnative,postgres,sybase
define("PHPGRID_DBTYPE","mysqli");
define("PHPGRID_DBHOST",env("DB_HOST"));
define("PHPGRID_DBUSER",env("DB_USERNAME"));
define("PHPGRID_DBPASS",env("DB_PASSWORD"));
define("PHPGRID_DBNAME",env("DB_DATABASE"));
@gridphp
gridphp / custom-delete-button.php
Last active November 26, 2023 13:48
Code to make a delete button and JS call of delete, line 38: custom row delete button, line 64: callback
<?php
/**
* PHP Grid Component
*
* @author Abu Ghufran <gridphp@gmail.com> - http://www.phpgrid.org
* @version 2.0.0
* @license: see license.txt included in package
*/
include_once("../../config.php");
@gridphp
gridphp / Home.php
Created September 13, 2023 19:39
Codeigniter4 Integration Code Sample
<?php
namespace App\Controllers;
class Home extends BaseController
{
public function index()
{
$db_conf = array();
$db_conf["type"] = "mysqli"; // mysql,oci8(for oracle),mssql,postgres,sybase
$e["on_after_insert"] = array("after_insert", null, true);
$g->set_events($e);
function after_insert($data)
{
    // where client_id is primary key (first column of grid)
    $id = $data["client_id"];
    phpgrid_msg("<script>location.href='$id';</script>")
}
@gridphp
gridphp / master-detail-bs5.php
Created August 26, 2023 21:30
Master Detail with Bootstrap5 css
<?php
/**
* PHP Grid Component
*
* @author Abu Ghufran <gridphp@gmail.com> - http://www.phpgrid.org
* @version 2.0.0
* @license: see license.txt included in package
*/
// include db config
@gridphp
gridphp / toolbar-top-paging.php
Last active March 25, 2024 18:27
Pagination on top toolbar, Line 28,29 and 51,52
<?php
/**
* PHP Grid Component
*
* @author Abu Ghufran <gridphp@gmail.com> - http://www.phpgrid.org
* @version 2.0.0
* @license: see license.txt included in package
*/
include_once("../../config.php");
@gridphp
gridphp / master-detail-ajax.php
Created March 27, 2023 15:19
Load different detail grid structure using ajax
<?php
/**
* PHP Grid Component
*
* @author Abu Ghufran <gridphp@gmail.com> - http://www.phpgrid.org
* @version 2.0.0
* @license: see license.txt included in package
*/
// include db config