|
|
@@ -20,6 +20,8 @@ function SYNC_GIS_TABLES() {
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
DEBUG_S(-3,'db',$db);
|
|
|
DEBUG_S(-3,'gis',$gdb);
|
|
|
|
|
|
@@ -56,13 +58,42 @@ function SYNC_GIS_TABLES() {
|
|
|
|
|
|
echo "<br> aktualziacja relacji obiektow do paszportyzacji optycznej";
|
|
|
|
|
|
- function gis_opto_relations($table_to_set,$field_index,$field_to_set,$table_from,$field_from,$ST_Relate='******F**',$filter_sql='') {
|
|
|
+
|
|
|
+ function gis_opto_intersect($table_to_set,$field_index,$field_to_set,$table_from,$field_from,$filter_table_from='') {
|
|
|
+ global $gdb;
|
|
|
+
|
|
|
+ $sql='drop table if exists gis_opto_relations;
|
|
|
+ -- gis_opto_intersect
|
|
|
+ select t1."'.$field_index.'" as "field_index", t2."'.$field_from.'" as "field_from"
|
|
|
+ , 1
|
|
|
+ as if_true , t2.*
|
|
|
+ into temporary table gis_opto_relations
|
|
|
+ FROM "'.$table_to_set.'" as t1
|
|
|
+ INNER JOIN "'.$table_from.'" as t2 ON ST_Intersects(t1.the_geom, t2.the_geom) '.$filter_table_from.' ;
|
|
|
+
|
|
|
+ CREATE INDEX myfield ON gis_opto_relations ("field_from");
|
|
|
+
|
|
|
+ update "'.$table_to_set.'" t1
|
|
|
+ set "'.$field_to_set.'"=t2.field_from
|
|
|
+
|
|
|
+ from gis_opto_relations t2
|
|
|
+ where t1."'.$field_index.'"=t2.field_index and t2.if_true=1
|
|
|
+ '.$filter_sql.'
|
|
|
+ ;
|
|
|
+
|
|
|
+ drop table gis_opto_relations;';
|
|
|
+ DEBUG_S(-3,"Zapytanie sql aktualizujace ".$table_to_set,$sql,__FILE__,__FUNCTION__,__LINE__);
|
|
|
+ $gdb->query($sql);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function gis_opto_relations($table_to_set,$field_index,$field_to_set,$table_from,$field_from,$ST_Relate='******F**',$filter_sql='',$filter_table_from=' on 1=1 ') {
|
|
|
global $gdb;
|
|
|
$sql='
|
|
|
-
|
|
|
+ -- gis_opto_relations
|
|
|
drop table if exists gis_opto_relations;
|
|
|
|
|
|
- select t1.'.$field_index.' as "field_index", t2."'.$field_from.'" as "field_from"
|
|
|
+ select t1."'.$field_index.'" as "field_index", t2."'.$field_from.'" as "field_from"
|
|
|
|
|
|
, case ST_Relate(t1."the_geom",t2."the_geom",\''.$ST_Relate.'\') when true then
|
|
|
1
|
|
|
@@ -70,7 +101,7 @@ function SYNC_GIS_TABLES() {
|
|
|
as if_true , t2.*
|
|
|
into temporary table gis_opto_relations
|
|
|
FROM "'.$table_to_set.'" as t1
|
|
|
- CROSS JOIN "'.$table_from.'" as t2;
|
|
|
+ LEFT JOIN "'.$table_from.'" as t2 '.$filter_table_from.' ;
|
|
|
|
|
|
CREATE INDEX myfield ON gis_opto_relations (field_from);
|
|
|
|
|
|
@@ -94,14 +125,36 @@ function SYNC_GIS_TABLES() {
|
|
|
|
|
|
|
|
|
|
|
|
- function gis_opto_calculations($table_to_set,$field_index,$field_to_set,$table_from,$field_from_geom,$ST_Relate='******F**',$filter_sql='') {
|
|
|
+ function gis_opto_calculations($table_to_set,$field_index,$field_to_set,$table_from,$field_from_geom,$ST_Relate='******F**',$filter_sql='',$price_column='',$lenght_column='') {
|
|
|
global $gdb;
|
|
|
+ $sql_select='';$sql_price='';
|
|
|
+ if(is_array($field_index)) {
|
|
|
+ $field_index_t1=$field_index[0];
|
|
|
+ $field_index_t2=$field_index[1];
|
|
|
+ } else {
|
|
|
+ $field_index_t1=$field_index;
|
|
|
+ $field_index_t2=$field_index;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(strlen($price_column)>0) { $sql_select=', t2."'.$price_column.'"';
|
|
|
+ $sql_price='*t2."'.$price_column.'"';
|
|
|
+ }
|
|
|
+ // if(!empty($filter_sql)) {
|
|
|
+ // $ST_Relate=" 1=1 ";
|
|
|
+ // $ST_Intersects=" 1=1 ";
|
|
|
+ // } else {
|
|
|
+ $ST_Relate='ST_Relate(t1."'.$field_from_geom.'",t2."'.$field_from_geom.'",\''.$ST_Relate.'\')';
|
|
|
+ $ST_Intersects='ST_Intersects(t1."'.$field_from_geom.'",t2."'.$field_from_geom.'")';
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
$sql='
|
|
|
+ -- gis_opto_calculations
|
|
|
drop table if exists "'.$table_from.'_AGR" ;
|
|
|
- select t1.'.$field_index.' , t2.'.$field_index.' as gid_t2
|
|
|
- , ST_Intersects(t1."'.$field_from_geom.'",t2."'.$field_from_geom.'")
|
|
|
- , case ST_Relate(t1."'.$field_from_geom.'",t2."'.$field_from_geom.'",\''.$ST_Relate.'\') when true then
|
|
|
+ select t1."'.$field_index_t1.'" as field_index '.$sql_select.'
|
|
|
+ , '.$ST_Intersects.'
|
|
|
+ , case '.$ST_Relate.' '.$filter_sql.' when true then
|
|
|
ST_Length_Spheroid(t2."'.$field_from_geom.'",\'SPHEROID["WGS 84",6378137,298.257223563]\')
|
|
|
else \'0\' end
|
|
|
as length
|
|
|
@@ -109,28 +162,50 @@ function SYNC_GIS_TABLES() {
|
|
|
FROM "'.$table_to_set.'" as t1
|
|
|
CROSS JOIN "'.$table_from.'" as t2
|
|
|
;
|
|
|
-
|
|
|
+ CREATE INDEX ON "'.$table_from.'_AGR" ("field_index");
|
|
|
+
|
|
|
update "'.$table_to_set.'" t1
|
|
|
set "'.$field_to_set.'"=(
|
|
|
select
|
|
|
- round(sum(t2.length))
|
|
|
- from "'.$table_from.'_AGR" as t2 where t2.'.$field_index.'=t1.'.$field_index.'
|
|
|
+ round(sum(t2.length'.$sql_price.'))
|
|
|
+ from "'.$table_from.'_AGR" as t2 where t2."field_index"=t1."'.$field_index_t1.'"
|
|
|
)
|
|
|
|
|
|
;';
|
|
|
|
|
|
- echo "<br>sql to : ".$sql;
|
|
|
+ if(!empty($lenght_column)) { //wylicamy dlugosc
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ DEBUG_S(-3,'Zapyt gis_opt '.$table_to_set,$sql,__FILE__,__FUNCTION__,__LINE__);
|
|
|
+ flush();
|
|
|
$gdb->query($sql);
|
|
|
}
|
|
|
|
|
|
- function gis_opto_calculations_count($table_to_set,$field_index,$field_to_set,$table_from,$field_from_geom,$ST_Relate='******F**',$filter_sql='') {
|
|
|
+ function gis_opto_calculations_count($table_to_set,$field_index,$field_to_set,$table_from,$field_from_geom,$ST_Relate='******F**',$filter_sql='',$price_column='') {
|
|
|
global $gdb;
|
|
|
+ $sql_select='';$sql_price='';
|
|
|
+ if(strlen($price_column)>0) { $sql_select=', t2."'.$price_column.'"';
|
|
|
+ $sql_price='*t2."'.$price_column.'"';
|
|
|
+ }
|
|
|
+ if(is_array($field_index)) {
|
|
|
+ $field_index_t1=$field_index[0];
|
|
|
+ $field_index_t2=$field_index[1];
|
|
|
+ } else {
|
|
|
+ $field_index_t1=$field_index;
|
|
|
+ $field_index_t2=$field_index;
|
|
|
+ }
|
|
|
|
|
|
$sql='
|
|
|
+ -- gis_opto_calculations_count
|
|
|
drop table if exists "'.$table_from.'_AGR" ;
|
|
|
- select t1.'.$field_index.'
|
|
|
+ select t1."'.$field_index_t1.'" as field_index '.$sql_select.'
|
|
|
, ST_Intersects(t1."'.$field_from_geom.'",t2."'.$field_from_geom.'")
|
|
|
- , case ST_Relate(t1."'.$field_from_geom.'",t2."'.$field_from_geom.'",\''.$ST_Relate.'\') when true then
|
|
|
+ , case ST_Relate(t1."'.$field_from_geom.'",t2."'.$field_from_geom.'",\''.$ST_Relate.'\') '.$filter_sql.' when true then
|
|
|
1
|
|
|
else 0 end
|
|
|
as length
|
|
|
@@ -139,50 +214,368 @@ function SYNC_GIS_TABLES() {
|
|
|
CROSS JOIN "'.$table_from.'" as t2
|
|
|
;
|
|
|
|
|
|
+ CREATE INDEX ON "'.$table_from.'_AGR" ("field_index");
|
|
|
+
|
|
|
+ update "'.$table_to_set.'" t1
|
|
|
+ set "'.$field_to_set.'"=(
|
|
|
+ select
|
|
|
+ sum(t2.length'.$sql_price.')
|
|
|
+ from "'.$table_from.'_AGR" as t2 where t2."field_index"=t1."'.$field_index_t1.'"
|
|
|
+ )
|
|
|
+
|
|
|
+ ;';
|
|
|
+
|
|
|
+ DEBUG_S(-3,'sql',array($sql,debug_backtrace()),__FILE__,__FUNCTION__,__LINE__);
|
|
|
+
|
|
|
+ $gdb->query($sql);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ function gis_opto_calculations_sum($table_to_set,$field_index,$field_to_set,$table_from,$field_from_geom,$ST_Relate='******F**',$filter_sql='',$field_to_sum) {
|
|
|
+ global $gdb;
|
|
|
+ if(is_array($field_index)) {
|
|
|
+ $field_index_t1=$field_index[0];
|
|
|
+ $field_index_t2=$field_index[1];
|
|
|
+ } else {
|
|
|
+ $field_index_t1=$field_index;
|
|
|
+ $field_index_t2=$field_index;
|
|
|
+ }
|
|
|
+
|
|
|
+ $sql='
|
|
|
+ -- gis_opto_calculations_sum
|
|
|
+ drop table if exists "'.$table_from.'_AGR" ;
|
|
|
+ select t1."'.$field_index_t1.'" as field_index
|
|
|
+ , ST_Intersects(t1."'.$field_from_geom.'",t2."'.$field_from_geom.'")
|
|
|
+ , case ST_Relate(t1."'.$field_from_geom.'",t2."'.$field_from_geom.'",\''.$ST_Relate.'\') '.$filter_sql.' when true then
|
|
|
+ t2."'.$field_to_sum.'"
|
|
|
+ else 0 end
|
|
|
+ as length
|
|
|
+ into temporary table "'.$table_from.'_AGR"
|
|
|
+ FROM "'.$table_to_set.'" as t1
|
|
|
+ CROSS JOIN "'.$table_from.'" as t2
|
|
|
+ ;
|
|
|
+
|
|
|
+ CREATE INDEX ON "'.$table_from.'_AGR" ("field_index");
|
|
|
+
|
|
|
|
|
|
update "'.$table_to_set.'" t1
|
|
|
set "'.$field_to_set.'"=(
|
|
|
select
|
|
|
sum(t2.length)
|
|
|
- from "'.$table_from.'_AGR" as t2 where t2.'.$field_index.'=t1.'.$field_index.'
|
|
|
+ from "'.$table_from.'_AGR" as t2 where t2."field_index"=t1."'.$field_index_t1.'"
|
|
|
)
|
|
|
|
|
|
;';
|
|
|
|
|
|
- echo "<br>sql to : ".$sql;
|
|
|
+ DEBUG_S(-3,'sql calc_sum '.$table_to_set,$sql,__FILE__,__FUNCTION__,__LINE__);
|
|
|
$gdb->query($sql);
|
|
|
}
|
|
|
|
|
|
- gis_opto_calculations('Inwestycje_Planowane','gid','Agr_metrow_mikrorurek_5szt','Rozdzielcza_Pakiet5MikrorurekMagistrala_WSG84','the_geom','T********');
|
|
|
- gis_opto_calculations('Inwestycje_Planowane','gid','Agr_metrow_mikrorurek','Rozdzielcza_Mikrokanalizacja_do_klienta','the_geom','T********');
|
|
|
- gis_opto_calculations('Inwestycje_Planowane','gid','Agr_ilosc_wykopu','Rozdzielcza_Wykop_przedmiar_na_mikrorurki','the_geom','******F**');
|
|
|
- gis_opto_calculations('Inwestycje_Planowane','gid','Agr_ilosc_przeciskow','Rozdzielcza_Przeciski_110mm','the_geom','******F**');
|
|
|
- gis_opto_calculations('Inwestycje_Planowane','gid','Agr_ilosc_zabrukow','Rozdzielcza_Zabruki','the_geom','******F**');
|
|
|
- gis_opto_calculations_count('Inwestycje_Planowane','gid','Agr_ilosc_domow','MK_Mieszkania','the_geom','******F**');
|
|
|
-
|
|
|
- $sql_cena='update "Inwestycje_Planowane" set "Agr_metrow_mikrorurek_5szt"=0 where "Agr_metrow_mikrorurek_5szt" is null;';
|
|
|
-
|
|
|
+
|
|
|
+ function gis_opto_calculations_set_lenght($table_to_set,$field_to_set) {
|
|
|
+ global $gdb;
|
|
|
+ $sql='
|
|
|
+ -- gis_opto_calculations_set_lenght
|
|
|
+ update "'.$table_to_set.'" set "'.$field_to_set.'"=round(ST_Length_Spheroid("the_geom",\'SPHEROID["WGS 84",6378137,298.257223563]\')) ';
|
|
|
+ DEBUG_S(-3,'sql set_lenght '.$table_to_set,$sql,__FILE__,__FUNCTION__,__LINE__);
|
|
|
+ $gdb->query($sql);
|
|
|
+ }
|
|
|
+
|
|
|
+ function USERS2_MARKETING_OVERWIEV_to_MK_Budynki(){
|
|
|
+ global $db,$gdb;
|
|
|
+ $sql='select t1.* , t2.A_STATUS as BUILDING_STATUS , t2.geoportal_gml_punkty_adr_gml_id from USERS2_MARKETING_OVERWIEV t1 inner join
|
|
|
+ BUILDINGS as t2 on t2.S_ADDRESS_STREET=t1.T_TELBOX_BUILDING_IN where t2.geoportal_gml_punkty_adr_gml_id!=\'\' or S_ADDRESS_STREET!=\'\'';
|
|
|
+ $res=$db->query($sql);
|
|
|
+
|
|
|
+ echo "<br> To update USERS2_MARKETING_OVERWIEV use ?FUNCTION_INIT=STATYSTYKA_TABELE ".$sql;
|
|
|
+
|
|
|
+ $row=0;
|
|
|
+
|
|
|
+ while($h=$db->fetch($res)) {
|
|
|
+ if($row==0) { //add columns
|
|
|
+ foreach($h as $col=>$val) {
|
|
|
+ $sql="SELECT column_name FROM information_schema.columns WHERE table_name='MK_Budynki' and column_name='".$col."'";
|
|
|
+ $res2=$gdb->query($sql);
|
|
|
+ if($gdb->count($res2)==0) {
|
|
|
+
|
|
|
+ $sql='alter table "MK_Budynki" add "'.$col.'" char(255) not null default \'\' '; echo "<br> ".$sql; flush();
|
|
|
+ $gdb->query($sql);
|
|
|
+ } else echo " Field ".$col." exists. ";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $set=array();
|
|
|
+ foreach($h as $col=>$val) {
|
|
|
+ $set[]="\"".$col."\"='".$val."'";
|
|
|
+ }
|
|
|
+
|
|
|
+ $sql='update "MK_Budynki" set '.implode(',', $set).' where ( geoportal_gml_punkty_adr_gml_id=\''.$h->geoportal_gml_punkty_adr_gml_id.'\' and geoportal_gml_punkty_adr_gml_id!=\'\' ) or ( "T_TELBOX_BUILDING_IN"=\''.$h->T_TELBOX_BUILDING_IN.'\' and ( geoportal_gml_punkty_adr_gml_id=\'\' or geoportal_gml_punkty_adr_gml_id is null ) )';
|
|
|
+ echo "<br> ".$sql;
|
|
|
+ $gdb->query($sql);
|
|
|
+
|
|
|
+ $row++;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ function PROCESY5_to_GIS($p5_table,$p5_key,$gis_table,$gis_key,$p5_what_extra='',$p5_join='',$p5_limit=''){
|
|
|
+ global $db,$gdb;
|
|
|
+
|
|
|
+ //! pierw trigger
|
|
|
+ $trigger_psql_do_timestamp="CREATE OR REPLACE FUNCTION update_A_RECORD_UPDATE_DATE_column()
|
|
|
+ RETURNS TRIGGER AS $$
|
|
|
+ BEGIN
|
|
|
+ NEW.\"A_RECORD_UPDATE_DATE\" = now();
|
|
|
+ RETURN NEW;
|
|
|
+ END;
|
|
|
+ $$ language 'plpgsql';";
|
|
|
+ $gdb->query($sql);
|
|
|
+
|
|
|
+ $sql='select t1.* '.$p5_what.' from '.$p5_table.' as t1
|
|
|
+ where t1.'.$p5_key.'!=\'\' or t1.'.$p5_key.' is not null ';
|
|
|
+ $res=$db->query($sql);
|
|
|
+
|
|
|
+ echo "<br> f.PROCESY5_to_GIS use ".$sql;
|
|
|
+
|
|
|
+ $row=0;
|
|
|
+
|
|
|
+ while($h=$db->fetch($res)) {
|
|
|
+ if($row==0) { //add columns
|
|
|
+ foreach($h as $col=>$val) {
|
|
|
+ $sql="SELECT column_name FROM information_schema.columns WHERE table_name='".$gis_table."' and column_name='".$col."'";
|
|
|
+ $res2=$gdb->query($sql);
|
|
|
+ if($gdb->count($res2)==0) {
|
|
|
+
|
|
|
+ $sql='alter table "'.$gis_table.'" add "'.$col.'" char(255) not null default \'\' '; echo "<br> ".$sql; flush();
|
|
|
+ $gdb->query($sql);
|
|
|
+
|
|
|
+ if($col=='A_RECORD_UPDATE_DATE') {
|
|
|
+ $gdb->query("CREATE TRIGGER update_A_RECORD_UPDATE_DATE BEFORE UPDATE
|
|
|
+ ON \"".$gis_table."\" FOR EACH ROW EXECUTE PROCEDURE
|
|
|
+ update_A_RECORD_UPDATE_DATE_column();");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ } else echo " Field ".$col." exists. ";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $set=array();
|
|
|
+ $insert=array();
|
|
|
+ foreach($h as $col=>$val) {
|
|
|
+ if($col=='the_geom') continue; //todo GEOM tez kopiowac trzeba ale inaczej
|
|
|
+ if($col==$gis_key) continue;
|
|
|
+ $set[]="\"".$col."\"='".$gdb->_($val)."'";
|
|
|
+ $insert['row'][]='"'.$col.'"';
|
|
|
+ $insert['vals'][]="'".$gdb->_($val)."'";
|
|
|
+ }
|
|
|
+
|
|
|
+ $sql='update "'.$gis_table.'" set '.implode(',', $set).' where ( "'.$gis_key.'"=\''.$h->$p5_key.'\' and "'.$gis_key.'"!=\'\' )
|
|
|
+ ';
|
|
|
+ // -- and "A_RECORD_UPDATE_DATE"<\''.$h->A_RECORD_UPDATE_DATE.'\''; //Jak poprawi Piotr aktualizacje GIS to bedzie OK.
|
|
|
+ // echo "<br> ".$sql;
|
|
|
+
|
|
|
+ $gdb->query($sql);
|
|
|
+
|
|
|
+ if(!empty($h->the_geom)) { //new record dodajemy jak jest oznaczona geometria
|
|
|
+ $sql='insert into "'.$his_table.'" ( '.implode(',', $insert['row']).' values ( '.implode(',',$insert['vals']).' )';
|
|
|
+ // echo "<br> ".$sql;
|
|
|
+ }
|
|
|
+
|
|
|
+ $row++;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ { //! teraz aktualizujemy po timestampie w prawo
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function POSTGIS_to_MYSQL_Tables($local_table_mysql,$local_key,$remote_table_postgis,$remote_key){
|
|
|
+ global $db,$gdb;
|
|
|
+ $sql='select "'.$remote_key.'", ST_AsText(the_geom) as the_geom from "'.$remote_table_postgis.'" where "'.$remote_key.'"!=\'\' and "'.$remote_key.'" is not null and the_geom!=\'\' and the_geom is not null ';
|
|
|
+ $res=$gdb->query($sql);
|
|
|
+ while($h=$gdb->fetch($res)) {
|
|
|
+ $sql2="update `".$local_table_mysql."` set `the_geom`=GeomFromText('".$h->the_geom."') where `".$local_key."`='".trim($h->$remote_key)."' and `".$local_key."`!='' and `".$local_key."` is not null
|
|
|
+ and ( the_geom='' or the_geom is null )";
|
|
|
+ echo "<br> ".$sql2;
|
|
|
+ $db->query($sql2) or die('Problem with sql 228: '.$sql);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ gis_opto_calculations_set_lenght('Rozdzielcza_rurociag_wsg84','dlugosc');
|
|
|
+ gis_opto_calculations_set_lenght('Rozdzielcza_Kabel_Swiatlowodowy_wsg84','Dlugosc');
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ gis_opto_intersect('geoportal_gml_punkty_adr','id_0','Mk_Rewir_set','MK_Rewiry','gid');
|
|
|
+ gis_opto_intersect('Rozdzielcza_rurociag_wsg84','gid','Mk_Rewir_set','MK_Rewiry','gid');
|
|
|
+
|
|
|
+
|
|
|
+ gis_opto_intersect('MK_Budynki','gid','geoportal_gml_punkty_adr_gml_id','geoportal_gml_punkty_adr','gml_id',' and t2."Mk_Rewir_set">0 ');
|
|
|
+
|
|
|
+// gis_opto_intersect('Rozdzielcza_Wykop_przedmiar_na_mikrorurki','gid','ID_PROJECT','Inwestycje_Planowane','ID_PROJECT',' and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+ gis_opto_intersect('Rozdzielcza_Wykop_przedmiar_na_mikrorurki','gid','ID_PROJECT','IN7_MK_BAZA_DYSTRYBUCJI','ID',' and t2."ID"!=0 and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+
|
|
|
+// gis_opto_intersect('Rozdzielcza_Mikrokanalizacja_do_klienta','gid','ID_PROJECT','Inwestycje_Planowane','ID_PROJECT',' and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+ gis_opto_intersect('Rozdzielcza_Mikrokanalizacja_do_klienta','gid','ID_PROJECT','IN7_MK_BAZA_DYSTRYBUCJI','ID',' and t2."ID"!=0 and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+
|
|
|
+// gis_opto_intersect('Rozdzielcza_Pakiet5MikrorurekMagistrala_WSG84','gid','ID_PROJECT','Inwestycje_Planowane','ID_PROJECT',' and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+ gis_opto_intersect('Rozdzielcza_Pakiet5MikrorurekMagistrala_WSG84','gid','ID_PROJECT','IN7_MK_BAZA_DYSTRYBUCJI','ID',' and t2."ID"!=0 and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+// gis_opto_intersect('Rozdzielcza_Przeciski_110mm','gid','ID_PROJECT','Inwestycje_Planowane','ID_PROJECT',' and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+ gis_opto_intersect('Rozdzielcza_Przeciski_110mm','gid','ID_PROJECT','IN7_MK_BAZA_DYSTRYBUCJI','ID',' and t2."ID"!=0 and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+
|
|
|
+// gis_opto_intersect('Rozdzielcza_Zabruki','gid','ID_PROJECT','Inwestycje_Planowane','ID_PROJECT',' and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+ gis_opto_intersect('Rozdzielcza_Zabruki','gid','ID_PROJECT','IN7_MK_BAZA_DYSTRYBUCJI','ID',' and t2."ID"!=0 and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+
|
|
|
+// gis_opto_intersect('Rozdzielcza_koszty_dodatkowe_wsg84','id_0','ID_PROJECT','Inwestycje_Planowane','ID_PROJECT',' and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+ gis_opto_intersect('Rozdzielcza_koszty_dodatkowe_wsg84','id_0','ID_PROJECT','IN7_MK_BAZA_DYSTRYBUCJI','ID',' and t2."ID"!=0 and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+
|
|
|
+// gis_opto_intersect('Rozdzielcza_rurociag_wsg84','gid','ID_PROJECT','Inwestycje_Planowane','ID_PROJECT',' and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+ gis_opto_intersect('Rozdzielcza_rurociag_wsg84','gid','ID_PROJECT','IN7_MK_BAZA_DYSTRYBUCJI','ID',' and t2."ID"!=0 and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+
|
|
|
+// gis_opto_intersect('Rozdzielcza_wezly','gid','ID_PROJECT','Inwestycje_Planowane','ID_PROJECT',' and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+ gis_opto_intersect('Rozdzielcza_wezly','gid','ID_PROJECT','IN7_MK_BAZA_DYSTRYBUCJI','ID',' and t2."ID"!=0 and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+
|
|
|
+// gis_opto_intersect('Rozdzielcza_Kabel_Swiatlowodowy_wsg84','gid','ID_PROJECT','Inwestycje_Planowane','ID_PROJECT',' and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+ gis_opto_intersect('Rozdzielcza_Kabel_Swiatlowodowy_wsg84','gid','ID_PROJECT','IN7_MK_BAZA_DYSTRYBUCJI','ID',' and t2."ID"!=0 and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+
|
|
|
+// gis_opto_intersect('MK_Budynki','gid','ID_PROJECT','Inwestycje_Planowane','ID_PROJECT',' and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+ gis_opto_intersect('MK_Budynki','gid','ID_PROJECT','IN7_MK_BAZA_DYSTRYBUCJI','ID',' and t2."ID"!=0 and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+// gis_opto_intersect('MK_Mieszkania','gid','ID_PROJECT','Inwestycje_Planowane','ID_PROJECT',' and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+ gis_opto_intersect('MK_Mieszkania','gid','ID_PROJECT','IN7_MK_BAZA_DYSTRYBUCJI','ID',' and t2."ID"!=0 and ( t1."ID_PROJECT"=\'0\' or t1."ID_PROJECT"=\'\' or t1."ID_PROJECT" is null ) ');
|
|
|
+
|
|
|
+// gis_opto_intersect('MK_Budynki','gid','geoportal_gml_punkty_adr_gml_id','geoportal_gml_punkty_adr','gml_id','');
|
|
|
+
|
|
|
+ //gis_opto_relations('MK_Budynki','gid','geoportal_gml_punkty_adr_gml_id','geoportal_gml_punkty_adr','gml_id','T********',''," on t2.\"Mk_Rewir_set\" > 0 ");
|
|
|
+
|
|
|
+
|
|
|
+ // die('celowe 228');
|
|
|
+
|
|
|
+
|
|
|
+ DEBUG_S(-3,'Agr rurociag',null,__FILE__,__FUNCTION__,__LINE__);
|
|
|
+// gis_opto_calculations('Inwestycje_Planowane','gid','Agr_Rozdzielcza_rurociag_wsg84','Rozdzielcza_rurociag_wsg84','the_geom','******F**','and t1."ID_PROJECT"=t2."ID_PROJECT" ');
|
|
|
+ gis_opto_calculations('IN7_MK_BAZA_DYSTRYBUCJI','ID','Agr_Rozdzielcza_rurociag_wsg84','Rozdzielcza_rurociag_wsg84','the_geom','******F**','and t1."ID"::int=t2."ID_PROJECT"::int and t1."ID"!=0 ');
|
|
|
+// die('431');
|
|
|
+
|
|
|
+// gis_opto_calculations('Inwestycje_Planowane','gid','Agr_Rozdzielcza_rurociag_wsg84_koszt','Rozdzielcza_rurociag_wsg84','the_geom','******F**','and t1."ID_PROJECT"=t2."ID_PROJECT" ','cena_jedn');
|
|
|
+ gis_opto_calculations('IN7_MK_BAZA_DYSTRYBUCJI','ID','Agr_Rozdzielcza_rurociag_wsg84_koszt','Rozdzielcza_rurociag_wsg84','the_geom','******F**','and t1."ID"::int=t2."ID_PROJECT"::int and t1."ID"!=0 ','cena_jedn');
|
|
|
+
|
|
|
+// gis_opto_calculations('Inwestycje_Planowane','gid','Agr_Rozdzielcza_Kabel_Swiatlowodowy_wsg84','Rozdzielcza_Kabel_Swiatlowodowy_wsg84','the_geom','******F**','and t1."ID_PROJECT"=t2."ID_PROJECT" ');
|
|
|
+ gis_opto_calculations('IN7_MK_BAZA_DYSTRYBUCJI',array('ID','gid'),'Agr_Rozdzielcza_Kabel_Swiatlowodowy_wsg84','Rozdzielcza_Kabel_Swiatlowodowy_wsg84','the_geom','******F**','and t1."ID"::int=t2."ID_PROJECT"::int and t1."ID"!=0');
|
|
|
+
|
|
|
+// gis_opto_calculations('Inwestycje_Planowane','gid','Agr_Rozdzielcza_Kabel_Swiatlowodowy_wsg84_koszt','Rozdzielcza_Kabel_Swiatlowodowy_wsg84','the_geom','******F**','and t1."ID_PROJECT"=t2."ID_PROJECT" ','koszt_jedn');
|
|
|
+ gis_opto_calculations('IN7_MK_BAZA_DYSTRYBUCJI',array('ID','gid'),'Agr_Rozdzielcza_Kabel_Swiatlowodowy_wsg84_koszt','Rozdzielcza_Kabel_Swiatlowodowy_wsg84','the_geom','******F**','and t1."ID"::int=t2."ID_PROJECT"::int and t1."ID"!=0','koszt_jedn');
|
|
|
+
|
|
|
+// gis_opto_calculations('Inwestycje_Planowane','gid','Agr_metrow_mikrorurek_5szt','Rozdzielcza_Pakiet5MikrorurekMagistrala_WSG84','the_geom','******F**','and t1."ID_PROJECT"=t2."ID_PROJECT" ');
|
|
|
+ gis_opto_calculations('IN7_MK_BAZA_DYSTRYBUCJI',array('ID','gid'),'Agr_metrow_mikrorurek_5szt','Rozdzielcza_Pakiet5MikrorurekMagistrala_WSG84','the_geom','******F**','and t1."ID"::int=t2."ID_PROJECT"::int and t1."ID"!=0');
|
|
|
+DEBUG_S(-3,'CheckPoint',null,__FILE__,__FUNCTION__,__LINE__);
|
|
|
+
|
|
|
+// gis_opto_calculations('Inwestycje_Planowane','gid','Agr_metrow_mikrorurek','Rozdzielcza_Mikrokanalizacja_do_klienta','the_geom','******F**','and t1."ID_PROJECT"=t2."ID_PROJECT" ');
|
|
|
+ gis_opto_calculations('IN7_MK_BAZA_DYSTRYBUCJI',array('ID','gid'),'Agr_metrow_mikrorurek','Rozdzielcza_Mikrokanalizacja_do_klienta','the_geom','******F**','and t1."ID"::int=t2."ID_PROJECT"::int and t1."ID"!=0');
|
|
|
+
|
|
|
+// gis_opto_calculations('Inwestycje_Planowane','gid','Agr_ilosc_wykopu','Rozdzielcza_Wykop_przedmiar_na_mikrorurki','the_geom','******F**','and t1."ID_PROJECT"=t2."ID_PROJECT" ');
|
|
|
+ gis_opto_calculations('IN7_MK_BAZA_DYSTRYBUCJI',array('ID','gid'),'Agr_ilosc_wykopu','Rozdzielcza_Wykop_przedmiar_na_mikrorurki','the_geom','******F**','and t1."ID"::int=t2."ID_PROJECT"::int and t1."ID"!=0');
|
|
|
+DEBUG_S(-3,'CheckPoint Wykop prev',null,__FILE__,__FUNCTION__,__LINE__);
|
|
|
+
|
|
|
+// gis_opto_calculations('Inwestycje_Planowane','gid','Agr_ilosc_przeciskow','Rozdzielcza_Przeciski_110mm','the_geom','******F**','and t1."ID_PROJECT"=t2."ID_PROJECT" ');
|
|
|
+ gis_opto_calculations('IN7_MK_BAZA_DYSTRYBUCJI',array('ID','gid'),'Agr_ilosc_przeciskow','Rozdzielcza_Przeciski_110mm','the_geom','******F**','and t1."ID"::int=t2."ID_PROJECT"::int and t1."ID"!=0');
|
|
|
+
|
|
|
+// gis_opto_calculations('Inwestycje_Planowane','gid','Agr_ilosc_zabrukow','Rozdzielcza_Zabruki','the_geom','******F**','and t1."ID_PROJECT"=t2."ID_PROJECT" ');
|
|
|
+ gis_opto_calculations('IN7_MK_BAZA_DYSTRYBUCJI',array('ID','gid'),'Agr_ilosc_zabrukow','Rozdzielcza_Zabruki','the_geom','******F**','and t1."ID"::int=t2."ID_PROJECT"::int and t1."ID"!=0');
|
|
|
+DEBUG_S(-3,'CheckPoint',null,__FILE__,__FUNCTION__,__LINE__);
|
|
|
+// gis_opto_calculations_count('Inwestycje_Planowane','gid','Agr_ilosc_domow','MK_Mieszkania','the_geom','******F**','and t1."ID_PROJECT"=t2."ID_PROJECT" ');
|
|
|
+ gis_opto_calculations_count('IN7_MK_BAZA_DYSTRYBUCJI',array('ID','gid'),'Agr_ilosc_domow','MK_Mieszkania','the_geom','******F**','and t1."ID"::int=t2."ID_PROJECT"::int and t1."ID"!=0');
|
|
|
+
|
|
|
+// gis_opto_calculations_count('Inwestycje_Planowane','gid','Agr_ilosc_wezlow','Rozdzielcza_wezly','the_geom','******F**','and t1."ID_PROJECT"=t2."ID_PROJECT" ');
|
|
|
+ gis_opto_calculations_count('IN7_MK_BAZA_DYSTRYBUCJI',array('ID','gid'),'Agr_ilosc_wezlow','Rozdzielcza_wezly','the_geom','******F**','and t1."ID"::int=t2."ID_PROJECT"::int and t1."ID"!=0');
|
|
|
+
|
|
|
+// gis_opto_calculations_count('Inwestycje_Planowane','gid','Agr_ilosc_wezlow_koszt','Rozdzielcza_wezly','the_geom','******F**','and t1."ID_PROJECT"=t2."ID_PROJECT" ','koszt_jedn');
|
|
|
+ gis_opto_calculations_count('IN7_MK_BAZA_DYSTRYBUCJI',array('ID','gid'),'Agr_ilosc_wezlow_koszt','Rozdzielcza_wezly','the_geom','******F**','and t1."ID"::int=t2."ID_PROJECT"::int and t1."ID"!=0','koszt_jedn');
|
|
|
+
|
|
|
+// gis_opto_calculations_sum('Inwestycje_Planowane','gid','Agr_Rozdzielcza_koszty_dodatkowe_wsg84','Rozdzielcza_koszty_dodatkowe_wsg84','the_geom','******F**','and t1."ID_PROJECT"=t2."ID_PROJECT"','Wartosc_kosztu');
|
|
|
+ gis_opto_calculations_sum('IN7_MK_BAZA_DYSTRYBUCJI',array('ID','gid'),'Agr_Rozdzielcza_koszty_dodatkowe_wsg84','Rozdzielcza_koszty_dodatkowe_wsg84','the_geom','******F**','and t1."ID"::int=t2."ID_PROJECT"::int and t1."ID"!=0','Wartosc_kosztu');
|
|
|
+
|
|
|
+ // PROCESY5_to_GIS('TELBOXES','ID','Rozdzielcza_lokalizacje','ID_TELBOXES');
|
|
|
+ // PROCESY5_to_GIS('IN7_MK_BAZA_DYSTRYBUCJI','ID','Inwestycje_Planowane','ID_PROJECT');
|
|
|
+
|
|
|
+ // POSTGIS_to_MYSQL_Tables('BUILDINGS','geoportal_gml_punkty_adr_gml_id','MK_Budynki','geoportal_gml_punkty_adr_gml_id');
|
|
|
+ // POSTGIS_to_MYSQL_Tables('IN7_MK_BAZA_DYSTRYBUCJI','ID','Inwestycje_Planowane','ID_PROJECT');
|
|
|
+
|
|
|
+ // USERS2_MARKETING_OVERWIEV_to_MK_Budynki();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// $sql_cena='update "Inwestycje_Planowane" set "Agr_metrow_mikrorurek_5szt"=0 where "Agr_metrow_mikrorurek_5szt" is null;';
|
|
|
+// $gdb->query($sql_cena);
|
|
|
+
|
|
|
+ $sql_cena='update "IN7_MK_BAZA_DYSTRYBUCJI" set "Agr_metrow_mikrorurek_5szt"=0 where "Agr_metrow_mikrorurek_5szt" is null;';
|
|
|
$gdb->query($sql_cena);
|
|
|
- $sql_cena='update "Inwestycje_Planowane" set "Agr_ilosc_zabrukow"=0 where "Agr_ilosc_zabrukow" is null;';
|
|
|
+
|
|
|
+// $sql_cena='update "Inwestycje_Planowane" set "Agr_ilosc_zabrukow"=0 where "Agr_ilosc_zabrukow" is null;';
|
|
|
+// $gdb->query($sql_cena);
|
|
|
+
|
|
|
+ $sql_cena='update "IN7_MK_BAZA_DYSTRYBUCJI" set "Agr_ilosc_zabrukow"=0 where "Agr_ilosc_zabrukow" is null;';
|
|
|
$gdb->query($sql_cena);
|
|
|
|
|
|
- $sql_cena='update "Inwestycje_Planowane" set
|
|
|
- koszt_wspolny="Agr_ilosc_wykopu"*10
|
|
|
- +"Agr_metrow_mikrorurek"*3
|
|
|
- +"Agr_metrow_mikrorurek_5szt"*7
|
|
|
- +"Agr_ilosc_przeciskow"*80
|
|
|
- +"Agr_ilosc_zabrukow"*40
|
|
|
-
|
|
|
+
|
|
|
+/* $sql_cena='update "Inwestycje_Planowane" set
|
|
|
+ koszt_wspolny="Agr_ilosc_wykopu"*"Agr_ilosc_wykopu_cena"
|
|
|
+ +"Agr_metrow_mikrorurek"*"Agr_metrow_mikrorurek_cena"
|
|
|
+ +"Agr_metrow_mikrorurek_5szt"*"Agr_metrow_mikrorurek_5szt_cena"
|
|
|
+ +"Agr_ilosc_przeciskow"*"Agr_ilosc_przeciskow_cena"
|
|
|
+ +"Agr_ilosc_zabrukow"*"Agr_ilosc_zabrukow_cena"
|
|
|
+ +"Agr_ilosc_wezlow_koszt"
|
|
|
+ +"Agr_Rozdzielcza_koszty_dodatkowe_wsg84"
|
|
|
+ +"Agr_Rozdzielcza_rurociag_wsg84_koszt"
|
|
|
+ +"Agr_Rozdzielcza_Kabel_Swiatlowodowy_wsg84_koszt"
|
|
|
+ +"Agr_ilosc_domow"*"Agr_MK_Mieszkania_cena_jedn"
|
|
|
;'; //"Agr_metrow_w_tpsa*3 +Agr_metrow_kabel*
|
|
|
- //+ studnia +
|
|
|
+ ////+ studnia1300 z pioh+ mufa 300 + spliter 200 = 1800 PLN za wezel
|
|
|
+ $gdb->query($sql_cena);
|
|
|
+*/
|
|
|
+ $sql_cena='update "IN7_MK_BAZA_DYSTRYBUCJI" set
|
|
|
+ koszt_wspolny="Agr_ilosc_wykopu"*"Agr_ilosc_wykopu_cena"
|
|
|
+ +"Agr_metrow_mikrorurek"*"Agr_metrow_mikrorurek_cena"
|
|
|
+ +"Agr_metrow_mikrorurek_5szt"*"Agr_metrow_mikrorurek_5szt_cena"
|
|
|
+ +"Agr_ilosc_przeciskow"*"Agr_ilosc_przeciskow_cena"
|
|
|
+ +"Agr_ilosc_zabrukow"*"Agr_ilosc_zabrukow_cena"
|
|
|
+ +"Agr_ilosc_wezlow_koszt"
|
|
|
+ +"Agr_Rozdzielcza_koszty_dodatkowe_wsg84"
|
|
|
+ +"Agr_Rozdzielcza_rurociag_wsg84_koszt"
|
|
|
+ +"Agr_Rozdzielcza_Kabel_Swiatlowodowy_wsg84_koszt"
|
|
|
+ +"Agr_ilosc_domow"*"Agr_MK_Mieszkania_cena_jedn"
|
|
|
+ ;'; //"Agr_metrow_w_tpsa*3 +Agr_metrow_kabel*
|
|
|
+ ////+ studnia1300 z pioh+ mufa 300 + spliter 200 = 1800 PLN za wezel
|
|
|
+ $gdb->query($sql_cena);
|
|
|
+
|
|
|
|
|
|
+// $sql_cena='update "Inwestycje_Planowane" set "Agr_MK_Mieszkania_koszt"=round("Agr_MK_Mieszkania_cena_jedn"*"Agr_ilosc_domow") where "Agr_ilosc_domow">0 ' ;
|
|
|
+// $gdb->query($sql_cena);
|
|
|
+// $sql_cena='update "Inwestycje_Planowane" set "koszt_na_dom"=round("koszt_wspolny"/"Agr_ilosc_domow") where "Agr_ilosc_domow">0 ' ;
|
|
|
+// $gdb->query($sql_cena);
|
|
|
+
|
|
|
+
|
|
|
+ $sql_cena='update "IN7_MK_BAZA_DYSTRYBUCJI" set "Agr_MK_Mieszkania_koszt"=round("Agr_MK_Mieszkania_cena_jedn"*"Agr_ilosc_domow") where "Agr_ilosc_domow">0 ' ;
|
|
|
$gdb->query($sql_cena);
|
|
|
- $sql_cena='update "Inwestycje_Planowane" set "koszt_na_dom"=round("koszt_wspolny"/"Agr_ilosc_domow") where "Agr_ilosc_domow">0 ' ;
|
|
|
+ $sql_cena='update "IN7_MK_BAZA_DYSTRYBUCJI" set "koszt_na_dom"=round("koszt_wspolny"/"Agr_ilosc_domow") where "Agr_ilosc_domow">0 ' ;
|
|
|
$gdb->query($sql_cena);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ ///
|
|
|
+
|
|
|
+ die("celowe zabicie zapytanie: ");
|
|
|
+
|
|
|
|
|
|
gis_opto_relations('opt_tacki','id_0','id_przelac','opt_przelacznice_mufy','id_0','T********');
|
|
|
gis_opto_relations('opt_spawy','id_0','id_tacka','opt_tacki','id_0','T********');
|
|
|
@@ -204,7 +597,6 @@ function SYNC_GIS_TABLES() {
|
|
|
|
|
|
|
|
|
|
|
|
- die("zapytanie: ".$sql);
|
|
|
// add_pg_roles();
|
|
|
//dodanie wszystkich uzytkownikow z haslem
|
|
|
// public static function &get_users_list( $params = array(), $limit = 10, $limit_start = 0, $order_by = '', $order_dir = '' ) {
|
|
|
@@ -376,13 +768,7 @@ function SYNC_GIS_TABLES() {
|
|
|
|
|
|
|
|
|
|
|
|
- $trigger_psql_do_timestamp="CREATE OR REPLACE FUNCTION update_modified_column()
|
|
|
- RETURNS TRIGGER AS $$
|
|
|
- BEGIN
|
|
|
- NEW.modified = now();
|
|
|
- RETURN NEW;
|
|
|
- END;";
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|