Browse Source

dodanie raportu ERROR dla pokazywania spotkan na nieaktualnym pracowniku

a.binder 9 years ago
parent
commit
63bef01d56
1 changed files with 5 additions and 2 deletions
  1. 5 2
      SE/superedit-view_L_APPOITMENT_OVERWIEV.php

+ 5 - 2
SE/superedit-view_L_APPOITMENT_OVERWIEV.php

@@ -70,16 +70,19 @@ foreach($tbls as $tbl) {
 				} else echo "<br> Nie ma ".$src." w tabeli".$tbl;
 			}
 			
+			$errors_=" , if(t1.A_STATUS in ('NORMAL','WAITING') and (t2.A_STATUS!='NORMAL' or t2.ADM_ADMIN_LEVEL>5),'Ustalony pracownik nie pracuje','') as ERROR  "; //do weryfikacji bledow w spotkaniach
+			
+			
 			$sql_=array();
 			if(isset($sql)) $sql[]=" union ";
 			foreach($trans as $fld=>$as) {
 			 $sql_[]="t1.`".$fld."` as `".$as."`";
 			}
-			$sql[]=" ( select  t1.`ID`, '".$tbl."' as `TABLE`,".implode(',', $sql_).$transform_." from `".$tbl."` as t1 where ( t1.L_APPOITMENT_DATE!='' )   order by t1.A_RECORD_UPDATE_DATE DESC  ) ";
+			$sql[]=" ( select  t1.`ID`, '".$tbl."' as `TABLE`,".implode(',', $sql_).$transform_.$errors_." from `".$tbl."` as t1  left join ADMIN_USERS as t2 on t1.L_APPOITMENT_USER=t2.ADM_ACCOUNT where ( t1.L_APPOITMENT_DATE!='' )   order by t1.A_RECORD_UPDATE_DATE DESC  ) ";
 			
 			
 			$msc=microtime(true);
-			$conn->query("select  t1.`ID`, '".$tbl."' as `TABLE`,".implode(',', $sql_).$transform_." from `".$tbl."` as t1 where t1.L_APPOITMENT_DATE!=''   order by t1.A_RECORD_UPDATE_DATE DESC   ");
+			$conn->query("select  t1.`ID`, '".$tbl."' as `TABLE`,".implode(',', $sql_).$transform_.$errors_." from `".$tbl."` as t1 left join ADMIN_USERS as t2 on t1.L_APPOITMENT_USER=t2.ADM_ACCOUNT where t1.L_APPOITMENT_DATE!=''   order by t1.A_RECORD_UPDATE_DATE DESC   ");
 			$msc=microtime(true)-$msc;
 			$czas[]="Czas ".$msc." dla tabeli ".$tbl;