# ## 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", ""); /* 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='btos'; /* usually like this: prefix_name */ $DB_PASS='phpsotb03PASS'; /* must be already enscrypted (recommended) */ $DB_HOST='localhost'; /* usually localhost */ $DB_NAME='eqf'; /* usually like this: prefix_dbName */ $DB_IDENT=isset($_GET['id']) ? $_GET['id'] : ""; // 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 KSC.ID, KSC.IDENT, KSC.ISCO, ISCO.DESCR, KSC.WEEKS, KSC.MONTHS, KSC.YEARS, KSC.KL, KSC.SL, KSC.CL FROM KSC INNER JOIN ISCO ON ISCO.IDENT=KSC.ISCO WHERE KSC.IDENT='".$DB_IDENT."'"; ## *** 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 = "ID"; $default_order_type = "ASC"; $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 = "
IDIdentifierISCO Code
"; $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"=>false, "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 = "EQF - Knowledge / Skills / Competence"; $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 = "C:/wamp/www/EQF/export/".$DB_IDENT; $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"=>""), "Description"=>array("type"=>"dropdownlist", "order"=>"ASC|DESC", "table"=>"ISCO", "field"=>"DESCR", "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" */ $fill_from_array = array("1"=>"General", "2"=>"Basic", "3"=>"General Concepts", "4"=>"Factual&Theoretical", "5"=>"Specialized", "6"=>"Advanced specialist", "7"=>"Highly specialized", "8"=>"Frontier knowledge & study"); /* as "value"=>"option" */ // $fill_from_array_s = array("0"=>"Basic", "1"=>"Basic of work", "2"=>"Closed", "3"=>"Removed"); /* as "value"=>"option" */ // $fill_from_array_c = array("0"=>"Basic", "1"=>"Basic of work", "2"=>"Closed", "3"=>"Removed"); /* as "value"=>"option" */ $vm_colimns = array( "ID"=>array("header"=>"ID", "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"=>""), "IDENT"=>array("header"=>"Identifier", "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"=>""), "DESCR"=>array("header"=>"ISCO Name", "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"=>""), "WEEKS"=>array("header"=>"Weeks", "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"=>""), "MONTHS"=>array("header"=>"Months", "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"=>""), "YEARS"=>array("header"=>"Years", "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"=>""), "KL"=>array("header"=>"Knowledge Level", "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), "SL"=>array("header"=>"Skills Level", "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), "CL"=>array("header"=>"Competence Level", "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), /// "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 = "KSC"; $primary_key = "ID"; // $condition = "table_name.field = ".$_REQUEST['abc_rid']; $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" */ $fill_from_array = array("1"=>"General", "2"=>"Basic", "3"=>"General Concepts", "4"=>"Factual&Theoretical", "5"=>"Specialized", "6"=>"Advanced specialist", "7"=>"Highly specialized", "8"=>"Frontier knowledge & study"); /* as "value"=>"option" */ $em_columns = array( "ID" =>array("header"=>"ID", "type"=>"textbox", "req_type"=>"s", "width"=>"210px", "title"=>"", "readonly"=>"true", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""), "IDENT" =>array("header"=>"Identifier", "type"=>"textbox", "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>"true", "maxlength"=>"-1", "default"=>$DB_IDENT, "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""), "ISCO" =>array("header"=>"ISCO", "type"=>"textbox", "req_type"=>"rt", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""), "WEEKS" =>array("header"=>"Weeks", "type"=>"textbox", "req_type"=>"si", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""), "MONTHS" =>array("header"=>"Months", "type"=>"textbox", "req_type"=>"si", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""), "YEARS" =>array("header"=>"Years", "type"=>"textbox", "req_type"=>"si", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""), "KL" =>array("header"=>"Knowledge Level", "type"=>"enum", "req_type"=>"rt", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array, "view_type"=>"dropdownlist(default)|radiobutton", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>"false", "multiple_size"=>"4"), "SL" =>array("header"=>"Skills Level", "type"=>"enum", "req_type"=>"rt", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array, "view_type"=>"dropdownlist(default)|radiobutton", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>"false", "multiple_size"=>"4"), "CL" =>array("header"=>"Competence Level", "type"=>"enum", "req_type"=>"rt", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_from_array, "view_type"=>"dropdownlist(default)|radiobutton", "radiobuttons_alignment"=>"horizontal|vertical", "multiple"=>"false", "multiple_size"=>"4"), /// "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 < 'c'" ## *** Ex.: "on_js_event"=>"onclick='alert(\"Yes!!!\");'" $foreign_keys = array( "ISCO"=>array("table"=>"ISCO", "field_key"=>"IDENT", "field_name"=>"DESCR", "view_type"=>"dropdownlist", "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 elements // $dgrid->WriteCssClass(); ?> Hello from Prosoft
BTOS

Bind(); ob_end_flush(); ################################################################################ ?>

Copyright © 2009  Btos  All Rights Reserved.
Administered by Prosoft