likeku 8 years atrás
parent
commit
a7202ddb68

+ 8 - 0
.idea/cld.iml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/cld.iml" filepath="$PROJECT_DIR$/.idea/cld.iml" />
+    </modules>
+  </component>
+</project>

+ 0 - 56
protected/config/common.conf.php

@@ -1,56 +0,0 @@
-<?php
-/* 
- * Common configuration that can be used throughout the application
- * Please refer to DooConfig class in the API doc for a complete list of configurations
- * Access via Singleton, eg. Doo::conf()->BASE_PATH;
- */
-error_reporting(E_ALL | E_STRICT);
-date_default_timezone_set('Asia/Kuala_Lumpur');
-
-/**
- * for benchmark purpose, call Doo::benchmark() for time used.
- */
-//$config['START_TIME'] = microtime(true);
-
-
-//For framework use. Must be defined. Use full absolute paths and end them with '/'      eg. /var/www/project/
-$config['SITE_PATH'] = realpath('..').'/dongleerp/';
-//$config['PROTECTED_FOLDER'] = 'protected/';
-$config['BASE_PATH'] = realpath('..').'/dooframework/';
-
-//for production mode use 'prod'
-$config['APP_MODE'] = 'dev';
-
-//----------------- optional, if not defined, default settings are optimized for production mode ----------------
-//if your root directory is /var/www/ and you place this in a subfolder eg. 'app', define SUBFOLDER = '/app/'
-
-$config['SUBFOLDER'] = str_replace($_SERVER['DOCUMENT_ROOT'], '', str_replace('\\','/',$config['SITE_PATH']));
-if(strpos($config['SUBFOLDER'], '/')!==0){
-	$config['SUBFOLDER'] = '/'.$config['SUBFOLDER'];
-}
-
-$config['APP_URL'] = 'http://'.$_SERVER['HTTP_HOST'].$config['SUBFOLDER'];
-//$config['AUTOROUTE'] = TRUE;
-$config['DEBUG_ENABLED'] = TRUE;
-
-//$config['TEMPLATE_COMPILE_ALWAYS'] = TRUE;
-
-//register functions to be used with your template files
-//$config['TEMPLATE_GLOBAL_TAGS'] = array('url', 'url2', 'time', 'isset', 'empty');
-
-/**
- * Path to store logs/profiles when using with the logger tool. This is needed for writing log files and using the log viewer tool
- */
-//$config['LOG_PATH'] = '/var/logs/';
-
-
-
-//$config['ERROR_404_DOCUMENT'] = 'error.php';
-$config['ERROR_404_ROUTE'] = '/error';
-
-define ( "WEB_SITE", "http://cld.com" );
-define ( "WEB_SITE_GLOBAL", WEB_SITE . "/global/" );
-define ( "REAL_PATH", realpath ( '..' ) );
-define ( "SITE_PATH", REAL_PATH . "/dongleerp/" );
-
-//$config['pagesize'] = 10;

+ 0 - 7
protected/config/db.conf.php

@@ -1,7 +0,0 @@
-<?php
-
-$dbconfig['dev'] = array('192.168.78.128', 'dongleerp', 'caipin', '123456', 'mysql', true, 'collate'=>'utf8_unicode_ci', 'charset'=>'utf8');
-//$dbconfig['dev'] = array('127.0.0.1', 'dongleerp', 'os', '123456', 'mysql', true, 'collate'=>'utf8_unicode_ci', 'charset'=>'utf8');
-//$dbconfig['dev'] = array('127.0.0.1', 'dongleerp', 'root', 'root', 'mysql', true, 'collate'=>'utf8_unicode_ci', 'charset'=>'utf8');
-
-?>

+ 10 - 2
protected/controller/AdminController.php

@@ -51,8 +51,7 @@ class AdminController extends DooController {
 				}
 			}
 		}
-		//添加注释8998 2222
-//我的代码
+
 		Doo::loadCore ( 'uri/DooUriRouter' );
 		$router = new DooUriRouter ();
 		$routeRs = $router->execute ( Doo::app ()->route, Doo::conf ()->SUBFOLDER );
