0) // { // $valid_anio=$anio; // session_register("valid_anio"); // } //$lectivo_desc=get_lectivodes($valid_user,$valid_pass,$valid_anio); //$valid_lecdes=$lectivo_desc; //session_register("valid_lecdes"); //do_html_lectivo($valid_lecdes); do_html_izquierda(); //$tblName = table name fro you database. // ** $dropListName = name to be assigned on select. // ** $rowValue1 = rows from the table fields to be assign to option. // ** $rowValue2 = rows from the table fields to be assign to drop list. // ** $vCheck = given parameter to be checked from the list. // ** $orderBy = select given field name to be order. // ** $asc = assign DESC for descending display or blank for default ascending order. // ** $name ################################################################################ ## Creating & Calling ## ---------------------------------------------------------------------------- ?>
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 nota.NOT_COD,' .'nota.EST_COD,' .'nota.MAT_COD,' .'nota.NOTA01,' .'nota.NOTA02,' .'nota.NOTA03,' .'nota.NOTA04,' .'nota.NOTA05,' .'nota.NOTA06,' .'nota.NOTA07,' .'nota.NOTA08,' .'nota.NOTA09,' .'nota.NOTA10,' .'estudiante.EST_COD,' .'estudiante.SEC_COD,' .'estudiante.LEC_COD,' .'estudiante.EST_RET,' .'maestro.MAE_CED,' .'maestro.MAE_NOM,' .'paralelo.PAR_DES,' .'curso.CUR_DES,' .'paralelo.PAR_DES,' .'seccion.SEC_DES,' .'materia.MAT_DES,' .'round((nota.NOTA01+nota.NOTA02+nota.NOTA03)/3) as NOTA1T,' .'round((nota.NOTA04+nota.NOTA05+nota.NOTA06)/3) as NOTA2T,' .'round((nota.NOTA07+nota.NOTA08+nota.NOTA09)/3) as NOTA3T,' .'round((nota.NOTA01+nota.NOTA02+nota.NOTA03)/3)+ round((nota.NOTA04+nota.NOTA05+nota.NOTA06)/3)+ round((nota.NOTA07+nota.NOTA08+nota.NOTA09)/3)as SUMA,' .'lectivo.LEC_DES from nota ' .'left join estudiante using (EST_COD) ' .'left join maestro using (MAE_CED) ' .'left join curso using (CUR_COD) ' .'left join paralelo using (PAR_COD) ' .'left join seccion using (SEC_COD) ' .'left join materia using (MAT_COD) ' .'left join lectivo using (LEC_COD) ' ."where lectivo.LEC_DES='".$f__ff_lectivo_LEC_DES."' AND maestro.MAE_CED ='".$f__ff_maestro_MAE_CED."' AND materia.MAT_DES <> 'DISCIPLINA'"; ## *** 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 = "f_"; /* prevent overlays - must be started with a letter */ $dgrid = new DataGrid($debug_mode, $messaging, $unique_prefix, DATAGRID_DIR); ## *** set data source with needed options if (isset ($layouts)) { $default_order_field = ""; $default_order_type = "DESC"; $dgrid->dataSource($db_conn, $sql, $default_order_field, $default_order_type); } else { $default_order_field = ""; $default_order_type = "DESC"; $dgrid->dataSource($db_conn, $sql, $default_order_field, $default_order_type); } ## ## ## +---------------------------------------------------------------------------+ ## | 2. General Settings: | ## +---------------------------------------------------------------------------+ ## *** set encoding and collation (default: utf8/utf8_unicode_ci) $dg_encoding = "latin1"; $dg_collation = "latin1_spanish_ci"; $dgrid->setEncoding($dg_encoding, $dg_collation); ## *** 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 $dg_language = "es"; $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) $layouts = array("view"=>"0", "edit"=>"1", "details"=>"2", "filter"=>"1"); $layouts = array("view"=>"0", "edit"=>"0", "details"=>"1", "filter"=>"1"); $dgrid->setLayouts($layouts); $details_template = "
{PROF_DES}
Profesor: {PROF_DES}
Materia: {mat_des}
Curso: {CUR_DES}
Paralelo: {PAR_DES}
Seccion: {SEC_DES}




"; $details_template = "
{PROF_DES}
Profesor: {PROF_DES}
Materia: {MAT_DES}
Curso: {CUR_DES}
Paralelo: {PAR_DES}
Seccion: {SEC_DES}




