예제 #1
0
 function render()
 {
     $model = HC_App::model('location');
     $model->get();
     $options = array();
     foreach ($model as $obj) {
         $options[$obj->id] = $obj->present_title();
     }
     $this->set_options($options);
     return parent::render();
 }
예제 #2
0
파일: time.php 프로젝트: RCMmedia/rubicon
 function __construct($name = '')
 {
     parent::__construct($name);
     // $this->add_attr('class', 'timepicker');
     $start_with = 0;
     $end_with = 24 * 60 * 60;
     /*
     		if( isset($more['conf']['min']) && ($more['conf']['min'] > $start_with) )
     		{
     			$start_with = $more['conf']['min'];
     		}
     		if( isset($more['conf']['max']) && ($more['conf']['max'] < $end_with) )
     		{
     			$end_with = $more['conf']['max'];
     		}
     		unset( $more['conf'] );
     */
     if ($end_with < $start_with) {
         $end_with = $start_with;
     }
     $step = 15 * 60;
     $options = array();
     $t = HC_Lib::time();
     $t->setDateDb(20130118);
     /*
     		if( $value && ($value > $end_with) )
     		{
     			$value = $value - 24 * 60 * 60;
     		}
     */
     if ($start_with) {
         $t->modify('+' . $start_with . ' seconds');
     }
     $no_of_steps = ($end_with - $start_with) / $step;
     for ($ii = 0; $ii <= $no_of_steps; $ii++) {
         $sec = $start_with + $ii * $step;
         $options[$sec] = $t->formatTime();
         $t->modify('+' . $step . ' seconds');
     }
     $this->set_options($options);
 }