~desarrollokumbia/kumbia/0.5

« back to all changes in this revision

Viewing changes to library/kumbia/generator/components.php

  • Committer: Deivinson Tejeda
  • Date: 2009-01-01 20:30:45 UTC
  • Revision ID: deivinsontejeda@gmail.com-20090101203045-q9xgzpp0a6vaomdh
actualizando repositorio launchpad

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
                }
50
50
                Generator::forms_print(">");
51
51
                if(isset($_REQUEST['fl_'.$name])){
52
 
                        Generator::forms_print($_REQUEST['fl_'.$name]);
 
52
                        Generator::forms_print(stripslashes($_REQUEST['fl_'.$name]));
53
53
                }
54
54
                if(!isset($com['extraText'])) {
55
55
                 $com['extraText'] = "";
303
303
                        }
304
304
                        if(isset($com["detail_field"])){
305
305
                                ActiveRecord::sql_sanizite($com["detail_field"]);
 
306
                        } 
 
307
                        if(isset($com["orderBy"])){
 
308
                            ActiveRecord::sql_sanizite($com["orderBy"]);
 
309
                            if(!$com["orderBy"]) $ordb = $name; else $ordb = $com["orderBy"];
 
310
                        } else {
 
311
                            $ordb = $name;
306
312
                        }
307
 
                        ActiveRecord::sql_sanizite($com["orderBy"]);
 
313
                        
308
314
                        ActiveRecord::sql_item_sanizite($com["foreignTable"]);
309
 
                        if(!$com["orderBy"]) $ordb = $name; else $ordb = $com["orderBy"];
310
315
                        $where = "";
311
316
                        if(isset($com['whereCondition'])){
312
317
                                if($com['whereCondition']) {
480
485
         */
481
486
        static function build_time_component($com, $name, $form){
482
487
                $arr = array();
483
 
                if(!$_REQUEST["fl_$name"]&&$com['value']){
484
 
                        $_REQUEST["fl_$name"] = $com['value'];
485
 
                }
486
 
                if($_REQUEST["fl_$name"]){
487
 
                        ereg("([0-2][0-9]):([0-5][0-8])", $_REQUEST["fl_$name"], $arr);
488
 
                }
489
488
                Generator::forms_print("<label for='flid_$name'><strong>".$com['caption']." :</strong></label></td><td>\n");
490
489
                Generator::forms_print("<select name='time{$name}_hour' id='time{$name}_hour'
491
490
                onchange='document.getElementById(\"flid_$name\").value = document.getElementById(\"time{$name}_hour\").options[document.getElementById(\"time{$name}_hour\").selectedIndex].value+\":\"+document.getElementById(\"time{$name}_minutes\").options[document.getElementById(\"time{$name}_minutes\").selectedIndex].value' disabled='disabled'>\n");
492
491
                for($i=0;$i<=23;$i++){
493
 
                        if($arr[1]!=sprintf("%02s", $i)){
494
 
                                Generator::forms_print("<option value='".sprintf("%02s", $i)."'>".sprintf("%02s", $i)."</option>\n");
495
 
                        } else {
496
 
                                Generator::forms_print("<option value='".sprintf("%02s", $i)."' selected='selected'>".sprintf("%02s", $i)."</option>\n");
497
 
                        }
 
492
                        Generator::forms_print("<option value='".sprintf("%02s", $i)."' selected='selected'>".sprintf("%02s", $i)."</option>\n");
498
493
                }
499
494
                Generator::forms_print("</select>:");
500
495
                Generator::forms_print("<select name='time{$name}_minutes' id='time{$name}_minutes'
501
496
                onchange='document.getElementById(\"flid_$name\").value = document.getElementById(\"time{$name}_hour\").options[document.getElementById(\"time{$name}_hour\").selectedIndex].value+\":\"+document.getElementById(\"time{$name}_minutes\").options[document.getElementById(\"time{$name}_minutes\").selectedIndex].value' disabled='disabled'>\n");
502
497
                for($i=0;$i<=59;$i++){
503
 
                        if($arr[2]!=sprintf("%02s", $i)){
504
 
                                Generator::forms_print("<option value='".sprintf("%02s", $i)."'>".sprintf("%02s", $i)."</option>\n");
505
 
                        } else {
506
 
                                Generator::forms_print("<option value='".sprintf("%02s", $i)."' selected='selected'>".sprintf("%02s", $i)."</option>\n");
507
 
                        }
 
498
                        Generator::forms_print("<option value='".sprintf("%02s", $i)."' selected='selected'>".sprintf("%02s", $i)."</option>\n");
508
499
                }
509
500
                Generator::forms_print("</select>");
510
501
                Generator::forms_print("<input type='hidden' name='fl_$name' id='flid_$name' value='00:00' />");