"; // $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"), // "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 mulirow operations $multirow_option = false; $dgrid->allowMultirowOperations($multirow_option); $multirow_operations = array( "delete" => array("view"=>true), "edit" => array("view"=>true), "details" => array("view"=>true), "crearn" => array("view"=>true, "flag_name"=>"my_flag_name", "flag_value"=>"my_flag_value", "tooltip"=>"crear reporte", "image"=>"update.gif") ); $dgrid->setMultirowOperations($multirow_operations); ## *** set CSS class for datagrid ## *** "default" or "blue" or "gray" or "green" or your css file relative path with name $css_class = isset($_REQUEST['skin']) ? $_REQUEST['skin'] : "default"; if($css_class == "") $css_class = "default"; ## "embedded" - use embedded classes, "file" - link external css file $css_type = "embedded"; $dgrid->setCssClass($css_class, $css_type); $hide=true; $dgrid->setHide($hide); ## *** set variables that used to get access to the page (like: my_page.php?act=34&id=56 etc.) $valid_anio1=$valid_anio; $http_get_vars = array("skin","valid_anio1"); $dgrid->setHttpGetVars($http_get_vars); ## *** set other datagrid/s unique prefixes (if you use few datagrids on one page) ## *** format (in wich mode to allow processing of another datagrids) ## *** array("unique_prefix"=>array("view"=>true|false, "edit"=>true|false, "details"=>true|false)); $anotherDatagrids = array("fp_"=>array("view"=>false, "edit"=>true, "details"=>false)); $dgrid->setAnotherDatagrids($anotherDatagrids); ## *** set DataGrid caption //  $sql1="select * from maestro where MAE_CED ='".$f__ff_maestro_MAE_CED."'"; //echo $sql1."
"; $result1 = mysql_db_query("notas",$sql1); $materia = mysql_fetch_array($result1); $cnombre=$materia["MAE_NOM"]; echo "
".$cnombre."
"; $dg_caption = '
NOTAS
'; $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 $exporting_option = true; $dgrid->allowExporting($exporting_option); ## ## ## +---------------------------------------------------------------------------+ ## | 4. Sorting & Paging Settings: | ## +---------------------------------------------------------------------------+ ## *** set sorting option: true(default) or false $sorting_option = false; $dgrid->allowSorting($sorting_option); ## *** set paging option: true(default) or false $paging_option = false; $rows_numeration = true; $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(); //$pages_array = array("10"=>"10", "25"=>"25", "50"=>"50", "100"=>"100", "250"=>"250", "500"=>"500", "1000"=>"1000"); $pages_array = array(); $default_page_size = 20; $dgrid->setPagingSettings($bottom_paging, $top_paging, $pages_array, $default_page_size); ## ## ## +---------------------------------------------------------------------------+ ## | 5. Filter Settings: | ## +---------------------------------------------------------------------------+ ## *** set filtering option: true or false(default) $filtering_option = true; $dgrid->allowFiltering($filtering_option,false); ## *** set aditional filtering settings $fill_from_array = array("10000"=>"10000", "250000"=>"250000", "5000000"=>"5000000", "25000000"=>"25000000", "100000000"=>"100000000"); $filtering_fields = array( // "Curso" =>array("table"=>"curso", "field"=>"CUR_DES", "source"=>"self", "operator"=>true, "default_operator"=>"=", "type"=>"dropdownlist", "case_sensitive"=>true, "comparison_type"=>"string"), // "Paralelo" =>array("table"=>"paralelo","field"=>"PAR_DES", "source"=>"self", "order"=>"ASC", "operator"=>true, "type"=>"dropdownlist", "case_sensitive"=>false, "comparison_type"=>"binary"), // "Sección" =>array("table"=>"seccion", "field"=>"SEC_DES", "source"=>"self", "order"=>"DESC", "operator"=>true, "type"=>"dropdownlist", "case_sensitive"=>false, "comparison_type"=>"binary"), // "Materia" =>array("table"=>"materia", "field"=>"MAT_DES", "source"=>"self", "order"=>"ASC", "operator"=>true, "type"=>"dropdownlist", "case_sensitive"=>false, "comparison_type"=>"binary"), "Año Lectivo" =>array("table"=>"lectivo", "field"=>"LEC_DES", "source"=>"self", "operator"=>false, "default_operator"=>"=", "type"=>"dropdownlist", "case_sensitive"=>true, "comparison_type"=>"string"), "Cédula Estudiante" =>array("table"=>"maestro", "field"=>"MAE_CED", "source"=>"self", "operator"=>false, "default_operator"=>"=", "type"=>"textbox", "case_sensitive"=>true, "comparison_type"=>"string") // "Lectivo" =>array("table"=>"lectivo", "field"=>"LEC_DES", "source"=>"self", "order"=>"DESC", "operator"=>true, "type"=>"dropdownlist", "case_sensitive"=>false, "comparison_type"=>"binary") // "Date" =>array("table"=>"countries", "field"=>"independent_date", "source"=>"self", "operator"=>true, "type"=>"textbox", "case_sensitive"=>false, "comparison_type"=>"string"), // "Population" =>array("table"=>"countries", "field"=>"population", "source"=>$fill_from_array, "order"=>"DESC", "operator"=>true, "type"=>"dropdownlist", "case_sensitive"=>false, "comparison_type"=>"numeric") ); $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 $vm_colimns = array( "MAT_DES" =>array("header"=>"Materia", "type"=>"label", "width"=>"80px","summarize"=>false, "align"=>"left", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal"), "NOTA01" =>array("header"=>"Sep", "type"=>"label", "width"=>"5px","summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"2", "case"=>"normal"), "NOTA02" =>array("header"=>"Oct", "type"=>"label", "width"=>"5px","summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"2", "case"=>"normal"), "NOTA03" =>array("header"=>"Nov", "type"=>"label", "width"=>"5px","summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"2", "case"=>"normal"), "NOTA1T" =>array("header"=>"1T", "type"=>"label", "width"=>"5px","summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"2", "case"=>"normal"), "NOTA04" =>array("header"=>"Ene", "type"=>"label", "summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal"), "NOTA05" =>array("header"=>"Feb", "type"=>"label", "summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal"), "NOTA06" =>array("header"=>"Mar", "type"=>"label", "summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal"), "NOTA2T" =>array("header"=>"2T", "type"=>"label", "width"=>"5px","summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"2", "case"=>"normal"), "NOTA07" =>array("header"=>"Abr", "type"=>"label", "summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal"), "NOTA08" =>array("header"=>"May", "type"=>"label", "summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal"), "NOTA09" =>array("header"=>"Jun", "type"=>"label", "summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal"), "NOTA3T" =>array("header"=>"3T", "type"=>"label", "width"=>"5px","summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"2", "case"=>"normal"), "SUMA" =>array("header"=>"SUM", "type"=>"label", "width"=>"5px","summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"2", "case"=>"normal"), "NOTA10" =>array("header"=>"Sup", "type"=>"label", "summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal") ); $dgrid->setColumnsInViewMode($vm_colimns); ## ## ## +---------------------------------------------------------------------------+ ## | 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 = "nota,estudiante,maestro,materia"; $primary_key = "NOT_COD"; if ($f__ff_curso_CUR_DES>""){ $cond_cur=" AND CUR_DES='".$f__ff_curso_CUR_DES."' AND estudiante.CUR_COD = curso.CUR_COD"; $table_name_cur = ",curso"; } else { $cond_cur=""; } if ($f__ff_paralelo_PAR_DES>""){ $cond_par=" AND PAR_DES='".$f__ff_paralelo_PAR_DES."' AND estudiante.PAR_COD = paralelo.PAR_COD"; $table_name_par = ",paralelo"; } else { $cond_par=""; } if ($f__ff_seccion_SEC_DES>""){ $cond_sec=" AND SEC_DES='".$f__ff_seccion_SEC_DES."' AND estudiante.SEC_COD = seccion.SEC_COD"; $table_name_sec= ",seccion"; } else { $cond_sec=""; } if ($f__ff_materia_MAT_DES>""){ $cond_mat=" AND MAT_DES='".$f__ff_materia_MAT_DES."'"; } else { $cond_mat=""; } if ($f__ff_maestro_MAE_NOM>""){ $cond_mae=" AND maestro.MAE_NOM ='".$f__ff_maestro_MAE_NOM."'"; $cond_cur=""; $cond_par=""; $cond_sec=""; $table_name_cur=""; $table_name_par=""; $table_name_sec=""; } else { $cond_mae=""; } //echo $f__ff_paralelo_PAR_DES; //echo $f__ff_seccion_SEC_DES; //echo $f__ff_materia_MAT_DES; $condition = "nota.EST_COD = estudiante.EST_COD AND estudiante.MAE_CED = maestro.MAE_CED and estudiante.LEC_COD =".$valid_anio; $condition .= " AND nota.MAT_COD = materia.MAT_COD"; //$condition .= " AND MAT_DES='".$f__ff_materia_MAT_DES."'"; //$condition .= " AND CUR_DES='".$f__ff_curso_CUR_DES."'"; //$condition .= " AND PAR_DES='".$f__ff_paralelo_PAR_DES."'"; //$condition .= " AND SEC_DES='".$f__ff_seccion_SEC_DES."'"; //$condition .= " AND estudiante.CUR_COD = curso.CUR_COD"; //$condition .= " AND estudiante.PAR_COD = paralelo.PAR_COD"; //$condition .= " AND estudiante.SEC_COD = seccion.SEC_COD"; $condition .= $cond_mat; $condition .= $cond_cur; $condition .= $cond_par; $condition .= $cond_sec; $condition .= $cond_mae; $table_name .= $table_name_cur; $table_name .= $table_name_par; $table_name .= $table_name_sec; //$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 ## *** 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)|image|password|enum|print|checkbox ## *** make sure your WYSIWYG dir has 755 permissions $fill_from_array = array(" "=>" ","20"=>"20","19"=>"19","18"=>"18","17"=>"17","16"=>"16","15"=>"15","14"=>"14","13"=>"13","12"=>"12","11"=>"11","10"=>"10","09"=>"09","08"=>"08","07"=>"07","06"=>"06","05"=>"05","04"=>"04","03"=>"03","02"=>"02","01"=>"01"); $em_columns = array( "NOT_COD" =>array("header"=>"Codigo", "type"=>"hidden", "width"=>"10px", "req_type"=>"ry", "title"=>"Codigo","unique"=>false,"view_type"=>"textbox","readonly"=>true), "MAT_COD" =>array("header"=>"Materia", "type"=>"hidden", "width"=>"10px", "req_type"=>"ry", "title"=>"Estudiante","unique"=>false,"view_type"=>"textbox","readonly"=>true), "MAE_NOM" =>array("header"=>"Nombre", "type"=>"hidden", "width"=>"160px", "req_type"=>"ry", "title"=>"Nombre","unique"=>false,"unique_condition"=>"nota.EST_COD=estudiante.EST_COD and estudiante.MAE_CED=maestro.MAE_CED","view_type"=>"textbox","readonly"=>true), "MAT_DES" =>array("header"=>"Materia", "type"=>"textbox", "width"=>"60px", "req_type"=>"ry", "title"=>"Materia","unique"=>false,"view_type"=>"textbox","readonly"=>true), "NOTA01" =>array("header"=>"Sep", "type"=>"enum", "width"=>"20px", "req_type"=>"rt", "title"=>"Sep.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA02" =>array("header"=>"Oct", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Oct.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA03" =>array("header"=>"Nov", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Nov.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA04" =>array("header"=>"Ene", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Ene.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA05" =>array("header"=>"Feb", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Feb.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA06" =>array("header"=>"Mar", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Mar.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA07" =>array("header"=>"Abr", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Abr.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA08" =>array("header"=>"May", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"May.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA09" =>array("header"=>"Jun", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Jun.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA10" =>array("header"=>"Sup", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Sup.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array) // "LEC_COD" =>array("header"=>"LECTIVO", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Lectivo", "unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array,"readonly"=>false), // "CUR_COD" =>array("header"=>"curso", "type"=>"textbox", "width"=>"210px", "req_type"=>"rt", "title"=>"Curso", "edit_type"=>"wysiwyg", "rows"=>"7", "cols"=>"50","view_type"=>"dropdownlist"), // "PAR_COD" =>array("header"=>"paralelo", "type"=>"textbox", "width"=>"139px", "req_type"=>"rt", "title"=>"Paralelo","view_type"=>"dropdownlist"), // "SEC_COD" =>array("header"=>"seccion", "type"=>"textbox", "req_type"=>"rt", "width"=>"210px", "title"=>"Seccion", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "on_js_event"=>"", "target_path"=>"uploads/", "max_file_size"=>"100K", "image_width"=>"100px", "image_height"=>"100px", "file_name"=>"", "host"=>"local","view_type"=>"dropdownlist"), // "EST_RET" =>array("header"=>"retirado", "type"=>"textbox", "req_type"=>"st", "width"=>"210px", "title"=>"Retirado", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "on_js_event"=>"", "target_path"=>"uploads/", "max_file_size"=>"100K", "image_width"=>"100px", "image_height"=>"100px", "file_name"=>"", "host"=>"local","view_type"=>"textbox") // "is_democracy" =>array("header"=>"Is Democracy", "type"=>"checkbox", "true_value"=>1, "false_value"=>0, "width"=>"210px", "req_type"=>"sy", "title"=>"Is Democraty"), // "independent_date" =>array("header"=>"Independence Day", "type"=>"date", "width"=>"210px", "req_type"=>"rt", "title"=>"Independence Day"), // "independent_time" =>array("header"=>"Independence Time", "type"=>"time", "width"=>"210px", "req_type"=>"rt", "title"=>"Independence Time") ); $dgrid->setColumnsInEditMode($em_columns); ## *** set auto-genereted eName_1.FieldName > 'a' AND TableName_1.FieldName < 'c'" ## *** Ex.: "on_js_event"=>"onclick='alert(\"Yes!!!\");'" //SELECT estudiante.EST_COD, maestro.MAE_NOM, estudiante. * , maestro. * //FROM estudiante, maestro //WHERE 1 =1 //AND LEC_COD =1 //AND maestro.MAE_CED = estudiante.MAE_CED //ORDER BY maestro.MAE_NOM ASC //LIMIT 0 , 30 $foreign_keys = array( // "unico"=>array("table"=>"estudiante", "field_key"=>"MAE_CED", "field_name"=>"MAE_NOM", "view_type"=>"dropdownlist", "order_by_field"=>"MAE_NOM", "order_type"=>"ASC"), // "EST_COD"=>array("table"=>"estudiante", "field_key"=>"EST_COD", "field_name"=>"EST_COD", "view_type"=>"dropdownlist", "order_by_field"=>"EST_COD", "order_type"=>"ASC","condition"=>"LEC_COD=".$valid_anio), // "EST_COD"=>array("table"=>"estudiante,maestro", "field_key"=>"estudiante.EST_COD", "field_name"=>"maestro.MAE_NOM", "view_type"=>"dropdownlist", "order_by_field"=>"maestro.MAE_NOM", "order_type"=>"ASC","condition"=>"estudiante.LEC_COD=".$valid_anio." AND maestro.MAE_CED = estudiante.MAE_CED"), "MAT_COD"=>array("table"=>"materia", "field_key"=>"MAT_COD", "field_name"=>"MAT_DES", "view_type"=>"dropdownlist", "order_by_field"=>"MAT_DES", "order_type"=>"ASC") // "CUR_COD"=>array("table"=>"curso", "field_key"=>"CUR_COD", "field_name"=>"CUR_DES", "view_type"=>"dropdownlist", "order_by_field"=>"CUR_DES", "order_type"=>"ASC"), // "PAR_COD"=>array("table"=>"paralelo", "field_key"=>"PAR_COD", "field_name"=>"PAR_DES", "view_type"=>"dropdownlist", "order_by_field"=>"PAR_DES", "order_type"=>"ASC"), // "SEC_COD"=>array("table"=>"seccion", "field_key"=>"SEC_COD", "field_name"=>"SEC_DES", "view_type"=>"dropdownlist", "order_by_field"=>"SEC_DES", "order_type"=>"ASC") ); // $dgrid->setForeignKeysEdit($foreign_keys); ## ## ## +---------------------------------------------------------------------------+ ## | 8. Bind the DataGrid: | ## +---------------------------------------------------------------------------+ ## *** bind the DataGrid and draw it on the screen $dgrid->bind(); ob_end_flush(); ## ################################################################################ //segundo datagrid ob_start(); $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 nota.NOT_COD,' .'nota.EST_COD,' .'nota.MAT_COD,' .'nota.NOTA01,' .'nota.NOTA02,' .'nota.NOTA03,' .'nota.NOTA04,' .'nota.NOTA05,' .'nota.NOTA06,' .'nota.NOTA07,' .'nota.NOTA08,' .'nota.NOTA09,' .'nota.NOTA10,' .'estudiante.EST_COD,' .'estudiante.SEC_COD,' .'estudiante.LEC_COD,' .'estudiante.EST_RET,' .'maestro.MAE_CED,' .'maestro.MAE_NOM,' .'paralelo.PAR_DES,' .'curso.CUR_DES,' .'paralelo.PAR_DES,' .'seccion.SEC_DES,' .'materia.MAT_DES,' // .'round((nota.NOTA01+nota.NOTA02+nota.NOTA03)/3) as NOTA1T,' // .'round((nota.NOTA04+nota.NOTA05+nota.NOTA06)/3) as NOTA2T,' // .'round((nota.NOTA07+nota.NOTA08+nota.NOTA09)/3) as NOTA3T,' .'nota.NOTA03+nota.NOTA06+nota.NOTA09 as SUMA,' .'lectivo.LEC_DES from nota ' .'left join estudiante using (EST_COD) ' .'left join maestro using (MAE_CED) ' .'left join curso using (CUR_COD) ' .'left join paralelo using (PAR_COD) ' .'left join seccion using (SEC_COD) ' .'left join materia using (MAT_COD) ' .'left join lectivo using (LEC_COD) ' ."where lectivo.LEC_DES='".$f__ff_lectivo_LEC_DES."' AND maestro.MAE_CED ='".$f__ff_maestro_MAE_CED."' AND materia.MAT_DES = 'DISCIPLINA'"; ## *** 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 = "f_"; /* prevent overlays - must be started with a letter */ $dgrid1 = new DataGrid($debug_mode, $messaging, $unique_prefix, DATAGRID_DIR); ## *** set data source with needed options if (isset ($layouts)) { $default_order_field = ""; $default_order_type = "DESC"; $dgrid1->dataSource($db_conn, $sql, $default_order_field, $default_order_type); } else { $default_order_field = ""; $default_order_type = "DESC"; $dgrid1->dataSource($db_conn, $sql, $default_order_field, $default_order_type); } ## ## ## +---------------------------------------------------------------------------+ ## | 2. General Settings: | ## +---------------------------------------------------------------------------+ ## *** set encoding and collation (default: utf8/utf8_unicode_ci) $dg_encoding = "latin1"; $dg_collation = "latin1_spanish_ci"; $dgrid1->setEncoding($dg_encoding, $dg_collation); ## *** 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 $dg_language = "es"; $dgrid1->setInterfaceLang($dg_language); ## *** set direction: "ltr" or "rtr" (default - "ltr") $direction = "ltr"; $dgrid1->setDirection($direction); ## *** set layouts: 0 - tabular(horizontal) - default, 1 - columnar(vertical) $layouts = array("view"=>"0", "edit"=>"1", "details"=>"2", "filter"=>"1"); $layouts = array("view"=>"0", "edit"=>"0", "details"=>"1", "filter"=>"1"); $dgrid1->setLayouts($layouts); $details_template = "
{PROF_DES}
Profesor: {PROF_DES}
Materia: {mat_des}
Curso: {CUR_DES}
Paralelo: {PAR_DES}
Seccion: {SEC_DES}




"; $details_template = "
{PROF_DES}
Profesor: {PROF_DES}
Materia: {MAT_DES}
Curso: {CUR_DES}
Paralelo: {PAR_DES}
Seccion: {SEC_DES}




"; // $dgrid1->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"), // "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") ); $dgrid1->setModes($modes); ## *** allow scrolling on datagrid /// $scrolling_option = false; /// $dgrid1->allowScrollingSettings($scrolling_option); ## *** set scrolling settings (optional) /// $scrolling_width = "90%"; /// $scrolling_height = "100%"; /// $dgrid1->setScrollingSettings($scrolling_width, $scrolling_height); ## *** allow mulirow operations $multirow_option = false; $dgrid1->allowMultirowOperations($multirow_option); $multirow_operations = array( "delete" => array("view"=>true), "edit" => array("view"=>true), "details" => array("view"=>true), "crearn" => array("view"=>true, "flag_name"=>"my_flag_name", "flag_value"=>"my_flag_value", "tooltip"=>"crear reporte", "image"=>"update.gif") ); $dgrid1->setMultirowOperations($multirow_operations); ## *** set CSS class for datagrid ## *** "default" or "blue" or "gray" or "green" or your css file relative path with name $css_class = isset($_REQUEST['skin']) ? $_REQUEST['skin'] : "default"; if($css_class == "") $css_class = "default"; ## "embedded" - use embedded classes, "file" - link external css file $css_type = "embedded"; $dgrid1->setCssClass($css_class, $css_type); $hide=true; $dgrid1->setHide($hide); ## *** set variables that used to get access to the page (like: my_page.php?act=34&id=56 etc.) $valid_anio1=$valid_anio; $http_get_vars = array("skin","valid_anio1"); $dgrid1->setHttpGetVars($http_get_vars); ## *** set other datagrid/s unique prefixes (if you use few datagrids on one page) ## *** format (in wich mode to allow processing of another datagrids) ## *** array("unique_prefix"=>array("view"=>true|false, "edit"=>true|false, "details"=>true|false)); $anotherDatagrids = array("f_"=>array("view"=>false, "edit"=>true, "details"=>false)); $dgrid1->setAnotherDatagrids($anotherDatagrids); ## *** set DataGrid caption //  $dg_caption = '

