예제 #1
0
<?php
	require $KoolControlsFolder."/KoolAjax/koolajax.php";
	$koolajax->scriptFolder = $KoolControlsFolder."/KoolAjax";

	require $KoolControlsFolder."/KoolGrid/koolgrid.php";
	$ds = new MySQLDataSource($db_con);//This $db_con link has been created inside KoolPHPSuite/Resources/runexample.php
	$ds->SelectCommand = "select customerNumber as pk, customerNumber,customerName,phone,city from customers";
	$ds->UpdateCommand = "update customers set customerNumber=@customerNumber, customerName='@customerName', phone='@phone', city='@city' where customerNumber=@pk";
	$ds->DeleteCommand = "delete from customers where customerNumber=@pk";
	$ds->InsertCommand = "insert into customers (customerNumber,customerName,phone,city) values (@customerNumber,'@customerName','@phone','@city');";

	$grid = new KoolGrid("grid");
	$grid->scriptFolder = $KoolControlsFolder."/KoolGrid";
	$grid->styleFolder="default";
	$grid->DataSource = $ds;
	$grid->Width = "655px";
	$grid->AllowEditing = true;
	$grid->AllowDeleting = true;
	

	$grid->AjaxEnabled = true;

	$grid->AutoGenerateRowSelectColumn = true;
	$grid->AutoGenerateColumns = true;
	$grid->DisableAutoGenerateDataFields = "pk";
	$grid->AutoGenerateDeleteColumn = true;
	$grid->AutoGenerateEditColumn = true;
	
	$grid->MasterTable->Pager = new GridPrevNextAndNumericPager();
	
	$grid->Process();
예제 #2
0
/*
 * This file is ready to run as standalone example. However, please do:
 * 1. Add tags <html><head><body> to make a complete page
 * 2. Change relative path in $KoolControlFolder variable to correctly point to KoolControls folder 
 */
$KoolControlsFolder = "../../../../KoolControls";
//Relative path to "KoolPHPSuite/KoolControls" folder
require $KoolControlsFolder . "/KoolAjax/koolajax.php";
$koolajax->scriptFolder = $KoolControlsFolder . "/KoolAjax";
require $KoolControlsFolder . "/KoolGrid/koolgrid.php";
require $KoolControlsFolder . "/KoolCalendar/koolcalendar.php";
$ds = new MySQLDataSource($db_con);
//This $db_con link has been created inside KoolPHPSuite/Resources/runexample.php
$ds->SelectCommand = "select orderNumber,orderDate,status,comments from orders";
$ds->UpdateCommand = "update orders set orderDate='@orderDate', status='@status', comments='@comments' where orderNumber=@orderNumber";
$grid = new KoolGrid("grid");
$grid->scriptFolder = $KoolControlsFolder . "/KoolGrid";
$grid->styleFolder = "sunset";
$grid->AjaxEnabled = true;
$grid->DataSource = $ds;
$grid->MasterTable->Pager = new GridPrevNextAndNumericPager();
$grid->Width = "655px";
$grid->ColumnWrap = true;
$grid->AllowEditing = true;
$column = new GridBoundColumn();
$column->DataField = "orderNumber";
$column->ReadOnly = true;
$grid->MasterTable->AddColumn($column);
$column = new GridDateTimeColumn();
$column->DataField = "orderDate";
$column->HeaderText = "Date";
예제 #3
0
	else
	{
		if(!$koolajax->isCallback)
		{
			$_rows = $grid_customer->GetInstanceMasterTable()->GetInstanceRows();
			$_rows[0]->Selected = true;			
			$ds_order->SelectCommand = "select orderNumber,orderDate,status,customerNumber from orders where customerNumber=".$_rows[0]->DataItem["customerNumber"];		
		}
		else
		{
			$ds_order->SelectCommand = "select orderNumber,orderDate,status,customerNumber from orders where customerNumber=".$_SESSION["customerNumber"];					
		}
	}


	$grid_order = new KoolGrid("grid_order");
	$grid_order->scriptFolder = $KoolControlsFolder."/KoolGrid";
	$grid_order->styleFolder="default";
	$grid_order->Width = "655px";
	$grid_order->RowAlternative = true;
	$grid_order->AjaxEnabled = true;
	$grid_order->AjaxLoadingImage =  $KoolControlsFolder."/KoolAjax/loading/5.gif";
	
	$grid_order->MasterTable->DataSource = $ds_order;
	$grid_order->MasterTable->AutoGenerateColumns = true;

	$grid_order->MasterTable->Pager = new GridPrevNextAndNumericPager();
	$grid_order->Process();
?>

<form id="form1" method="post">
예제 #4
0
<?php

