2004-07-15 14:40:07 +02:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
< html > < head > < meta http-equiv = "Content-Type" content = "text/html;charset=iso-8859-1" >
< title > dolibarr: htdocs/lib/webcal.class.php Source File< / title >
< link href = "doxygen.css" rel = "stylesheet" type = "text/css" >
< / head > < body >
<!-- G<> n<EFBFBD> r<EFBFBD> par Doxygen 1.3.7 -->
2004-07-15 20:43:48 +02:00
< div class = "qindex" > < a class = "qindex" href = "index.html" > Page principale< / a > | < a class = "qindex" href = "classes.html" > Liste alphab<EFBFBD> tique< / a > | < a class = "qindex" href = "annotated.html" > Liste des classes< / a > | < a class = "qindex" href = "files.html" > Liste des fichiers< / a > | < a class = "qindex" href = "functions.html" > Membres de classe< / a > | < a class = "qindex" href = "globals.html" > Membres de fichier< / a > < / div >
2004-07-15 14:40:07 +02:00
< h1 > htdocs/lib/webcal.class.php< / h1 > < a href = "webcal_8class_8php.html" > Aller <20> la documentation de ce fichier.< / a > < pre class = "fragment" > < div > 00001 < ?PHP
00002 < span class = "comment" > /* Copyright (C) 2002-2003 Rodolphe Quiedeville < rodolphe@quiedeville.org> < / span >
00003 < span class = "comment" > *< / span >
00004 < span class = "comment" > * This program is free software; you can redistribute it and/or modify< / span >
00005 < span class = "comment" > * it under the terms of the GNU General Public License as published by< / span >
00006 < span class = "comment" > * the Free Software Foundation; either version 2 of the License, or< / span >
00007 < span class = "comment" > * (at your option) any later version.< / span >
00008 < span class = "comment" > *< / span >
00009 < span class = "comment" > * This program is distributed in the hope that it will be useful,< / span >
00010 < span class = "comment" > * but WITHOUT ANY WARRANTY; without even the implied warranty of< / span >
00011 < span class = "comment" > * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the< / span >
00012 < span class = "comment" > * GNU General Public License for more details.< / span >
00013 < span class = "comment" > *< / span >
00014 < span class = "comment" > * You should have received a copy of the GNU General Public License< / span >
00015 < span class = "comment" > * along with this program; if not, write to the Free Software< / span >
00016 < span class = "comment" > * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.< / span >
00017 < span class = "comment" > *< / span >
00018 < span class = "comment" > * $Id$< / span >
00019 < span class = "comment" > * $Source$< / span >
00020 < span class = "comment" > *< / span >
00021 < span class = "comment" > */< / span >
00022
2004-07-15 20:43:48 +02:00
< a name = "l00037" > < / a > < a class = "code" href = "classWebcal.html" > 00037< / a > < span class = "keyword" > class < / span > < a class = "code" href = "classWebcal.html" > Webcal< / a > {
00038 var $localdb;
00039 var $heure = -1;
00040 var $duree = 0;
00041
< a name = "l00046" > < / a > < a class = "code" href = "classWebcal.html#a0" > 00046< / a > function < a class = "code" href = "classWebcal.html#a0" > Webcal< / a > ()
00047 {
00048 global $conf;
00049
00050 $this-> localdb = < span class = "keyword" > new< / span > Db($conf-> webcal-> db-> type,
00051 $conf-> webcal-> db-> host,
00052 $conf-> webcal-> db-> user,
00053 $conf-> webcal-> db-> pass,
00054 $conf-> webcal-> db-> name);
00055 }
00056
< a name = "l00065" > < / a > < a class = "code" href = "classWebcal.html#a1" > 00065< / a > function < a class = "code" href = "classWebcal.html#a1" > add< / a > ($user, $date, $texte, $desc)
00066 {
00067
00068 $id = $this-> < a class = "code" href = "classWebcal.html#a2" > get_next_id< / a > ();
00069
00070 $cal_id = $id;
00071 $cal_create_by = $user-> webcal_login;
00072 $cal_date = strftime('%Y%m%d', $date);
00073 $cal_time = $this-> heure;
00074 $cal_mod_date = strftime('%Y%m%d', time());
00075 $cal_mod_time = strftime('%H%M', time());
00076 $cal_duration = $this-> duree;
00077 $cal_priority = 2;
00078 $cal_type = < span class = "stringliteral" > "E"< / span > ;
00079 $cal_access = < span class = "stringliteral" > "P"< / span > ;
00080 $cal_name = $texte;
00081 $cal_description = $desc;
2004-07-15 14:40:07 +02:00
00082
2004-07-15 20:43:48 +02:00
00083 $sql = < span class = "stringliteral" > "INSERT INTO webcal_entry (cal_id, cal_create_by,cal_date,cal_time,cal_mod_date,< / span >
00084 < span class = "stringliteral" > cal_mod_time,cal_duration,cal_priority,cal_type, cal_access, cal_name,cal_description)"< / span > ;
2004-07-15 14:40:07 +02:00
00085
2004-07-15 20:43:48 +02:00
00086 $sql .= < span class = "stringliteral" > " VALUES ($cal_id, '$cal_create_by', $cal_date, $cal_time,$cal_mod_date, $cal_mod_time,< / span >
00087 < span class = "stringliteral" > $cal_duration,$cal_priority,'$cal_type', '$cal_access', '$cal_name','$cal_description')"< / span > ;
2004-07-15 14:40:07 +02:00
00088
2004-07-15 20:43:48 +02:00
00089 < span class = "keywordflow" > if< / span > ( $this-> localdb-> query($sql) )
00090 {
2004-07-15 14:40:07 +02:00
00091
2004-07-15 20:43:48 +02:00
00092 $sql = < span class = "stringliteral" > "INSERT INTO webcal_entry_user (cal_id, cal_login, cal_status)"< / span > ;
00093 $sql .= < span class = "stringliteral" > " VALUES ($cal_id, '$cal_create_by', 'A')"< / span > ;
00094
00095 < span class = "keywordflow" > if< / span > ( $this-> localdb-> query($sql) )
00096 {
00097
00098 }
00099 < span class = "keywordflow" > else< / span >
00100 {
00101 $error = $this-> localdb-> error() . '< br> ' .$sql;
00102 }
00103 }
00104 < span class = "keywordflow" > else< / span >
00105 {
00106 $error = $this-> localdb-> error() . '< br> ' .$sql;
00107 }
00108
00109 $this-> localdb-> close();
00110 }
00111
< a name = "l00118" > < / a > < a class = "code" href = "classWebcal.html#a2" > 00118< / a > function < a class = "code" href = "classWebcal.html#a2" > get_next_id< / a > ()
00119 {
00120
00121 $sql = < span class = "stringliteral" > "SELECT max(cal_id) FROM webcal_entry"< / span > ;
00122
00123 < span class = "keywordflow" > if< / span > ($this-> localdb-> query($sql))
00124 {
00125 $id = $this-> localdb-> result(0, 0) + 1;
00126 < span class = "keywordflow" > return< / span > $id;
00127 }
00128 < span class = "keywordflow" > else< / span >
00129 {
00130 print $this-> localdb-> error();
00131 }
00132 }
00133 }
00134 ?>
2004-07-16 08:41:58 +02:00
< / div > < / pre > < hr size = "1" > < address style = "align: right;" > < small > G<EFBFBD> n<EFBFBD> r<EFBFBD> le Fri Jul 16 08:51:52 2004 pour dolibarr par
2004-07-15 14:40:07 +02:00
< a href = "http://www.doxygen.org/index.html" >
< img src = "doxygen.png" alt = "doxygen" align = "middle" border = 0 > < / a > 1.3.7 < / small > < / address >
< / body >
< / html >