/[dolibarr]/dolibarr/htdocs/propal.class.php
ViewVC logotype

Diff of /dolibarr/htdocs/propal.class.php

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

revision 1.62 by eldy, Fri Nov 4 20:24:40 2005 UTC revision 1.63 by eldy, Tue Dec 6 23:45:35 2005 UTC
# Line 347  class Propal Line 347  class Propal
347        $this->fin_validite = $this->datep + ($this->duree_validite * 24 * 3600);        $this->fin_validite = $this->datep + ($this->duree_validite * 24 * 3600);
348    
349        $sql = "INSERT INTO ".MAIN_DB_PREFIX."propal (fk_soc, fk_soc_contact, price, remise, tva, total, datep, datec, ref, fk_user_author, note, model_pdf, fin_validite) ";        $sql = "INSERT INTO ".MAIN_DB_PREFIX."propal (fk_soc, fk_soc_contact, price, remise, tva, total, datep, datec, ref, fk_user_author, note, model_pdf, fin_validite) ";
350        $sql .= " VALUES ($this->socidp, $this->contactid, 0, $this->remise, 0,0,".$this->db->idate($this->datep).", now(), '$this->ref', $this->author, '$this->note','$this->modelpdf',".$this->db->idate($this->fin_validite).")";        $sql .= " VALUES ($this->socidp, $this->contactid, 0, $this->remise, 0,0,".$this->db->idate($this->datep).", now(), '$this->ref', $this->author, '".addslashes($this->note)."','$this->modelpdf',".$this->db->idate($this->fin_validite).")";
351        $sqlok = 0;        $sqlok = 0;
352                
353        if ( $this->db->query($sql) )        if ( $this->db->query($sql) )
# Line 536  class Propal Line 536  class Propal
536                          $objp                  = $this->db->fetch_object($result);                          $objp                  = $this->db->fetch_object($result);
537            
538                          $ligne                 = new PropaleLigne();                          $ligne                 = new PropaleLigne();
539                          $ligne->desc           = stripslashes($objp->description);  // Description ligne                          $ligne->desc           = $objp->description;  // Description ligne
540                          $ligne->libelle        = stripslashes($objp->label);        // Label produit                          $ligne->libelle        = $objp->label;        // Label produit
541                          $ligne->product_desc   = stripslashes($objp->product_desc); // Description produit                          $ligne->product_desc   = $objp->product_desc; // Description produit
542                          $ligne->qty            = $objp->qty;                          $ligne->qty            = $objp->qty;
543                          $ligne->ref            = $objp->ref;                          $ligne->ref            = $objp->ref;
544                          $ligne->tva_tx         = $objp->tva_tx;                          $ligne->tva_tx         = $objp->tva_tx;
# Line 577  class Propal Line 577  class Propal
577                      {                      {
578                          $objp                  = $this->db->fetch_object($result);                          $objp                  = $this->db->fetch_object($result);
579                          $ligne                 = new PropaleLigne();                          $ligne                 = new PropaleLigne();
580                          $ligne->libelle        = stripslashes($objp->description);                          $ligne->libelle        = $objp->description;
581                          $ligne->desc           = stripslashes($objp->description);                          $ligne->desc           = $objp->description;
582                          $ligne->qty            = $objp->qty;                          $ligne->qty            = $objp->qty;
583                          $ligne->ref            = $objp->ref;                          $ligne->ref            = $objp->ref;
584                          $ligne->tva_tx         = $objp->tva_tx;                          $ligne->tva_tx         = $objp->tva_tx;
# Line 1045  class Propal Line 1045  class Propal
1045        }        }
1046    }    }
1047                    
1048    /**      /**
1049     * \brief Mets à jour la note       *      \brief      Mets à jour la note
1050     *       *      \param      note        Note à mettre à jour
1051     */       *      \return     int         <0 si ko, >0 si ok
1052                 */
1053    function update_note($note)      function update_note($note)
1054    {      {
1055      $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET note = '$note'";          $sql = "UPDATE ".MAIN_DB_PREFIX."propal";
1056      $sql .= " WHERE rowid = $this->id;";          $sql.= " SET note = '".addslashes($note)."'";
1057            $sql.= " WHERE rowid = ".$this->id;
1058            
1059      if ($this->db->query($sql) )          if ($this->db->query($sql))
1060        {          {
1061          return 1;              return 1;
1062        }          }
1063      else          else
1064        {          {
1065              $this->error=$this->db->error();              $this->error=$this->db->error();
1066          return -1;              return -1;
1067        }          }
1068    }      }
1069        
1070        
1071    /**    /**

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.63

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26