1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- /**
- * @author darkredz
- */
- class SettingController extends DooController {
-
- public function beforeRun($resource, $action) {
-
- }
-
- function __construct() {
- if (isset ( $_COOKIE ["staff"] )) {
- if (! empty ( $_COOKIE ["staff"] )) {
- Doo::loadModel ( 'staff' );
- $staff = new staff ();
-
- $this->staff = $staff->getUserByIdList ( $_COOKIE ["staff"] );
- return "/";
- }
- }
-
- Doo::loadCore ( 'uri/DooUriRouter' );
- $router = new DooUriRouter ();
- $routeRs = $router->execute ( Doo::app ()->route, Doo::conf ()->SUBFOLDER );
-
- if ($routeRs ['1'] != "login") {
- header ( 'Content-Type:text/html;charset=utf-8' );
- @header ( "Location: /login" );
- }
- }
-
- /**
- * 员工信息
- */
- function settingEmployeeInfo(){
-
- $data ['staff'] = $this->staff;
-
- $birArray = explode ( '-', $this->staff [0] ['birthday'] );
-
- $data ['year'] = $birArray [0];
-
- $year = date ( 'Y' );
- $yearHtml = "";
- for(; $year >= 1900; $year --) {
- $yearHtml .= '<option ';
- if ($data ['year'] == $year)
- $yearHtml .= 'selected';
- $yearHtml .= ' value="' . $year . '">' . $year . '</option>';
- }
- $data ['yearHtml'] = $yearHtml;
- $data ['month'] = 01;
- $data ['day'] = 01;
- if (isset ( $birArray [1] )) {
- $data ['month'] = $birArray [1];
- $data ['day'] = $birArray [2];
- }
- $data ['msg'] = urldecode ( $this->params ['msg'] );
-
-
-
- $this->data ['memu'] = "adminmyinfo";
- $this->data ['hrMemu'] = "settingEmployeeInfo";
-
- $this->render ( "/setting/settingEmployeeInfo", $this->data );
- }
-
-
- /**
- * 获取get或者POST值
- *
- * @param string $name 属性名称
- * @return fixed 值
- */
- function get_args($name) {
- if (isset ( $_GET [$name] )) {
- if (is_array ( $_GET [$name] ))
- return $_GET [$name];
- else
- return addslashes ( $_GET [$name] );
- } elseif (isset ( $_POST [$name] )) {
- if (is_array ( $_POST [$name] ))
- return $_POST [$name];
- else
- return addslashes ( $_POST [$name] );
- } else
- return false;
- }
- }
- ?>
|