[eluser]Dileep[/eluser]
Hi ,
I have some problems with Data grid in codeigniter ,i am using a datagrid from
http://www.gurusistemas.com/_guru/indexd...ge=samples.
it have the following files ,
Quote:[1]. phpmydatagrid.class.php - the class file
[2] . FOLDERS :JS,CSS,IMG
[3] . sample8.php - datagrid showing here,i want this as view.
the content of sample1.php is following
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>phpMyDatagrid - Sample file</title>
<?php
include ("phpmydatagrid.class.php");
$objGrid = new datagrid;
$objGrid -> friendlyHTML();
$objGrid -> pathtoimages("./images/");
$objGrid -> closeTags(true);
$objGrid -> form('employee', true);
$objGrid -> methodForm("post");
$objGrid -> searchby("id,name,lastname,afiliation");
// $objGrid -> linkparam("sess=".$_REQUEST["sess"]."&username;=".$_REQUEST["username"]);
$objGrid -> decimalDigits(2);
$objGrid -> decimalPoint(",");
$objGrid -> conectadb("localhost", "username_to_connect", "", "database_name");
$objGrid -> tabla ("table_name");
$objGrid -> buttons(true,true,true,true);
$objGrid -> keyfield("userid");
$objGrid -> salt("Some Code4Stronger(Protection)");
$objGrid -> TituloGrid("phpMyDataGrid Sample page");
$objGrid -> FooterGrid("<div style='float:left'>© 2007 Gurusistemas.com</div>");
$objGrid -> datarows(5);
$objGrid -> paginationmode('links');
$objGrid -> noorderarrows();
$objGrid -> FormatColumn("table_field_1", "User ID", 5, 5, 1, "50", "center", "integer");
$objGrid -> FormatColumn("table_field_2", "User ID", 30, 30, 0, "150", "left");
$objGrid -> FormatColumn("table_field_3", "Email", 30, 30, 0, "150", "left");
$objGrid -> FormatColumn("table_field_4", "IsConfirmed?","select:1_Confirmed:2_Not confirmed");
$objGrid -> FormatColumn("table_field_5", "Confirmation String", 10, 10, 0, "80", "left", "text");
$objGrid -> FormatColumn("table_field_6", "Password", 5, 5, 0, "60", "left", "text");
$objGrid -> setHeader();
?>
</head>
<body>
<?php
/* AJAX inline edition comes in two flawors */
/* silent: To save record, just enter or double click */
/* default: To save record, must click icon */
/* try yourself and see which one likes more (My preferred is silent) */
$objGrid -> ajax("silent");
$objGrid -> grid();
$objGrid -> desconectar();
?>
</body>
</html>
i placed "phpmydatagrid.class.php",sample8.php and other folders in views folder.
Datagrid is working fine outsite Codeigniter ,but its not working as a view.
my controller have a function index and it loading the sample1.php view.
the error is :
Code:
! ) Fatal error: Cannot redeclare class datagrid in C:\wamp\www\userreg\application\views\phpmydatagrid.class.php on line 33
Call Stack
# Time Memory Function Location
1 0.0008 384360 {main}( ) ..\index.php:0
2 0.0026 452832 require_once( 'C:\wamp\www\userreg\system\core\CodeIgniter.php' ) ..\index.php:201
3 0.0345 1587680 call_user_func_array ( ) ..\CodeIgniter.php:339
4 0.0345 1587728 Datagrid->index( ) ..\CodeIgniter.php:0
5 0.0423 1939168 CI_Loader->view( ) ..\datagrid.php:7
6 0.0423 1939728 CI_Loader->_ci_load( ) ..\Loader.php:308
7 0.0440 2007368 include( 'C:\wamp\www\userreg\application\views\sample8.php' ) ..\Loader.php:683
8 0.0513 2802832 include( 'C:\wamp\www\userreg\application\views\phpmydatagrid.class.php' ) ..\sample8.php:43
pls help how can i configure this ?