Esta clases se copian al sitio web, y lo que yo necesito crear es el siguiente codigo: Hice este ejemplo para que veas lo facil que es acomodarlo, ya que se usa de manera similar a FiveWin:
Code: Select all
<?php
require "resources/config.php";
require "KoolControls/KoolAjax/koolajax.php";
$koolajax->scriptFolder = "KoolControls/KoolAjax";
require "KoolControls/KoolGrid/koolgrid.php";
$db_con = mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db(kool);
$ds_customer = new MySQLDataSource($db_con);//This $db_con link has been created inside KoolPHPSuite/Resources/runexample.php
$ds_customer->SelectCommand = "select customerNumber,customerName,phone,city from customers";
$ds_order = new MySQLDataSource($db_con);//This $db_con link has been created inside KoolPHPSuite/Resources/runexample.php
$ds_order->SelectCommand = "select orderNumber,orderDate,status,customerNumber from orders";
$ds_order_detail = new MySQLDataSource($db_con);//This $db_con link has been created inside KoolPHPSuite/Resources/runexample.php
$ds_order_detail->SelectCommand = "select orderNumber,productName,quantityOrdered,priceEach from orderdetails,products where orderdetails.productCode=products.productCode";
$grid = new KoolGrid("grid");
$grid->scriptFolder = "KoolControls/KoolGrid";
$grid->styleFolder="default";
$grid->Width = "1000px";
$grid->RowAlternative = true;
$grid->AjaxEnabled = true;
$grid->AjaxLoadingImage = "KoolControls/KoolAjax/loading/1.gif";
$table_order_detail = new GridTableView();
$table_order_detail->Width = "100%";
$table_order_detail->DataSource = $ds_order_detail;
$table_order_detail->AddRelationField("orderNumber","orderNumber");
$table_order_detail->AutoGenerateColumns = true;//Auto Generate all column from tables
$table_order_detail->DisableAutoGenerateDataFields = "orderNumber";//Disable generate column for orderNumber data fields.
$table_order = new GridTableView();
$table_order->Width = "100%";
$table_order->DataSource = $ds_order;
$table_order->AddRelationField("customerNumber","customerNumber");
$table_order->AutoGenerateExpandColumn = true;
$table_order->AutoGenerateColumns = true;
$table_order->DisableAutoGenerateDataFields = "customerNumber";
$table_order->AddDetailTable($table_order_detail);
$grid->MasterTable->DataSource = $ds_customer;
$grid->MasterTable->AutoGenerateExpandColumn = true;
$grid->MasterTable->AutoGenerateColumns = true;
$grid->MasterTable->AddDetailTable($table_order);
$grid->MasterTable->Pager = new GridPrevNextAndNumericPager();
$grid->Process();
?>
<form id="form1" method="post">
<?php echo $koolajax->Render();?>
<?php echo $grid->Render();?>
</form>
Code: Select all
<?php
$KoolControlsFolder = "";
require $KoolControlsFolder."koolControls/KoolTreeView/kooltreeview.php";
$treeview = new KoolTreeView("treeview");
$treeview->scriptFolder = $KoolControlsFolder."koolControls/KoolTreeView";
$treeview->imageFolder=$KoolControlsFolder."koolControls/KoolTreeView/icons";
$root = $treeview->getRootNode();
$root->text = "My Properties";
$root->expand=true;
$root->image="woman2S.gif";
$treeview->Add("root","hardware","Hardware",false,"xpNetwork.gif","");
$treeview->Add("hardware","laptop","HP dv2500 Laptop",false,"square_blueS.gif","");
$treeview->Add("hardware","desktop","Lenovo desktop",false,"square_greenS.gif","");
$treeview->Add("hardware","lcd","Asus 19\" LCD",false,"square_redS.gif","");
$treeview->Add("root","software","Software",true,"ie.gif","");
$treeview->Add("software","os","Operating System",true,"bfly.gif","");
$treeview->Add("os","linux","Ubuntu 8.10",false,"ball_redS.gif","");
$treeview->Add("os","windows","Vista Home Edition",false,"ball_blueS.gif","");
$treeview->Add("software","office","Office",false,"doc.gif","");
$treeview->Add("office","msoffice","Microsoft Office 2007",false,"square_redS.gif","");
$treeview->Add("office","ooffice","Open Office 2.4",false,"square_greenS.gif","");
$treeview->Add("software","burning","Burn CD/DVD",false,"xpShared.gif","");
$treeview->Add("burning","nero","Nero 8",false,"triangle_yellowS.gif","");
$treeview->Add("burning","k3b","K3B <i>(on Ubuntu)</i>",false,"triangle_blueS.gif","");
$treeview->Add("software","imageeditor","Image editors",false,"goblet_bronzeS.gif","");
$treeview->Add("imageeditor","photoshop","Photoshop 10",false,"ball_glass_blueS.gif","");
$treeview->Add("imageeditor","gimp","GIMP 2.3.4",false,"ball_glass_greenS.gif","");
$treeview->Add("root","book","Books",true,"book.gif","");
$treeview->Add("book","ajax","Ajax For Dummies",false,"BookY.gif","");
$treeview->Add("book","csharp","Mastering C#",false,"BookY.gif","");
$treeview->Add("book","flash","Flash 8 Bible",false,"BookY.gif","");
$treeview->showLines = true;
$style_select = "default";
if(isset($_POST["style_select"]))
{
$style_select = $_POST["style_select"];
}
$treeview->styleFolder=$style_select;
?>
<form id="form1" method="post">
Select style:
<select id="style_select" name="style_select" onchange="submit();">
<option value="default" <?php if ($style_select=="default") echo "selected" ?> >Default</option>
<option value="vista" <?php if ($style_select=="vista") echo "selected" ?> >Vista</option>
<option value="hay" <?php if ($style_select=="hay") echo "selected" ?> >Hay</option>
<option value="inox" <?php if ($style_select=="inox") echo "selected" ?> >Inox</option>
<option value="office2007" <?php if ($style_select=="office2007") echo "selected" ?> >Office2007</option>
<option value="outlook" <?php if ($style_select=="outlook") echo "selected" ?> >Outlook</option>
<option value="silver" <?php if ($style_select=="silver") echo "selected" ?> >Silver</option>
<option value="gray" <?php if ($style_select=="gray") echo "selected" ?> >Gray</option>
<option value="graygreen" <?php if ($style_select=="graygreen") echo "selected" ?> >Graygreen</option>
<option value="pink" <?php if ($style_select=="pink") echo "selected" ?> >Pink</option>
<option value="green" <?php if ($style_select=="green") echo "selected" ?> >Green</option>
<option value="darkgray" <?php if ($style_select=="darkgray") echo "selected" ?> >Darkgray</option>
</select>
<div style="padding:10px;">
<?php echo $treeview->Render();?>
</div>
</form>