Skip to content

Instantly share code, notes, and snippets.

View gridphp's full-sized avatar

Abu gridphp

View GitHub Profile
@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 / grid-height.php
Last active April 19, 2024 04:19
Set grid height based on parent container
<?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 / 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 / auth.php
Last active March 4, 2024 17:56
Basic authentication for php grid - non database - https://www.gridphp.com
<?php
###############################################################
# Simple Auth 2.13
# Website: https://www.gridphp.com/
# Inspired from: http://www.zubrag.com/scripts/
###############################################################
#
# Usage:
# Set usernames / passwords below between SETTINGS START and SETTINGS END.
# Open it in browser with "help" parameter to get the code
@gridphp
gridphp / wp-demo-snippet-latest.php
Last active February 14, 2024 00:47
Wordpress Grid 4 PHP Framework Integration - Sample Snippet tested with Wordpress 6.4.3, https://www.gridphp.com
/**
* Grid 4 PHP Framework
*
* @author Abu Ghufran <gridphp@gmail.com> - https://www.gridphp.com
* @version 2
* @date 20-Oct-2020
* @license: see license.txt included in package
*/
/*
@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 / web-signature.php
Last active May 31, 2023 20:13
Demo to integrate Web Signature Plugin: SignaturePad, 100-136: Main integration code, 176: JS api inclusion
<?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
*/
// include db config