PHP DataGrid (AJAX Enabled) script is a simple, innovative and powerful tool for generating data-bound grid control. It was specially designed for web developers. The PHP DataGrid is excellent for all PHP database-driven web sites and online-based data administration; it is also useful for dynamic content management and PHP-based hosting providers. The goal of this script is to simplify the generation and editing of DataGrid for web developers. The PHP DG is an excellent tool for: – PHP database-driven web sites – Adding Back-End for existing sites; – Creating online-based data administration; – Creating dynamic content management or your own CMS.
PHP DataGrid (AJAX Enabled)-datagrid control. PHP DataGrid (AJAX Enabled) script is a simple, innovative and powerful tool for generating data-bound grid control. It was specially designed for web developers.
################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- #
## --------------------------------------------------------------------------- #
## PHP DataGrid version 4.2.8 (01.10.2008) #
## Author & developer: Leumas Naypoka <leumas.a@gmail.com> #
## Developers: Zewa <http://www.softic.at> #
## Fcallez <http://www.innovavirtual.org> #
## Lisence: GNU GPL #
## Site: http://phpbuilder.blogspot.com #
## Copyright: Leumas Naypoka (c) 2006-2008. All rights reserved. #
################################################################################
## +---------------------------------------------------------------------------+
## | 1. Creating & Calling: |
## +---------------------------------------------------------------------------+
## *** define a relative (virtual) path to datagrid.class.php file and "pear"
## *** directory (relatively to the current file)
## *** RELATIVE PATH ONLY ***
//
// define ("DATAGRID_DIR", ""); /* Ex.: "datagrid/" */
// define ("PEAR_DIR", "pear/"); /* Ex.: "datagrid/pear/" */
//
// require_once(DATAGRID_DIR.'datagrid.class.php');
// require_once(PEAR_DIR.'PEAR.php');
// require_once(PEAR_DIR.'DB.php');
##
## *** creating variables that we need for database connection
// $DB_USER='name'; /* usually like this: prefix_name */
// $DB_PASS=''; /* must be already enscrypted (recommended) */
// $DB_HOST='localhost'; /* usually localhost */
// $DB_NAME='dbName'; /* usually like this: prefix_dbName */
//
// ob_start();
## *** (example of ODBC connection string)
## *** $result_conn = $db_conn->connect(DB::parseDSN('odbc://root:12345@test_db'));
## *** (example of Oracle connection string)
## *** $result_conn = $db_conn->connect(DB::parseDSN('oci8://root:12345@localhost:1521/mydatabase));
## *** (example of PostgreSQL connection string)
## *** $result_conn = $db_conn->connect(DB::parseDSN('pgsql://root:12345@localhost/mydatabase));
## === (Examples of connections to other db types see in "docs/pear/" folder)
// $db_conn = DB::factory('mysql'); /* don't forget to change on appropriate db type */
// $result_conn = $db_conn->connect(DB::parseDSN('mysql://'.$DB_USER.':'.$DB_PASS.'@'.$DB_HOST.'/'.$DB_NAME));
// if(DB::isError($result_conn)){ die($result_conn->getDebugInfo()); }
## *** put a primary key on the first place
// $sql = "SELECT primary_key, field_1, field_2 ... FROM tableName ;";
## *** set encoding and collation (default: utf8/utf8_unicode_ci)
/// $dg_encoding = "utf8";
/// $dg_collation = "utf8_unicode_ci";
/// $dgrid->SetEncoding($dg_encoding, $dg_collation);
## *** set needed options and create a new class instance
// $debug_mode = false; /* display SQL statements while processing */
// $messaging = true; /* display system messages on a screen */
// $unique_prefix = "abc_"; /* prevent overlays - must be started with a letter */
// $dgrid = new DataGrid($debug_mode, $messaging, $unique_prefix, DATAGRID_DIR);
## *** set data source with needed options
// $default_order_field = "field_name_1 [, field_name_2...]";
// $default_order_type = "ASC|DESC [, ASC|DESC...]";
// $dgrid->DataSource($db_conn, $sql, $default_order_field, $default_order_type);
##
##
## +---------------------------------------------------------------------------+
## | 2. General Settings: |
## +---------------------------------------------------------------------------+
## *** set interface language (default - English)
## *** (en) - English (de) - German (se) - Swedish (hr) - Bosnian/Croatian
## *** (hu) - Hungarian (es) - Espanol (ca) - Catala (fr) - Francais
## *** (nl) - Netherlands/"Vlaams"(Flemish) (it) - Italiano (pl) - Polish
## *** (ch) - Chinese (sr) - Serbian (bg) - Bulgarian (pb) - Brazilian Portuguese
## *** (ar) - Arabic (tr) - Turkish (cz) - Czech (ro/ro_utf8) - Romanian
## *** (gk) - Greek (he) - Hebrew (ru_utf8) - Russian
/// $dg_language = "en";
/// $dgrid->SetInterfaceLang($dg_language);
## *** set direction: "ltr" or "rtr" (default - "ltr")
/// $direction = "ltr";
/// $dgrid->SetDirection($direction);
## *** set layouts: "0" - tabular(horizontal) - default, "1" - columnar(vertical), "2" - customized
/// $layouts = array("view"=>"0", "edit"=>"1", "details"=>"1", "filter"=>"1");
/// $dgrid->SetLayouts($layouts);
/// $details_template = "<table><tr><td>{field_name_1}</td><td>{field_name_2}</td></tr>...</table>";
/// $dgrid->SetTemplates("","",$details_template);
## *** set modes for operations ("type" => "link|button|image")
## *** "byFieldValue"=>"fieldName" - make the field to be a link to edit mode page
/// $modes = array(
/// "add" =>array("view"=>true, "edit"=>false, "type"=>"link", "show_add_button"=>"inside|outside"),
/// "edit" =>array("view"=>true, "edit"=>true, "type"=>"link", "byFieldValue"=>""),
/// "cancel" =>array("view"=>true, "edit"=>true, "type"=>"link"),
/// "details" =>array("view"=>true, "edit"=>false, "type"=>"link"),
/// "delete" =>array("view"=>true, "edit"=>true, "type"=>"image")
/// );
/// $dgrid->SetModes($modes);
## *** allow scrolling on datagrid
/// $scrolling_option = false;
/// $dgrid->AllowScrollingSettings($scrolling_option);
## *** set scrolling settings (optional)
/// $scrolling_width = "90%";
/// $scrolling_height = "100%";
/// $dgrid->setScrollingSettings($scrolling_width, $scrolling_height);
## *** allow multirow operations
// $multirow_option = true;
// $dgrid->AllowMultirowOperations($multirow_option);
/// $multirow_operations = array(
/// "delete" => array("view"=>true),
/// "details" => array("view"=>true),
/// "my_operation_name" => array("view"=>true, "flag_name"=>"my_flag_name", "flag_value"=>"my_flag_value", "tooltip"=>"Do something with selected", "image"=>"image.gif")
/// );
/// $dgrid->SetMultirowOperations($multirow_operations);
## *** set CSS class for datagrid
## *** "default" or "blue" or "gray" or "green" or "pink" or your own css file
/// $css_class = "default";
/// $dgrid->SetCssClass($css_class);
## *** set variables that used to get access to the page (like: my_page.php?act=34&id=56 etc.)
/// $http_get_vars = array("act", "id");
/// $dgrid->SetHttpGetVars($http_get_vars);
## *** set other datagrid/s unique prefixes (if you use few datagrids on one page)
## *** format (in which mode to allow processing of another datagrids)
## *** array("unique_prefix"=>array("view"=>true|false, "edit"=>true|false, "details"=>true|false));
/// $anotherDatagrids = array("abcd_"=>array("view"=>true, "edit"=>true, "details"=>true));
/// $dgrid->SetAnotherDatagrids($anotherDatagrids);
## *** set DataGrid caption
/// $dg_caption = "My Favorite Lovely PHP DataGrid";
/// $dgrid->SetCaption($dg_caption);
##
##
## +---------------------------------------------------------------------------+
## | 3. Printing & Exporting Settings: |
## +---------------------------------------------------------------------------+
## *** set printing option: true(default) or false
/// $printing_option = true;
/// $dgrid->AllowPrinting($printing_option);
## *** set exporting option: true(default) or false and relative (virtual) path
## *** to export directory (relatively to datagrid.class.php file).
## *** Ex.: "" - if we use current datagrid folder
/// $exporting_option = true;
/// $exporting_directory = "";
/// $dgrid->AllowExporting($exporting_option, $exporting_directory);
/// $exporting_types = array("excel"=>"true", "pdf"=>"true", "xml"=>"true");
/// $dgrid->AllowExportingTypes($exporting_types);
##
##
## +---------------------------------------------------------------------------+
## | 4. Sorting & Paging Settings: |
## +---------------------------------------------------------------------------+
## *** set sorting option: true(default) or false
/// $sorting_option = true;
/// $dgrid->AllowSorting($sorting_option);
## *** set paging option: true(default) or false
/// $paging_option = true;
/// $rows_numeration = false;
/// $numeration_sign = "N #";
/// $dgrid->AllowPaging($paging_option, $rows_numeration, $numeration_sign);
## *** set paging settings
/// $bottom_paging = array("results"=>true, "results_align"=>"left", "pages"=>true, "pages_align"=>"center", "page_size"=>true, "page_size_align"=>"right");
/// $top_paging = array("results"=>true, "results_align"=>"left", "pages"=>true, "pages_align"=>"center", "page_size"=>true, "page_size_align"=>"right");
// $pages_array = array("10"=>"10", "25"=>"25", "50"=>"50", "100"=>"100", "250"=>"250", "500"=>"500", "1000"=>"1000");
/// $default_page_size = 10;
/// $paging_arrows = array("first"=>"|&lt;&lt;", "previous"=>"&lt;&lt;", "next"=>"&gt;&gt;", "last"=>"&gt;&gt;|");
/// $dgrid->SetPagingSettings($bottom_paging, $top_paging, $pages_array, $default_page_size, $paging_arrows);
##
##
## +---------------------------------------------------------------------------+
## | 5. Filter Settings: |
## +---------------------------------------------------------------------------+
## *** set filtering option: true or false(default)
/// $filtering_option = true;
/// $show_search_type = true;
/// $dgrid->AllowFiltering($filtering_option, $show_search_type);
## *** set aditional filtering settings
## *** tips: use "," (comma) if you want to make search by some words, for ex.: hello, bye, hi
/// $fill_from_array = array("0"=>"No", "1"=>"Yes"); /* as "value"=>"option" */
/// $filtering_fields = array(
/// "Caption_1"=>array("type"=>"textbox", "table"=>"tableName_1", "field"=>"fieldName_1|,fieldName_2", "show_operator"=>"false", "default_operator"=>"=|<|>|like|%like|like%|%like%|not like", "case_sensitive"=>"false", "comparison_type"=>"string|numeric|binary", "width"=>"", "on_js_event"=>""),
/// "Caption_2"=>array("type"=>"textbox", "autocomplete"=>"false", "handler"=>"modules/autosuggest/test.php", "maxresults"=>"12", "shownoresults"=>"false", "table"=>"tableName_1", "field"=>"fieldName_1|,fieldName_2", "show_operator"=>"false", "default_operator"=>"=|<|>|like|%like|like%|%like%|not like", "case_sensitive"=>"false", "comparison_type"=>"string|numeric|binary", "width"=>"", "on_js_event"=>""),
/// "Caption_3"=>array("type"=>"dropdownlist", "order"=>"ASC|DESC", "table"=>"tableName_2", "field"=>"fieldName_2", "source"=>"self"|$fill_from_array, "show"=>"", "condition"=>"", "show_operator"=>"false", "default_operator"=>"=|<|>|like|%like|like%|%like%|not like", "case_sensitive"=>"false", "comparison_type"=>"string|numeric|binary", "width"=>"", "on_js_event"=>""),
/// "Caption_4"=>array("type"=>"calendar", "table"=>"tableName_3", "field"=>"fieldName_3", "show_operator"=>"false", "default_operator"=>"=|<|>|like|%like|like%|%like%|not like", "case_sensitive"=>"false", "comparison_type"=>"string|numeric|binary", "width"=>"", "on_js_event"=>""),
/// );
/// $dgrid->SetFieldsFiltering($filtering_fields);
##
##
## +---------------------------------------------------------------------------+
## | 6. View Mode Settings: |
## +---------------------------------------------------------------------------+
## *** set view mode table properties
/// $vm_table_properties = array("width"=>"90%");
/// $dgrid->SetViewModeTableProperties($vm_table_properties);
## *** set columns in view mode
## *** Ex.: "on_js_event"=>"onclick='alert(\"Yes!!!\");'"
## *** "barchart" : number format in SELECT SQL must be equal with number format in max_value
/// $fill_from_array = array("0"=>"Banned", "1"=>"Active", "2"=>"Closed", "3"=>"Removed"); /* as "value"=>"option" */
/// $vm_colimns = array(
/// "FieldName_1"=>array("header"=>"Name_A", "type"=>"label", "align"=>"left", "width"=>"X%|Xpx", "wrap"=>"wrap|nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal|upper|lower|camel", "summarize"=>"false", "sort_type"=>"string|numeric", "sort_by"=>"", "visible"=>"true", "on_js_event"=>""),
/// "FieldName_2"=>array("header"=>"Name_B", "type"=>"image", "align"=>"left", "width"=>"X%|Xpx", "wrap"=>"wrap|nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal|upper|lower|camel", "summarize"=>"false", "sort_type"=>"string|numeric", "sort_by"=>"", "visible"=>"true", "on_js_event"=>"", "target_path"=>"uploads/", "default"=>"default_image.ext", "image_width"=>"50px", "image_height"=>"30px", "magnify"=>"false"),
/// "FieldName_3"=>array("header"=>"Name_C", "type"=>"linktoview", "align"=>"left", "width"=>"X%|Xpx", "wrap"=>"wrap|nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal|upper|lower|camel", "summarize"=>"false", "sort_type"=>"string|numeric", "sort_by"=>"", "visible"=>"true", "on_js_event"=>""),
/// "FieldName_4"=>array("header"=>"Name_D", "type"=>"linktoedit", "align"=>"left", "width"=>"X%|Xpx", "wrap"=>"wrap|nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal|upper|lower|camel", "summarize"=>"false", "sort_type"=>"string|numeric", "sort_by"=>"", "visible"=>"true", "on_js_event"=>""),
/// "FieldName_5"=>array("header"=>"Name_E", "type"=>"linktodelete", "align"=>"left", "width"=>"X%|Xpx", "wrap"=>"wrap|nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal|upper|lower|camel", "summarize"=>"false", "sort_type"=>"string|numeric", "sort_by"=>"", "visible"=>"true", "on_js_event"=>""),
/// "FieldName_6"=>array("header"=>"Name_F", "type"=>"link", "align"=>"left", "width"=>"X%|Xpx", "wrap"=>"wrap|nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal|upper|lower|camel", "summarize"=>"false", "sort_type"=>"string|numeric", "sort_by"=>"", "visible"=>"true", "on_js_event"=>"", "field_key"=>"field_name_0"|"field_key_1"=>"field_name_1"|..., "field_data"=>"field_name_2", "rel"=>"", "title"=>"", "target"=>"_new", "href"=>"{0}"),
/// "FieldName_7"=>array("header"=>"Name_G", "type"=>"link", "align"=>"left", "width"=>"X%|Xpx", "wrap"=>"wrap|nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal|upper|lower|camel", "summarize"=>"false", "sort_type"=>"string|numeric", "sort_by"=>"", "visible"=>"true", "on_js_event"=>"", "field_key"=>"field_name_0"|"field_key_1"=>"field_name_1"|..., "field_data"=>"field_name_2", "rel"=>"", "title"=>"", "target"=>"_new", "href"=>"mailto:{0}"),
/// "FieldName_8"=>array("header"=>"Name_H", "type"=>"link", "align"=>"left", "width"=>"X%|Xpx", "wrap"=>"wrap|nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal|upper|lower|camel", "summarize"=>"false", "sort_type"=>"string|numeric", "sort_by"=>"", "visible"=>"true", "on_js_event"=>"", "field_key"=>"field_name_0"|"field_key_1"=>"field_name_1"|..., "field_data"=>"field_name_2", "rel"=>"", "title"=>"", "target"=>"_new", "href"=>"http://mydomain.com?act={0}&act={1}&code=ABC"),
/// "FieldName_9"=>array("header"=>"Name_I", "type"=>"money", "align"=>"left", "width"=>"X%|Xpx", "wrap"=>"wrap|nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal|upper|lower|camel", "summarize"=>"false", "sort_type"=>"string|numeric", "sort_by"=>"", "visible"=>"true", "on_js_event"=>"", "sign"=>"$", "decimal_places"=>"2", "dec_separator"=>".", "thousands_separator"=>","),
/// "FieldName_10"=>array("header"=>"Name_J", "type"=>"password", "align"=>"left", "width"=>"X%|Xpx", "wrap"=>"wrap|nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal|upper|lower|camel", "summarize"=>"false", "sort_type"=>"string|numeric", "sort_by"=>"", "visible"=>"true", "on_js_event"=>""),
/// "FieldName_11"=>array("header"=>"Name_K", "type"=>"barchart", "align"=>"left", "width"=>"X%|Xpx", "wrap"=>"wrap|nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal|upper|lower|camel", "summarize"=>"false", "sort_type"=>"string|numeric", "sort_by"=>"", "visible"=>"true", "on_js_event"=>"", "field"=>"field_name", "maximum_value"=>"value"),
/// "FieldName_12"=>array("header"=>"Name_L", "type"=>"enum", "align"=>"left", "width"=>"X%|Xpx", "wrap"=>"wrap|nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal|upper|lower|camel", "summarize"=>"false", "sort_type"=>"string|numeric", "sort_by"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array),
/// );
/// $dgrid->SetColumnsInViewMode($vm_colimns);
## *** set auto-genereted columns in view mode
// $auto_column_in_view_mode = false;
// $dgrid->SetAutoColumnsInViewMode($auto_column_in_view_mode);
##
##
## +---------------------------------------------------------------------------+
## | 7. Add/Edit/Details Mode Settings: |
## +---------------------------------------------------------------------------+
## *** set add/edit mode table properties
/// $em_table_properties = array("width"=>"70%");
/// $dgrid->SetEditModeTableProperties($em_table_properties);
## *** set details mode table properties
/// $dm_table_properties = array("width"=>"70%");
/// $dgrid->SetDetailsModeTableProperties($dm_table_properties);
## *** set settings for add/edit/details modes
// $table_name = "table_name";
// $primary_key = "primary_key";
// $condition = "table_name.field = ".$_REQUEST['abc_rid'];
// $dgrid->SetTableEdit($table_name, $primary_key, $condition);
## *** set columns in edit mode
## *** first letter: r - required, s - simple (not required)
## *** second letter: t - text(including datetime), n - numeric, a - alphanumeric,
## e - email, f - float, y - any, l - login name, z - zipcode,
## p - password, i - integer, v - verified, c - checkbox, u - URL
## *** third letter (optional):
## for numbers: s - signed, u - unsigned, p - positive, n - negative
## for strings: u - upper, l - lower, n - normal, y - any
## *** Ex.: "on_js_event"=>"onclick='alert(\"Yes!!!\");'"
## *** Ex.: type = textbox|textarea|label|date(yyyy-mm-dd)|datedmy(dd-mm-yyyy)|datetime(yyyy-mm-dd hh:mm:ss)|datetimedmy(dd-mm-yyyy hh:mm:ss)|time(hh:mm:ss)|image|password|enum|print|checkbox
## *** make sure your WYSIWYG dir has 777 permissions
/// $fill_from_array = array("0"=>"No", "1"=>"Yes", "2"=>"Don't know", "3"=>"My be"); /* as "value"=>"option" */
/// $em_columns = array(
/// "FieldName_1" =>array("header"=>"Name_A", "type"=>"textbox", "req_type"=>"rt", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""),
/// "FieldName_2" =>array("header"=>"Name_B", "type"=>"textarea", "req_type"=>"rt", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "edit_type"=>"simple|wysiwyg", "resizable"=>"false", "rows"=>"7", "cols"=>"50"),
/// "FieldName_3" =>array("header"=>"Name_C", "type"=>"label", "req_type"=>"rt", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""),
/// "FieldName_4" =>array("header"=>"Name_D", "type"=>"date", "req_type"=>"rt", "width"=>"187px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "calendar_type"=>"popup|floating"),
/// "FieldName_5" =>array("header"=>"Name_E", "type"=>"datetime", "req_type"=>"st", "width"=>"187px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "calendar_type"=>"popup|floating"),
/// "FieldName_6" =>array("header"=>"Name_F", "type"=>"time", "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""),
/// "FieldName_7" =>array("header"=>"Name_G", "type"=>"image", "req_type"=>"st", "width"=>"220px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "target_path"=>"uploads/", "max_file_size"=>"100000|100K|10M|1G", "image_width"=>"120px", "image_height"=>"90px", "magnify"=>"false", "file_name"=>"", "host"=>"local|remote"),
/// "FieldName_8" =>array("header"=>"Name_H", "type"=>"password", "req_type"=>"rp", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""),
/// "FieldName_9" =>array("header"=>"Name_I", "type"=>"enum", "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>"self"|$fill_from_array, "view_type"=>"dropdownlist(default)|radiobutton", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>"false", "multiple_size"=>"4"),
/// "FieldName_10" =>array("header"=>"Name_J", "type"=>"print", "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""),
/// "FieldName_11" =>array("header"=>"Name_K", "type"=>"checkbox", "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "true_value"=>1, "false_value"=>0),
/// "FieldName_12" =>array("header"=>"Name_L", "type"=>"file", "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "target_path"=>"uploads/", "max_file_size"=>"100000|100K|10M|1G", "file_name"=>"File_Name", "host"=>"local|remote"),
/// "FieldName_13" =>array("header"=>"Name_M", "type"=>"link", "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "field_key"=>"field_name_0"|"field_key_1"=>"field_name_1"|..., "field_data"=>"field_name_2", "target"=>"_new", "href"=>"http://mydomain.com?act={0}&act={1}&code=ABC"),
/// "FieldName_14" =>array("header"=>"Name_N", "type"=>"foreign_key","req_type"=>"ri", "width"=>"210px", "title"=>"", "readonly"=>"false", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true"),
/// "FieldName_15" =>array("header"=>"", "type"=>"hidden", "req_type"=>"st", "default"=>"default_value", "visible"=>"true", "unique"=>"false"),
/// "validator" =>array("header"=>"Name_N", "type"=>"validator", "req_type"=>"rv", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "visible"=>"true", "on_js_event"=>"", "for_field"=>"", "validation_type"=>"password|email"),
/// "delimiter" =>array("inner_html"=>"<br>"),
/// );
/// $dgrid->SetColumnsInEditMode($em_columns);
## *** set auto-genereted columns in edit mode
// $auto_column_in_edit_mode = false;
// $dgrid->SetAutoColumnsInEditMode($auto_column_in_edit_mode);
## *** set foreign keys for add/edit/details modes (if there are linked tables)
## *** Ex.: "field_name"=>"CONCAT(field1,','field2) as field3"
## *** Ex.: "condition"=>"TableName_1.FieldName > 'a' AND TableName_1.FieldName < 'c'"
## *** Ex.: "on_js_event"=>"onclick='alert(\"Yes!!!\");'"
/// $foreign_keys = array(
/// "ForeignKey_1"=>array("table"=>"TableName_1", "field_key"=>"FieldKey_1", "field_name"=>"FieldName_1", "view_type"=>"dropdownlist(default)|radiobutton|textbox", "radiobuttons_alignment"=>"horizontal|vertical", "condition"=>"", "order_by_field"=>"", "order_type"=>"ASC|DESC", "on_js_event"=>""),
/// "ForeignKey_2"=>array("table"=>"TableName_2", "field_key"=>"FieldKey_2", "field_name"=>"FieldName_2", "view_type"=>"dropdownlist(default)|radiobutton|textbox", "radiobuttons_alignment"=>"horizontal|vertical", "condition"=>"", "order_by_field"=>"", "order_type"=>"ASC|DESC", "on_js_event"=>"")
/// );
/// $dgrid->SetForeignKeysEdit($foreign_keys);
##
##
################################################################################
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>:: Home</title>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<?
## call of this method between HTML <HEAD> elements
// $dgrid->WriteCssClass();
?>
</head>
<body>
<?
################################################################################
## +---------------------------------------------------------------------------+
## | 8. Bind the DataGrid: |
## +---------------------------------------------------------------------------+
## *** bind the DataGrid and draw it on the screen
// $dgrid->Bind();
// ob_end_flush();
################################################################################
?>
</body>
</html>
&nbsp;
hi,
I try to use this. but i got failed. im very new to php. can some one help me.
<?php
################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- #
## ————————————————————————— #
## PHP DataGrid version 4.2.8 (01.10.2008) #
## Author & developer: Leumas Naypoka #
## Developers: Zewa #
## Fcallez #
## Lisence: GNU GPL #
## Site: http://phpbuilder.blogspot.com #
## Copyright: Leumas Naypoka (c) 2006-2008. All rights reserved. #
################################################################################
## +—————————————————————————+
## | 1. Creating & Calling: |
## +—————————————————————————+
## *** define a relative (virtual) path to datagrid.class.php file and “pear”
## *** directory (relatively to the current file)
## *** RELATIVE PATH ONLY ***
//
define (“DATAGRID_DIR”, “datagrid/”); /* Ex.: “datagrid/” */
define (“PEAR_DIR”, “pear/”); /* Ex.: “datagrid/pear/” */
//
require_once(DATAGRID_DIR.’datagrid.class.php’);
require_once(PEAR_DIR.’PEAR.php’);
require_once(PEAR_DIR.’DB.php’);
##
## *** creating variables that we need for database connection
$DB_USER=’root’; /* usually like this: prefix_name */
$DB_PASS=’123′; /* must be already enscrypted (recommended) */
$DB_HOST=’localhost’; /* usually localhost */
$DB_NAME=’payroll’; /* usually like this: prefix_dbName */
//
ob_start();
## *** (example of ODBC connection string)
## *** $result_conn = $db_conn->connect(DB::parseDSN(‘odbc://root:12345@test_db’));
## *** (example of Oracle connection string)
## *** $result_conn = $db_conn->connect(DB::parseDSN(‘oci8://root:12345@localhost:1521/mydatabase));
## *** (example of PostgreSQL connection string)
## *** $result_conn = $db_conn->connect(DB::parseDSN(‘pgsql://root:12345@localhost/mydatabase));
## === (Examples of connections to other db types see in “docs/pear/” folder)
$db_conn = DB::factory(‘mysql’); /* don’t forget to change on appropriate db type */
$result_conn = $db_conn->connect(DB::parseDSN(‘mysql://’.$DB_USER.’:’.$DB_PASS.’@’.$DB_HOST.’/’.$DB_NAME));
if(DB::isError($result_conn)){ die($result_conn->getDebugInfo()); }
## *** put a primary key on the first place
$sql = “select emp_no, emp_f_name, emp_l_name, emp_addr, emp_phone, emp_nic, emp_dob, emp_gender, emp_civil_stat, emp_photo, emp_doj, emp_basic_sal from employee;”;
## *** set encoding and collation (default: utf8/utf8_unicode_ci)
$dg_encoding = “utf8″;
/// $dg_collation = “utf8_unicode_ci”;
$dgrid->SetEncoding($dg_encoding);
## *** set needed options and create a new class instance
$debug_mode = false; /* display SQL statements while processing */
$messaging = true; /* display system messages on a screen */
$unique_prefix = “abc_”; /* prevent overlays – must be started with a letter */
$dgrid = new DataGrid($debug_mode, $messaging, $unique_prefix, DATAGRID_DIR);
## *** set data source with needed options
$default_order_field = “emp_gender, emp_civil_stat”;
$default_order_type = “ASC, DESC”;
$dgrid->DataSource($db_conn, $sql, $default_order_field, $default_order_type);
##
##
## +—————————————————————————+
## | 2. General Settings: |
## +—————————————————————————+
## *** set interface language (default – English)
## *** (en) – English (de) – German (se) – Swedish (hr) – Bosnian/Croatian
## *** (hu) – Hungarian (es) – Espanol (ca) – Catala (fr) – Francais
## *** (nl) – Netherlands/”Vlaams”(Flemish) (it) – Italiano (pl) – Polish
## *** (ch) – Chinese (sr) – Serbian (bg) – Bulgarian (pb) – Brazilian Portuguese
## *** (ar) – Arabic (tr) – Turkish (cz) – Czech (ro/ro_utf8) – Romanian
## *** (gk) – Greek (he) – Hebrew (ru_utf8) – Russian
$dg_language = “en”;
$dgrid->SetInterfaceLang($dg_language);
## *** set direction: “ltr” or “rtr” (default – “ltr”)
$direction = “ltr”;
$dgrid->SetDirection($direction);
## *** set layouts: “0″ – tabular(horizontal) – default, “1″ – columnar(vertical), “2″ – customized
$layouts = array(“view”=>”0″, “edit”=>”1″, “details”=>”1″, “filter”=>”1″);
$dgrid->SetLayouts($layouts);
/// $details_template = “{field_name_1}{field_name_2}…”;
/// $dgrid->SetTemplates(“”,”",$details_template);
## *** set modes for operations (“type” => “link|button|image”)
## *** “byFieldValue”=>”fieldName” – make the field to be a link to edit mode page
$modes = array(
“add” =>array(“view”=>true, “edit”=>false, “type”=>”link”, “show_add_button”=>”inside|outside”),
“edit” =>array(“view”=>true, “edit”=>true, “type”=>”link”, “byFieldValue”=>”"),
“cancel” =>array(“view”=>true, “edit”=>true, “type”=>”link”),
“details” =>array(“view”=>true, “edit”=>false, “type”=>”link”),
“delete” =>array(“view”=>true, “edit”=>true, “type”=>”image”)
);
$dgrid->SetModes($modes);
## *** allow scrolling on datagrid
$scrolling_option = false;
$dgrid->AllowScrollingSettings($scrolling_option);
## *** set scrolling settings (optional)
$scrolling_width = “90%”;
$scrolling_height = “100%”;
$dgrid->setScrollingSettings($scrolling_width, $scrolling_height);
## *** allow multirow operations
$multirow_option = true;
$dgrid->AllowMultirowOperations($multirow_option);
$multirow_operations = array(
“delete” => array(“view”=>true),
“details” => array(“view”=>true),
“my_operation_name” => array(“view”=>true, “flag_name”=>”my_flag_name”, “flag_value”=>”my_flag_value”, “tooltip”=>”Do something with selected”, “image”=>”image.gif”)
);
$dgrid->SetMultirowOperations($multirow_operations);
## *** set CSS class for datagrid
## *** “default” or “blue” or “gray” or “green” or “pink” or your own css file
$css_class = “default”;
$dgrid->SetCssClass($css_class);
## *** set variables that used to get access to the page (like: my_page.php?act=34&id=56 etc.)
$http_get_vars = array(“act”, “id”);
$dgrid->SetHttpGetVars($http_get_vars);
## *** set other datagrid/s unique prefixes (if you use few datagrids on one page)
## *** format (in which mode to allow processing of another datagrids)
## *** array(“unique_prefix”=>array(“view”=>true|false, “edit”=>true|false, “details”=>true|false));
$anotherDatagrids = array(“abcd_”=>array(“view”=>true, “edit”=>true, “details”=>true));
$dgrid->SetAnotherDatagrids($anotherDatagrids);
## *** set DataGrid caption
$dg_caption = “My Favorite Lovely PHP DataGrid”;
$dgrid->SetCaption($dg_caption);
##
##
## +—————————————————————————+
## | 3. Printing & Exporting Settings: |
## +—————————————————————————+
## *** set printing option: true(default) or false
$printing_option = true;
$dgrid->AllowPrinting($printing_option);
## *** set exporting option: true(default) or false and relative (virtual) path
## *** to export directory (relatively to datagrid.class.php file).
## *** Ex.: “” – if we use current datagrid folder
$exporting_option = true;
$exporting_directory = “”;
$dgrid->AllowExporting($exporting_option, $exporting_directory);
$exporting_types = array(“excel”=>”true”, “pdf”=>”true”, “xml”=>”true”);
$dgrid->AllowExportingTypes($exporting_types);
##
##
## +—————————————————————————+
## | 4. Sorting & Paging Settings: |
## +—————————————————————————+
## *** set sorting option: true(default) or false
$sorting_option = true;
$dgrid->AllowSorting($sorting_option);
## *** set paging option: true(default) or false
$paging_option = true;
$rows_numeration = false;
$numeration_sign = “N #”;
$dgrid->AllowPaging($paging_option, $rows_numeration, $numeration_sign);
## *** set paging settings
$bottom_paging = array(“results”=>true, “results_align”=>”left”, “pages”=>true, “pages_align”=>”center”, “page_size”=>true, “page_size_align”=>”right”);
$top_paging = array(“results”=>true, “results_align”=>”left”, “pages”=>true, “pages_align”=>”center”, “page_size”=>true, “page_size_align”=>”right”);
$pages_array = array(“10″=>”10″, “25″=>”25″, “50″=>”50″, “100″=>”100″, “250″=>”250″, “500″=>”500″, “1000″=>”1000″);
$default_page_size = 10;
$paging_arrows = array(“first”=>”|<<”, “previous”=>”<<”, “next”=>”>>”, “last”=>”>>|”);
$dgrid->SetPagingSettings($bottom_paging, $top_paging, $pages_array, $default_page_size, $paging_arrows);
##
##
## +—————————————————————————+
## | 5. Filter Settings: |
## +—————————————————————————+
## *** set filtering option: true or false(default)
$filtering_option = true;
$show_search_type = true;
$dgrid->AllowFiltering($filtering_option, $show_search_type);
## *** set aditional filtering settings
## *** tips: use “,” (comma) if you want to make search by some words, for ex.: hello, bye, hi
$fill_from_array = array(“0″=>”No”, “1″=>”Yes”); /* as “value”=>”option” */
$filtering_fields = array(
“Caption_1″=>array(“type”=>”textbox”, “table”=>”tableName_1″, “field”=>”fieldName_1|,fieldName_2″, “show_operator”=>”false”, “default_operator”=>”=||like|%like|like%|%like%|not like”, “case_sensitive”=>”false”, “comparison_type”=>”string|numeric|binary”, “width”=>”", “on_js_event”=>”"),
“Caption_2″=>array(“type”=>”textbox”, “autocomplete”=>”false”, “handler”=>”modules/autosuggest/test.php”, “maxresults”=>”12″, “shownoresults”=>”false”, “table”=>”tableName_1″, “field”=>”fieldName_1|,fieldName_2″, “show_operator”=>”false”, “default_operator”=>”=||like|%like|like%|%like%|not like”, “case_sensitive”=>”false”, “comparison_type”=>”string|numeric|binary”, “width”=>”", “on_js_event”=>”"),
“Caption_3″=>array(“type”=>”dropdownlist”, “order”=>”ASC|DESC”, “table”=>”tableName_2″, “field”=>”fieldName_2″, “source”=>”self”|$fill_from_array, “show”=>”", “condition”=>”", “show_operator”=>”false”, “default_operator”=>”=||like|%like|like%|%like%|not like”, “case_sensitive”=>”false”, “comparison_type”=>”string|numeric|binary”, “width”=>”", “on_js_event”=>”"),
“Caption_4″=>array(“type”=>”calendar”, “table”=>”tableName_3″, “field”=>”fieldName_3″, “show_operator”=>”false”, “default_operator”=>”=||like|%like|like%|%like%|not like”, “case_sensitive”=>”false”, “comparison_type”=>”string|numeric|binary”, “width”=>”", “on_js_event”=>”"),
);
$dgrid->SetFieldsFiltering($filtering_fields);
##
##
## +—————————————————————————+
## | 6. View Mode Settings: |
## +—————————————————————————+
## *** set view mode table properties
$vm_table_properties = array(“width”=>”90%”);
$dgrid->SetViewModeTableProperties($vm_table_properties);
## *** set columns in view mode
## *** Ex.: “on_js_event”=>”onclick=’alert(\”Yes!!!\”);’”
## *** “barchart” : number format in SELECT SQL must be equal with number format in max_value
$fill_from_array = array(“0″=>”Banned”, “1″=>”Active”, “2″=>”Closed”, “3″=>”Removed”); /* as “value”=>”option” */
$vm_colimns = array(
“FieldName_1″=>array(“header”=>”Name_A”, “type”=>”label”, “align”=>”left”, “width”=>”X%|Xpx”, “wrap”=>”wrap|nowrap”, “text_length”=>”-1″, “tooltip”=>”false”, “tooltip_type”=>”floating|simple”, “case”=>”normal|upper|lower|camel”, “summarize”=>”false”, “sort_type”=>”string|numeric”, “sort_by”=>”", “visible”=>”true”, “on_js_event”=>”"),
“FieldName_2″=>array(“header”=>”Name_B”, “type”=>”image”, “align”=>”left”, “width”=>”X%|Xpx”, “wrap”=>”wrap|nowrap”, “text_length”=>”-1″, “tooltip”=>”false”, “tooltip_type”=>”floating|simple”, “case”=>”normal|upper|lower|camel”, “summarize”=>”false”, “sort_type”=>”string|numeric”, “sort_by”=>”", “visible”=>”true”, “on_js_event”=>”", “target_path”=>”uploads/”, “default”=>”default_image.ext”, “image_width”=>”50px”, “image_height”=>”30px”, “magnify”=>”false”),
“FieldName_3″=>array(“header”=>”Name_C”, “type”=>”linktoview”, “align”=>”left”, “width”=>”X%|Xpx”, “wrap”=>”wrap|nowrap”, “text_length”=>”-1″, “tooltip”=>”false”, “tooltip_type”=>”floating|simple”, “case”=>”normal|upper|lower|camel”, “summarize”=>”false”, “sort_type”=>”string|numeric”, “sort_by”=>”", “visible”=>”true”, “on_js_event”=>”"),
“FieldName_4″=>array(“header”=>”Name_D”, “type”=>”linktoedit”, “align”=>”left”, “width”=>”X%|Xpx”, “wrap”=>”wrap|nowrap”, “text_length”=>”-1″, “tooltip”=>”false”, “tooltip_type”=>”floating|simple”, “case”=>”normal|upper|lower|camel”, “summarize”=>”false”, “sort_type”=>”string|numeric”, “sort_by”=>”", “visible”=>”true”, “on_js_event”=>”"),
“FieldName_5″=>array(“header”=>”Name_E”, “type”=>”linktodelete”, “align”=>”left”, “width”=>”X%|Xpx”, “wrap”=>”wrap|nowrap”, “text_length”=>”-1″, “tooltip”=>”false”, “tooltip_type”=>”floating|simple”, “case”=>”normal|upper|lower|camel”, “summarize”=>”false”, “sort_type”=>”string|numeric”, “sort_by”=>”", “visible”=>”true”, “on_js_event”=>”"),
“FieldName_6″=>array(“header”=>”Name_F”, “type”=>”link”, “align”=>”left”, “width”=>”X%|Xpx”, “wrap”=>”wrap|nowrap”, “text_length”=>”-1″, “tooltip”=>”false”, “tooltip_type”=>”floating|simple”, “case”=>”normal|upper|lower|camel”, “summarize”=>”false”, “sort_type”=>”string|numeric”, “sort_by”=>”", “visible”=>”true”, “on_js_event”=>”", “field_key”=>”field_name_0″|”field_key_1″=>”field_name_1″|…, “field_data”=>”field_name_2″, “rel”=>”", “title”=>”", “target”=>”_new”, “href”=>”{0}”),
“FieldName_7″=>array(“header”=>”Name_G”, “type”=>”link”, “align”=>”left”, “width”=>”X%|Xpx”, “wrap”=>”wrap|nowrap”, “text_length”=>”-1″, “tooltip”=>”false”, “tooltip_type”=>”floating|simple”, “case”=>”normal|upper|lower|camel”, “summarize”=>”false”, “sort_type”=>”string|numeric”, “sort_by”=>”", “visible”=>”true”, “on_js_event”=>”", “field_key”=>”field_name_0″|”field_key_1″=>”field_name_1″|…, “field_data”=>”field_name_2″, “rel”=>”", “title”=>”", “target”=>”_new”, “href”=>”mailto:{0}”),
“FieldName_8″=>array(“header”=>”Name_H”, “type”=>”link”, “align”=>”left”, “width”=>”X%|Xpx”, “wrap”=>”wrap|nowrap”, “text_length”=>”-1″, “tooltip”=>”false”, “tooltip_type”=>”floating|simple”, “case”=>”normal|upper|lower|camel”, “summarize”=>”false”, “sort_type”=>”string|numeric”, “sort_by”=>”", “visible”=>”true”, “on_js_event”=>”", “field_key”=>”field_name_0″|”field_key_1″=>”field_name_1″|…, “field_data”=>”field_name_2″, “rel”=>”", “title”=>”", “target”=>”_new”, “href”=>”http://mydomain.com?act={0}&act={1}&code=ABC”),
“FieldName_9″=>array(“header”=>”Name_I”, “type”=>”money”, “align”=>”left”, “width”=>”X%|Xpx”, “wrap”=>”wrap|nowrap”, “text_length”=>”-1″, “tooltip”=>”false”, “tooltip_type”=>”floating|simple”, “case”=>”normal|upper|lower|camel”, “summarize”=>”false”, “sort_type”=>”string|numeric”, “sort_by”=>”", “visible”=>”true”, “on_js_event”=>”", “sign”=>”$”, “decimal_places”=>”2″, “dec_separator”=>”.”, “thousands_separator”=>”,”),
“FieldName_10″=>array(“header”=>”Name_J”, “type”=>”password”, “align”=>”left”, “width”=>”X%|Xpx”, “wrap”=>”wrap|nowrap”, “text_length”=>”-1″, “tooltip”=>”false”, “tooltip_type”=>”floating|simple”, “case”=>”normal|upper|lower|camel”, “summarize”=>”false”, “sort_type”=>”string|numeric”, “sort_by”=>”", “visible”=>”true”, “on_js_event”=>”"),
“FieldName_11″=>array(“header”=>”Name_K”, “type”=>”barchart”, “align”=>”left”, “width”=>”X%|Xpx”, “wrap”=>”wrap|nowrap”, “text_length”=>”-1″, “tooltip”=>”false”, “tooltip_type”=>”floating|simple”, “case”=>”normal|upper|lower|camel”, “summarize”=>”false”, “sort_type”=>”string|numeric”, “sort_by”=>”", “visible”=>”true”, “on_js_event”=>”", “field”=>”field_name”, “maximum_value”=>”value”),
“FieldName_12″=>array(“header”=>”Name_L”, “type”=>”enum”, “align”=>”left”, “width”=>”X%|Xpx”, “wrap”=>”wrap|nowrap”, “text_length”=>”-1″, “tooltip”=>”false”, “tooltip_type”=>”floating|simple”, “case”=>”normal|upper|lower|camel”, “summarize”=>”false”, “sort_type”=>”string|numeric”, “sort_by”=>”", “visible”=>”true”, “on_js_event”=>”", “source”=>$fill_from_array),
);
$dgrid->SetColumnsInViewMode($vm_colimns);
## *** set auto-genereted columns in view mode
$auto_column_in_view_mode = false;
$dgrid->SetAutoColumnsInViewMode($auto_column_in_view_mode);
##
##
## +—————————————————————————+
## | 7. Add/Edit/Details Mode Settings: |
## +—————————————————————————+
## *** set add/edit mode table properties
$em_table_properties = array(“width”=>”70%”);
$dgrid->SetEditModeTableProperties($em_table_properties);
## *** set details mode table properties
$dm_table_properties = array(“width”=>”70%”);
$dgrid->SetDetailsModeTableProperties($dm_table_properties);
## *** set settings for add/edit/details modes
$table_name = “employee”;
$primary_key = “emp_no”;
$condition = “”;
$dgrid->SetTableEdit($table_name, $primary_key, $condition);
## *** set columns in edit mode
## *** first letter: r – required, s – simple (not required)
## *** second letter: t – text(including datetime), n – numeric, a – alphanumeric,
## e – email, f – float, y – any, l – login name, z – zipcode,
## p – password, i – integer, v – verified, c – checkbox, u – URL
## *** third letter (optional):
## for numbers: s – signed, u – unsigned, p – positive, n – negative
## for strings: u – upper, l – lower, n – normal, y – any
## *** Ex.: “on_js_event”=>”onclick=’alert(\”Yes!!!\”);’”
## *** Ex.: type = textbox|textarea|label|date(yyyy-mm-dd)|datedmy(dd-mm-yyyy)|datetime(yyyy-mm-dd hh:mm:ss)|datetimedmy(dd-mm-yyyy hh:mm:ss)|time(hh:mm:ss)|image|password|enum|print|checkbox
## *** make sure your WYSIWYG dir has 777 permissions
$fill_from_array = array(“0″=>”No”, “1″=>”Yes”, “2″=>”Don’t know”, “3″=>”My be”); /* as “value”=>”option” */
$em_columns = array(
“FieldName_1″ =>array(“header”=>”Name_A”, “type”=>”textbox”, “req_type”=>”rt”, “width”=>”210px”, “title”=>”", “readonly”=>”false”, “maxlength”=>”-1″, “default”=>”", “unique”=>”false”, “unique_condition”=>”", “visible”=>”true”, “on_js_event”=>”"),
“FieldName_2″ =>array(“header”=>”Name_B”, “type”=>”textarea”, “req_type”=>”rt”, “width”=>”210px”, “title”=>”", “readonly”=>”false”, “maxlength”=>”-1″, “default”=>”", “unique”=>”false”, “unique_condition”=>”", “visible”=>”true”, “on_js_event”=>”", “edit_type”=>”simple|wysiwyg”, “resizable”=>”false”, “rows”=>”7″, “cols”=>”50″),
“FieldName_3″ =>array(“header”=>”Name_C”, “type”=>”label”, “req_type”=>”rt”, “width”=>”210px”, “title”=>”", “readonly”=>”false”, “maxlength”=>”-1″, “default”=>”", “unique”=>”false”, “unique_condition”=>”", “visible”=>”true”, “on_js_event”=>”"),
“FieldName_4″ =>array(“header”=>”Name_D”, “type”=>”date”, “req_type”=>”rt”, “width”=>”187px”, “title”=>”", “readonly”=>”false”, “maxlength”=>”-1″, “default”=>”", “unique”=>”false”, “unique_condition”=>”", “visible”=>”true”, “on_js_event”=>”", “calendar_type”=>”popup|floating”),
“FieldName_5″ =>array(“header”=>”Name_E”, “type”=>”datetime”, “req_type”=>”st”, “width”=>”187px”, “title”=>”", “readonly”=>”false”, “maxlength”=>”-1″, “default”=>”", “unique”=>”false”, “unique_condition”=>”", “visible”=>”true”, “on_js_event”=>”", “calendar_type”=>”popup|floating”),
“FieldName_6″ =>array(“header”=>”Name_F”, “type”=>”time”, “req_type”=>”st”, “width”=>”210px”, “title”=>”", “readonly”=>”false”, “maxlength”=>”-1″, “default”=>”", “unique”=>”false”, “unique_condition”=>”", “visible”=>”true”, “on_js_event”=>”"),
“FieldName_7″ =>array(“header”=>”Name_G”, “type”=>”image”, “req_type”=>”st”, “width”=>”220px”, “title”=>”", “readonly”=>”false”, “maxlength”=>”-1″, “default”=>”", “unique”=>”false”, “unique_condition”=>”", “visible”=>”true”, “on_js_event”=>”", “target_path”=>”uploads/”, “max_file_size”=>”100000|100K|10M|1G”, “image_width”=>”120px”, “image_height”=>”90px”, “magnify”=>”false”, “file_name”=>”", “host”=>”local|remote”),
“FieldName_8″ =>array(“header”=>”Name_H”, “type”=>”password”, “req_type”=>”rp”, “width”=>”210px”, “title”=>”", “readonly”=>”false”, “maxlength”=>”-1″, “default”=>”", “unique”=>”false”, “unique_condition”=>”", “visible”=>”true”, “on_js_event”=>”"),
“FieldName_9″ =>array(“header”=>”Name_I”, “type”=>”enum”, “req_type”=>”st”, “width”=>”210px”, “title”=>”", “readonly”=>”false”, “maxlength”=>”-1″, “default”=>”", “unique”=>”false”, “unique_condition”=>”", “visible”=>”true”, “on_js_event”=>”", “source”=>”self”|$fill_from_array, “view_type”=>”dropdownlist(default)|radiobutton”, “radiobuttons_alignment”=>”horizontal|vertical”, “multiple”=>”false”, “multiple_size”=>”4″),
“FieldName_10″ =>array(“header”=>”Name_J”, “type”=>”print”, “req_type”=>”st”, “width”=>”210px”, “title”=>”", “readonly”=>”false”, “maxlength”=>”-1″, “default”=>”", “unique”=>”false”, “unique_condition”=>”", “visible”=>”true”, “on_js_event”=>”"),
“FieldName_11″ =>array(“header”=>”Name_K”, “type”=>”checkbox”, “req_type”=>”st”, “width”=>”210px”, “title”=>”", “readonly”=>”false”, “maxlength”=>”-1″, “default”=>”", “unique”=>”false”, “unique_condition”=>”", “visible”=>”true”, “on_js_event”=>”", “true_value”=>1, “false_value”=>0),
“FieldName_12″ =>array(“header”=>”Name_L”, “type”=>”file”, “req_type”=>”st”, “width”=>”210px”, “title”=>”", “readonly”=>”false”, “maxlength”=>”-1″, “default”=>”", “unique”=>”false”, “unique_condition”=>”", “visible”=>”true”, “on_js_event”=>”", “target_path”=>”uploads/”, “max_file_size”=>”100000|100K|10M|1G”, “file_name”=>”File_Name”, “host”=>”local|remote”),
“FieldName_13″ =>array(“header”=>”Name_M”, “type”=>”link”, “req_type”=>”st”, “width”=>”210px”, “title”=>”", “readonly”=>”false”, “maxlength”=>”-1″, “default”=>”", “unique”=>”false”, “unique_condition”=>”", “visible”=>”true”, “on_js_event”=>”", “field_key”=>”field_name_0″|”field_key_1″=>”field_name_1″|…, “field_data”=>”field_name_2″, “target”=>”_new”, “href”=>”http://mydomain.com?act={0}&act={1}&code=ABC”),
“FieldName_14″ =>array(“header”=>”Name_N”, “type”=>”foreign_key”,”req_type”=>”ri”, “width”=>”210px”, “title”=>”", “readonly”=>”false”, “default”=>”", “unique”=>”false”, “unique_condition”=>”", “visible”=>”true”),
“FieldName_15″ =>array(“header”=>”", “type”=>”hidden”, “req_type”=>”st”, “default”=>”default_value”, “visible”=>”true”, “unique”=>”false”),
“validator” =>array(“header”=>”Name_N”, “type”=>”validator”, “req_type”=>”rv”, “width”=>”210px”, “title”=>”", “readonly”=>”false”, “maxlength”=>”-1″, “default”=>”", “visible”=>”true”, “on_js_event”=>”", “for_field”=>”", “validation_type”=>”password|email”),
“delimiter” =>array(“inner_html”=>”"),
);
$dgrid->SetColumnsInEditMode($em_columns);
## *** set auto-genereted columns in edit mode
$auto_column_in_edit_mode = false;
$dgrid->SetAutoColumnsInEditMode($auto_column_in_edit_mode);
## *** set foreign keys for add/edit/details modes (if there are linked tables)
## *** Ex.: “field_name”=>”CONCAT(field1,’,'field2) as field3″
## *** Ex.: “condition”=>”TableName_1.FieldName > ‘a’ AND TableName_1.FieldName “onclick=’alert(\”Yes!!!\”);’”
$foreign_keys = array(
“ForeignKey_1″=>array(“table”=>”TableName_1″, “field_key”=>”FieldKey_1″, “field_name”=>”FieldName_1″, “view_type”=>”dropdownlist(default)|radiobutton|textbox”, “radiobuttons_alignment”=>”horizontal|vertical”, “condition”=>”", “order_by_field”=>”", “order_type”=>”ASC|DESC”, “on_js_event”=>”"),
“ForeignKey_2″=>array(“table”=>”TableName_2″, “field_key”=>”FieldKey_2″, “field_name”=>”FieldName_2″, “view_type”=>”dropdownlist(default)|radiobutton|textbox”, “radiobuttons_alignment”=>”horizontal|vertical”, “condition”=>”", “order_by_field”=>”", “order_type”=>”ASC|DESC”, “on_js_event”=>”")
);
$dgrid->SetForeignKeysEdit($foreign_keys);
##
##
################################################################################
?>
:: Home
<?
## call of this method between HTML elements
//$dgrid->WriteCssClass();
?>
Bind();
ob_end_flush();
################################################################################
?>