Skip to content

Instantly share code, notes, and snippets.

Avatar

Abu gridphp

View GitHub Profile
View fx_get_dropdown
fx_get_dropdown = function (o,field,for_search_bar)
{
// dont process hidden elements, removed for select2 dependent
// if (!jQuery(o).is(":visible"))
// return;
if (for_search_bar)
{
// for inline edit and dialog edit
var sel = '.ui-search-toolbar select[name='+field+']';
@gridphp
gridphp / index.php
Created Jun 28, 2022
Default grid4PHP Generated Code from demos\editing\index.php
View index.php
<?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 / config.php
Created Jun 27, 2022
Grid4PHP MySQL Configuration.
View config.php
<?php
// Grid4PHP Database Connection Settings.
// Set of constants defined.
define("PHPGRID_DBTYPE","mysqli"); // Replace mysqli with one of these: mysqli,oci8 (for oracle),mssqlnative,postgres,sybase.
define("PHPGRID_DBHOST","localhost"); // The Database Host
define("PHPGRID_DBUSER","root"); // The Database User
define("PHPGRID_DBPASS","dbpass123"); // The Database Password
define("PHPGRID_DBNAME","griddemo"); // The Database Name
@gridphp
gridphp / base.php
Last active Apr 21, 2022
Ticket kimberley - 22020222
View base.php
function update_data($data) {
global $g;
//update history table with record before updated in contracts by using OLD as value for ACTION field in HISTORY TABLE
$str3 = "INSERT INTO history
SELECT NULL, NOW(), 'old', '" . $_SESSION['username'] . "',
d.* FROM contracts AS d
WHERE d.contract_Id ={$data["contract_Id"]}";
// mysql_query($str3);
$g->execute_query($str3);
View index.php
<?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");
View dropdown.php
<?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 / Home.php
Last active Aug 9, 2021
CodeIgniter 4 - Demo Controller Code (app/Controllers/Home.php, Line 9-28) & View Code (app/Views/welcome_message.php, line 234-244)
View Home.php
<?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
@gridphp
gridphp / dropdown-onload-sql.php
Last active Aug 7, 2021
Dropdown onload sql on 2.6.5. In this demo on line 79
View dropdown-onload-sql.php
<?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 / index.php
Created Aug 5, 2021
Demo which ondblclick opens View dialog along with inline edit on pencil icon.
View index.php
<?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 / bulk-edit.php
Last active Apr 26, 2021
Download as zip sample, line 153-183, 240-249
View bulk-edit.php
<?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