/[openfoncier]/trunk/obj/destination_shon.class.php
ViewVC logotype

Diff of /trunk/obj/destination_shon.class.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 20 by fraynaud, Mon Jul 18 15:27:17 2011 UTC revision 38 by fraynaud, Thu Jul 21 14:47:33 2011 UTC
# Line 9  class destination_shon extends destinati Line 9  class destination_shon extends destinati
9          $this->constructeur($id,$db,$debug);          $this->constructeur($id,$db,$debug);
10      }// fin constructeur      }// fin constructeur
11    
12        function setvalF($val){
13            parent::setvalF($val);  
14            // colone numerique
15            if(!is_numeric($val['shon'])) unset ($this->valF['shon']);
16        }
17    
18    
19      function setType(&$form,$maj) {      function setType(&$form,$maj) {
20          parent :: setType($form,$maj);          parent :: setType($form,$maj);
21          if ($maj < 2) { //ajouter et modifier          if ($maj < 2) { //ajouter et modifier
22            $form->setType('dossier', 'hiddenstatic');            $form->setType('dossier', 'hiddenstatic');
23          }            }else
24                 $form->setType('shon', 'text');
25      }      }
26    
27      function setTaille(&$form,$maj){      function setTaille(&$form,$maj){
# Line 35  class destination_shon extends destinati Line 43  class destination_shon extends destinati
43         $sql ="select sum(shon) as shon from destination_shon where dossier ='"         $sql ="select sum(shon) as shon from destination_shon where dossier ='"
44         .$val['dossier']."'" ;         .$val['dossier']."'" ;
45         $res=$db->query($sql);         $res=$db->query($sql);
46         if (DB :: isError($res))         if (database :: isError($res))
47            die($res->getMessage()."erreur  ".$sql);            die($res->getMessage()."erreur  ".$sql);
48         while ($row=& $res->fetchRow( DB_FETCHMODE_ASSOC)){         while ($row=& $res->fetchRow( DB_FETCHMODE_ASSOC)){
49            $cle= " dossier = '".$val['dossier']."'";            $cle= " dossier = '".$val['dossier']."'";
50            $valF['shon_calcul']= $row['shon'];            if(!is_numeric($row['shon']))
51                  $surface=0;
52              else
53                  $surface = $row['shon'];
54                $valF['shon_calcul']= $surface;
55            $res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);            $res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);
56            if (database::isError($res1))            if (database::isError($res1))
57              die($res1->getMessage());              die($res1->getMessage());
# Line 63  class destination_shon extends destinati Line 75  class destination_shon extends destinati
75              die($res->getMessage());              die($res->getMessage());
76          while ($row=& $res->fetchRow( DB_FETCHMODE_ASSOC)){          while ($row=& $res->fetchRow( DB_FETCHMODE_ASSOC)){
77            $cle= " dossier = '".$val['dossier']."'";            $cle= " dossier = '".$val['dossier']."'";
78            $valF['shon_calcul']= $row['shon'];            if(!is_numeric($row['shon']))
79                  $surface=0;
80              else
81                  $surface = $row['shon'];
82              $valF['shon_calcul']= $surface;
83            $res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);            $res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);
84            if (database::isError($res1))            if (database::isError($res1))
85              die($res1->getMessage());              die($res1->getMessage());
# Line 86  class destination_shon extends destinati Line 102  class destination_shon extends destinati
102              die($res->getMessage());              die($res->getMessage());
103          while ($row=& $res->fetchRow( DB_FETCHMODE_ASSOC)){          while ($row=& $res->fetchRow( DB_FETCHMODE_ASSOC)){
104              $cle= " dossier = '".$val['dossier']."'";              $cle= " dossier = '".$val['dossier']."'";
105              $valF['shon_calcul']= $row['shon'];              if(!is_numeric($row['shon']))
106                  $surface=0;
107                else
108                  $surface = $row['shon'];
109                $valF['shon_calcul']= $surface;
110              $res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);              $res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);
111              if (database::isError($res1))              if (database::isError($res1))
112              die($res1->getMessage());              die($res1->getMessage());

Legend:
Removed from v.20  
changed lines
  Added in v.38

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26