Ejemplo n.º 1
0
 public function action_view($id = null)
 {
     $user = \Model_User::find($id);
     if (is_null($user)) {
         \Response::redirect('users');
     }
     $out = Petro::render_panel('User Information', Petro::render_attr_table($user, array('name', 'username', 'email', 'group', 'last_login'), static::_columns()));
     $out .= Petro_Comment::render($this->app, $id);
     $routes = Petro::get_routes($id);
     $this->action_items = array(array('title' => 'Edit User', 'link' => $routes['edit']), array('title' => 'Delete User', 'link' => $routes['delete']));
     $gp = \Auth::group()->get_name($user->group);
     if (\Auth::instance()->is_current_user($id)) {
         $this->sidebars->add('Operations', '<div>' . \Html::anchor('users/change_password', 'Change password') . '<br/>' . \Html::anchor('#', 'Reset password') . '<br/>' . $user->group . ' : ' . $gp . '</div>');
     }
     $this->template->page_title = $user->username;
     $this->template->set('content', $out, false);
 }
Ejemplo n.º 2
0
 /**
  * View
  */
 public function action_view($id = null)
 {
     $docmk = Model_DocMK::find($id);
     $data['docinfo'] = Petro::render_panel('Document Information', $this->display_info($docmk));
     $mk011 = Model_DocMK011::find()->where('mk_id', $docmk->id)->get_one();
     $this->sidebars->add('Client Sales History', 'Total this month' . '<br>Total this year ');
     $this->sidebars->add('Belt History', View::forge('docmk2/flow2', array('docmk' => $docmk, 'mk011' => $mk011)));
     // $this->sidebars->add(
     // 'Belt History',
     // 'วันที่รับ order'.
     // '<br>วันที่สั่งผลิต'.
     // '<br>วันที่ตัด-ประกบ'.
     // '<br>วันที่เคลื่อบผิว'.
     // '<br>วันที่อบ'.
     // '<br>วันที่ QC'.
     // '<br>วันที่จัดส่ง'
     // );
     $routes = Petro::get_routes($id);
     $this->action_items = array(array('title' => 'Print', 'link' => 'print/mk/' . $id, 'attr' => array('target' => '_blank')), array('title' => 'Edit Docmk', 'link' => $routes['edit']), array('title' => 'Delete Docmk', 'link' => $routes['delete']));
     $data['comments'] = Petro_Comment::render($this->app, $id, 'History');
     $this->template->page_title = "MK Info";
     $this->template->content = View::forge('docmk2/view', $data, false);
 }
Ejemplo n.º 3
0
 protected function setup_view(&$data)
 {
     $this->sidebars->add('Render from another View!', View::forge('sidebar_link', array('url' => 'going/anywhere')));
     return Petro_Comment::render($this->app, $data->id);
 }