| 
					
				 | 
			
			
				@@ -7,6 +7,7 @@ Doo::loadClass('project'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 Doo::loadClass('contractact'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 Doo::loadClass('actmeasure'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 Doo::loadClass('numofperact'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+Doo::loadClass('measureauditact'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 /* * proDetail 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * MainController 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -15,22 +16,25 @@ Doo::loadClass('numofperact'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * @author darkredz 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+class ProjectController extends DooController 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $numofperact, $statusArray = array('uncheck' => '<span class = "colGray">未审核</span>', 'checking' => '<span class = "colOrange">审核中</span>', 'checked' => '<span class = "colGreen">审批通过</span>', 'checkno' => '<span class = "colRed">审批不通过</span>'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '<span class = "colGray">未审核</span>', 'checking' => '<span class = "colOrange">审核中</span>', 'checked' => '<span class = "colGreen">审批通过</span>', 'checkno' => '<span class = "colRed">审批不通过</span>'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function beforeRun($resource, $action) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function beforeRun($resource, $action) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($this->auth->getUid()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $uGroups = $this->profile->getProWithUid($this->auth->getUid()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $falg = Doo::acl()->isAllowed($uGroups['groups'], $resource, $action); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!$falg) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return Doo::acl()->defaultFailedRoute; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return Doo::acl()->defaultFailedRoute; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function __construct() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function __construct() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->auth = new Auth(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->attfile = new attFile(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->profile = new Profile(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -38,16 +42,28 @@ class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->contractact = new Contractact(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->actmeasure = new actMeasure(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->numofperact = new NumofperAct(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $this->measureauditact = new MeasureauditAct(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->data['rootUrl'] = Doo::conf()->APP_URL; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->data['currChannle'] = 'p'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->data['user'] = $this->profile->getProWithUid($this->auth->getUid()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $mpidArray = $this->measureauditact->getAuditProject2($this->auth->getUid()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (isset($mpidArray[0]['pid'])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            foreach ($mpidArray as $key => $value) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 审批操作按照时间排序多标段 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $this->data['numofchecking'] += $this->measureauditact->getCountMyChecking($value['pid'], $this->auth->getUid()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ($this->data['numofchecking'] == 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $this->data['numofchecking'] = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @return type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function index() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function index() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (isset($_POST['pname']) && $_POST['pname']) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $this->project->insertProject($this->auth->getUid(), $_POST['pname']); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return Doo::conf()->APP_URL . 'project/index'; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -78,7 +94,8 @@ class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->render('w-project', $this->data, TRUE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function proOverview() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function proOverview() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $conArray = $this->contractact->getRowByPid($this->params['pid']); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->data['projectDate'] = ''; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->data['conArray'][] = array(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -162,8 +179,8 @@ class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         foreach ($this->data['conArray'] as $k => $v) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $this->data['conArray'][$k]['pstopnow'] = $this->data['conArray'][$k]['pscurrdone'] = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $retval = $this->actmeasure->getAllbyStidSum($v['stid']); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $contracttotal+=$retval[0]['contracttotal']; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $totalstid +=$this->actmeasure->getTotal($v['stid'])['total']; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $contracttotal += $retval[0]['contracttotal']; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $totalstid += $this->actmeasure->getTotal($v['stid'])['total']; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $total = $this->actmeasure->getTotal($v['stid'])['total']; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if ($total) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $this->data['conArray'][$k]['total'] = round($total, 2); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -223,7 +240,8 @@ class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->render('w-project-detail', $this->data, TRUE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function proSection() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function proSection() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (isset($_POST['stid']) && isset($_POST['proname'])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $this->contractact->updateStName($_POST['stid'], $_POST['proname']); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return Doo::conf()->APP_URL . 'project/' . $this->params['pid'] . '/section'; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -279,7 +297,7 @@ class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $statusStr = ''; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $bdhtmlstr .=' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $bdhtmlstr .= ' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				<tr> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 					<td><a href="/project/' . $this->params['pid'] . '/section/' . $value['pmid'] . '/detail">' . $value['pmname'] . '</a></td> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 					<td class="">第 ' . $numCount['numpname'] . ' 期' . $statusStr . '</td> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -332,7 +350,8 @@ class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->render('w-project-section', $this->data, TRUE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    Function fNumber($number) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    Function fNumber($number) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($number == '') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Return "-"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $nlen = strlen($number); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -348,7 +367,8 @@ class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Return $fNumber; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private function getFav() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private function getFav() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $proArray = $this->project->getAll($this->auth->getUid()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->data['othrPro'] = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         foreach ($proArray as $key => $value) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -361,7 +381,8 @@ class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function proSectionMeasure() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function proSectionMeasure() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //此处未做更改,JSON文件已经固定名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $jsonpath = pathinfo($this->attfile->getMaxRow()['filepath']); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (isset($jsonpath['dirname'])) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -376,7 +397,7 @@ class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 closedir($handle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $this->data['proArray'] = $proArray['Bills']; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $this->data['proArray'] = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->data['mpid'] = $this->params['mpid']; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -384,7 +405,8 @@ class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->render('w-project-section-measure', $this->data, TRUE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function substr_replace_cn($string, $repalce = '*', $start = 0, $len = 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function substr_replace_cn($string, $repalce = '*', $start = 0, $len = 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $count = mb_strlen($string, 'UTF-8'); //此处传入编码,建议使用utf-8。此处编码要与下面mb_substr()所使用的一致 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!$count) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return $string; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -403,12 +425,13 @@ class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $returnString .= $tmpString; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $i ++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $i++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return $returnString; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    function unicode_encode($name) {//to Unicode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    function unicode_encode($name) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    {//to Unicode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $name = iconv('UTF-8', 'UCS-2', $name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $len = strlen($name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $str = ''; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -425,7 +448,8 @@ class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return $str; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    function unicode_decode($name) {//Unicode to 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    function unicode_decode($name) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    {//Unicode to 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $pattern = '/([\w]+)|(\\\u([\w]{4}))/i'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         preg_match_all($pattern, $name, $matches); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!empty($matches)) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -446,7 +470,8 @@ class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return $name; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function proDetail() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function proDetail() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // 面包屑导航项目 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->data['currproArray'] = $this->data['allproArray'] = NULL; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->data['pmid'] = $this->params['pmid']; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -501,7 +526,8 @@ class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->render('w-project-section-detail', $this->data, TRUE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function welcome() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function welcome() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //	if (!$this->auth->isLoggedIn()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //	    return Doo::conf()->APP_URL; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($this->profile->getProWithUid($this->auth->getUid())['userid']) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -515,7 +541,8 @@ class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->render('welcome', $this->data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function prolist() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function prolist() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //	if (!$this->auth->isLoggedIn()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //	    return Doo::conf()->APP_URL; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //	$proArray = new stdClass(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -536,7 +563,8 @@ class ProjectController extends DooController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // ajax提取密码名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function getAjaxSection() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function getAjaxSection() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!$this->isAjax()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         echo json_encode($_POST); 
			 |