/[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 174 by fraynaud, Wed Oct 5 08:18:30 2011 UTC revision 242 by fraynaud, Wed Nov 23 19:39:04 2011 UTC
# Line 53  class destination_shon extends destinati Line 53  class destination_shon extends destinati
53            
54      function triggerajouterapres($id,&$db,$val,$DEBUG){      function triggerajouterapres($id,&$db,$val,$DEBUG){
55      /// calcul shon dossier  [calculate shon dossier]      /// calcul shon dossier  [calculate shon dossier]
56         $sql ="select sum(shon) as shon from destination_shon where dossier ='"         $sql ="select sum(shon) as shon from ".DB_PREFIXE.
57         .$val['dossier']."'" ;               "destination_shon where dossier ='".$val['dossier']."'" ;
58         $res=$db->query($sql);         $res=$db->query($sql);
59         if (database :: isError($res))         if (database :: isError($res))
60            die($res->getMessage()."erreur  ".$sql);            die($res->getMessage()."erreur  ".$sql);
# Line 65  class destination_shon extends destinati Line 65  class destination_shon extends destinati
65            else            else
66                $surface = $row['shon'];                $surface = $row['shon'];
67              $valF['shon_calcul']= $surface;              $valF['shon_calcul']= $surface;
68            $res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);            $res1= $db->autoExecute(DB_PREFIXE.'dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);
69            if (database::isError($res1))            if (database::isError($res1))
70              die($res1->getMessage());              die($res1->getMessage());
71                    if ($DEBUG == 1)                    if ($DEBUG == 1)
# Line 85  class destination_shon extends destinati Line 85  class destination_shon extends destinati
85      function triggermodifierapres($id,&$db,$val,$DEBUG)      function triggermodifierapres($id,&$db,$val,$DEBUG)
86      {      {
87      // calcul shon dossier [calculate shon dossier]      // calcul shon dossier [calculate shon dossier]
88          $sql ="select sum(shon) as shon from destination_shon where dossier ='"          $sql ="select sum(shon) as shon from ".DB_PREFIXE.
89          .$val['dossier']."'" ;          "destination_shon where dossier ='".$val['dossier']."'" ;
90          $res=$db->query($sql);          $res=$db->query($sql);
91           if (database::isError($res))           if (database::isError($res))
92              die($res->getMessage());              die($res->getMessage());
# Line 97  class destination_shon extends destinati Line 97  class destination_shon extends destinati
97            else            else
98                $surface = $row['shon'];                $surface = $row['shon'];
99            $valF['shon_calcul']= $surface;            $valF['shon_calcul']= $surface;
100            $res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);            $res1= $db->autoExecute(DB_PREFIXE.'dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);
101            if (database::isError($res1))            if (database::isError($res1))
102              die($res1->getMessage());              die($res1->getMessage());
103            if ($DEBUG == 1)            if ($DEBUG == 1)
# Line 112  class destination_shon extends destinati Line 112  class destination_shon extends destinati
112      function triggersupprimerapres($id,&$db,$val,$DEBUG)      function triggersupprimerapres($id,&$db,$val,$DEBUG)
113      {      {
114      // calcul shon dossier [calculate shon dossier]      // calcul shon dossier [calculate shon dossier]
115          $sql ="select sum(shon) as shon from destination_shon where dossier ='"          $sql ="select sum(shon) as shon from ".DB_PREFIXE."destination_shon where dossier ='"
116          .$val['dossier']."'" ;          .$val['dossier']."'" ;
117          $res=$db->query($sql);          $res=$db->query($sql);
118          if (database::isError($res))          if (database::isError($res))
# Line 124  class destination_shon extends destinati Line 124  class destination_shon extends destinati
124              else              else
125                $surface = $row['shon'];                $surface = $row['shon'];
126              $valF['shon_calcul']= $surface;              $valF['shon_calcul']= $surface;
127              $res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);              $res1= $db->autoExecute(DB_PREFIXE.'dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);
128              if (database::isError($res1))              if (database::isError($res1))
129              die($res1->getMessage());              die($res1->getMessage());
130              if ($DEBUG == 1)              if ($DEBUG == 1)

Legend:
Removed from v.174  
changed lines
  Added in v.242

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26