MENU
:
Back
Edit Soste (soste.php)
[ Switch to Wizard
]
[ : Back ]
Code:
*
... * 3. Be careful when using the names of fields they may be case sensitive! * 4. For the best performance uncomment ob_start(); and ob_end_flush(); functions. * */ //*// $md_mode = isset($_REQUEST['md_mode']) ? strip_tags($_REQUEST['md_mode']) : ''; //*// $md_key = isset($_REQUEST['md_key']) ? strip_tags($_REQUEST['md_key']) : ''; ################################################################################ ## --------------------------------------------------------------------------- # ## ApPHP DataGrid (enabled for Pro versions - 7xx) # ## Last changes : 02.01.2014 # ## Developed by : ApPHP
# ## License : GNU LGPL v.3 # ## Site : https://www.apphp.com/php-datagrid/ # ## Copyright : ApPHP DataGrid (c) 2006-2014. All rights reserved. # ## # ################################################################################ ## +---------------------------------------------------------------------------+ ## | 1. Creating & Calling: | ## +---------------------------------------------------------------------------+ ## *** define a relative (virtual) path to datagrid.class.php file ## *** (relatively to the current file) ## *** RELATIVE PATH ONLY *** //*// define ('DATAGRID_DIR', '
'); /* Ex.: 'datagrid/' */ //*// require_once(DATAGRID_DIR.'datagrid.class.php'); ## ## *** creating variables that we need for database connection //*// $DB_TYPE='
'; //*// $DB_HOST='
'; /* usually localhost */ //*// $DB_NAME='
'; /* usually like this: prefix_dbName */ //*// $DB_USER='
'; /* usually like this: prefix_name */ //*// $DB_PASS='
'; //*// //*// ob_start(); ## *** (don't remove this line!!!) START_DATAGRID ## *** set needed options and create a new class instance //*// $debug_mode =
; /* display SQL statements while processing */ //*// $messaging = true; /* display system messages on a screen */ //*// $unique_prefix = '
'; /* prevent overlays - must be started with a letter */ //*// $dgrid = new DataGrid($debug_mode, $messaging, $unique_prefix); //*//
## *** set encoding and collation (default: utf8/utf8_unicode_ci) //*// $dg_encoding = '
'; //*// $dg_collation = '
'; //*// $dgrid->SetEncoding($dg_encoding, $dg_collation); ## *** set data source with required settings ## *** 1. write all fields separated by commas(,) like: field1, field2 etc.. DON'T USE table.* ## *** 2. write the primary key in the first place (MUST BE AUTO-INCREMENT NUMERIC!) //*// $sql = '
'; ## *** set data source with needed options ## *** first parameter 'PDO' //*// $default_order = array(
); /* Ex.: array('field_1'=>'ASC', 'field_2'=>'DESC') */ //*// $dgrid->DataSource('
', $DB_TYPE, $DB_HOST, $DB_NAME, $DB_USER, $DB_PASS, $sql, $default_order); ## ## ## +---------------------------------------------------------------------------+ ## | 2. General Settings: | ## +---------------------------------------------------------------------------+ ## +-- PostBack Submission Method -------------------------(for PRO Version)---+ ## *** defines postback submission method for DataGrid: AJAX, POST(default) or GET //-// $postback_method = '
'; //-// $dgrid->SetPostBackMethod($postback_method); ## ## +-- Cache Settings -------------------------------------(for PRO Version)---+ ## *** make sure your cache/ dir has 755 (write) permissions ## *** define caching parameters: 1st - allow caching or not, 2nd - caching lifetime in minutes /// $dgrid->SetCachingParameters(true, 5); ## *** delete all caching pages (only if needed) /// $dgrid->DeleteCache(); ## ## +-- Languages --------------------------------------------------------------+ ## *** set interface language (default - English) ## *** (ar) - Arabic (bg) - Bulgarian (ca) - Catala (ch) - Chinese ## *** (cz) - Czech (da) - Danish (de) - German (en) - English ## *** (es) - Espanol (fi) - Finnish, Suomi (fr) - Francais (gk) - Greek ## *** (he) - Hebrew (hr) - Bosnian/Croatian (hu) - Hungarian (it) - Italian ## *** (ja) - Japanese (lt) - Lithuanian (nl) - Netherlands/'Vlaams'(Flemish) ## *** (pl) - Polish (pb) - Brazilian Portuguese (ro) - Romanian ## *** (ru) - Russian (se) - Swedish (sr) - Serbian (tr) - Turkish //*// $dg_language = '
'; //*// $dgrid->SetInterfaceLang($dg_language); ## *** set direction: 'ltr' or 'rtr' (default - 'ltr') //*// $direction = '
'; //*// $dgrid->SetDirection($direction); ## ## +-- Layouts, Templates & CSS -----------------------------------------------+ ## *** datagrid layouts: '0' - tabular(horizontal) - default, '1' - columnar(vertical), '2' - customized ## *** use 'view'=>'0' and 'edit'=>'0' only if you work on the same tables ## *** filter layouts: '0' - tabular(horizontal) - default, '1' - columnar(vertical), '2' - advanced(inline) //*// $layouts = array('view'=>'
', 'edit'=>'
', 'details'=>'1', 'filter'=>'
'); //*// $dgrid->SetLayouts($layouts); /// *** $mode_template = array('header'=>'', 'body'=>'', 'footer'=>''); /// @field_name_1@ - field header /// {field_name_1} - field value /// [ADD][CREATE][EDIT][DELETE][BACK][CANCEL][UPDATE][MULTIROW_CHECKBOX][ROWS_NUMERATION] - allowed elements and operations (must be placed in $template['body'] only) /// $view_template = ''; /// $add_edit_template = ''; /// $details_template = array('header'=>'', 'body'=>'', 'footer'=>''); /// $details_template['header'] = ''; /// $details_template['body'] = '
{field_name_1}
{field_name_2}
[BACK]
'; /// $details_template['footer'] = ''; /// $dgrid->SetTemplates($view_template, $add_edit_template, $details_template); ## *** set modes operations ('type' => 'link|button|image') ## *** 'view' - view mode, 'edit' - add/edit/details modes, ## *** 'byFieldValue'=>'fieldName' - make the field to be a link to edit mode page //*// $modes = array( //*// 'add' =>array('view'=>
, 'edit'=>false, 'type'=>'link', 'show_button'=>true, 'show_add_button'=>'inside|outside'), //*// 'edit' =>array('view'=>
, 'edit'=>true, 'type'=>'link', 'show_button'=>true, 'byFieldValue'=>''), //*// 'details' =>array('view'=>
, 'edit'=>false, 'type'=>'link', 'show_button'=>true), //*// 'delete' =>array('view'=>
, 'edit'=>false, 'type'=>'image', 'show_button'=>true) //*// ); //*// $dgrid->SetModes($modes); ## *** set CSS class for datagrid ## *** 'default|blue|gray|green|pink|empty|x-blue|x-gray|x-green' or your own css style //*// $css_class = '
'; //*// $dgrid->SetCssClass($css_class); ## *** set DataGrid caption //*// $dg_caption = '
'; //*// $dgrid->SetCaption($dg_caption); //*// $dg_footer = '
[ Switch to Wizard
]
[ : Back ]