| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 | <?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->getStaffBySid( $_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(){		$this->data ['staff'] = $this->staff;		$this->data ['memu'] = "adminmyinfo";		$this->data ['hrMemu'] = "settingEmployeeInfo";				$this->render ( "/setting/settingEmployeeInfo", $this->data );	}	/**	 * 证件信息	 */	function settingCredentialInfo(){		$this->data ['staff'] = $this->staff;		$this->data ['memu'] = "adminmyinfo";		$this->data ['hrMemu'] = "settingEmployeeInfo";				$this->render ( "/setting/settingCredentialInfo", $this->data );	}	/**	 * 财务信息	 */	function settingFinanceInfo(){		$this->data ['staff'] = $this->staff;		$this->data ['memu'] = "adminmyinfo";		$this->data ['hrMemu'] = "settingEmployeeInfo";				$this->render ( "/setting/settingFinanceInfo", $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;	}}?>
 |