diff --git a/doc/dev/php/html/CMailFile_8class_8php-source.html b/doc/dev/php/html/CMailFile_8class_8php-source.html new file mode 100644 index 00000000000..3e9f578453d --- /dev/null +++ b/doc/dev/php/html/CMailFile_8class_8php-source.html @@ -0,0 +1,167 @@ + +
+00001 <?php +00002 /* notes from Dan Potter: +00003 Sure. I changed a few other things in here too though. One is that I let +00004 you specify what the destination filename is (i.e., what is shows up as in +00005 the attachment). This is useful since in a web submission you often can't +00006 tell what the filename was supposed to be from the submission itself. I +00007 also added my own version of chunk_split because our production version of +00008 PHP doesn't have it. You can change that back or whatever though =). +00009 Finally, I added an extra "\n" before the message text gets added into the +00010 MIME output because otherwise the message text wasn't showing up. +00011 /* +00012 note: someone mentioned a command-line utility called 'mutt' that +00013 can mail attachments. +00014 */ +00015 /* +00016 If chunk_split works on your system, change the call to my_chunk_split +00017 to chunk_split +00018 */ +00019 /* Note: if you don't have base64_encode on your sytem it will not work */ +00020 +00021 /* +00022 Éric Seigne <eric.seigne@ryxeo.com> 2004.01.08 +00023 - ajout de la gestion du Cc +00024 - ajout de l'expédition de plusieurs fichiers +00025 +00026 Laurent Destailleur 2004.02.10 +00027 - Correction d'un disfonctionnement suite à modif précédente sur la gestion +00028 des attachements multi-fichiers +00029 */ +00030 +00031 // simple class that encapsulates mail() with addition of mime file attachment. +00032 class CMailFile +00033 { +00034 var $subject; +00035 var $addr_to; +00036 var $addr_cc; +00037 var $text_body; +00038 var $text_encoded; +00039 var $mime_headers; +00040 var $mime_boundary = "--==================_846811060==_"; +00041 var $smtp_headers; +00042 +00043 // CMail("sujet","email_to","email_from","email_msg",tableau du path de fichiers,tableau de type mime,tableau de noms fichiers,"chaine cc") +00044 function CMailFile($subject,$to,$from,$msg,$filename_list,$mimetype_list,$mimefilename_list,$addr_cc = "") +00045 { +00046 $this->subject = $subject; +00047 $this->addr_to = $to; +00048 $this->smtp_headers = $this->write_smtpheaders($from,$addr_cc); +00049 $this->text_body = $this->write_body($msg, $filename_list); +00050 if (count($filename_list)) { +00051 $this->mime_headers = $this->write_mimeheaders($filename_list, $mimefilename_list); +00052 $this->text_encoded = $this->attach_file($filename_list,$mimetype_list,$mimefilename_list); +00053 } +00054 } +00055 +00056 function attach_file($filename_list,$mimetype_list,$mimefilename_list) +00057 { +00058 for ($i = 0; $i < count($filename_list); $i++) { +00059 $encoded = $this->encode_file($filename_list[$i]); +00060 if ($mimefilename_list[$i]) $filename_list[$i] = $mimefilename_list[$i]; +00061 $out = $out . "--" . $this->mime_boundary . "\n"; +00062 if (! $mimetype_list[$i]) { $mimetype_list[$i] = "application/octet-stream"; } +00063 $out = $out . "Content-type: " . $mimetype_list[$i] . "; name=\"$filename_list[$i]\";\n"; +00064 $out = $out . "Content-Transfer-Encoding: base64\n"; +00065 $out = $out . "Content-disposition: attachment; filename=\"$filename_list[$i]\"\n\n"; +00066 $out = $out . $encoded . "\n"; +00067 } +00068 $out = $out . "--" . $this->mime_boundary . "--" . "\n"; +00069 return $out; +00070 // added -- to notify email client attachment is done +00071 } +00072 +00073 function encode_file($sourcefile) +00074 { +00075 // print "<pre> on encode $sourcefile </pre>\n"; +00076 if (is_readable($sourcefile)) +00077 { +00078 $fd = fopen($sourcefile, "r"); +00079 $contents = fread($fd, filesize($sourcefile)); +00080 $encoded = my_chunk_split(base64_encode($contents)); +00081 fclose($fd); +00082 } +00083 return $encoded; +00084 } +00085 +00086 function sendfile() +00087 { +00088 $headers .= $this->smtp_headers . $this->mime_headers; +00089 $message = $this->text_body . $this->text_encoded; +00090 return mail($this->addr_to,$this->subject,stripslashes($message),$headers); +00091 } +00092 +00093 function write_body($msgtext, $filename_list) +00094 { +00095 if (count($filename_list)) +00096 { +00097 $out = "--" . $this->mime_boundary . "\n"; +00098 $out = $out . "Content-Type: text/plain; charset=\"iso8859-15\"\n\n"; +00099 // $out = $out . "Content-Type: text/plain; charset=\"us-ascii\"\n\n"; +00100 } +00101 $out = $out . $msgtext . "\n"; +00102 return $out; +00103 } +00104 +00105 function write_mimeheaders($filename_list, $mimefilename_list) { +00106 $out = "MIME-version: 1.0\n"; +00107 $out = $out . "Content-type: multipart/mixed; "; +00108 $out = $out . "boundary=\"$this->mime_boundary\"\n"; +00109 $out = $out . "Content-transfer-encoding: 7BIT\n"; +00110 for($i = 0; $i < count($filename_list); $i++) { +00111 if ($mimefilename_list[$i]) $filename_list[$i] = $mimefilename_list[$i]; +00112 $out = $out . "X-attachments: $filename_list[$i];\n\n"; +00113 } +00114 return $out; +00115 } +00116 +00117 function write_smtpheaders($addr_from,$addr_cc) +00118 { +00119 $out = "From: $addr_from\n"; +00120 if($addr_cc != "") +00121 $out = $out . "Cc: $addr_cc\n"; +00122 $out = $out . "Reply-To: $addr_from\n"; +00123 $out = $out . "X-Mailer: Dolibarr version " . DOL_VERSION ."\n"; +00124 $out = $out . "X-Sender: $addr_from\n"; +00125 return $out; +00126 } +00127 } +00128 +00129 // usage - mimetype example "image/gif" +00130 // $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filename,$mimetype); +00131 // $mailfile->sendfile(); +00132 +00133 // Splits a string by RFC2045 semantics (76 chars per line, end with \r\n). +00134 // This is not in all PHP versions so I define one here manuall. +00135 function my_chunk_split($str) +00136 { +00137 $stmp = $str; +00138 $len = strlen($stmp); +00139 $out = ""; +00140 while ($len > 0) { +00141 if ($len >= 76) { +00142 $out = $out . substr($stmp, 0, 76) . "\r\n"; +00143 $stmp = substr($stmp, 76); +00144 $len = $len - 76; +00145 } +00146 else { +00147 $out = $out . $stmp . "\r\n"; +00148 $stmp = ""; $len = 0; +00149 } +00150 } +00151 return $out; +00152 } +00153 +00154 // end script +00155 ?> +
1.3.7
+
+
diff --git a/doc/dev/php/html/doxygen.css b/doc/dev/php/html/doxygen.css
new file mode 100644
index 00000000000..dc9da52203c
--- /dev/null
+++ b/doc/dev/php/html/doxygen.css
@@ -0,0 +1,218 @@
+H1 {
+ text-align: center;
+ font-family: Geneva, Arial, Helvetica, sans-serif;
+}
+H2 {
+ font-family: Geneva, Arial, Helvetica, sans-serif;
+}
+CAPTION { font-weight: bold }
+DIV.qindex {
+ width: 100%;
+ background-color: #eeeeff;
+ border: 1px solid #B0B0B0;
+ text-align: center;
+ margin: 2px;
+ padding: 2px;
+ line-height: 120%;
+}
+A.qindex {
+ text-decoration: none;
+ font-weight: bold;
+ color: #1A419D;
+ padding: 2px;
+}
+A.qindex:visited {
+ text-decoration: none;
+ font-weight: bold;
+ color: #1A419D
+ padding: 2px;
+}
+A.qindex:hover {
+ text-decoration: none;
+ background-color: #ddddff;
+ padding: 2px;
+}
+A.qindexHL {
+ text-decoration: none;
+ font-weight: bold;
+ background-color: #6666cc;
+ color: #ffffff;
+ padding: 2px 6px;
+ border: 1px double #9295C2;
+}
+A.qindexHL:hover {
+ text-decoration: none;
+ background-color: #6666cc;
+ color: #ffffff;
+ padding: 2px 6px;
+}
+A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
+A.el { text-decoration: none; font-weight: bold }
+A.elRef { font-weight: bold }
+A.code { text-decoration: none; font-weight: normal; color: #1A419D}
+A.codeRef { font-weight: normal; color: #1A419D}
+A:hover { text-decoration: none; background-color: #f2f2ff }
+DL.el { margin-left: -1cm }
+PRE.fragment {
+ border: 1px solid #CCCCCC;
+ background-color: #f5f5f5;
+ margin-top: 4px;
+ margin-bottom: 4px;
+ margin-left: 2px;
+ margin-right: 8px;
+ padding-left: 6px;
+ padding-right: 6px;
+ padding-top: 4px;
+ padding-bottom: 4px;
+}
+DIV.fragment {
+ border: 1px solid #CCCCCC;
+ background-color: #f5f5f5;
+ padding: 6px;
+}
+DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
+TD.md { background-color: #F4F4FB; font-weight: bold; }
+TD.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; }
+TD.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; }
+DIV.groupHeader {
+ margin-left: 16px;
+ margin-top: 12px;
+ margin-bottom: 6px;
+ font-weight: bold;
+ font-family: Geneva, Arial, Helvetica, sans-serif;
+}
+DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller }
+BODY {
+ background: white;
+ color: black;
+ margin-right: 20px;
+ margin-left: 20px;
+}
+TD.indexkey {
+ background-color: #eeeeff;
+ font-weight: bold;
+ padding-right : 10px;
+ padding-top : 2px;
+ padding-left : 10px;
+ padding-bottom : 2px;
+ margin-left : 0px;
+ margin-right : 0px;
+ margin-top : 2px;
+ margin-bottom : 2px;
+ border: 1px solid #CCCCCC;
+}
+TD.indexvalue {
+ background-color: #eeeeff;
+ font-style: italic;
+ padding-right : 10px;
+ padding-top : 2px;
+ padding-left : 10px;
+ padding-bottom : 2px;
+ margin-left : 0px;
+ margin-right : 0px;
+ margin-top : 2px;
+ margin-bottom : 2px;
+ border: 1px solid #CCCCCC;
+}
+TR.memlist {
+ background-color: #f0f0f0;
+}
+P.formulaDsp { text-align: center; }
+IMG.formulaDsp { }
+IMG.formulaInl { vertical-align: middle; }
+SPAN.keyword { color: #008000 }
+SPAN.keywordtype { color: #604020 }
+SPAN.keywordflow { color: #e08000 }
+SPAN.comment { color: #800000 }
+SPAN.preprocessor { color: #806020 }
+SPAN.stringliteral { color: #002080 }
+SPAN.charliteral { color: #008080 }
+.mdTable {
+ border: 1px solid #868686;
+ background-color: #F4F4FB;
+}
+.mdRow {
+ padding: 8px 10px;
+}
+.mdescLeft {
+ font-size: smaller;
+ font-style: italic;
+ background-color: #FAFAFA;
+ padding-left: 8px;
+ border-top: 1px none #E0E0E0;
+ border-right: 1px none #E0E0E0;
+ border-bottom: 1px none #E0E0E0;
+ border-left: 1px none #E0E0E0;
+ margin: 0px;
+}
+.mdescRight {
+ font-size: smaller;
+ font-style: italic;
+ background-color: #FAFAFA;
+ padding-left: 4px;
+ border-top: 1px none #E0E0E0;
+ border-right: 1px none #E0E0E0;
+ border-bottom: 1px none #E0E0E0;
+ border-left: 1px none #E0E0E0;
+ margin: 0px;
+ padding-bottom: 0px;
+ padding-right: 8px;
+}
+.memItemLeft {
+ padding: 1px 0px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-style: solid;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ background-color: #FAFAFA;
+ font-family: Geneva, Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+.memItemRight {
+ padding: 1px 0px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-style: solid;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ background-color: #FAFAFA;
+ font-family: Geneva, Arial, Helvetica, sans-serif;
+ font-size: 13px;
+}
+.search { color: #003399;
+ font-weight: bold;
+}
+FORM.search {
+ margin-bottom: 0px;
+ margin-top: 0px;
+}
+INPUT.search { font-size: 75%;
+ color: #000080;
+ font-weight: normal;
+ background-color: #eeeeff;
+}
+TD.tiny { font-size: 75%;
+}
+a {
+ color: #252E78;
+}
+a:visited {
+ color: #3D2185;
+}
diff --git a/doc/dev/php/html/files.html b/doc/dev/php/html/files.html
new file mode 100644
index 00000000000..182faf3fecf
--- /dev/null
+++ b/doc/dev/php/html/files.html
@@ -0,0 +1,21 @@
+
+
+| htdocs/lib/CMailFile.class.php [code] | |
| htdocs/lib/functions.inc.php [code] | |
| htdocs/lib/ldap.lib.php [code] | Librairie contenant les fonctions pour accèder au serveur ldap |
| htdocs/lib/mysql.lib.php [code] | Classes permettant de gérér la database de dolibarr |
| htdocs/lib/price.lib.php [code] | Librairie contenant les fonctions pour calculer un prix |
| htdocs/lib/thermometer.php [code] | Classe permettant d'afficher un thermometre |
| htdocs/lib/webcal.class.php [code] | Classe permettant d'acceder a la database webcalendar |
1.3.7
+
+
diff --git a/doc/dev/php/html/functions_8inc_8php-source.html b/doc/dev/php/html/functions_8inc_8php-source.html
new file mode 100644
index 00000000000..b6e027aebbb
--- /dev/null
+++ b/doc/dev/php/html/functions_8inc_8php-source.html
@@ -0,0 +1,1111 @@
+
+
+00001 <?PHP +00002 /* Copyright (C) 2000-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> +00003 * Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org> +00004 * Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> +00005 * +00006 * This program is free software; you can redistribute it and/or modify +00007 * it under the terms of the GNU General Public License as published by +00008 * the Free Software Foundation; either version 2 of the License, or +00009 * (at your option) any later version. +00010 * +00011 * This program is distributed in the hope that it will be useful, +00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of +00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +00014 * GNU General Public License for more details. +00015 * +00016 * You should have received a copy of the GNU General Public License +00017 * along with this program; if not, write to the Free Software +00018 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +00019 * or see http://www.gnu.org/ +00020 * +00021 * $Id$ +00022 * $Source$ +00023 * +00024 */ +00025 +00026 $yn[0] = "non"; +00027 $yn[1] = "oui"; +00028 +00029 Function dolibarr_syslog($message) +00030 { +00031 define_syslog_variables(); +00032 +00033 openlog("dolibarr", LOG_PID | LOG_PERROR, LOG_USER); # LOG_USER au lieu de LOG_LOCAL0 car non accepté par tous les PHP +00034 +00035 syslog(LOG_WARNING, $message); +00036 +00037 closelog(); +00038 } +00039 +00040 Function dolibarr_fiche_head($links, $active=0) +00041 { +00042 print "<!-- fiche --><div class=\"tabs\">\n"; +00043 +00044 for ($i = 0 ; $i < sizeof($links) ; $i++) +00045 { +00046 if ($links[$i][2] == 'image') +00047 { +00048 print '<a class="tabimage" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n"; +00049 } +00050 else +00051 { +00052 if ($i == $active) +00053 { +00054 print '<a id="active" class="tab" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n"; +00055 } +00056 else +00057 { +00058 print '<a class="tab" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n"; +00059 } +00060 } +00061 } +00062 +00063 print "</div>\n"; +00064 print "<div class=\"tabBar\">\n<br>\n"; +00065 } +00066 +00067 +00068 Function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='') +00069 // Ajoute ou modifie un parametre dans la table llx_const +00070 // Retour: 0=KO, 1=OK +00071 { +00072 $sql = "REPLACE INTO llx_const SET name = '$name', value='$value', visible=$visible, type='$type', note='$note'"; +00073 +00074 if ($db->query($sql)) +00075 { +00076 return 1; +00077 } +00078 else +00079 { +00080 return 0; +00081 } +00082 } +00083 +00084 Function dolibarr_del_const($db, $name) +00085 // Supprime un parametre de la table llx_const +00086 // Retour: 0=KO, 1=OK +00087 { +00088 $sql = "DELETE FROM llx_const WHERE name='$name'"; +00089 +00090 if ($db->query($sql)) +00091 { +00092 return 1; +00093 } +00094 else +00095 { +00096 return 0; +00097 } +00098 } +00099 +00100 Function dolibarr_print_ca($ca) +00101 { +00102 // Permet d'avoir une fonction commune du formatage des nombres +00103 if ($ca > 1000) +00104 { +00105 $cat = round(($ca / 1000),2); +00106 $cat = "$cat Keuros"; +00107 } +00108 else +00109 { +00110 $cat = round($ca,2); +00111 $cat = "$cat euros"; +00112 } +00113 +00114 if ($ca > 1000000) +00115 { +00116 $cat = round(($ca / 1000000),2); +00117 $cat = "$cat Meuros"; +00118 } +00119 +00120 return $cat; +00121 } +00122 +00123 Function dolibarr_print_date($time,$format="%d %b %Y") +00124 { +00125 // Permet d'avoir une fonction commune du formatage d'affichage des date +00126 return strftime($format,$time); +00127 } +00128 +00129 Function dolibarr_print_object_info($object) +00130 { +00131 print "Créé par : " . $object->user_creation->fullname . '<br>'; +00132 print "Date de création : " . strftime("%A %d %B %Y %H:%M:%S",$object->date_creation) . '<br>'; +00133 print "Modifié par : " . $object->user_modification->fullname . '<br>'; +00134 print "Date de modification : " . strftime("%A %d %B %Y %H:%M:%S",$object->date_modification) . '<br>'; +00135 } +00136 +00137 Function dolibarr_print_phone($phone) +00138 { +00139 // Permet d'avoir une fonction commune du formatage d'affichage des tel/fax +00140 if (strlen(trim($phone)) == 10) +00141 { +00142 return substr($phone,0,2)." ".substr($phone,2,2)." ".substr($phone,4,2)." ".substr($phone,6,2)." ".substr($phone,8,2); +00143 } +00144 else +00145 { +00146 return $phone; +00147 } +00148 } +00149 +00150 Function img_file($alt = "Voir") +00151 { +00152 return '<img src="'.DOL_URL_ROOT.'/theme/'.MAIN_THEME.'/img/file.png" border="0" alt="'.$alt.'">'; +00153 } +00154 +00155 Function img_file_new($alt = "Voir") +00156 { +00157 return '<img src="'.DOL_URL_ROOT.'/theme/'.MAIN_THEME.'/img/filenew.png" border="0" alt="'.$alt.'">'; +00158 } +00159 +00160 +00161 Function img_pdf($alt = "Voir") +00162 { +00163 return '<img src="'.DOL_URL_ROOT.'/theme/'.MAIN_THEME.'/img/pdf.png" border="0" alt="'.$alt.'">'; +00164 } +00165 +00166 Function img_warning($alt = "Voir") +00167 { +00168 return '<img src="'.DOL_URL_ROOT.'/theme/'.MAIN_THEME.'/img/warning.png" border="0" alt="'.$alt.'">'; +00169 } +00170 +00171 Function img_delete($alt = "Supprimer") +00172 { +00173 return '<img src="'.DOL_URL_ROOT.'/theme/'.MAIN_THEME.'/img/delete.png" border="0" alt="'.$alt.'" title="Supprimer">'; +00174 } +00175 +00176 Function img_info($alt = "Informations") +00177 { +00178 return '<img src="'.DOL_URL_ROOT.'/theme/'.MAIN_THEME.'/img/info.png" border="0" alt="'.$alt.'" title="Informations">'; +00179 } +00180 +00181 +00182 Function img_edit($alt = "Modifier") +00183 { +00184 return '<img src="'.DOL_URL_ROOT.'/theme/'.MAIN_THEME.'/img/edit.png" border="0" alt="'.$alt.'" title="Modifier">'; +00185 } +00186 +00187 Function img_phone_in($alt = "Modifier") +00188 { +00189 return '<img src="'.DOL_URL_ROOT.'/theme/'.MAIN_THEME.'/img/call.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; +00190 } +00191 +00192 Function img_phone_out($alt = "Modifier") +00193 { +00194 return '<img src="'.DOL_URL_ROOT.'/theme/'.MAIN_THEME.'/img/call_out.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; +00195 } +00196 +00197 +00198 Function img_alerte($alt = "Alerte") +00199 { +00200 return '<img src="'.DOL_URL_ROOT.'/theme/'.MAIN_THEME.'/img/alerte.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; +00201 } +00202 +00203 +00204 Function img_next($alt = "Suivant") +00205 { +00206 return '<img src="'.DOL_URL_ROOT.'/theme/'.MAIN_THEME.'/img/next.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; +00207 } +00208 +00209 Function img_previous($alt = "Précédent") +00210 { +00211 return '<img src="'.DOL_URL_ROOT.'/theme/'.MAIN_THEME.'/img/previous.png" border="0" alt="'.$alt.'" title="'.$alt.'">'; +00212 } +00213 +00214 +00215 function loginFunction() +00216 { +00220 print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'; +00221 print "\n<html><head><title>Dolibarr Authentification</title>"; +00222 print '<style type="text/css"> +00223 body { +00224 font-size:14px; +00225 font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; +00226 background-color: #cac8c0; +00227 margin-left: 30%; +00228 margin-right: 30%; +00229 margin-top: 10%; +00230 margin-bottom: 1%; +00231 } +00232 div.main { +00233 background-color: white; +00234 text-align: left; +00235 border: solid black 1px; +00236 } +00237 div.main-inside { +00238 background-color: white; +00239 padding-left: 20px; +00240 padding-right: 50px; +00241 text-align: center; +00242 margin-bottom: 50px; +00243 margin-top: 30px; +00244 } +00245 div.footer { +00246 background-color: #dcdff4; +00247 font-size: 10px; +00248 border-top: solid black 1px; +00249 padding-left: 5px; +00250 text-align: center; +00251 } +00252 div.header { +00253 background-color: #dcdff4; +00254 border-bottom: solid black 1px; +00255 padding-left: 5px; +00256 text-align: center; +00257 } +00258 div.footer p { +00259 margin: 0px; +00260 } +00261 a:link,a:visited,a:active { +00262 text-decoration:none; +00263 color:blue; +00264 } +00265 a:hover { +00266 text-decoration:underline; +00267 color:blue; +00268 } +00269 </style> +00270 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15"> +00271 <script language="javascript"> +00272 function donnefocus(){ +00273 document.identification.username.focus(); +00274 } +00275 </script> +00276 </head> +00277 <body onload="donnefocus();"> +00278 <div class="main"> +00279 <div class="header">'; +00280 print 'Dolibarr '.DOL_VERSION; +00281 print ' +00282 </div> +00283 <div class="main-inside"> +00284 '; +00285 +00286 echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="identification">'; +00287 print '<table><tr>'; +00288 print '<td>Login : </td><td><input type="text" name="username"></td></tr>';; +00289 print '<tr><td>Password : </td><td><input type="password" name="password"></td></tr>'; +00290 +00291 echo '</table> +00292 <p align="center"><input value="Login" type="submit"> +00293 </form>'; +00294 } +00295 /* +00296 * +00297 * +00298 */ +00299 function accessforbidden() +00300 { +00301 llxHeader(); +00302 print "Accés interdit"; +00303 llxFooter(); +00304 exit(0); +00305 } +00306 +00307 function doliMoveFileUpload($src_file, $dest_file) +00308 { +00309 $file_name = $dest_file; +00310 +00311 if (substr($file_name, strlen($file_name) -3 , 3) == 'php') +00312 { +00313 $file_name = $dest_file . ".txt"; +00314 } +00315 +00316 return move_uploaded_file($src_file, $file_name); +00317 } +00318 +00319 function dolibarr_user_page_param($db, &$user) +00320 { +00321 foreach ($GLOBALS["_GET"] as $key=>$value) +00322 { +00323 if ($key == "sortfield") +00324 { +00325 $sql = "REPLACE INTO ".MAIN_DB_PREFIX."user_param "; +00326 $sql .= " SET fk_user =".$user->id; +00327 $sql .= " ,page='".$GLOBALS["SCRIPT_URL"] . "'"; +00328 $sql .= " ,param='sortfield'"; +00329 $sql .= " ,value='".urlencode($value)."'"; +00330 +00331 $db->query($sql); +00332 $user->page_param["sortfield"] = $value; +00333 } +00334 +00335 // print $key . "=".$value . "<br>"; +00336 +00337 if ($key == "sortorder") +00338 { +00339 $sql = "REPLACE INTO ".MAIN_DB_PREFIX."user_param "; +00340 $sql .= " SET fk_user =".$user->id; +00341 $sql .= " ,page='".$GLOBALS["SCRIPT_URL"] . "'"; +00342 $sql .= " ,param='sortorder'"; +00343 $sql .= " ,value='".urlencode($value)."'"; +00344 +00345 $db->query($sql); +00346 $user->page_param["sortorder"] = $value; +00347 } +00348 if ($key == "begin") +00349 { +00350 $sql = "REPLACE INTO ".MAIN_DB_PREFIX."user_param "; +00351 $sql .= " SET fk_user =".$user->id; +00352 $sql .= " ,page='".$GLOBALS["SCRIPT_URL"] . "'"; +00353 $sql .= " ,param='begin'"; +00354 $sql .= " ,value='".$value."'"; +00355 +00356 $db->query($sql); +00357 $user->page_param["begin"] = $value; +00358 } +00359 if ($key == "page") +00360 { +00361 $sql = "REPLACE INTO ".MAIN_DB_PREFIX."user_param "; +00362 $sql .= " SET fk_user =".$user->id; +00363 $sql .= " ,page='".$GLOBALS["SCRIPT_URL"] . "'"; +00364 $sql .= " ,param='page'"; +00365 $sql .= " ,value='".$value."'"; +00366 +00367 $db->query($sql); +00368 $user->page_param["page"] = $value; +00369 } +00370 } +00371 } +00372 +00373 function transcoS2L($zonein,$devise) +00374 { +00375 // Open source offert par <A HREF="mailto:alainfloch@free.fr?subject=chif2let">alainfloch@free.fr</A> 28/10/2001, sans garantie. +00376 // début de la fonction de transcodification de somme en toutes lettres +00377 +00378 /* $zonein = "123,56"; +00379 * $devise = "E"; // préciser F si francs , sinon ce sera de l'euro +00380 * $r = transcoS2L($zonein,$devise); // appeler la fonction +00381 * echo "résultat vaut $r<br>"; +00382 * $zonelettresM = strtoupper($r); // si vous voulez la même zone mais tout en majuscules +00383 * echo "résultat en Majuscules vaut $zonelettresM<br>"; +00384 * $zonein = "1,01"; +00385 * $r = transcoS2L($zonein,$devise); +00386 * echo "résultat vaut $r<br>"; +00387 */ +00388 +00389 +00390 if ($devise == "F") +00391 { +00392 $unite_singulier = " franc "; +00393 $unite_pluriel = " francs "; +00394 $cent_singulier = " centime"; +00395 } +00396 else +00397 { +00398 $unite_singulier = " euro "; +00399 $unite_pluriel = " euros "; +00400 $cent_singulier = " centime"; +00401 } +00402 +00403 $arr1_99 = array("zéro","un","deux","trois", +00404 "quatre","cinq","six","sept", +00405 "huit","neuf","dix","onze","douze", +00406 "treize","quatorze","quinze","seize", +00407 "dix-sept","dix-huit","dix-neuf","vingt "); +00408 +00409 $arr1_99[30] = "trente "; +00410 $arr1_99[40] = "quarante "; +00411 $arr1_99[50] = "cinquante "; +00412 $arr1_99[60] = "soixante "; +00413 $arr1_99[70] = "soixante-dix "; +00414 $arr1_99[71] = "soixante et onze"; +00415 $arr1_99[80] = "quatre-vingts "; +00416 $i = 22; +00417 while ($i < 63) {// initialise la table +00418 $arr1_99[$i - 1] = $arr1_99[$i - 2]." et un"; +00419 $j = 0; +00420 while ($j < 8) { +00421 $k = $i + $j; +00422 $arr1_99[$k] = $arr1_99[$i - 2].$arr1_99[$j + 2]; +00423 $j++; +00424 } +00425 $i = $i + 10; +00426 } // fin initialise la table +00427 +00428 $i = 12; +00429 while ($i < 20) {// initialise la table (suite) +00430 $j = 60 + $i; +00431 $arr1_99[$j] = "soixante-".$arr1_99[$i]; +00432 $i++; +00433 } // fin initialise la table (suite) +00434 +00435 $i = 1; +00436 while ($i < 20) {// initialise la table (fin) +00437 $j = 80 + $i; +00438 $arr1_99[$j] = "quatre-vingt-".$arr1_99[$i]; +00439 $i++; +00440 } // fin initialise la table (fin) +00441 // echo "Pour une valeur en entrée = $zonein<br>"; //pour ceux qui ne croient que ce qu'ils voient ! +00442 // quelques petits controles s'imposent !! +00443 $valid = "[a-zA-Z\&\é\"\'\(\-\è\_\ç\à\)\=\;\:\!\*\$\^<>]"; +00444 if (ereg($valid,$zonein)) +00445 { +00446 $r = "<b>la chaîne ".$zonein." n'est pas valide</b>"; +00447 return($r); +00448 } +00449 $zone = explode(" ",$zonein); // supprimer les blancs séparateurs +00450 $zonein = implode("",$zone); // reconcatène la zone input +00451 $zone = explode(".",$zonein); // supprimer les points séparateurs +00452 $zonein = implode("",$zone); // reconcatène la zone input, ça c'est fort ! merci PHP +00453 $virg = strpos($zonein,",",1); // à la poursuite de la virgule +00454 $i = strlen($zonein); // et de la longueur de la zone input +00455 if ($virg == 0) { // ya pas de virgule +00456 if ($i > 7) +00457 { +00458 $r = "<b>la chaîne ".$zonein." est trop longue (maxi = 9 millions)</b>"; +00459 return($r); +00460 } +00461 $deb = 7 - $i; +00462 $zoneanaly = substr($zonechiffres,0,$deb).$zonein.",00"; +00463 } +00464 else +00465 { //ya une virgule +00466 $ti = explode(",",$zonein); // mettre de côté ce qu'il y a devant la virgule +00467 $i = strlen($ti[0]); // en controler la longueur +00468 $zonechiffres = "0000000,00"; +00469 if ($i > 7) +00470 { +00471 $r = "<b>la chaîne ".$zonein." est trop longue (maxi = 9 millions,00)</b>"; +00472 return($r); +00473 } +00474 $deb = 7 - $i; +00475 $zoneanaly = substr($zonechiffres,0,$deb).$zonein; +00476 } +00477 $M= substr($zoneanaly,0,1); +00478 if ($M != 0) +00479 { // qui veut gagner des millions +00480 $r = $arr1_99[$M]." million"; +00481 if ($M ==1) $r = $r." "; +00482 else $r = $r."s "; +00483 if (substr($zoneanaly,1,6)==0) +00484 { +00485 if ($devise == 'F') $r = $r." de "; +00486 else $r = $r."d'"; +00487 } +00488 } +00489 $CM= substr($zoneanaly,1,1); +00490 if ($CM == 1) +00491 { // qui veut gagner des centaines de mille +00492 $r = $r." cent "; +00493 } +00494 else +00495 { // ya des centaines de mille +00496 if ($CM > 1) +00497 { +00498 $r = $r. $arr1_99[$CM]." cent "; +00499 } +00500 } // fin du else ya des centaines de mille +00501 $MM= substr($zoneanaly,2,2); +00502 if (substr($zoneanaly,2,1)==0){ $MM = substr($zoneanaly,3,1);} // enlever le zéro des milliers cause indexation +00503 if ($MM ==0 && $CM > 0) +00504 { +00505 $r = $r."mille "; +00506 } +00507 if ($MM != 0) +00508 { +00509 if ($MM == 80) +00510 { +00511 $r = $r."quatre-vingt mille "; +00512 } +00513 else +00514 { +00515 if ($MM > 1 ) +00516 { +00517 $r = $r.$arr1_99[$MM]." mille "; +00518 } +00519 else +00520 { +00521 if ($CM == 0) $r = $r." mille "; +00522 else +00523 { +00524 $r = $r.$arr1_99[$MM]." mille "; +00525 } +00526 } +00527 } +00528 } +00529 $C2= substr($zoneanaly,5,2); +00530 if (substr($zoneanaly,5,1)==0){ $C2 = substr($zoneanaly,6,1);} // enlever le zéro des centaines cause indexation +00531 $C1= substr($zoneanaly,4,1); +00532 if ($C2 ==0 && $C1 > 1) +00533 { +00534 $r = $r.$arr1_99[$C1]." cents "; +00535 } +00536 else +00537 { +00538 if ($C1 == 1) $r = $r." cent "; +00539 else +00540 { +00541 if ($C1 > 1) $r = $r.$arr1_99[$C1]." cent "; +00542 } +00543 } +00544 if ($C2 != 0) +00545 { +00546 $r = $r.$arr1_99[$C2]; +00547 } +00548 if ($virg !=0) +00549 { +00550 if ($ti[0] > 1) $r = $r. $unite_pluriel; else $r = "un ".$unite_singulier; +00551 } +00552 else +00553 { +00554 if ($zonein > 1) $r = $r.$unite_pluriel; else $r = "un ".$unite_singulier; +00555 } +00556 $UN= substr($zoneanaly,8,2); +00557 if ($UN != "00") +00558 { +00559 $cts = $UN; +00560 if (substr($UN,0,1)==0){ $cts = substr($UN,1,1);} // enlever le zéro des centimes cause indexation +00561 $r = $r." et ". $arr1_99[$cts].$cent_singulier; +00562 if ($UN > 1) $r =$r."s"; // accorde au pluriel +00563 } +00564 $r1 = ltrim($r); // enleve quelques blancs possibles en début de zone +00565 $r = ucfirst($r1); // met le 1er caractère en Majuscule, c'est + zoli +00566 return($r); // retourne le résultat +00567 } // fin fonction transcoS2L +00568 +00569 +00570 +00571 function print_liste_field_titre($name, $file, $field, $begin="", $options="") +00572 { +00573 global $conf; +00574 +00575 print $name." "; +00576 print '<a href="'.$file.'?sortfield='.$field.'&sortorder=asc&begin='.$begin.$options.'">'; +00577 print '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1downarrow.png" border="0" alt="A-Z"></a>'; +00578 print '<a href="'.$file.'?sortfield='.$field.'&sortorder=desc&begin='.$begin.$options.'">'; +00579 print '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1uparrow.png" border="0" alt="Z-A"></a>'; +00580 } +00581 +00582 function print_liste_field_titre_new($name, $file, $field, $begin="", $options="", $td="", $sortfield="") +00583 { +00584 /* +00585 * idem à la fonction ci dessus mais ajoute des fonctionnalités +00586 * +00587 * +00588 */ +00589 global $conf; +00590 if ($sortfield == $field) +00591 { +00592 print '<td class="menusel" '. $td.'>'; +00593 } +00594 else +00595 { +00596 print '<td '. $td.'>'; +00597 } +00598 print $name." "; +00599 print '<a href="'.$file.'?sortfield='.$field.'&sortorder=asc&begin='.$begin.$options.'">'; +00600 print '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1downarrow.png" border="0" alt="A-Z"></a>'; +00601 print '<a href="'.$file.'?sortfield='.$field.'&sortorder=desc&begin='.$begin.$options.'">'; +00602 print '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1uparrow.png" border="0" alt="Z-A"></a>'; +00603 print "</td>"; +00604 } +00605 +00606 /* +00607 * +00608 */ +00609 function print_titre($titre) +00610 { +00611 print '<div class="titre">'.$titre.'</div>'; +00612 } +00613 /* +00614 * Idem que print_titre mais offre en plus possibilité de mettre un text à droite +00615 */ +00616 function print_fiche_titre($titre, $mesg='') +00617 { +00618 print "\n".'<table width="100%" border="0" cellpadding="3" cellspacing="0">'; +00619 print '<tr><td><div class="titre" valign="middle">'.$titre.'</div></td>'; +00620 if (strlen($mesg)) +00621 { +00622 print '<td align="right" valign="middle"><b>'.$mesg.'</b></td>'; +00623 } +00624 print '</tr></table>'."\n"; +00625 } +00626 +00627 /* +00628 * +00629 * +00630 */ +00631 function dol_delete_file($file) +00632 { +00633 return unlink($file); +00634 } +00635 +00636 /* +00637 * +00638 * +00639 */ +00640 function block_access() +00641 { +00642 llxHeader(); +00643 print "Accés refusé"; +00644 llxFooter(); +00645 } +00646 +00647 /* +00648 * +00649 * +00650 */ +00651 +00652 function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $form='', $num=-1) +00653 { +00654 global $conf; +00655 +00656 if ($num > $conf->liste_limit or $num == -1) +00657 { +00658 $nextpage = 1; +00659 } +00660 else +00661 { +00662 $nextpage = 0; +00663 } +00664 +00665 print '<table width="100%" border="0" cellpadding="3" cellspacing="0">'; +00666 +00667 if ($page > 0) +00668 { +00669 print '<tr><td><div class="titre">'.$titre.' - page '.($page+1).'</div></td>'; +00670 } +00671 else +00672 { +00673 print '<tr><td><div class="titre">'.$titre.'</div></td>'; +00674 } +00675 +00676 if ($form) +00677 { +00678 print '<td align="left">'.$form.'</td>'; +00679 } +00680 +00681 print '<td align="right">'; +00682 +00683 if (strlen($sortfield)) +00684 { +00685 $options .= "&sortfield=$sortfield"; +00686 } +00687 +00688 if (strlen($sortorder)) +00689 { +00690 $options .= "&sortorder=$sortorder"; +00691 } +00692 +00693 // affichage des fleches de navigation +00694 +00695 print_fleche_navigation($page,$file,$options, $nextpage); +00696 +00697 print '</td></tr></table>'; +00698 } +00699 +00700 /* +00701 * fonction servant a afficher les fleches de navigation dans les +00702 * pages de liste +00703 */ +00704 function print_fleche_navigation($page,$file,$options='', $nextpage) +00705 { +00706 global $conf; +00707 if ($page > 0) +00708 { +00709 print '<a href="'.$file.'?page='.($page-1).$options.'"><img alt="Page précédente" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1leftarrow.png" border="0"></a>'; +00710 } +00711 +00712 if ($nextpage > 0) +00713 { +00714 print '<a href="'.$file.'?page='.($page+1).$options.'"><img alt="Page suivante" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1rightarrow.png" border="0"></a>'; +00715 } +00716 } +00717 /* +00718 * +00719 * +00720 */ +00721 function print_oui_non($value) +00722 { +00723 if ($value) +00724 { +00725 print '<option value="0">non'; +00726 print '<option value="1" selected>oui'; +00727 } +00728 else +00729 { +00730 print '<option value="0" selected>non'; +00731 print '<option value="1">oui'; +00732 } +00733 } +00734 /* +00735 * +00736 * +00737 */ +00738 function print_date_select($set_time='') +00739 { +00740 if (! $set_time) +00741 { +00742 $set_time = time(); +00743 } +00744 +00745 $strmonth[1] = "Janvier"; +00746 $strmonth[2] = "Février"; +00747 $strmonth[3] = "Mars"; +00748 $strmonth[4] = "Avril"; +00749 $strmonth[5] = "Mai"; +00750 $strmonth[6] = "Juin"; +00751 $strmonth[7] = "Juillet"; +00752 $strmonth[8] = "Août"; +00753 $strmonth[9] = "Septembre"; +00754 $strmonth[10] = "Octobre"; +00755 $strmonth[11] = "Novembre"; +00756 $strmonth[12] = "Décembre"; +00757 +00758 $smonth = 1; $endmonth = 12; +00759 $sday = 1; $endday = 31; +00760 +00761 $cday = date("d", $set_time); +00762 $cmonth = date("n", $set_time); +00763 $syear = date("Y", $set_time); +00764 +00765 print "<select name=\"reday\">"; +00766 +00767 for ($day = 1 ; $day <= $endday ; $day++) +00768 { +00769 if ($day == $cday) +00770 { +00771 print "<option value=\"$day\" selected>$day"; +00772 } +00773 else +00774 { +00775 print "<option value=\"$day\">$day"; +00776 } +00777 } +00778 +00779 print "</select>"; +00780 +00781 +00782 print "<select name=\"remonth\">"; +00783 for ($month = $smonth ; $month <= $endmonth ; $month++) +00784 { +00785 if ($month == $cmonth) +00786 { +00787 print "<option value=\"$month\" selected>" . $strmonth[$month]; +00788 } +00789 else +00790 { +00791 print "<option value=\"$month\">" . $strmonth[$month]; +00792 } +00793 } +00794 print "</select>"; +00795 +00796 print "<select name=\"reyear\">"; +00797 +00798 for ($year = $syear - 2; $year < $syear + 5 ; $year++) +00799 { +00800 if ($year == $syear) +00801 { +00802 print "<option value=\"$year\" SELECTED>$year"; +00803 } +00804 else +00805 { +00806 print "<option value=\"$year\">$year"; +00807 } +00808 } +00809 print "</select>\n"; +00810 +00811 } +00812 /* +00813 * +00814 * +00815 */ +00816 function print_heure_select($prefix,$begin=1,$end=23) { +00817 +00818 print '<select name="'.$prefix.'hour">'; +00819 for ($hour = $begin ; $hour <= $end ; $hour++) { +00820 print "<option value=\"$hour\">$hour"; +00821 } +00822 print "</select> H "; +00823 print '<select name="'.$prefix.'min">'; +00824 for ($min = 0 ; $min < 60 ; $min=$min+5) { +00825 if ($min < 10) { +00826 $min = "0" . $min; +00827 } +00828 print "<option value=\"$min\">$min"; +00829 } +00830 print "</select>\n"; +00831 } +00832 /* +00833 * +00834 * +00835 */ +00836 function print_duree_select($prefix) +00837 { +00838 print '<select name="'.$prefix.'hour">'; +00839 print "<option value=\"0\">0"; +00840 print "<option value=\"1\" SELECTED>1"; +00841 +00842 for ($hour = 2 ; $hour < 13 ; $hour++) +00843 { +00844 print "<option value=\"$hour\">$hour"; +00845 } +00846 print "</select> H "; +00847 print '<select name="'.$prefix.'min">'; +00848 for ($min = 0 ; $min < 55 ; $min=$min+5) +00849 { +00850 print "<option value=\"$min\">$min"; +00851 } +00852 print "</select>\n"; +00853 } +00854 +00855 /* +00856 * Return an amount with format "9 999.99" +00857 * Fonction utilisée dans les pdf et les pages +00858 * html +00859 */ +00860 function price($amount, $html=0) +00861 { +00862 if ($html) +00863 { +00864 +00865 $dec='.'; $thousand=' '; +00866 return ereg_replace(' ',' ',number_format($amount, 2, $dec, $thousand)); +00867 +00868 } +00869 else +00870 { +00871 return number_format($amount, 2, '.', ' '); +00872 } +00873 +00874 } +00875 +00876 function francs($euros) +00877 { +00878 return price($euros * 6.55957); +00879 } +00880 +00881 function tva($euros, $taux=19.6) +00882 { +00883 $taux = $taux / 100 ; +00884 +00885 return sprintf("%01.2f",($euros * $taux)); +00886 } +00887 function inctva($euros, $taux=1.196) +00888 { +00889 return sprintf("%01.2f",($euros * $taux)); +00890 } +00891 +00892 +00893 /* +00894 * +00895 * +00896 */ +00897 function stat_print($basename,$bc1,$bc2,$ftc, $jour) { +00898 +00899 $db = pg_Connect("","","","","$basename"); +00900 if (!$db) { +00901 echo "Pas de connexion a la base\n"; +00902 exit ; +00903 } +00904 +00905 $offset = $jour * 9; +00906 +00907 $sql="SELECT s.date, s.nb, l.libelle FROM stat_base as s, stat_cat as l WHERE s.cat = l.id ORDER by s.date DESC, s.cat ASC LIMIT 9 OFFSET $offset"; +00908 +00909 $result = $db->query($sql); +00910 if (!$result) { +00911 print "Erreur SELECT<br><h1>$sql</h1><br>"; +00912 return 1; +00913 } +00914 +00915 print "<table border=1 cellspacing=0 cellpadding=2>"; +00916 print "<tr><td><font color=\"white\">base <b>$basename</b></font></td>"; +00917 print "<td><font color=\"white\">libelle</font></td>"; +00918 print "</tr>"; +00919 +00920 $num = $db->num_rows(); +00921 $i = 0; +00922 +00923 $tag = 1; +00924 while ( $i < $num) { +00925 $obj = $db->fetch_object( $i); +00926 +00927 $tag = !$tag; +00928 +00929 print "<TR><TD>$obj->date</TD><TD>$obj->libelle</TD>\n"; +00930 print "<TD align=\"center\">$obj->nb</TD></TR>\n"; +00931 $i++; +00932 } +00933 print "</TABLE>"; +00934 $db->free(); +00935 +00936 $db->close(); +00937 +00938 } +00939 +00940 function tab_count($basename,$bc1,$bc2,$ftc) { +00941 +00942 $db = pg_Connect("","","","","$basename"); +00943 if (!$db) { +00944 echo "Pas de connexion a la base\n"; +00945 exit ; +00946 } +00947 +00948 $sql="SELECT count(*) AS nbcv from candidat WHERE active=1"; +00949 $result = $db->query($sql); +00950 if (!$result) { +00951 print "Erreur SELECT<br><h1>$sql</h1><br>"; +00952 return 1; +00953 } +00954 print "<table border=0 bgcolor=black cellspacing=0 cellpadding=0><tr><td>"; +00955 +00956 print "<table border=0 cellspacing=1 cellpadding=1>"; +00957 print "<tr><td><font color=\"white\">base <b>$basename</b></font></td>"; +00958 print "<td><font color=\"white\">libelle</font></td>"; +00959 print "</tr>"; +00960 $nbcv = $db->result( $i, "nbcv"); +00961 +00962 print "<tr $bc1><td><b>$ftc Nombre de CV</font></b></td>\n"; +00963 print "<td align=\"center\">$ftc $nbcv</td>\n"; +00964 print "</tr>\n"; +00965 $db->free(); +00966 +00967 $sql="SELECT count(*) AS nbcv from offre WHERE active=1"; +00968 +00969 $result = $db->query($sql); +00970 if (!$result) { +00971 print "Erreur SELECT<br><h1>$sql</h1><br>"; +00972 } +00973 $nbcv = $db->result( $i, "nbcv"); +00974 +00975 print "<tr $bc2><td><b>$ftc Nombre d'offre</font></b></td>"; +00976 print "<td align=\"center\">$ftc $nbcv</td>"; +00977 print "</tr>"; +00978 +00979 $db->free(); +00980 +00981 +00982 $sql="SELECT count(*) AS nbcv from candidat WHERE active=0"; +00983 +00984 $result = $db->query($sql); +00985 if (!$result) { +00986 print "Erreur SELECT<br><h1>$sql</h1><br>"; +00987 } +00988 +00989 $nbcv = $db->result( $i, "nbcv"); +00990 +00991 print "<tr $bc1><td><b>$ftc Nombre de CV inactifs</font></b></td>\n"; +00992 print "<td align=\"center\">$ftc $nbcv</td>"; +00993 print "</tr>"; +00994 +00995 $db->free(); +00996 +00997 +00998 $sql="SELECT count(*) AS nbcv from offre WHERE active=0"; +00999 +01000 $result = $db->query($sql); +01001 if (!$result) { +01002 print "Erreur SELECT<br><h1>$sql</h1><br>"; +01003 } +01004 +01005 $nbcv = $db->result( $i, "nbcv"); +01006 +01007 print "<tr $bc2><td><b>$ftc Nombre d'offres inactives</font></b></td>\n"; +01008 print "<td align=\"center\">$ftc $nbcv</td>\n"; +01009 print "</tr>\n"; +01010 +01011 $db->free(); +01012 +01013 $sql="SELECT count(*) AS nbsoc from logsoc"; +01014 +01015 $result = $db->query($sql); +01016 if (!$result) { +01017 print "Erreur SELECT<br><h1>$sql</h1><br>"; +01018 } +01019 +01020 $nbsoc = $db->result( $i, "nbsoc"); +01021 +01022 print "<tr $bc1><td><b>$ftc Nombre de logins societes</font></b></td>\n"; +01023 print "<td align=\"center\">$ftc $nbsoc</td>"; +01024 print "</tr>"; +01025 +01026 print "</td></tr></table></td></tr></table>"; +01027 +01028 $db->close(); +01029 +01030 } +01031 +01032 /* +01033 * logfile : permet de logguer dans un fichier +01034 * cette fonction ne fonctionenra que si et seulement si le fichier de +01035 * la constante globale MAIN_DEBUG existe et vaut 1 +01036 */ +01037 function logfile($str,$log="/var/log/dolibarr/dolibarr.log") +01038 { +01039 if (defined("MAIN_DEBUG") && MAIN_DEBUG ==1) +01040 { +01041 if (!file_exists($log)) +01042 { +01043 if (!$file=fopen($log,"w")) +01044 { +01045 return 0; +01046 } +01047 } +01048 else +01049 { +01050 if (!$file=fopen($log,"a+")) +01051 { +01052 return 0; +01053 } +01054 } +01055 $logentry=date("[d/M/Y:H:i:s] ").$str."\n"; +01056 if(!fwrite($file,$logentry)) { +01057 fclose($file); +01058 return 0; +01059 } +01060 fclose($file); +01061 return 1; +01062 } +01063 } +01064 +01065 /* +01066 * Fonctions reprise sur spip +01067 * http://www.uzine.net/spip/ +01068 */ +01069 function creer_pass_aleatoire($longueur = 8, $sel = "") { +01070 $seed = (double) (microtime() + 1) * time(); +01071 srand($seed); +01072 +01073 for ($i = 0; $i < $longueur; $i++) { +01074 if (!$s) { +01075 if (!$s) $s = rand(); +01076 $s = substr(md5(uniqid($s).$sel), 0, 16); +01077 } +01078 $r = unpack("Cr", pack("H2", $s.$s)); +01079 $x = $r['r'] & 63; +01080 if ($x < 10) $x = chr($x + 48); +01081 else if ($x < 36) $x = chr($x + 55); +01082 else if ($x < 62) $x = chr($x + 61); +01083 else if ($x == 63) $x = '/'; +01084 else $x = '.'; +01085 $pass .= $x; +01086 $s = substr($s, 2); +01087 } +01088 return $pass; +01089 } +01090 +01091 /* +01092 * Fonctions reprise sur spip +01093 * http://www.uzine.net/spip/ +01094 */ +01095 +01096 function initialiser_sel() { +01097 global $htsalt; +01098 +01099 $htsalt = '$1$'.creer_pass_aleatoire(); +01100 } +01101 +01102 ?> +
1.3.7
+
+
diff --git a/doc/dev/php/html/globals.html b/doc/dev/php/html/globals.html
new file mode 100644
index 00000000000..a3bd96b239c
--- /dev/null
+++ b/doc/dev/php/html/globals.html
@@ -0,0 +1,25 @@
+
+
++Liste de tous les membres de fichier documentés avec liens vers la documentation:
1.3.7
+
+
diff --git a/doc/dev/php/html/globals_func.html b/doc/dev/php/html/globals_func.html
new file mode 100644
index 00000000000..aa1d71f0990
--- /dev/null
+++ b/doc/dev/php/html/globals_func.html
@@ -0,0 +1,25 @@
+
+
++
1.3.7
+
+
diff --git a/doc/dev/php/html/graph_legend.dot b/doc/dev/php/html/graph_legend.dot
new file mode 100644
index 00000000000..5420927dd83
--- /dev/null
+++ b/doc/dev/php/html/graph_legend.dot
@@ -0,0 +1,22 @@
+digraph G
+{
+ edge [fontname="Helvetica",fontsize=10,labelfontname="Helvetica",labelfontsize=10];
+ node [fontname="Helvetica",fontsize=10,shape=record];
+ Node9 [shape="box",label="Inherited",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="black",style="filled" fontcolor="white"];
+ Node10 -> Node9 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="Helvetica"];
+ Node10 [shape="box",label="PublicBase",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classPublicBase.html"];
+ Node11 -> Node10 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="Helvetica"];
+ Node11 [shape="box",label="Truncated",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="red",URL="$classTruncated.html"];
+ Node13 -> Node9 [dir=back,color="darkgreen",fontsize=10,style="solid",fontname="Helvetica"];
+ Node13 [shape="box",label="ProtectedBase",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classProtectedBase.html"];
+ Node14 -> Node9 [dir=back,color="firebrick4",fontsize=10,style="solid",fontname="Helvetica"];
+ Node14 [shape="box",label="PrivateBase",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classPrivateBase.html"];
+ Node15 -> Node9 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="Helvetica"];
+ Node15 [shape="box",label="Undocumented",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="grey75"];
+ Node16 -> Node9 [dir=back,color="midnightblue",fontsize=10,style="solid",fontname="Helvetica"];
+ Node16 [shape="box",label="Templ< int >",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classTempl.html"];
+ Node17 -> Node16 [dir=back,color="orange",fontsize=10,style="dashed",label="< int >",fontname="Helvetica"];
+ Node17 [shape="box",label="Templ< T >",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classTempl.html"];
+ Node18 -> Node9 [dir=back,color="darkorchid3",fontsize=10,style="dashed",label="m_usedClass",fontname="Helvetica"];
+ Node18 [shape="box",label="Used",fontsize=10,height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classUsed.html"];
+}
diff --git a/doc/dev/php/html/graph_legend.html b/doc/dev/php/html/graph_legend.html
new file mode 100644
index 00000000000..93860ac7312
--- /dev/null
+++ b/doc/dev/php/html/graph_legend.html
@@ -0,0 +1,73 @@
+
+
++Considérez l'exemple suivant:
Si la valeur 240 est attribuée au tag/*! Classe invisible à cause d'une troncature */ +class Invisible { }; + +/*! Classe tronquée, la relation d'héritage est masquée */ +class Truncated : public Invisible { }; + +/*! Classe non documentée avec des commentaires Doxygen */ +class Undocumented { }; + +/*! Classe dérivée par héritage public */ +class PublicBase : public Truncated { }; + +/*! Un modèle de classe */ +template<class T> class Templ { }; + +/*! Classe dérivée par héritage protégé */ +class ProtectedBase { }; + +/*! Classe dérivée par héritage privé */ +class PrivateBase { }; + +/*! Classe utilisée par la classe dérivée */ +class Used { }; + +/*! Super-classe qui hérite de plusieurs autres classes */ +class Inherited : public PublicBase, + protected ProtectedBase, + private PrivateBase, + public Undocumented + public Templ<int> +{ + private: + Used *m_usedClass; +}; +
MAX_DOT_GRAPH_HEIGHT du fichier de configuration, cela génèrera le graphe suivant:<p>
++Les rectangles du graphe ci-dessus ont la signification suivante:
1.3.7
+
+
diff --git a/doc/dev/php/html/index.html b/doc/dev/php/html/index.html
new file mode 100644
index 00000000000..ef9c9aba424
--- /dev/null
+++ b/doc/dev/php/html/index.html
@@ -0,0 +1,14 @@
+
+
++
1.3.7
+
+
diff --git a/doc/dev/php/html/ldap_8lib_8php-source.html b/doc/dev/php/html/ldap_8lib_8php-source.html
new file mode 100644
index 00000000000..a84bf31b1ce
--- /dev/null
+++ b/doc/dev/php/html/ldap_8lib_8php-source.html
@@ -0,0 +1,90 @@
+
+
+00001 <?PHP +00002 /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> +00003 * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> +00004 * +00005 * This program is free software; you can redistribute it and/or modify +00006 * it under the terms of the GNU General Public License as published by +00007 * the Free Software Foundation; either version 2 of the License, or +00008 * (at your option) any later version. +00009 * +00010 * This program is distributed in the hope that it will be useful, +00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of +00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +00013 * GNU General Public License for more details. +00014 * +00015 * You should have received a copy of the GNU General Public License +00016 * along with this program; if not, write to the Free Software +00017 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +00018 * or see http://www.gnu.org/ +00019 * +00020 * $Id$ +00021 * $Source$ +00022 * +00023 */ +00024 +00040 function dolibarr_ldap_connect() +00041 { +00042 $ldapconnect = ldap_connect(LDAP_SERVER_HOST); +00043 +00044 return $ldapconnect; +00045 } +00046 +00054 function dolibarr_ldap_bind($ds) +00055 { +00056 if (defined("LDAP_SERVER_PASS") && LDAP_SERVER_DN && LDAP_SERVER_PASS) +00057 { +00058 $ldapbind = ldap_bind($ds, LDAP_SERVER_DN, LDAP_SERVER_PASS); +00059 } +00060 +00061 return $ldapbind; +00062 } +00063 +00070 function dolibarr_ldap_unbind($ds) +00071 { +00072 +00073 $ldapunbind = ldap_unbind($ds); +00074 +00075 return $ldapunbind; +00076 } +00077 +00084 function dolibarr_ldap_getversion($ds) +00085 { +00086 $version = 0; +00087 +00088 ldap_get_option($ds, LDAP_OPT_PROTOCOL_VERSION, $version); +00089 +00090 return $version; +00091 } +00092 +00101 function dolibarr_ldap_setversion($ds,$version) +00102 { +00103 $ldapsetversion = ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, $version); +00104 +00105 return $ldapsetversion; +00106 } +00107 +00114 function dolibarr_ldap_unacc($str) +00115 { +00116 $stu = ereg_replace("é","e",$str); +00117 $stu = ereg_replace("è","e",$stu); +00118 $stu = ereg_replace("ê","e",$stu); +00119 $stu = ereg_replace("à","a",$stu); +00120 $stu = ereg_replace("ç","c",$stu); +00121 $stu = ereg_replace("ï","i",$stu); +00122 $stu = ereg_replace("ä","a",$stu); +00123 return $stu; +00124 } +00125 +00126 ?> +
1.3.7
+
+
diff --git a/doc/dev/php/html/ldap_8lib_8php.html b/doc/dev/php/html/ldap_8lib_8php.html
new file mode 100644
index 00000000000..f077053f37d
--- /dev/null
+++ b/doc/dev/php/html/ldap_8lib_8php.html
@@ -0,0 +1,280 @@
+
+
++ +
+Aller au code source de ce fichier.
Fonctions | |
| dolibarr_ldap_connect () | |
| ouverture d'une connection vers le serveur ldap. | |
| dolibarr_ldap_bind ($ds) | |
| bind au serveur ldap. | |
| dolibarr_ldap_unbind ($ds) | |
| unbind du serveur ldap. | |
| dolibarr_ldap_getversion ($ds) | |
| verification de la version du serveur ldap. | |
| dolibarr_ldap_setversion ($ds, $version) | |
| changement de la version du serveur ldap. | |
| dolibarr_ldap_unacc ($str) | |
| permet d'enlever les accents d'une chaine. | |
+
+Benoit Mortier.
+Définition dans le fichier ldap.lib.php.
+
+
|
+
| + + | +
+
+ +bind au serveur ldap. + +
+Définition à la ligne 54 du fichier ldap.lib.php. |
+
+
+
|
+
| + + | +
+
+ +ouverture d'une connection vers le serveur ldap. + +
+Définition à la ligne 40 du fichier ldap.lib.php. |
+
+
+
|
+
| + + | +
+
+ +verification de la version du serveur ldap. + +
+Définition à la ligne 84 du fichier ldap.lib.php. |
+
+
+
|
+ ||||||||||||
| + + | +
+
+ +changement de la version du serveur ldap. + +
+Définition à la ligne 101 du fichier ldap.lib.php. |
+
+
+
|
+
| + + | +
+
+ +permet d'enlever les accents d'une chaine. + +
+Définition à la ligne 114 du fichier ldap.lib.php. |
+
+
+
|
+
| + + | +
+
+ +unbind du serveur ldap. + +
+Définition à la ligne 70 du fichier ldap.lib.php. |
+
1.3.7
+
+
diff --git a/doc/dev/php/html/mysql_8lib_8php-source.html b/doc/dev/php/html/mysql_8lib_8php-source.html
new file mode 100644
index 00000000000..d1800b7f1b9
--- /dev/null
+++ b/doc/dev/php/html/mysql_8lib_8php-source.html
@@ -0,0 +1,298 @@
+
+
+00001 <?PHP +00002 /* Copyright (C) 2001 Fabien Seisen <seisen@linuxfr.org> +00003 * Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> +00004 * Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> +00005 * +00006 * $Id$ +00007 * $Source$ +00008 * +00009 * This program is free software; you can redistribute it and/or modify +00010 * it under the terms of the GNU General Public License as published by +00011 * the Free Software Foundation; either version 2 of the License, or +00012 * (at your option) any later version. +00013 * +00014 * This program is distributed in the hope that it will be useful, +00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of +00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +00017 * GNU General Public License for more details. +00018 * +00019 * You should have received a copy of the GNU General Public License +00020 * along with this program; if not, write to the Free Software +00021 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +00022 * +00023 */ +00024 +00035 class DoliDb { +00036 var $db, $results, $ok, $connected, $database_selected; +00037 +00038 // Constantes pour code erreurs +00039 var $ERROR_DUPLICATE=1062; +00040 var $ERROR_TABLEEXISTS=1050; +00041 +00051 Function DoliDb($type = 'mysql', $host = '', $user = '', $pass = '', $name = '') +00052 +00053 // Se connecte au serveur et éventuellement à une base (si spécifié) +00054 // Renvoie 1 en cas de succès, 0 sinon +00055 +00056 { +00057 global $conf; +00058 +00059 if ($host == '') +00060 { +00061 $host = $conf->db->host; +00062 } +00063 +00064 if ($user == '') +00065 { +00066 $user = $conf->db->user; +00067 } +00068 +00069 if ($pass == '') +00070 { +00071 $pass = $conf->db->pass; +00072 } +00073 +00074 if ($name == '') +00075 { +00076 $name = $conf->db->name; +00077 } +00078 +00079 //print "Name DB: $host,$user,$pass,$name<br>"; +00080 +00081 // Essai connexion serveur +00082 +00083 $this->db = $this->connect($host, $user, $pass); +00084 +00085 if ($this->db) +00086 { +00087 $this->connected = 1; +00088 $this->ok = 1; +00089 } +00090 else +00091 { +00092 $this->connected = 0; +00093 $this->ok = 0; +00094 } +00095 +00096 // Si connexion serveur ok et si connexion base demandée, on essaie connexion base +00097 +00098 if ($this->connected && $name) +00099 { +00100 +00101 if ($this->select_db($name) == 1) +00102 { +00103 $this->database_selected = 1; +00104 $this->ok = 1; +00105 } +00106 else +00107 { +00108 $this->database_selected = 0; +00109 $this->ok = 0; +00110 } +00111 +00112 } +00113 else +00114 { +00115 // Pas de selection de base demandée, mais tout est ok +00116 +00117 $this->database_selected = 0; +00118 $this->ok = 1; +00119 } +00120 +00121 return $this->ok; +00122 } +00123 +00130 Function select_db($database) +00131 { +00132 return mysql_select_db($database, $this->db); +00133 } +00134 +00143 Function connect($host, $login, $passwd) +00144 { +00145 $this->db = @mysql_connect($host, $login, $passwd); +00146 //print "Resultat fonction connect: ".$this->db; +00147 return $this->db; +00148 } +00149 +00156 Function create_db($database) +00157 { +00158 if (mysql_create_db ($database, $this->db)) +00159 { +00160 return 1; +00161 } +00162 else +00163 { +00164 return 0; +00165 } +00166 } +00167 +00173 Function clone() +00174 { +00175 $db2 = new DoliDb("", "", "", "", ""); +00176 $db2->db = $this->db; +00177 return $db2; +00178 } +00179 +00188 Function pconnect($host, $login, $passwd) +00189 { +00190 $this->db = mysql_pconnect($host, $login, $passwd); +00191 return $this->db; +00192 } +00193 +00199 Function close() +00200 { +00201 return mysql_close($this->db); +00202 } +00203 +00210 Function begin($do=1) +00211 { +00212 if ($do) +00213 { +00214 return $this->query("BEGIN"); +00215 } +00216 else +00217 { +00218 return 1; +00219 } +00220 } +00221 +00228 Function commit($do=1) +00229 { +00230 if ($do) +00231 { +00232 return $this->query("COMMIT"); +00233 } +00234 else +00235 { +00236 return 1; +00237 } +00238 } +00239 +00246 Function rollback($do=1) +00247 { +00248 if ($do) +00249 { +00250 return $this->query("ROLLBACK"); +00251 } +00252 else +00253 { +00254 return 1; +00255 } +00256 } +00257 +00266 Function query($query, $limit="", $offset="") +00267 { +00268 $query = trim($query); +00269 //print "<p>$query</p>\n"; +00270 $this->results = mysql_query($query, $this->db); +00271 return $this->results; +00272 } +00273 +00280 Function list_tables($database) +00281 { +00282 $this->results = mysql_list_tables($database, $this->db); +00283 return $this->results; +00284 } +00285 +00293 Function result($nb, $fieldname) +00294 { +00295 return mysql_result($this->results, $nb, $fieldname); +00296 } +00297 +00303 Function free() +00304 { +00305 return mysql_free_result($this->results); +00306 } +00307 +00313 Function fetch_object() +00314 { +00315 return mysql_fetch_object($this->results); +00316 } +00317 +00325 Function plimit($limit=0,$offset=0) +00326 { +00327 if ($offset > 0) +00328 { +00329 return " LIMIT $offset,$limit "; +00330 } +00331 else +00332 { +00333 return " LIMIT $limit "; +00334 } +00335 } +00336 +00337 +00338 Function pdate($fname) +00339 { +00340 return "unix_timestamp($fname)"; +00341 } +00342 +00349 Function idate($fname) +00350 { +00351 return strftime("%Y%m%d%H%M%S",$fname); +00352 } +00353 +00359 Function fetch_array() +00360 { +00361 return mysql_fetch_array($this->results); +00362 } +00363 +00369 Function fetch_row() +00370 { +00371 return mysql_fetch_row($this->results); +00372 } +00373 +00381 Function fetch_field() +00382 { +00383 return mysql_fetch_field($this->results); +00384 } +00385 +00386 +00392 Function num_rows() +00393 { +00394 return mysql_num_rows($this->results); +00395 } +00396 +00402 Function num_fields() +00403 { +00404 return mysql_num_fields($this->results); +00405 } +00406 +00412 Function error() +00413 { +00414 return mysql_error($this->db); +00415 } +00416 +00422 Function errno() +00423 { +00424 // $ERROR_DUPLICATE=1062; +00425 // $ERROR_TABLEEXISTS=1050; +00426 +00427 return mysql_errno($this->db); +00428 } +00429 +00435 Function last_insert_id() +00436 { +00437 return mysql_insert_id(); +00438 } +00439 +00445 Function affected_rows() +00446 { +00447 return mysql_affected_rows(); +00448 } +00449 +00450 } +00451 +00452 ?> +
1.3.7
+
+
diff --git a/doc/dev/php/html/mysql_8lib_8php.html b/doc/dev/php/html/mysql_8lib_8php.html
new file mode 100644
index 00000000000..d2b290fb442
--- /dev/null
+++ b/doc/dev/php/html/mysql_8lib_8php.html
@@ -0,0 +1,29 @@
+
+
++ +
+Aller au code source de ce fichier.
+
+Rodolphe Quiedeville.
+Laurent Destailleur.
+Définition dans le fichier mysql.lib.php.
1.3.7
+
+
diff --git a/doc/dev/php/html/price_8lib_8php-source.html b/doc/dev/php/html/price_8lib_8php-source.html
new file mode 100644
index 00000000000..6b2a603873e
--- /dev/null
+++ b/doc/dev/php/html/price_8lib_8php-source.html
@@ -0,0 +1,100 @@
+
+
+00001 <?PHP +00002 /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> +00003 * +00004 * This program is free software; you can redistribute it and/or modify +00005 * it under the terms of the GNU General Public License as published by +00006 * the Free Software Foundation; either version 2 of the License, or +00007 * (at your option) any later version. +00008 * +00009 * This program is distributed in the hope that it will be useful, +00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of +00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +00012 * GNU General Public License for more details. +00013 * +00014 * You should have received a copy of the GNU General Public License +00015 * along with this program; if not, write to the Free Software +00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +00017 * +00018 * $Id$ +00019 * $Source$ +00020 * +00021 */ +00022 +00038 function calcul_price($products, $remise_percent) +00039 { +00040 $total_ht = 0; +00041 $amount_ht = 0; +00042 $tva = array(); +00043 $total_tva = 0; +00044 $total_remise = 0; +00045 +00046 $num = sizeof($products); +00047 $i = 0; +00048 +00049 while ($i < $num) +00050 { +00051 $prod_price = $products[$i][0]; +00052 $prod_qty = $products[$i][1]; +00053 $prod_txtva = $products[$i][2]; +00054 +00055 $lprice = $prod_qty * $prod_price; +00056 +00057 $amount_ht = $amount_ht + $lprice; +00058 +00059 if ($remise_percent > 0) +00060 { +00061 $lremise = ($lprice * $remise_percent / 100); +00062 $lprice = $lprice - $lremise; +00063 $total_remise = $total_remise + $lremise; +00064 } +00065 +00066 $total_ht = $total_ht + $lprice; +00067 +00068 $ligne_tva = ($lprice * ($prod_txtva / 100)); +00069 +00070 $tva[$prod_txtva] = $tva[$prod_txtva] + $ligne_tva; +00071 $i++; +00072 } +00073 +00074 /* +00075 * Sommes et arrondis +00076 */ +00077 $j=0; +00078 $result[5] = array(); +00079 +00080 foreach ($tva as $key => $value) +00081 { +00082 $tva[$key] = round($tva[$key], 2); +00083 $total_tva = $total_tva + $tva[$key]; +00084 $result[5][$key] = $tva[$key]; +00085 $j++; +00086 } +00087 +00088 $total_ht = round($total_ht, 2); +00089 $total_tva = round($total_tva, 2); +00090 +00091 $total_ttc = $total_ht + $total_tva; +00092 +00093 /* +00094 * +00095 */ +00096 $result[0] = $total_ht; +00097 $result[1] = $total_tva; +00098 $result[2] = $total_ttc; +00099 $result[3] = $total_remise; +00100 $result[4] = $amount_ht; +00101 +00102 return $result; +00103 } +
1.3.7
+
+
diff --git a/doc/dev/php/html/price_8lib_8php.html b/doc/dev/php/html/price_8lib_8php.html
new file mode 100644
index 00000000000..9a8f236074f
--- /dev/null
+++ b/doc/dev/php/html/price_8lib_8php.html
@@ -0,0 +1,80 @@
+
+
++ +
+Aller au code source de ce fichier.
Fonctions | |
| calcul_price ($products, $remise_percent) | |
| permet de calculer un prix. | |
+
+Définition dans le fichier price.lib.php.
+
+
|
+ ||||||||||||
| + + | +
+
+ +permet de calculer un prix. + +
+Définition à la ligne 38 du fichier price.lib.php. |
+
1.3.7
+
+
diff --git a/doc/dev/php/html/thermometer_8php-source.html b/doc/dev/php/html/thermometer_8php-source.html
new file mode 100644
index 00000000000..980627d838f
--- /dev/null
+++ b/doc/dev/php/html/thermometer_8php-source.html
@@ -0,0 +1,193 @@
+
+
+00001 <?php +00002 /* Copyright (C) 2002 "stichting Blender Foundation, Timothy Kanters" +00003 * Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> +00004 * +00005 * This program is free software; you can redistribute it and/or modify +00006 * it under the terms of the GNU General Public License as published by +00007 * the Free Software Foundation; either version 2 of the License, or +00008 * (at your option) any later version. +00009 * +00010 * This program is distributed in the hope that it will be useful, +00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of +00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +00013 * GNU General Public License for more details. +00014 * +00015 * You should have received a copy of the GNU General Public License +00016 * along with this program; if not, write to the Free Software +00017 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +00018 * +00019 * $Id$ +00020 * $Source$ +00021 * +00022 */ +00023 +00042 function moneyMeter($actualValue=0, $pendingValue=0, $intentValue=0) +00043 +00044 /* +00045 This function returns the html for the moneymeter. +00046 cachedValue: amount of actual money +00047 pendingValue: amount of money of pending memberships +00048 intentValue: amount of intended money (that's without the amount of actual money) +00049 */ +00050 { +00051 +00052 // variables +00053 $height="200"; +00054 $maximumValue=125000; +00055 +00056 $imageDir = "http://eucd.info/images/"; +00057 +00058 $imageTop = $imageDir . "therm_top.png"; +00059 $imageMiddleActual = $imageDir . "therm_actual.png"; +00060 $imageMiddlePending = $imageDir . "therm_pending.png"; +00061 $imageMiddleIntent = $imageDir . "therm_intent.png"; +00062 $imageMiddleGoal = $imageDir . "therm_goal.png"; +00063 $imageIndex = $imageDir . "therm_index.png"; +00064 $imageBottom = $imageDir . "therm_bottom.png"; +00065 $imageColorActual = $imageDir . "therm_color_actual.png"; +00066 $imageColorPending = $imageDir . "therm_color_pending.png"; +00067 $imageColorIntent = $imageDir . "therm_color_intent.png"; +00068 +00069 $htmlThermTop = ' +00070 <!-- Thermometer Begin --> +00071 <table cellpadding="0" cellspacing="4" border="0"> +00072 <tr><td> +00073 <table cellpadding="0" cellspacing="0" border="0"> +00074 <tr> +00075 <td colspan="2"><img src="' . $imageTop . '" width="58" height="6" border="0"></td> +00076 </tr> +00077 <tr> +00078 <td> +00079 <table cellpadding="0" cellspacing="0" border="0">'; +00080 +00081 $htmlSection = ' +00082 <tr><td><img src="{image}" width="26" height="{height}" border="0"></td></tr>'; +00083 +00084 $htmlThermbottom = ' +00085 </table> +00086 </td> +00087 <td><img src="' . $imageIndex . '" width="32" height="200" border="0"></td> +00088 </tr> +00089 <tr> +00090 <td colspan="2"><img src="' . $imageBottom . '" width="58" height="32" border="0"></td> +00091 </tr> +00092 </table> +00093 </td> +00094 </tr></table>'; +00095 +00096 // legenda +00097 +00098 $legendaActual = "€ " . round($actualValue); +00099 $legendaPending = "€ " . round($pendingValue); +00100 $legendaIntent = "€ " . round($intentValue); +00101 $legendaTotal = "€ " . round($actualValue + $pendingValue + $intentValue); +00102 $htmlLegenda = ' +00103 +00104 <table cellpadding="0" cellspacing="0" border="0"> +00105 <tr><td><img src="' . $imageColorActual . '" width="9" height="9"> </td><td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Payé:<br />' . $legendaActual . '</b></font></td></tr> +00106 <tr><td><img src="' . $imageColorPending . '" width="9" height="9"> </td><td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">En attente:<br />' . $legendaPending . '</font></td></tr> +00107 <tr><td><img src="' . $imageColorIntent . '" width="9" height="9"> </td><td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Promesses:<br />' . $legendaIntent . '</font></td></tr> +00108 <tr><td> </td><td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Total:<br />' . $legendaTotal . '</font></td></tr> +00109 </table> +00110 +00111 <!-- Thermometer End -->'; +00112 +00113 // check and edit some values +00114 +00115 $error = 0; +00116 if ( $maximumValue <= 0 || $height <= 0 || $actualValue < 0 || $pendingValue < 0 || $intentValue < 0) +00117 { +00118 return "The money meter could not be processed<br>\n"; +00119 } +00120 if ( $actualValue > $maximumValue ) +00121 { +00122 $actualValue = $maximumValue; +00123 $pendingValue = 0; +00124 $intentValue = 0; +00125 } +00126 else +00127 { +00128 if ( ($actualValue + $pendingValue) > $maximumValue ) +00129 { +00130 $pendingValue = $maximumValue - $actualValue; +00131 $intentValue = 0; +00132 } +00133 else +00134 { +00135 if ( ($actualValue + $pendingValue + $intentValue) > $maximumValue ) +00136 { +00137 $intentValue = $maximumValue - $actualValue - $pendingValue; +00138 } +00139 } +00140 } +00141 +00142 // start writing the html (from bottom to top) +00143 +00144 // bottom +00145 $thermometer = $htmlThermbottom; +00146 +00147 // actual +00148 $sectionHeight = round(($actualValue / $maximumValue) * $height); +00149 $totalHeight = $totalHeight + $sectionHeight; +00150 if ( $sectionHeight > 0 ) +00151 { +00152 $section = $htmlSection; +00153 $section = str_replace("{image}", $imageMiddleActual, $section); +00154 $section = str_replace("{height}", $sectionHeight, $section); +00155 $thermometer = $section . $thermometer; +00156 } +00157 +00158 // pending +00159 $sectionHeight = round(($pendingValue / $maximumValue) * $height); +00160 $totalHeight = $totalHeight + $sectionHeight; +00161 if ( $sectionHeight > 0 ) +00162 { +00163 $section = $htmlSection; +00164 $section = str_replace("{image}", $imageMiddlePending, $section); +00165 $section = str_replace("{height}", $sectionHeight, $section); +00166 $thermometer = $section . $thermometer; +00167 } +00168 +00169 // intent +00170 $sectionHeight = round(($intentValue / $maximumValue) * $height); +00171 $totalHeight = $totalHeight + $sectionHeight; +00172 if ( $sectionHeight > 0 ) +00173 { +00174 $section = $htmlSection; +00175 $section = str_replace("{image}", $imageMiddleIntent, $section); +00176 $section = str_replace("{height}", $sectionHeight, $section); +00177 $thermometer = $section . $thermometer; +00178 } +00179 +00180 // goal +00181 $sectionHeight = $height- $totalHeight; +00182 if ( $sectionHeight > 0 ) +00183 { +00184 $section = $htmlSection; +00185 $section = str_replace("{image}", $imageMiddleGoal, $section); +00186 $section = str_replace("{height}", $sectionHeight, $section); +00187 $thermometer = $section . $thermometer; +00188 } +00189 +00190 // top +00191 $thermometer = $htmlThermTop . $thermometer; +00192 +00193 return $thermometer . $htmlLegenda; +00194 } +00195 +00196 ?> +00197 +00198 +00199 +
1.3.7
+
+
diff --git a/doc/dev/php/html/thermometer_8php.html b/doc/dev/php/html/thermometer_8php.html
new file mode 100644
index 00000000000..631fa9606cc
--- /dev/null
+++ b/doc/dev/php/html/thermometer_8php.html
@@ -0,0 +1,88 @@
+
+
++ +
+Aller au code source de ce fichier.
Fonctions | |
| moneyMeter ($actualValue=0, $pendingValue=0, $intentValue=0) | |
| permet d'afficher un thermometre monetaire. | |
+
+Timothy Kanters.
+Définition dans le fichier thermometer.php.
+
+
|
+ ||||||||||||||||
| + + | +
+
+ +permet d'afficher un thermometre monetaire. + +
+Définition à la ligne 42 du fichier thermometer.php. |
+
1.3.7
+
+
diff --git a/doc/dev/php/html/webcal_8class_8php-source.html b/doc/dev/php/html/webcal_8class_8php-source.html
new file mode 100644
index 00000000000..de572aadf2d
--- /dev/null
+++ b/doc/dev/php/html/webcal_8class_8php-source.html
@@ -0,0 +1,114 @@
+
+
+00001 <?PHP +00002 /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> +00003 * +00004 * This program is free software; you can redistribute it and/or modify +00005 * it under the terms of the GNU General Public License as published by +00006 * the Free Software Foundation; either version 2 of the License, or +00007 * (at your option) any later version. +00008 * +00009 * This program is distributed in the hope that it will be useful, +00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of +00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +00012 * GNU General Public License for more details. +00013 * +00014 * You should have received a copy of the GNU General Public License +00015 * along with this program; if not, write to the Free Software +00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +00017 * +00018 * $Id$ +00019 * $Source$ +00020 * +00021 */ +00022 +00031 class Webcal { +00032 var $localdb; +00033 var $heure = -1; +00034 var $duree = 0; +00035 +00040 function Webcal() +00041 { +00042 global $conf; +00043 +00044 $this->localdb = new Db($conf->webcal->db->type, +00045 $conf->webcal->db->host, +00046 $conf->webcal->db->user, +00047 $conf->webcal->db->pass, +00048 $conf->webcal->db->name); +00049 } +00050 +00059 function add($user, $date, $texte, $desc) +00060 { +00061 +00062 $id = $this->get_next_id(); +00063 +00064 $cal_id = $id; +00065 $cal_create_by = $user->webcal_login; +00066 $cal_date = strftime('%Y%m%d', $date); +00067 $cal_time = $this->heure; +00068 $cal_mod_date = strftime('%Y%m%d', time()); +00069 $cal_mod_time = strftime('%H%M', time()); +00070 $cal_duration = $this->duree; +00071 $cal_priority = 2; +00072 $cal_type = "E"; +00073 $cal_access = "P"; +00074 $cal_name = $texte; +00075 $cal_description = $desc; +00076 +00077 $sql = "INSERT INTO webcal_entry (cal_id, cal_create_by,cal_date,cal_time,cal_mod_date, +00078 cal_mod_time,cal_duration,cal_priority,cal_type, cal_access, cal_name,cal_description)"; +00079 +00080 $sql .= " VALUES ($cal_id, '$cal_create_by', $cal_date, $cal_time,$cal_mod_date, $cal_mod_time, +00081 $cal_duration,$cal_priority,'$cal_type', '$cal_access', '$cal_name','$cal_description')"; +00082 +00083 if ( $this->localdb->query($sql) ) +00084 { +00085 +00086 $sql = "INSERT INTO webcal_entry_user (cal_id, cal_login, cal_status)"; +00087 $sql .= " VALUES ($cal_id, '$cal_create_by', 'A')"; +00088 +00089 if ( $this->localdb->query($sql) ) +00090 { +00091 +00092 } +00093 else +00094 { +00095 $error = $this->localdb->error() . '<br>' .$sql; +00096 } +00097 } +00098 else +00099 { +00100 $error = $this->localdb->error() . '<br>' .$sql; +00101 } +00102 +00103 $this->localdb->close(); +00104 } +00105 +00112 function get_next_id() +00113 { +00114 +00115 $sql = "SELECT max(cal_id) FROM webcal_entry"; +00116 +00117 if ($this->localdb->query($sql)) +00118 { +00119 $id = $this->localdb->result(0, 0) + 1; +00120 return $id; +00121 } +00122 else +00123 { +00124 print $this->localdb->error(); +00125 } +00126 } +00127 } +00128 ?> +
1.3.7
+
+
diff --git a/doc/dev/php/html/webcal_8class_8php.html b/doc/dev/php/html/webcal_8class_8php.html
new file mode 100644
index 00000000000..49bcc5e75ed
--- /dev/null
+++ b/doc/dev/php/html/webcal_8class_8php.html
@@ -0,0 +1,27 @@
+
+
++ +
+Aller au code source de ce fichier.
+
+Définition dans le fichier webcal.class.php.
1.3.7
+
+