|
From: <mah...@us...> - 2010-05-10 08:50:40
|
Revision: 374
http://dccss.svn.sourceforge.net/dccss/?rev=374&view=rev
Author: maher_karim
Date: 2010-05-10 08:50:33 +0000 (Mon, 10 May 2010)
Log Message:
-----------
2010-05-10 Maher Abdel karim <mah...@do...>
* print_workorder.php:
* query.php: adjust queries
* etc/symbols.sym:update symbols
* imgages/*.png: update gtz image
* admin/shapefile_dumper.php:fix return value
Modified Paths:
--------------
branches/ms4w/apps/dccss/admin/shapefile_dumper.php
branches/ms4w/apps/dccss/changelog
branches/ms4w/apps/dccss/conf/dccss_pewssa_ar.map
branches/ms4w/apps/dccss/conf/dccss_pewssa_en.map
branches/ms4w/apps/dccss/etc/symbols.sym
branches/ms4w/apps/dccss/images/gtz.PNG
branches/ms4w/apps/dccss/print_workorder.php
branches/ms4w/apps/dccss/query.php
Modified: branches/ms4w/apps/dccss/admin/shapefile_dumper.php
===================================================================
--- branches/ms4w/apps/dccss/admin/shapefile_dumper.php 2009-08-05 09:47:03 UTC (rev 373)
+++ branches/ms4w/apps/dccss/admin/shapefile_dumper.php 2010-05-10 08:50:33 UTC (rev 374)
@@ -103,7 +103,7 @@
//echo($strCommand);
$strResult = system($strCommand, $intReturnValue);
$blnSuccess = false;
- if($intReturnValue == 1) {
+ if($intReturnValue == 0) {
$strCommand = "@echo off & \"".$_SESSION["strZipCommand"].
"\" -j -9 -m \"".
$_SESSION["strMsTmpDirectory"].
@@ -113,7 +113,7 @@
$strTable.".dbf\"";
//echo($strCommand);
$strResult = system($strCommand, $intReturnValue);
- //echo($intReturnValue);
+ //zecho($intReturnValue);
if($intReturnValue == 0) {
$blnSuccess = true;
}
Modified: branches/ms4w/apps/dccss/changelog
===================================================================
--- branches/ms4w/apps/dccss/changelog 2009-08-05 09:47:03 UTC (rev 373)
+++ branches/ms4w/apps/dccss/changelog 2010-05-10 08:50:33 UTC (rev 374)
@@ -1,3 +1,11 @@
+2010-05-10 Maher Abdel karim <mah...@do...>
+
+ * print_workorder.php:
+ * query.php: adjust queries
+ * etc/symbols.sym:update symbols
+ * imgages/*.png: update gtz image
+ * admin/shapefile_dumper.php:fix return value
+
2009-08-05 Maher Abdel karim <mah...@do...>
* script/create_views.sql: Update css_to_billing view creation code
Modified: branches/ms4w/apps/dccss/conf/dccss_pewssa_ar.map
===================================================================
--- branches/ms4w/apps/dccss/conf/dccss_pewssa_ar.map 2009-08-05 09:47:03 UTC (rev 373)
+++ branches/ms4w/apps/dccss/conf/dccss_pewssa_ar.map 2010-05-10 08:50:33 UTC (rev 374)
@@ -83,7 +83,6 @@
END #QUERYMAP
#Collection area boundaries.
-
LAYER #building
TRANSPARENCY 100
NAME 'building'
@@ -92,13 +91,13 @@
TOLERANCEUNITS pixels
connectiontype PostGIS
CONNECTION "dbname=dccss user=dccss password=dccss host=localhost"
- data "the_geom from building using SRID=-1"
+ data "the_geom from building using unique gid using SRID=-1"
HEADER 'header.html'
FOOTER 'footer.html'
LABELCACHE on
# TILEINDEX ''
# TILEITEM ''
- STATUS on
+ STATUS default
DEBUG false
TRANSFORM true
TYPE polygon
@@ -107,17 +106,18 @@
TEMPLATE 'template.html'
#RASTERFILL_STYLE_SOLID
STYLE
- COLOR 255 251 195
+ COLOR 238 232 205
BACKGROUNDCOLOR 255 255 255
END #STYLE
#OUTLINE SYMBOL
STYLE
- OUTLINECOLOR 0 0 0
+ # OUTLINECOLOR 0 0 0
SIZE 1
END
END #CLASS
END #LAYER
+
LAYER #landmark
TRANSPARENCY 100
NAME 'landmark'
@@ -125,7 +125,7 @@
TOLERANCE 3
TOLERANCEUNITS pixels
CONNECTIONTYPE postgis
- CONNECTION "dbname=dccss user=dummy password=dummy host=localhost"
+ CONNECTION "dbname=dccss user=dcmms password=dcmms host=localhost"
DATA "the_geom from (select the_geom as the_geom,str_reverse(shape_arabic(dcmmstranslation('ar',name))) as name,
gid from landmarkview) as landmarkview using unique gid using SRID=-1"
labelitem "name"
@@ -247,6 +247,7 @@
END
END #LAYER
+
# DeliveryPoint Layer
LAYER
CONNECTIONTYPE postgis
@@ -288,7 +289,7 @@
CLASS
NAME "Center Point"
#template "ttt_query.html"
- SYMBOL "SQUARE"
+ SYMBOL "flag"
SIZE 30
color 255 0 0
outlinecolor 255 255 255
@@ -299,19 +300,67 @@
END
TOLERANCE 15
END
+
+
layer
connectiontype PostGIS
- CONNECTION "dbname=dccss user=dummy password=dummy host=localhost"
- name "route"
+ CONNECTION "dbname=dccss user=dcmms password=dcmms host=localhost"
+ name "route_filter"
type line
status Off
labelitem "logbookno"
- DATA "the_geom from route"
+ DATA "the_geom from route using unique gid"
CLASS
NAME "route"
TEMPLATE 'template.html'
#PEN
STYLE
+ SIZE 3
+ COLOR 255 0 0
+ END #STYLE
+ END
+
+END
+
+layer
+ connectiontype PostGIS
+ CONNECTION "dbname=dccss user=dcmms password=dcmms host=localhost"
+ name "cabinet"
+ type point
+ status Off
+ labelitem "pewssaid"
+ DATA "the_geom from metercabinet using unique gid"
+ CLASS
+ NAME "route"
+ TEMPLATE 'template.html'
+
+ symbol "square"
+ SIZE 15
+ COLOR 255 0 0
+ label
+ color 38 119 38
+ position uc
+ font arial
+ type truetype
+ size 9
+ end
+ END
+
+END
+
+layer
+ connectiontype PostGIS
+ CONNECTION "dbname=dccss user=dcmms password=dcmms host=localhost"
+ name "route"
+ type line
+ status On
+ labelitem "logbookno"
+ DATA "the_geom from route using unique gid"
+ CLASS
+ NAME "route"
+ TEMPLATE 'template.html'
+ #PEN
+ STYLE
SIZE 30
COLOR 100 102 100
END #STYLE
@@ -332,6 +381,7 @@
END
+
LAYER #collection
TRANSPARENCY 100
NAME 'collection'
@@ -339,7 +389,7 @@
TOLERANCE 3
TOLERANCEUNITS pixels
CONNECTIONTYPE postgis
- CONNECTION "dbname=dccss user=dummy password=dummy host=localhost"
+ CONNECTION "dbname=dccss user=dcmms password=dcmms host=localhost"
DATA "the_geom from (select the_geom,str_reverse(shape_arabic(dcmmstranslation('ar',name))) as name,id from collect) as collection using unique id using SRID=-1)"
labelitem "name"
HEADER 'header.html'
@@ -364,6 +414,66 @@
END #CLASS
END #LAYER
+# Billing Observation Layer
+LAYER
+ CONNECTIONTYPE postgis
+ NAME Observation
+ TYPE POINT
+ STATUS DEFAULT
+ CONNECTION "dbname=dccss user=dccss password=dccss host=localhost"
+ DATA "the_geom from (select the_geom,observation,evaluation,decisionmatrix,
+ meterlocation,plotting.username from DeliveryPoint right outer join plotting on
+ deliverypoint.sequence=plotting.meterlocation where observation=1) as f
+ using unique meterlocation using SRID=-1"
+ CLASS
+ NAME 'Observation'
+ template "ttt_query.html"
+ SYMBOL 'O'
+ SIZE 20
+ color 255 0 0
+ END
+END # Layer
+
+# Billing Observation Layer
+LAYER
+ CONNECTIONTYPE postgis
+ NAME Evaluation
+ TYPE POINT
+ STATUS DEFAULT
+ CONNECTION "dbname=dccss user=dccss password=dccss host=localhost"
+ DATA "the_geom from (select the_geom,observation,evaluation,decisionmatrix,
+ meterlocation,plotting.username from DeliveryPoint right outer join plotting on
+ deliverypoint.sequence=plotting.meterlocation where evaluation=1) as f
+ using unique meterlocation using SRID=-1"
+ CLASS
+ NAME 'evaluation'
+ template "ttt_query.html"
+ SYMBOL "E"
+ SIZE 20
+ color 0 255 0
+ END
+END # Layer
+
+# Billing Observation Layer
+LAYER
+ CONNECTIONTYPE postgis
+ NAME Decisionmatrix
+ TYPE POINT
+ STATUS DEFAULT
+ CONNECTION "dbname=dccss user=dccss password=dccss host=localhost"
+ DATA "the_geom from (select the_geom,observation,evaluation,decisionmatrix,
+ meterlocation,plotting.username from DeliveryPoint right outer join plotting on
+ deliverypoint.sequence=plotting.meterlocation where decisionmatrix=1) as f
+ using unique meterlocation using SRID=-1"
+ CLASS
+ NAME 'DM'
+ template "ttt_query.html"
+ SYMBOL "flag"
+ SIZE 30
+ color 0 0 255
+ END
+END # Layer
+
END #MAP
Modified: branches/ms4w/apps/dccss/conf/dccss_pewssa_en.map
===================================================================
--- branches/ms4w/apps/dccss/conf/dccss_pewssa_en.map 2009-08-05 09:47:03 UTC (rev 373)
+++ branches/ms4w/apps/dccss/conf/dccss_pewssa_en.map 2010-05-10 08:50:33 UTC (rev 374)
@@ -88,8 +88,8 @@
TOLERANCE 3
TOLERANCEUNITS pixels
connectiontype PostGIS
- CONNECTION "dbname=dccss user=dummy password=dummy host=localhost"
- data "the_geom from building using SRID=-1"
+ CONNECTION "dbname=dccss user=dcmms password=dcmms host=localhost"
+ data "the_geom from building using unique gid using SRID=-1"
HEADER 'header.html'
FOOTER 'footer.html'
LABELCACHE on
@@ -122,7 +122,7 @@
TOLERANCE 3
TOLERANCEUNITS pixels
CONNECTIONTYPE postgis
- CONNECTION "dbname=dccss user=dummy password=dummy host=localhost"
+ CONNECTION "dbname=dccss user=dcmms password=dcmms host=localhost"
DATA "the_geom from landmarkview using unique id using SRID=-1"
labelitem "name"
HEADER 'header.html'
@@ -211,7 +211,7 @@
TOLERANCE 3
TOLERANCEUNITS pixels
- CONNECTION "dbname=dccss user=dummy password=dummy host=localhost"
+ CONNECTION "dbname=dccss user=dcmms password=dcmms host=localhost"
data "the_geom from grid using srid=-1"
HEADER 'header.html'
FOOTER 'footer.html'
@@ -251,7 +251,7 @@
# maxscale 15000
TYPE POINT
STATUS off
- CONNECTION "dbname=dccss user=dummy password=dummy host=localhost"
+ CONNECTION "dbname=dccss user=dcmms password=dcmms host=localhost"
DATA "the_geom from DeliveryPoint using SRID=-1"
labelitem "sequence"
CLASS
@@ -277,7 +277,7 @@
# Empty layer,
layer
connectiontype PostGIS
- CONNECTION "dbname=dccss user=dummy password=dummy host=localhost"
+ CONNECTION "dbname=dccss user=dcmms password=dcmms host=localhost"
name "center"
type POINT
status OFF
@@ -285,7 +285,7 @@
CLASS
NAME "Center Point"
#template "ttt_query.html"
- SYMBOL "SQUARE"
+ SYMBOL "flag"
SIZE 30
color 255 0 0
outlinecolor 255 255 255
@@ -298,12 +298,118 @@
END
layer
connectiontype PostGIS
- CONNECTION "dbname=dccss user=dummy password=dummy host=localhost"
+ CONNECTION "dbname=dccss user=dcmms password=dcmms host=localhost"
+ name "route_filter"
+ type line
+ status Off
+ labelitem "logbookno"
+ DATA "the_geom from route using unique gid"
+ CLASS
+ NAME "route"
+ TEMPLATE 'template.html'
+ #PEN
+ STYLE
+ SIZE 3
+ COLOR 255 0 0
+ END #STYLE
+ END
+
+END
+
+layer
+ connectiontype PostGIS
+ CONNECTION "dbname=dccss user=dcmms password=dcmms host=localhost"
+ name "cabinet"
+ type point
+ status Off
+ labelitem "pewssaid"
+ DATA "the_geom from metercabinet using unique gid"
+ CLASS
+ NAME "route"
+ TEMPLATE 'template.html'
+
+ symbol "square"
+ SIZE 15
+ COLOR 255 0 0
+ label
+ color 38 119 38
+ position uc
+ font arial
+ type truetype
+ size 9
+ end
+ END
+
+END
+# Billing Observation Layer
+LAYER
+ CONNECTIONTYPE postgis
+ NAME Observation
+ TYPE POINT
+ STATUS DEFAULT
+ CONNECTION "dbname=dccss user=dccss password=dccss host=localhost"
+ DATA "the_geom from (select the_geom,observation,evaluation,decisionmatrix,
+ meterlocation,plotting.username from DeliveryPoint right outer join plotting on
+ deliverypoint.sequence=plotting.meterlocation where observation=1) as f
+ using unique meterlocation using SRID=-1"
+ CLASS
+ NAME 'Observation'
+ template "ttt_query.html"
+ SYMBOL 'O'
+
+ SIZE 20
+ color 255 0 0
+ END
+END # Layer
+
+# Billing Observation Layer
+LAYER
+ CONNECTIONTYPE postgis
+ NAME Evaluation
+ TYPE POINT
+ STATUS DEFAULT
+ CONNECTION "dbname=dccss user=dccss password=dccss host=localhost"
+ DATA "the_geom from (select the_geom,observation,evaluation,decisionmatrix,
+ meterlocation,plotting.username from DeliveryPoint right outer join plotting on
+ deliverypoint.sequence=plotting.meterlocation where evaluation=1) as f
+ using unique meterlocation using SRID=-1"
+ CLASS
+ NAME 'evaluation'
+ template "ttt_query.html"
+ SYMBOL "E"
+ SIZE 20
+ color 0 255 0
+ END
+END # Layer
+
+# Billing Observation Layer
+LAYER
+ CONNECTIONTYPE postgis
+ NAME Decisionmatrix
+ TYPE POINT
+ STATUS DEFAULT
+ CONNECTION "dbname=dccss user=dccss password=dccss host=localhost"
+ DATA "the_geom from (select the_geom,observation,evaluation,decisionmatrix,
+ meterlocation,plotting.username from DeliveryPoint right outer join plotting on
+ deliverypoint.sequence=plotting.meterlocation where decisionmatrix=1) as f
+ using unique meterlocation using SRID=-1"
+ CLASS
+ NAME 'DM'
+ template "ttt_query.html"
+ SYMBOL "flag"
+ SIZE 30
+ color 0 0 255
+ END
+END # Layer
+
+layer
+ connectiontype PostGIS
+ CONNECTION "dbname=dccss user=dcmms password=dcmms host=localhost"
name "route"
type line
status Off
labelitem "logbookno"
- DATA "the_geom from route"
+ DATA "the_geom from route using unique gid"
CLASS
NAME "route"
TEMPLATE 'template.html'
@@ -336,7 +442,7 @@
TOLERANCE 3
TOLERANCEUNITS pixels
CONNECTIONTYPE postgis
- CONNECTION "dbname=dccss user=dummy password=dummy host=localhost"
+ CONNECTION "dbname=dccss user=dcmms password=dcmms host=localhost"
DATA "the_geom from collect using unique id using SRID=-1"
labelitem "name"
HEADER 'header.html'
Modified: branches/ms4w/apps/dccss/etc/symbols.sym
===================================================================
--- branches/ms4w/apps/dccss/etc/symbols.sym 2009-08-05 09:47:03 UTC (rev 373)
+++ branches/ms4w/apps/dccss/etc/symbols.sym 2010-05-10 08:50:33 UTC (rev 374)
@@ -17,6 +17,31 @@
END
SYMBOL
+ NAME "D"
+ TYPE truetype
+ filled true
+ GAP 15
+ FONT "arial"
+ CHARACTER "░"
+END
+
+SYMBOL
+ NAME "E"
+ TYPE truetype
+ filled true
+ GAP 15
+ FONT "arial"
+ CHARACTER "®"
+END
+SYMBOL
+ NAME "O"
+ TYPE truetype
+ filled true
+ GAP 15
+ FONT "arial"
+ CHARACTER "▲"
+END
+SYMBOL
NAME "square"
TYPE VECTOR
FILLED TRUE
Modified: branches/ms4w/apps/dccss/images/gtz.PNG
===================================================================
(Binary files differ)
Modified: branches/ms4w/apps/dccss/print_workorder.php
===================================================================
--- branches/ms4w/apps/dccss/print_workorder.php 2009-08-05 09:47:03 UTC (rev 373)
+++ branches/ms4w/apps/dccss/print_workorder.php 2010-05-10 08:50:33 UTC (rev 374)
@@ -20,11 +20,18 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+if ($_REQUEST['action']!='printRoute'){
+ session_start();
+ $_SESSION['UserName']='softnet';
+ $_SESSION['Password']='softnet';
+ $_SESSION['Language']='ar';
+}
include("include/header.php");
include_once("conf/dccssconfig.php");
include("include/dccsspostgis.php");
include("include/dcmmaputil.php");
//print_r($_SESSION['TaskforceArray']);
+if ($_REQUEST['taskforce']!=''){
for ($m=0;$m<count($_SESSION['TaskforceArray']);$m++){
$record=$m+1;
//print_r($m);
@@ -134,31 +141,7 @@
adjustScalebar($map);
$objLayer = $map->getlayerbyname('DeliveryPoint');
- /*
- if ($objLayer->queryByAttributes("sequence","SEQUENCE=".
- $_SESSION['TaskforceArray'][$m]['dpsequence'],MS_MULTIPLE) ==
- MS_SUCCESS) {
-
- //$oResult=$objLayer->getresult(1);
- $ResultCount=$objLayer->getNumResults();
- //
- //print_r($objLayer->getresult(0));
- $gbShowQueryResults = TRUE;
- for ($i=0; $i < $ResultCount; $i++) {
- $QueryResult=$objLayer->getResult($i);
- $Risultato=$QueryResult->shapeindex;
- $objLayer->open();
- $Shape=$objLayer->getShape(0,$Risultato);
- // print_r ($Shape->values);
- $oExtents=$Shape->bounds;
- //print_r($oExtents);
- $objLayer->close();
-
- $map->setextent($oExtents->minx-50,$oExtents->miny-50,$oExtents->maxx+50,
- $oExtents->maxy+50);
- }
- }*/
-
+
$query = "select X(the_geom),Y(the_geom) from deliverypoint where sequence=".
$_SESSION['TaskforceArray'][$m]['dpsequence'];
$resultextent = pg_query($query);
@@ -169,19 +152,9 @@
$pointX = $r[0];
$pointY=$r[1];
- /*$box3d = str_replace("BOX3D(", "", $box3d);
- $token = strtok($box3d, " ");
- $minx = $token;
-
- $token = strtok(" ");
- $miny = $token;
- $token = strtok(",");
- $token = strtok(" ");
- $maxx = $token+1;
- $token = strtok(" ");
- $maxy = $token+1;*/
+
}
- //$map->setextent($minx-50,$miny-50,$maxx+50,$maxy+50);
+
$map->setextent($pointX-50,$pointY-50,$pointX+50,$pointY+50);
@@ -265,4 +238,176 @@
}
+}
+if ($_REQUEST['action']!=''){
+ $_SESSION['UserName']='softnet';
+ $_SESSION['Password']='softnet';
+ $_SESSION['Language']='ar';
+
+
+ if ($_REQUEST['action']=='printRoute'){
+$strWhere='';
+if ($_REQUEST['routeID']!=''){
+ $strWhere.=' where logbookno='.$_REQUEST['routeID'];
+}
+
+ $query = 'select distinct logbookno from route '.$strWhere;
+
+ $result = pg_query($query);
+ $numrows = pg_numrows($result);
+
+
+$DcssPage = new DccssPage(basename(__FILE__));
+for($rec=0; $rec<$numrows;$rec++) {
+$row = pg_fetch_row($result, $rec);
+
+$strDirection = (0 == strncmp($_SESSION['language'],'ar', 2)) ? 'rtl' :
+ 'ltr';
+$date=date("F j, Y, g:i a");
?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd">
+<html lang="<?= $_SESSION["language"] ?>">
+<head>
+ <title><?= _("Route Map"); ?></title>
+ <link rel="stylesheet" href="include/dccss.css" type="text/css" />
+ <link rel="stylesheet" href="include/<?= $strDirection ?>.css" type="text/css" />
+ <meta http-equiv="content-type" content="text/xhtml; charset=UTF-8" />
+</head>
+<body style="padding: 0px; margin: 0px; border: 0px; height: 18cm;"
+ dir="<?= (0 == strncmp($_SESSION['language'],'ar', 2)) ? 'rtl' :
+ 'ltr' ?>" >
+<table border="1" summary="Header" width="96.5%" height="4%" cellspacing="0"
+ cellpadding="0" nowrap="nowrap">
+ <tr>
+ <td width=25% align="left" ><a style="vertical-align: middle;"
+ href="index.php?PHPSESSID=<?= session_id()?>"><b style="vertical-align: middle;">
+ <img
+ style="vertical-align: left; height=1cm;"
+ src="images/gtz.png" border="0" align="right" />
+ </a>
+ <?= _("German Technical Cooperation-GTZ") ?></b><br>
+ <b style="vertical-align: middle;"><?= _("Institutional Support to Aleppo Water establishment") ?></b><br>
+
+ </td>
+ <td align="left">
+ <b><?= _("Route Printing") ?></b><br>
+ <br>
+ <b><?= _("Date:") ?><?php echo($date); ?></b>
+ </td>
+ <td><img src="<?= $_SESSION["OrgLogoSmall"]?>" border="0" align="right"
+ style="height: 1cm" /></td>
+ </tr>
+</table><table ><tr width=100% style="page-break-after: always">
+ <td width="" height="100%" valign="top"> <?php
+ $map_path="./";
+ $map = ms_newMapObj($map_path.sprintf($_SESSION["strMapFile"],
+ substr($_SESSION['language'], 0, 2)));
+ if(array_key_exists("PATH_TRANSLATED", $_SERVER)) {
+ $map->set("shapepath", str_replace("print_workorder.php", "data",
+ str_replace("\\", "/", $_SERVER["PATH_TRANSLATED"])));
+ }
+ $map->set("width", 1300);
+ $map->set("height", 900);
+
+ setLayerAuthentication($map);
+ adjustScalebar($map);
+
+ $objLayer = $map->getlayerbyname('route');
+
+ if ($objLayer->queryByAttributes('logbookno',"logbookno=".$row[0],MS_SINGLE) ==MS_SUCCESS) {
+
+ $minx=1000000;
+ $miny=1000000;
+ $maxx=-1000000;
+ $maxy=-1000000;
+
+ $ResultCount=$objLayer->getNumResults();
+
+ $gbShowQueryResults = TRUE;
+ for ($i=0; $i < $ResultCount; $i++) {
+ $QueryResult=$objLayer->getResult($i);
+ $Risultato=$QueryResult->shapeindex;
+ $objLayer->open();
+ $Shape=$objLayer->getShape(0,$Risultato);
+ $oExtents=$Shape->bounds;
+ // print_r($oExtents);
+ $objLayer->close();
+ $minx=min($minx,$oExtents->minx);
+ $miny=min($miny,$oExtents->miny);
+ $maxx=max($maxx,$oExtents->maxx);
+ $maxy=max($maxy,$oExtents->maxy);
+ $pointx=($maxx+$minx)/2;
+ $pointy=($maxy+$miny)/2;
+ //$map->setextent($oExtents->minx-100,$oExtents->miny-100,$oExtents->maxx+100,$oExtents->maxy+100);
+ }
+
+//print_r($minx.'/'.$miny.'/'.$maxx.'/'.$maxy);
+ $map->setextent($minx-50,$miny-50,$maxx+50,$maxy+50);
+
+ $objLayer = $map->getlayerbyname('route');
+ $objLayer->set("status",MS_OFF);
+ $objLayer = $map->getlayerbyname('route_filter');
+ $objLayer->set("status",MS_ON);
+ $objLayer->setfilter("logbookno=".$row[0]);
+ $objLayer = $map->getlayerbyname('collection');
+ $objLayer->set("status", MS_ON);
+ $objLayer = $map->getlayerbyname('grid');
+ $objLayer->set("status", MS_OFF);
+ $objLayer = $map->getlayerbyname('DeliveryPoint');
+ $objLayer->set("status",MS_ON);
+ $objLayer->setfilter("routeid=".$row[0]);
+
+ switch($_REQUEST["case"]) {
+ case "all" :
+ foreach (array('Evaluation','Decisionmatrix','Observation') as $case){
+ $objLayer = $map->getlayerbyname($case);
+ $objLayer->set("status",MS_ON);
+ $objLayer->setfilter("username='".$_REQUEST['username']."'");
+ }
+ break;
+ default:
+ case "all" :
+ foreach (array('Evaluation','Decisionmatrix','Observation') as $case){
+
+ $objLayer = $map->getlayerbyname($case);
+ if ($_REQUEST["case"]==$case){
+ $objLayer->set("status",MS_ON);
+ } else {
+ $objLayer->set("status",MS_OFF);
+ }
+ $objLayer->setfilter("username='".$_REQUEST['username']."'");
+ }
+ break;
+ }
+
+
+
+
+ $image=$map->draw();
+ $image=$map->drawquery();
+ $image2 = $map->embedLegend($image);
+ $image_url=$image->saveWebImage("MS_PNG", 1, 1, 0);
+ $map->labelcache->free();
+
+ // $image->free();
+
+ $img = $map->drawScaleBar();
+ $url = $img->saveWebImage($gImagesFmt, 0, 0, -1);
+
+
+ ?>
+ <a href="index.php?PHPSESSID=<?= session_id()?>"><img src="<?=
+ $image_url ?>" alt="Workorder Map" style="width: 42cm; height: 26.7cm;"/></a>
+ </td>
+ </tr></table>
+
+
+<?php
+ }
+}
+
+}
+
+
+}
+?>
Modified: branches/ms4w/apps/dccss/query.php
===================================================================
--- branches/ms4w/apps/dccss/query.php 2009-08-05 09:47:03 UTC (rev 373)
+++ branches/ms4w/apps/dccss/query.php 2010-05-10 08:50:33 UTC (rev 374)
@@ -58,11 +58,11 @@
//print_r($_POST);
-$objArea =&$Queryform->addElement('hierselect', 'area', _('Area:'),
+$objArea =&$Queryform->addElement('hierselect', 'area', _('Area:'),
array('title' => _('Narrow down the area in which to search for points of interest.')));
$strQuery = 'select dcmmstranslation(\''.$_SESSION['language'].
- '\',Name), CodedValue from AdministrativeArea';
-
+ '\',Name), CodedValue from AdministrativeArea';
+
$arrAdministrativeArea[0] = _('[Select One]');
$objResult =pg_query($strQuery);
@@ -71,7 +71,7 @@
}
$strQuery = 'select dcmmstranslation(\''.$_SESSION['language'].
- '\',Name), Administra, CodedValue from Village where codedvalue in
+ '\',Name), Administra, CodedValue from Village where codedvalue in
(select village from landmark) order by Administra';
$arrVillage[0][0] = _('[Select One]');
$objResult =pg_query($strQuery);
@@ -95,7 +95,7 @@
$arrlandmark[$arrRow[1]][0][0] = _('[Select One]');
}
$arrlandmark[$arrRow[1]][$arrRow[2]][$arrRow[0]] = $arrRow[0];
-
+
}
@@ -120,8 +120,8 @@
$strQuery="select logbook,sequence,subsequence,name,subscribernumber,
meternumber from ".$Queryform->exportValue('Table')." where ";
if (($Queryform->exportValue('query')==1)){
-
- $strWhere="chr(meternumber)='".$Queryform->exportValue('searchvalue')."'";
+
+ $strWhere="chr(meternumber)='".$Queryform->exportValue('searchvalue')."'";
} elseif ($Queryform->exportValue('query')==2){
$strWhere="subscribernumber='".$Queryform->exportValue('searchvalue')."'";
} elseif ($Queryform->exportValue('query')==3){
@@ -133,24 +133,25 @@
} elseif ($Queryform->exportValue('query')==6){
$strWhere="paracodee='".$Queryform->exportValue('searchvalue')."'";
}
-
+
}else{
-
+
// $tablename='public.'.$Queryform->exportValue('Table');
$tablename='public.subscriber';
$strQuery="select deliverypoint.sequence,subscriber.sequence as s,subscriber.logbooknumber,subscriber.name,subscriber.id,
- subscriber.geocode,subscriber.serialnumber,subscriber.subscription,subscriber.subsequence
- from deliverypoint,subscriber where
- subscriber.geocode=deliverypoint.geocode";
+ subscriber.geocode,subscriber.serialnumber,subscriber.subscription,subscriber.subsequence
+ from deliverypoint left outer join metercabinet on (metercabinet.pewssaid=deliverypoint.cabinetid) left outer join subscriber on (
+ subscriber.geocode=deliverypoint.geocode) ";
if ($Queryform->exportValue('query')==1){
- $strWhere=" and serialnumber='".$Queryform->exportValue('searchvalue')."'";
+ $strWhere=" and serialnumber='".$Queryform->exportValue('searchvalue')."'";
} elseif ($Queryform->exportValue('query')==2){
$strWhere=" and subscription='".$Queryform->exportValue('searchvalue')."'";
} elseif ($Queryform->exportValue('query')==3){
$strWhere=" and name='".$Queryform->exportValue('searchvalue')."'";
} elseif ($Queryform->exportValue('query')==4){
$strWhere=" and (deliverypoint.cabinetid='".
- $Queryform->exportValue('searchvalue')."' or subscriber.cabinetid='".
+ $Queryform->exportValue('searchvalue')."' or subscriber.cabinetid='".
+ $Queryform->exportValue('searchvalue')."' or metercabinet.id='".
$Queryform->exportValue('searchvalue')."')";
} elseif ($Queryform->exportValue('query')==5){
$strWhere=" and deliverypoint.sequence=".$Queryform->exportValue('searchvalue');
@@ -158,12 +159,12 @@
$strWhere=" and paracode='".$Queryform->exportValue('searchvalue')."'";
}
}
-
+
$objTable = DB_DataObject::factory($tablename);
if(PEAR::isError($objTable)or(NULL == $objTable)) {
die(_($objTable->getMessage()));
}
-
+
$Queryform->process($Queryform, false);
//$objSubscriber->orderBy('sequence,subsequence');
@@ -172,7 +173,7 @@
$result = pg_query($strQuery.$strWhere);
$numrows = pg_numrows($result);
$objTable->Query($strQuery.$strWhere);
-
+
if (($numrows > 0)){
$objSubscriberTable = $objTable->getTable('<a href="'.
basename(__FILE__).'?PHPSESSID='.session_id().'&geocode=1">'.
@@ -180,7 +181,7 @@
$DccssPage->add($objSubscriberTable->tohtml());
}
}elseif (($_POST['area'][1]!='0')&&($Queryform->exportValue('searchvalue')=='')){
-
+
$strQuery = "select dcmmstranslation('".$_SESSION['language'].
"',landmark.Name), dcmmstranslation('".$_SESSION['language'].
"',administrativearea.name), dcmmstranslation('".$_SESSION['language'].
@@ -192,7 +193,7 @@
$result = pg_query($strQuery);
$numrows = pg_numrows($result);
$objTable->Query($strQuery);
-
+
$objTable = new DbTable($DccssPage->postgis->db, $strQuery);
$objTable->addRows();
$numRowCount = $objTable->getRowCount();
@@ -206,17 +207,17 @@
// for ($i==0;$i<$numRowCount;$i++){
// $arrRow =& pg_fetch_row($result);
-
+
$ref='<a href="deliverypointpage.php?PHPSESSID='.session_id().
'&action=mapLandmark&gid='.$arrRow[3].'&name='.$arrRow[0].'&village='.$arrRow[2].'">'.
_('[View on Map]').'</a>';
$objTable->setCellContents($i, 3, $ref. '<a href="print_ac.php?PHPSESSID='.session_id().
'&action=mapLandmark&gid='.$arrRow[3].'&name='.$arrRow[0].'&village='.$arrRow[2].'">'.
_('[Print]').'</a>');
- $i++;
+ $i++;
}
}
-
+
$DccssPage->add($objTable->toHtml());
}elseif (($Queryform->exportValue('query')==0)&&($Queryform->exportValue('searchvalue')!='')){
@@ -226,7 +227,7 @@
"',administrativearea.name), dcmmstranslation('".$_SESSION['language'].
"',village.name),landmark.gid from landmark
left outer join administrativearea on (landmark.administra=administrativearea.codedvalue)
-left outer join village on (landmark.village=village.codedvalue)
+left outer join village on (landmark.village=village.codedvalue)
where dcmmstranslation('".$_SESSION['language'].
"',landmark.Name) like '%".$Queryform->exportValue('searchvalue')."%' order by gid asc";
//print_r($strQuery);
@@ -234,7 +235,7 @@
$result = pg_query($strQuery);
$numrows = pg_numrows($result);
$objTable->Query($strQuery);
-
+
$objTable = new DbTable($DccssPage->postgis->db, $strQuery);
$objTable->addRows();
$numRowCount = $objTable->getRowCount();
@@ -248,19 +249,19 @@
// for ($i==0;$i<$numRowCount;$i++){
// $arrRow =& pg_fetch_row($result);
-
+
$ref='<a href="deliverypointpage.php?PHPSESSID='.session_id().
'&action=mapLandmark&gid='.$arrRow[3].'&name='.$arrRow[0].'&village='.$arrRow[2].'">'.
_('[View on Map]').'</a>';
$objTable->setCellContents($i, 3, $ref. '<a href="print_ac.php?PHPSESSID='.session_id().
'&action=mapLandmark&gid='.$arrRow[3].'&name='.$arrRow[0].'&village='.$arrRow[2].'">'.
_('[Print]').'</a>');
- $i++;
+ $i++;
}
}
-
+
$DccssPage->add($objTable->toHtml());
-
+
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|