/*
 * This file is ready to run as standalone example. However, please do:
 * 1. Add tags <html><head><body> to make a complete page
 * 2. Change relative path in $KoolControlFolder variable to correctly point to KoolControls folder 
 */
$KoolControlsFolder = "../../../../KoolControls";
//Relative path to "KoolPHPSuite/KoolControls" folder
require $KoolControlsFolder . "/KoolAjax/koolajax.php";
$koolajax->scriptFolder = $KoolControlsFolder . "/KoolAjax";
require $KoolControlsFolder . "/KoolGrid/koolgrid.php";
$ds = new MySQLDataSource($db_con);
//This $db_con link has been created inside KoolPHPSuite/Resources/runexample.php
$ds->SelectCommand = "select customerNumber,customerName,phone,city from customers";
$grid = new KoolGrid("grid");
$grid->scriptFolder = $KoolControlsFolder . "/KoolGrid";
$grid->styleFolder = "sunset";
$grid->MasterTable->DataSource = $ds;
$grid->MasterTable->DataKeyNames = "customerNumber";
// Need to set to get selection.
$grid->Width = "655px";
$grid->AllowSelecting = true;
// Allow row selecting
$grid->AjaxEnabled = true;
$grid->AutoGenerateColumns = true;
$grid->MasterTable->Pager = new GridPrevNextAndNumericPager();
$grid->Process();
//Get selected keys after grid processing
$selected_keys = $grid->GetInstanceMasterTable()->SelectedKeys;
?>
예제 #5
0
/*
 * This file is ready to run as standalone example. However, please do:
 * 1. Add tags <html><head><body> to make a complete page
 * 2. Change relative path in $KoolControlFolder variable to correctly point to KoolControls folder 
 */
