|
@@ -133,11 +133,50 @@ function STATYSTYKA_TABELE() {
|
|
|
$sqlList[]="update BUILDINGS t1, Rozdzielcza_Kabel_Swiatlowodowy_wsg84 t2 set t1.__Rozdzielcza_Kabel_Swiatlowodowy_wsg84=t2.ID where t1.ID=t2.ID_BUILDINGS ; ";
|
|
$sqlList[]="update BUILDINGS t1, Rozdzielcza_Kabel_Swiatlowodowy_wsg84 t2 set t1.__Rozdzielcza_Kabel_Swiatlowodowy_wsg84=t2.ID where t1.ID=t2.ID_BUILDINGS ; ";
|
|
|
$sqlList[]="update BUILDINGS t1, MK_Rewiry t2 set t1.`__MK_Rewiry__STATUS`=t2.A_STATUS where t1.M_REWIR=t2.NAZWA_REWI ; ";
|
|
$sqlList[]="update BUILDINGS t1, MK_Rewiry t2 set t1.`__MK_Rewiry__STATUS`=t2.A_STATUS where t1.M_REWIR=t2.NAZWA_REWI ; ";
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $sqlList[]=" update USERS2_MARKETING set T_OPER='NIEWIADOMO' where T_OPER=''";
|
|
|
|
|
+ $sqlList[]=" update USERS2_MARKETING set TV_OPER='NIEWIADOMO' where TV_OPER=''";
|
|
|
|
|
+ $sqlList[]=" update USERS2_MARKETING set I_OPER='NIEWIADOMO' where I_OPER=''";
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ { //posprzatanie filtrow operatorow - todo tabela konkurencji
|
|
|
|
|
+ $oper_fix['%ORAN%']='ORANGE';
|
|
|
|
|
+ $oper_fix['%T%MOBLILE%']='T-MOBLILE';
|
|
|
|
|
+ $oper_fix['%TP%LIVE%BOX%']='ORANGE';
|
|
|
|
|
+ $oper_fix['%TP%ORANE%']='ORANGE';
|
|
|
|
|
+ $oper_fix['%BRAK%']='BRAK';
|
|
|
|
|
+ $oper_fix['CANAL%']='CANAL-PLUS';
|
|
|
|
|
+ $oper_fix['%CYFRA%']='CYFRA-PLUS';
|
|
|
|
|
+ $oper_fix['KABL%WKA']='INNY';
|
|
|
|
|
+ $oper_fix['NAZ%EMNA']='DVBC';
|
|
|
|
|
+ $oper_fix['NC%']='NC-PLUS';
|
|
|
|
|
+ $oper_fix['POLSAT%']='POLSAT';
|
|
|
|
|
+ $oper_fix['POLAT']='POLSAT';
|
|
|
|
|
+ $oper_fix['SATELITA%']='DVB-S';
|
|
|
|
|
+ $oper_fix['POLAT']='POLSAT';
|
|
|
|
|
+ $oper_fix['S__UZBOWY']='INNY';
|
|
|
|
|
+ $oper_fix['POLAT']='POLSAT';
|
|
|
|
|
+ $oper_fix['NA_KART%']='INNY';
|
|
|
|
|
+ $oper_fix['%BRAK%DANYCH%']='NIEWIADOMO';
|
|
|
|
|
+ $oper_fix['%CYFROWA%NAZIEMNA%']='DVBC';
|
|
|
|
|
+ $oper_fix['KABL__WKA']='INNY';
|
|
|
|
|
+ $oper_fix['%YOUTUBE%']='YOUTUBE';
|
|
|
|
|
+ $oper_fix['_']='NIEWIADOMO';
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ foreach($oper_fix as $filtr=>$set) {
|
|
|
|
|
+ $sqlList[]="update USERS2_MARKETING set I_OPER='".$set."' where I_OPER like '".$filtr."'" ;
|
|
|
|
|
+ $sqlList[]="update USERS2_MARKETING set TV_OPER='".$set."' where TV_OPER like '".$filtr."'" ;
|
|
|
|
|
+ $sqlList[]="update USERS2_MARKETING set T_OPER='".$set."' where T_OPER like '".$filtr."'" ;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
{ //stworzenie widoku bledow w USERS2_MARKETING dot budynkow
|
|
{ //stworzenie widoku bledow w USERS2_MARKETING dot budynkow
|
|
@@ -358,16 +397,16 @@ function STATYSTYKA_TABELE() {
|
|
|
$res_OPERS=$db->query($sql_OPERS);
|
|
$res_OPERS=$db->query($sql_OPERS);
|
|
|
while($row_OPERS=$db->fetch($res_OPERS)) {
|
|
while($row_OPERS=$db->fetch($res_OPERS)) {
|
|
|
if(strlen($row_OPERS->OPERS)>0)
|
|
if(strlen($row_OPERS->OPERS)>0)
|
|
|
- if(!in_array(strtolower(preg_replace('/[^a-zA-Z0-9\-_]/','_',$row_OPERS->OPERS), $COLSFORSTATS_OPERS)))
|
|
|
|
|
- if(!in_array(strtoupper(preg_replace('/[^a-zA-Z0-9\-_]/','_',$row_OPERS->OPERS), $COLSFORSTATS_OPERS)))
|
|
|
|
|
- if(!in_array(preg_replace('/[^a-zA-Z0-9\-_]/','_',$row_OPERS->OPERS, $COLSFORSTATS_OPERS))) {
|
|
|
|
|
|
|
+ if(!in_array(strtolower(preg_replace('/[^a-zA-Z0-9_\-]/','_',$row_OPERS->OPERS), $COLSFORSTATS_OPERS)))
|
|
|
|
|
+ if(!in_array(strtoupper(preg_replace('/[^a-zA-Z0-9_\-]/','_',$row_OPERS->OPERS), $COLSFORSTATS_OPERS)))
|
|
|
|
|
+ if(!in_array(preg_replace('/[^a-zA-Z0-9_\-]/','_',$row_OPERS->OPERS, $COLSFORSTATS_OPERS))) {
|
|
|
//echo "dodaje ".strtoupper(preg_replace('/[^a-zA-Z0-9\-_]/','_',$row_OPERS->OPERS));
|
|
//echo "dodaje ".strtoupper(preg_replace('/[^a-zA-Z0-9\-_]/','_',$row_OPERS->OPERS));
|
|
|
- $COLSFORSTATS_OPERS[]=strtoupper(preg_replace('/[^a-zA-Z0-9\-_]/','_',$row_OPERS->OPERS));
|
|
|
|
|
|
|
+ $COLSFORSTATS_OPERS[]=strtoupper(preg_replace('/[^a-zA-Z0-9_]/','_',$row_OPERS->OPERS));
|
|
|
}
|
|
}
|
|
|
- if($row_OPERS->OPERS!=preg_replace('/[^a-zA-Z0-9\-_]/','_',$row_OPERS->OPERS)) {
|
|
|
|
|
|
|
+ if($row_OPERS->OPERS!=preg_replace('/[^a-zA-Z0-9_\-]/','_',$row_OPERS->OPERS)) {
|
|
|
//aktualizacja w bazie nazwy operatora aby byla bez dziwnych znakow
|
|
//aktualizacja w bazie nazwy operatora aby byla bez dziwnych znakow
|
|
|
foreach($COLSFORSTATS as $FFS) {
|
|
foreach($COLSFORSTATS as $FFS) {
|
|
|
- $sql_upd="update USERS2_MARKETING set `{$FFS}_OPER`='".strtoupper(preg_replace('/[^a-zA-Z0-9\-_]/','_',$row_OPERS->OPERS))."' where `{$FFS}_OPER`='".$row_OPERS->OPERS."'";
|
|
|
|
|
|
|
+ $sql_upd="update USERS2_MARKETING set `{$FFS}_OPER`='".strtoupper(preg_replace('/[^a-zA-Z0-9_\-]/','_',$row_OPERS->OPERS))."' where `{$FFS}_OPER`='".$row_OPERS->OPERS."'";
|
|
|
$res = $db->query($sql_upd);
|
|
$res = $db->query($sql_upd);
|
|
|
if ($db->has_errors()) {
|
|
if ($db->has_errors()) {
|
|
|
$errors = true;
|
|
$errors = true;
|
|
@@ -466,7 +505,7 @@ function STATYSTYKA_TABELE() {
|
|
|
where
|
|
where
|
|
|
USERS2_MARKETING.A_STATUS!='DELETED'
|
|
USERS2_MARKETING.A_STATUS!='DELETED'
|
|
|
and BUILDINGS.A_STATUS!='DELETED'
|
|
and BUILDINGS.A_STATUS!='DELETED'
|
|
|
- group by USERS2_MARKETING.T_TELBOX_BUILDING_IN
|
|
|
|
|
|
|
+ group by USERS2_MARKETING.T_TELBOX_BUILDING_IN and 1=1
|
|
|
order by USERS2_MARKETING.M_REWIR DESC, USERS2_MARKETING.T_TELBOX_BUILDING_IN
|
|
order by USERS2_MARKETING.M_REWIR DESC, USERS2_MARKETING.T_TELBOX_BUILDING_IN
|
|
|
";
|
|
";
|
|
|
$sqlList[] = " create table `USERS2_MARKETING_OVERWIEV` \n {$sql} \n limit 1";
|
|
$sqlList[] = " create table `USERS2_MARKETING_OVERWIEV` \n {$sql} \n limit 1";
|