public function indexAction()
 {
     $content = Bootstrap::row();
     $panel = Bootstrap::panel('My profile');
     $form = BootstrapUI::form()->horizontal(3)->add(Bootstrap::textfield('username', $this->getUser('username'), 'username')->required())->add(Bootstrap::textfield('first_name', $this->getUser('first_name'), 'first name'))->add(Bootstrap::textfield('last_name', $this->getUser('last_name'), 'last name'))->add(Bootstrap::textfield('password', null, 'password')->type('password'))->add(Bootstrap::textfield('password2', null, 'password again')->type('password'))->add(BootstrapUI::select2('timezone', 'time zone', Timezone::$timezones, $this->getUser('timezone')))->addSubmit('Update');
     $panel->content($form);
     $content->add(6, $panel, 3);
     return View::create('base')->with('title', 'My profile')->with('content', $content);
 }
 public static function getLoginForm()
 {
     $container = Bootstrap::container();
     $panel = Bootstrap::panel('Login into ' . Request::hostName())->color('blue');
     $r = Url::controller() == 'index' && Url::action() == 'index' ? '/dashboard/first' : Request::uri();
     $form = BootstrapUI::form(Url::href(''))->add(Bootstrap::hiddenfield('r', base64_encode($r)))->add(Bootstrap::textfield('username', Cookie::get('username'))->placeholder('username')->required())->add(Bootstrap::textfield('pass')->type('password')->placeholder('password')->required())->addSubmit('Login');
     $panel->content($form);
     $container->add(Bootstrap::row()->add(4, $panel, 4))->setAttribute('style', 'margin-top: 20px');
     return $container;
 }
 public function packageAction()
 {
     $content = array();
     $panel = Bootstrap::panel('Filter')->collapsible(true);
     $form = BootstrapUI::form()->horizontal()->add(Bootstrap::textfield('name', null, 'name'))->addSubmit('Filter');
     $panel->content($form);
     $content[] = Bootstrap::row()->add(12, $panel);
     return View::create('base')->with('title', 'Package reports')->with('content', $content);
 }
 /**
  * Get the user form for add/update
  * @param array $values
  */
 private function getUserForm(array $values = null)
 {
     if ($values === null) {
         $values = array('id' => 0, 'username' => null, 'first_name' => null, 'last_name' => null, 'password' => null, 'password2' => null, 'account_type' => 'normal', 'timezone' => 'Europe/London');
     }
     $form = BootstrapUI::form()->horizontal(3)->add(Bootstrap::hiddenfield('id', $values['id']))->add(Bootstrap::textfield('username', $values['username'], 'username'))->add(Bootstrap::textfield('first_name', $values['first_name'], 'first name'))->add(Bootstrap::textfield('last_name', $values['last_name'], 'last name'))->add(Bootstrap::textfield('pass', null, 'password')->type('password'))->add(Bootstrap::textfield('pass2', null, 'password again')->type('password'))->add(Bootstrap::radio('account_type', array('admin' => 'administrator', 'normal' => 'normal user'), 'account type', $values['account_type']))->add(BootstrapUI::select2('timezone', 'timezone', Timezone::$timezones, $values['timezone']))->addSubmit('Submit')->addButton(Bootstrap::anchor('Cancel', Url::href('system', 'users'))->asButton()->color('red'));
     return $form;
 }