@@ -211,6 +210,7 @@ function adduser(){
 			Doo::loadModel ( 'L_category' );
 			Doo::loadModel ( 'staff' );
 			Doo::loadModel ( 'tag' );
+			Doo::loadModel ( 'holidaystaff' );
 
 			$staff = new staff ();
 			$L_category = new L_category ();
@@ -231,6 +231,12 @@ function adduser(){
 			$staff->nature=$nature;
 			$id=$staff->insert();
 
+			$holidaystaff = new HStaff();
+			$holidaystaff->uid = $id;
+			$holidaystaff->yearnum = $nature == 1 ? (time() > strtotime("+ 1 year", strtotime($hiredate)) ? 5 : 0) : 0;
+			$holidaystaff->insert();
+
+
 			for ($i=1;$i<=7;$i++){
 
 				$tag = new tag ();
@@ -352,6 +358,8 @@ function adminDoEdiUser(){
 
 			$staff->nature=$nature;
 
+
+
 			$staff->update();
 
 			return "/edi/user/".$sid."/".$msg;

+ 5 - 3
protected/model/staff.php

@@ -21,13 +21,15 @@ class staff extends DooModel {
 	public $position;
 	public $avatar;
 	public $appDate;
-	
+	public $hiredate;
+	public $nature;
+
 	public $_table = 'CLD_staff';
 	public $_primarykey = 'sid';
-	public $_fields = array ('sid', 'username','birthday','position', 'passwork','isadmin','cid','othercid','appDate','category','othercategory','gender','qq','phone','telephone','email','avatar' );
+	public $_fields = array ('sid', 'username','birthday','position', 'passwork','isadmin','cid','othercid','appDate','category','othercategory','gender','qq','phone','telephone','email','avatar','hiredate','nature' );
 	
 	public function checkUser($uid,$passwork){
-		return $this->find ( array ('select'=>'position,birthday,sid,username,isadmin,cid,othercid,category,othercategory,gender,qq,phone,telephone,email,avatar',
+		return $this->find ( array ('select'=>'position,birthday,sid,username,isadmin,cid,othercid,category,othercategory,gender,qq,phone,telephone,email,avatar,hiredate,nature',
 		'where' => "username= '".$uid."' and passwork = '".md5($passwork)."'", 'asArray' => TRUE ) );
 	}
 	

+ 16 - 1
protected/view/admin/admin_EdiUser.html

@@ -38,7 +38,22 @@
 		                </select>
 		              </div>
 		            </div>
-		            
+					<div class="control-group">
+						<label for="inputEmail" class="control-label">入职时间</label>
+						<div class="controls">
+							<input type="date" name="hiredate" value="{{staffInfo.0.hiredate}}">
+						</div>
+					</div>
+					<div class="control-group">
+						<label for="inputEmail" class="control-label">员工性质</label>
+						<div class="controls">
+							<select name="nature">
+								<option value="2" <!-- if {{staffInfo.0.nature}} == 2 --> selected <!-- endif -->>实习生</option>
+								<option value="1" <!-- if {{staffInfo.0.nature}} == 1 --> selected <!-- endif -->>正式员工</option>
+							</select>
+							<p>调整员工性质,会清空假期数据,请谨慎操作</p>
+						</div>
+					</div>
 		            <div class="control-group">
 		              <label for="inputEmail" class="control-label">性别</label>
 		              <div class="controls">

+ 19 - 2
protected/view/admin/admin_user.html

@@ -42,6 +42,21 @@
 		                </select>
 		              </div>
 		            </div>
+					<div class="control-group">
+						<label class="control-label">入职时间</label>
+						<div class="controls">
+							<input type="date" name="hiredate">
+						</div>
+					</div>
+					<div class="control-group">
+						<label class="control-label">员工性质</label>
+						<div class="controls">
+							<select name="nature">
+								<option value="1" selected>正式员工</option>
+								<option value="2">实习生</option>
+							</select>
+						</div>
+					</div>
 				    <input type="submit" class="button" value="添加新员工"></input>
 			    </form>
 			    <table class="table table-striped">
@@ -51,7 +66,8 @@
                   <th>员工名称</th>
                   <th>所在办事处</th>
                   <th>手机</th>
-                  <th>APP登陆</th>
+                  <th>APP登录</th>
+				  <th>入职时间</th>
                   <th>操作</th>
                 </tr>
               </thead>
@@ -59,10 +75,11 @@
               <!-- loop stafflist -->
                 <tr>
                   <td>{{staff' value.sid}}</td>
-                  <td>{{staff' value.username}}</td>
+                  <td>{{staff' value.username}}<!-- if {{staff' value.nature}} == 2 -->(实习)<!-- endif --></td>
                   <td>{{staff' value.category}},{{staff' value.othercategory}}</td>
                   <td>{{staff' value.telephone}}</td>
                   <td>{{staff' value.appDate}}</td>
+                  <td>{{staff' value.hiredate}}</td>
                   <td><a href="/edi/user/{{staff' value.sid}}">编辑</a>/<a href="javascript:linkok('/delete/user/{{staff' value.sid}}')">删除</a></td>
                 </tr>
                 <!-- endloop -->