DISCIPLINA

'; // $dgrid1->setCaption($dg_caption); ## ## +---------------------------------------------------------------------------+ ## | 3. Printing & Exporting Settings: | ## +---------------------------------------------------------------------------+ ## *** set printing option: true(default) or false $printing_option = false; $dgrid1->allowPrinting($printing_option); ## *** set exporting option: true(default) or false $exporting_option = false; $dgrid1->allowExporting($exporting_option); ## ## ## +---------------------------------------------------------------------------+ ## | 4. Sorting & Paging Settings: | ## +---------------------------------------------------------------------------+ ## *** set sorting option: true(default) or false $sorting_option = false; $dgrid1->allowSorting($sorting_option); ## *** set paging option: true(default) or false $paging_option = false; $rows_numeration = false; $numeration_sign = "N.-"; $dgrid1->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(); //$pages_array = array("10"=>"10", "25"=>"25", "50"=>"50", "100"=>"100", "250"=>"250", "500"=>"500", "1000"=>"1000"); $pages_array = array(); $default_page_size = 1; $dgrid1->setPagingSettings($bottom_paging, $top_paging, $pages_array, $default_page_size); ## ## ## +---------------------------------------------------------------------------+ ## | 5. Filter Settings: | ## +---------------------------------------------------------------------------+ ## *** set filtering option: true or false(default) $filtering_option = false; $dgrid1->allowFiltering($filtering_option); ## *** set aditional filtering settings $fill_from_array = array("10000"=>"10000", "250000"=>"250000", "5000000"=>"5000000", "25000000"=>"25000000", "100000000"=>"100000000"); $filtering_fields = array( // "Curso" =>array("table"=>"curso", "field"=>"CUR_DES", "source"=>"self", "operator"=>true, "default_operator"=>"=", "type"=>"dropdownlist", "case_sensitive"=>true, "comparison_type"=>"string"), // "Paralelo" =>array("table"=>"paralelo","field"=>"PAR_DES", "source"=>"self", "order"=>"ASC", "operator"=>true, "type"=>"dropdownlist", "case_sensitive"=>false, "comparison_type"=>"binary"), // "Sección" =>array("table"=>"seccion", "field"=>"SEC_DES", "source"=>"self", "order"=>"DESC", "operator"=>true, "type"=>"dropdownlist", "case_sensitive"=>false, "comparison_type"=>"binary"), // "Materia" =>array("table"=>"materia", "field"=>"MAT_DES", "source"=>"self", "order"=>"ASC", "operator"=>true, "type"=>"dropdownlist", "case_sensitive"=>false, "comparison_type"=>"binary"), "Año Lectivo" =>array("table"=>"lectivo", "field"=>"LEC_DES", "source"=>"self", "operator"=>false, "default_operator"=>"=", "type"=>"dropdownlist", "case_sensitive"=>true, "comparison_type"=>"string"), "Estudiante" =>array("table"=>"maestro", "field"=>"MAE_NOM", "source"=>"self", "operator"=>false, "default_operator"=>"=", "type"=>"textbox", "case_sensitive"=>true, "comparison_type"=>"string") // "Lectivo" =>array("table"=>"lectivo", "field"=>"LEC_DES", "source"=>"self", "order"=>"DESC", "operator"=>true, "type"=>"dropdownlist", "case_sensitive"=>false, "comparison_type"=>"binary") // "Date" =>array("table"=>"countries", "field"=>"independent_date", "source"=>"self", "operator"=>true, "type"=>"textbox", "case_sensitive"=>false, "comparison_type"=>"string"), // "Population" =>array("table"=>"countries", "field"=>"population", "source"=>$fill_from_array, "order"=>"DESC", "operator"=>true, "type"=>"dropdownlist", "case_sensitive"=>false, "comparison_type"=>"numeric") ); $dgrid1->setFieldsFiltering($filtering_fields); ## ## ## +---------------------------------------------------------------------------+ ## | 6. View Mode Settings: | ## +---------------------------------------------------------------------------+ ## *** set view mode table properties /// $vm_table_properties = array("width"=>"90%"); /// $dgrid1->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 $vm_colimns = array( "MAT_DES" =>array("header"=>"Materia", "type"=>"label", "width"=>"80px","summarize"=>false, "align"=>"left", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal"), "NOTA01" =>array("header"=>"Faltas J. 1Trim", "type"=>"label", "summarize"=>false, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"2", "case"=>"normal"), "NOTA02" =>array("header"=>"Faltas I. 1Trim", "type"=>"label", "summarize"=>false, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"2", "case"=>"normal"), "NOTA03" =>array("header"=>"Prom. 1Trim", "type"=>"label", "width"=>"5px","summarize"=>false, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"2", "case"=>"normal"), // "NOTA1T" =>array("header"=>"1T", "type"=>"label", "width"=>"5px","summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"2", "case"=>"normal"), "NOTA04" =>array("header"=>"Faltas J. 2Trim", "type"=>"label", "summarize"=>false, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal"), "NOTA05" =>array("header"=>"Faltas I. 2Trim", "type"=>"label", "summarize"=>false, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal"), "NOTA06" =>array("header"=>"Prom. 2Trim", "type"=>"label", "width"=>"5px","summarize"=>false, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal"), // "NOTA2T" =>array("header"=>"1T", "type"=>"label", "width"=>"5px","summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"2", "case"=>"normal"), "NOTA07" =>array("header"=>"Faltas J. 3Trim", "type"=>"label", "summarize"=>false, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal"), "NOTA08" =>array("header"=>"Faltas I. 3Trim", "type"=>"label", "summarize"=>false, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal"), "NOTA09" =>array("header"=>"Prom 3Trim", "type"=>"label", "width"=>"5px","summarize"=>false, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal"), // "NOTA3T" =>array("header"=>"3T", "type"=>"label", "width"=>"5px","summarize"=>true, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"2", "case"=>"normal"), "SUMA" =>array("header"=>"SUM", "type"=>"label", "width"=>"5px","summarize"=>false, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"2", "case"=>"normal"), "NOTA10" =>array("header"=>"Sup", "type"=>"label", "summarize"=>false, "align"=>"right", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal") ); $dgrid1->setColumnsInViewMode($vm_colimns); ## ## ## +---------------------------------------------------------------------------+ ## | 7. Add/Edit/Details Mode Settings: | ## +- --------------------------------------------------------------------------+ ## *** set add/edit mode table properties /// $em_table_properties = array("width"=>"70%"); /// $dgrid1->setEditModeTableProperties($em_table_properties); ## *** set details mode table properties /// $dm_table_properties = array("width"=>"70%"); /// $dgrid1->setDetailsModeTableProperties($dm_table_properties); ## *** set settings for add/edit/details modes $table_name = "nota,estudiante,maestro,materia"; $primary_key = "NOT_COD"; if ($f__ff_curso_CUR_DES>""){ $cond_cur=" AND CUR_DES='".$f__ff_curso_CUR_DES."' AND estudiante.CUR_COD = curso.CUR_COD"; $table_name_cur = ",curso"; } else { $cond_cur=""; } if ($f__ff_paralelo_PAR_DES>""){ $cond_par=" AND PAR_DES='".$f__ff_paralelo_PAR_DES."' AND estudiante.PAR_COD = paralelo.PAR_COD"; $table_name_par = ",paralelo"; } else { $cond_par=""; } if ($f__ff_seccion_SEC_DES>""){ $cond_sec=" AND SEC_DES='".$f__ff_seccion_SEC_DES."' AND estudiante.SEC_COD = seccion.SEC_COD"; $table_name_sec= ",seccion"; } else { $cond_sec=""; } if ($f__ff_materia_MAT_DES>""){ $cond_mat=" AND MAT_DES='".$f__ff_materia_MAT_DES."'"; } else { $cond_mat=""; } if ($f__ff_maestro_MAE_NOM>""){ $cond_mae=" AND maestro.MAE_NOM ='".$f__ff_maestro_MAE_NOM."'"; $cond_cur=""; $cond_par=""; $cond_sec=""; $table_name_cur=""; $table_name_par=""; $table_name_sec=""; } else { $cond_mae=""; } //echo $f__ff_paralelo_PAR_DES; //echo $f__ff_seccion_SEC_DES; //echo $f__ff_materia_MAT_DES; $condition = "nota.EST_COD = estudiante.EST_COD AND estudiante.MAE_CED = maestro.MAE_CED and estudiante.LEC_COD =".$valid_anio; $condition .= " AND nota.MAT_COD = materia.MAT_COD"; //$condition .= " AND MAT_DES='".$f__ff_materia_MAT_DES."'"; //$condition .= " AND CUR_DES='".$f__ff_curso_CUR_DES."'"; //$condition .= " AND PAR_DES='".$f__ff_paralelo_PAR_DES."'"; //$condition .= " AND SEC_DES='".$f__ff_seccion_SEC_DES."'"; //$condition .= " AND estudiante.CUR_COD = curso.CUR_COD"; //$condition .= " AND estudiante.PAR_COD = paralelo.PAR_COD"; //$condition .= " AND estudiante.SEC_COD = seccion.SEC_COD"; $condition .= $cond_mat; $condition .= $cond_cur; $condition .= $cond_par; $condition .= $cond_sec; $condition .= $cond_mae; $table_name .= $table_name_cur; $table_name .= $table_name_par; $table_name .= $table_name_sec; //$condition = ""; $dgrid1->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 ## *** 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)|image|password|enum|print|checkbox ## *** make sure your WYSIWYG dir has 755 permissions $fill_from_array = array(" "=>" ","20"=>"20","19"=>"19","18"=>"18","17"=>"17","16"=>"16","15"=>"15","14"=>"14","13"=>"13","12"=>"12","11"=>"11","10"=>"10","09"=>"09","08"=>"08","07"=>"07","06"=>"06","05"=>"05","04"=>"04","03"=>"03","02"=>"02","01"=>"01"); $em_columns = array( "NOT_COD" =>array("header"=>"Codigo", "type"=>"hidden", "width"=>"10px", "req_type"=>"ry", "title"=>"Codigo","unique"=>false,"view_type"=>"textbox","readonly"=>true), "MAT_COD" =>array("header"=>"Materia", "type"=>"hidden", "width"=>"10px", "req_type"=>"ry", "title"=>"Estudiante","unique"=>false,"view_type"=>"textbox","readonly"=>true), "MAE_NOM" =>array("header"=>"Nombre", "type"=>"hidden", "width"=>"160px", "req_type"=>"ry", "title"=>"Nombre","unique"=>false,"unique_condition"=>"nota.EST_COD=estudiante.EST_COD and estudiante.MAE_CED=maestro.MAE_CED","view_type"=>"textbox","readonly"=>true), "MAT_DES" =>array("header"=>"Materia", "type"=>"textbox", "width"=>"60px", "req_type"=>"ry", "title"=>"Materia","unique"=>false,"view_type"=>"textbox","readonly"=>true), "NOTA01" =>array("header"=>"Sep", "type"=>"enum", "width"=>"20px", "req_type"=>"rt", "title"=>"Sep.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA02" =>array("header"=>"Oct", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Oct.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA03" =>array("header"=>"Nov", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Nov.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA04" =>array("header"=>"Ene", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Ene.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA05" =>array("header"=>"Feb", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Feb.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA06" =>array("header"=>"Mar", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Mar.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA07" =>array("header"=>"Abr", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Abr.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA08" =>array("header"=>"May", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"May.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA09" =>array("header"=>"Jun", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Jun.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array), "NOTA10" =>array("header"=>"Sup", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Sup.","unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array) // "LEC_COD" =>array("header"=>"LECTIVO", "type"=>"enum", "width"=>"210px", "req_type"=>"rt", "title"=>"Lectivo", "unique"=>false,"view_type"=>"dropdownlist","source"=>$fill_from_array,"readonly"=>false), // "CUR_COD" =>array("header"=>"curso", "type"=>"textbox", "width"=>"210px", "req_type"=>"rt", "title"=>"Curso", "edit_type"=>"wysiwyg", "rows"=>"7", "cols"=>"50","view_type"=>"dropdownlist"), // "PAR_COD" =>array("header"=>"paralelo", "type"=>"textbox", "width"=>"139px", "req_type"=>"rt", "title"=>"Paralelo","view_type"=>"dropdownlist"), // "SEC_COD" =>array("header"=>"seccion", "type"=>"textbox", "req_type"=>"rt", "width"=>"210px", "title"=>"Seccion", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "on_js_event"=>"", "target_path"=>"uploads/", "max_file_size"=>"100K", "image_width"=>"100px", "image_height"=>"100px", "file_name"=>"", "host"=>"local","view_type"=>"dropdownlist"), // "EST_RET" =>array("header"=>"retirado", "type"=>"textbox", "req_type"=>"st", "width"=>"210px", "title"=>"Retirado", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "on_js_event"=>"", "target_path"=>"uploads/", "max_file_size"=>"100K", "image_width"=>"100px", "image_height"=>"100px", "file_name"=>"", "host"=>"local","view_type"=>"textbox") // "is_democracy" =>array("header"=>"Is Democracy", "type"=>"checkbox", "true_value"=>1, "false_value"=>0, "width"=>"210px", "req_type"=>"sy", "title"=>"Is Democraty"), // "independent_date" =>array("header"=>"Independence Day", "type"=>"date", "width"=>"210px", "req_type"=>"rt", "title"=>"Independence Day"), // "independent_time" =>array("header"=>"Independence Time", "type"=>"time", "width"=>"210px", "req_type"=>"rt", "title"=>"Independence Time") ); $dgrid1->setColumnsInEditMode($em_columns); ## *** set auto-genereted eName_1.FieldName > 'a' AND TableName_1.FieldName < 'c'" ## *** Ex.: "on_js_event"=>"onclick='alert(\"Yes!!!\");'" //SELECT estudiante.EST_COD, maestro.MAE_NOM, estudiante. * , maestro. * //FROM estudiante, maestro //WHERE 1 =1 //AND LEC_COD =1 //AND maestro.MAE_CED = estudiante.MAE_CED //ORDER BY maestro.MAE_NOM ASC //LIMIT 0 , 30 $foreign_keys = array( // "unico"=>array("table"=>"estudiante", "field_key"=>"MAE_CED", "field_name"=>"MAE_NOM", "view_type"=>"dropdownlist", "order_by_field"=>"MAE_NOM", "order_type"=>"ASC"), // "EST_COD"=>array("table"=>"estudiante", "field_key"=>"EST_COD", "field_name"=>"EST_COD", "view_type"=>"dropdownlist", "order_by_field"=>"EST_COD", "order_type"=>"ASC","condition"=>"LEC_COD=".$valid_anio), // "EST_COD"=>array("table"=>"estudiante,maestro", "field_key"=>"estudiante.EST_COD", "field_name"=>"maestro.MAE_NOM", "view_type"=>"dropdownlist", "order_by_field"=>"maestro.MAE_NOM", "order_type"=>"ASC","condition"=>"estudiante.LEC_COD=".$valid_anio." AND maestro.MAE_CED = estudiante.MAE_CED"), "MAT_COD"=>array("table"=>"materia", "field_key"=>"MAT_COD", "field_name"=>"MAT_DES", "view_type"=>"dropdownlist", "order_by_field"=>"MAT_DES", "order_type"=>"ASC") // "CUR_COD"=>array("table"=>"curso", "field_key"=>"CUR_COD", "field_name"=>"CUR_DES", "view_type"=>"dropdownlist", "order_by_field"=>"CUR_DES", "order_type"=>"ASC"), // "PAR_COD"=>array("table"=>"paralelo", "field_key"=>"PAR_COD", "field_name"=>"PAR_DES", "view_type"=>"dropdownlist", "order_by_field"=>"PAR_DES", "order_type"=>"ASC"), // "SEC_COD"=>array("table"=>"seccion", "field_key"=>"SEC_COD", "field_name"=>"SEC_DES", "view_type"=>"dropdownlist", "order_by_field"=>"SEC_DES", "order_type"=>"ASC") ); // $dgrid1->setForeignKeysEdit($foreign_keys); ## ## ## +---------------------------------------------------------------------------+ ## | 8. Bind the DataGrid: | ## +---------------------------------------------------------------------------+ ## *** bind the DataGrid and draw it on the screen $dgrid1->bind(); ob_end_flush(); ## ################################################################################ ?>