$KoolControlsFolder = "../../../../KoolControls";
//Relative path to "KoolPHPSuite/KoolControls" folder
require_once $KoolControlsFolder . "/KoolGrid/library/tcpdf/config/lang/eng.php";
require_once $KoolControlsFolder . "/KoolGrid/library/tcpdf/tcpdf.php";
require $KoolControlsFolder . "/KoolAjax/koolajax.php";
$koolajax->scriptFolder = $KoolControlsFolder . "/KoolAjax";
require $KoolControlsFolder . "/KoolGrid/koolgrid.php";
$ds = new MySQLDataSource($db_con);
//This $db_con link has been created inside KoolPHPSuite/Resources/runexample.php
$ds->SelectCommand = "select customerNumber,customerName,phone,city from customers";
$grid = new KoolGrid("grid");
$grid->scriptFolder = $KoolControlsFolder . "/KoolGrid";
$grid->styleFolder = "sunset";
$grid->DataSource = $ds;
$grid->Width = "655px";
//Enable Ajax Mode
$grid->AjaxEnabled = true;
//Add loading image
$grid->AjaxLoadingImage = $KoolControlsFolder . "/KoolAjax/loading/5.gif";
$grid->RowAlternative = true;
$grid->AutoGenerateColumns = true;
$grid->MasterTable->Pager = new GridPrevNextAndNumericPager();
$grid->Process();
if (isset($_POST["FileName"])) {
    $grid->ExportSettings->FileName = $_POST["FileName"];
}
예제 #6
0
<?php
	require $KoolControlsFolder."/KoolAjax/koolajax.php";
	$koolajax->scriptFolder = $KoolControlsFolder."/KoolAjax";

	require $KoolControlsFolder."/KoolGrid/koolgrid.php";
	$ds = new MySQLDataSource($db_con);//This $db_con link has been created inside KoolPHPSuite/Resources/runexample.php
	$ds->SelectCommand = "select customerNumber,customerName,phone,city from customers";

	$grid = new KoolGrid("grid");
	$grid->scriptFolder = $KoolControlsFolder."/KoolGrid";
	$grid->styleFolder="default";
	$grid->DataSource = $ds;
	$grid->Width = "655px";

	//Enable Ajax Mode
	$grid->AjaxEnabled = true;
	//Add loading image
	$grid->AjaxLoadingImage =  $KoolControlsFolder."/KoolAjax/loading/5.gif";

	$grid->RowAlternative = true;
	$grid->AutoGenerateColumns = true;		
	$grid->MasterTable->Pager = new GridPrevNextAndNumericPager();
	$grid->Process();
	
	if(isset($_POST["IgnorePaging"]))
	{
		$grid->ExportSettings->IgnorePaging = true;
	}
	
	if(isset($_POST["ExportToExcel"]))
	{
예제 #7
0
        <script type="text/javascript" src="{$pubDir}/script/jquery.js"></script> 
        <script type="text/javascript" src="{$pubDir}/script/{$name}.js"></script>
        <script type="text/javascript" src="{$pubDir}/script/common.js"></script>
        
        <title>{$title|default:'Universal Online Examination System'}</title>
    </head>
    <body>        
<?php 
require_once '../../private/class/autoload.inc';
require $KoolControlsFolder . "/KoolAjax/koolajax.php";
$koolajax->scriptFolder = $KoolControlsFolder . "/KoolAjax";
require $KoolControlsFolder . "/KoolGrid/koolgrid.php";
$db_con = mysql_connect("localhost", "root", "123");
$ds = new MySQLDataSource($db_con);
$ds->SelectCommand = "select customerNumber,customerName,phone,city from customers";
$grid = new KoolGrid("grid");
$grid->scriptFolder = $KoolControlsFolder . "/KoolGrid";
$grid->styleFolder = "default";
$grid->DataSource = $ds;
$grid->Width = "655px";
$grid->RowAlternative = true;
$grid->AjaxEnabled = true;
$grid->AutoGenerateColumns = true;
$grid->AllowSorting = true;
//Enable sorting for all rows;
$grid->MasterTable->Pager = new GridPrevNextAndNumericPager();
$grid->Process();
function other()
{
    $dept = new department();
    $admindept = $dept->getAll();
예제 #8
0
/*
 * This file is ready to run as standalone example. However, please do:
 * 1. Add tags <html><head><body> to make a complete page
 * 2. Change relative path in $KoolControlFolder variable to correctly point to KoolControls folder 
 */
$KoolControlsFolder = "../../../../KoolControls";
//Relative path to "KoolPHPSuite/KoolControls" folder
require $KoolControlsFolder . "/KoolAjax/koolajax.php";
$koolajax->scriptFolder = $KoolControlsFolder . "/KoolAjax";
require $KoolControlsFolder . "/KoolGrid/koolgrid.php";
require $KoolControlsFolder . "/KoolChart/koolchart.php";
$ds = new MySQLDataSource($db_con);
//This $db_con link has been created inside KoolPHPSuite/Resources/runexample.php
$ds->SelectCommand = "select customerNumber,customerName from customers";
$grid = new KoolGrid("grid");
$grid->scriptFolder = $KoolControlsFolder . "/KoolGrid";
$grid->DataSource = $ds;
$grid->AjaxEnabled = true;
$grid->MasterTable->Pager = new GridPrevNextPager();
$grid->MasterTable->Pager->ShowPageInfo = false;
$grid->MasterTable->RowAlternative = true;
$grid->AllowSelecting = true;
$grid->Width = "215px";
$column = new GridBoundColumn();
$column->DataField = "customerName";
$column->HeaderText = "Customers";
$grid->MasterTable->AddColumn($column);
$grid->styleFolder = "sunset";
$grid->ClientSettings->ClientEvents["OnRowSelect"] = "Handle_OnRowSelect";
$grid->Process();
예제 #9
0
$grid_customer->Process();
$ds_order = new MySQLDataSource($db_con);
//This $db_con link has been created inside KoolPHPSuite/Resources/runexample.php
if (isset($_POST["customer_selected"])) {
    $ds_order->SelectCommand = "select orderNumber,orderDate,status,customerNumber from orders where customerNumber=" . $_POST["customerNumber"];
    $_SESSION["customerNumber"] = $_POST["customerNumber"];
} else {
    if (!$koolajax->isCallback) {
        $_rows = $grid_customer->GetInstanceMasterTable()->GetInstanceRows();
        $_rows[0]->Selected = true;
        $ds_order->SelectCommand = "select orderNumber,orderDate,status,customerNumber from orders where customerNumber=" . $_rows[0]->DataItem["customerNumber"];
    } else {
        $ds_order->SelectCommand = "select orderNumber,orderDate,status,customerNumber from orders where customerNumber=" . $_SESSION["customerNumber"];
    }
}
$grid_order = new KoolGrid("grid_order");
$grid_order->scriptFolder = $KoolControlsFolder . "/KoolGrid";
$grid_order->styleFolder = "sunset";
$grid_order->Width = "655px";
$grid_order->RowAlternative = true;
$grid_order->AjaxEnabled = true;
$grid_order->AjaxLoadingImage = $KoolControlsFolder . "/KoolAjax/loading/5.gif";
$grid_order->MasterTable->DataSource = $ds_order;
$grid_order->MasterTable->AutoGenerateColumns = true;
$grid_order->MasterTable->Pager = new GridPrevNextAndNumericPager();
$grid_order->Process();
?>

<form id="form1" method="post">
	<?php 
echo $koolajax->Render();