Subversion Repositories Applications.papyrus

Rev

Rev 2 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 285
1
<?php
1
<?php
2
 
-
 
3
//vim: set expandtab tabstop=4 shiftwidth=4:
2
//vim: set expandtab tabstop=4 shiftwidth=4:
4
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
5
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
6
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
7
// | Copyright (C) 2001 COUDOUNEAU Laurent (lc@gsite.org)                                                 |
-
 
8
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
9
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
10
// |                                                                                                      |
8
// |                                                                                                      |
11
// | This library is free software; you can redistribute it and/or                                        |
9
// | This library is free software; you can redistribute it and/or                                        |
12
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | modify it under the terms of the GNU Lesser General Public                                           |
13
// | License as published by the Free Software Foundation; either                                         |
11
// | License as published by the Free Software Foundation; either                                         |
14
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// | version 2.1 of the License, or (at your option) any later version.                                   |
15
// |                                                                                                      |
13
// |                                                                                                      |
16
// | This library is distributed in the hope that it will be useful,                                      |
14
// | This library is distributed in the hope that it will be useful,                                      |
17
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
18
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
19
// | Lesser General Public License for more details.                                                      |
17
// | Lesser General Public License for more details.                                                      |
20
// |                                                                                                      |
18
// |                                                                                                      |
21
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | You should have received a copy of the GNU Lesser General Public                                     |
22
// | License along with this library; if not, write to the Free Software                                  |
20
// | License along with this library; if not, write to the Free Software                                  |
23
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
24
// |                                                                                                      |
22
// |                                                                                                      |
25
// +------------------------------------------------------------------------------------------------------+
23
// +------------------------------------------------------------------------------------------------------+
26
// CVS : $Id: BOG_sql.fonct.php,v 1.1 2004-06-15 10:13:07 jpm Exp $
24
// CVS : $Id: BOG_sql.fonct.php,v 1.2 2005-02-28 11:14:45 jpm Exp $
27
/**
25
/**
28
*Paquetage : BOG - bibliothèque de fonctions de débogage.
26
*Paquetage : BOG - bibliothèque de fonctions de débogage.
29
*
27
*
30
* Ce paquetage contient des fonctions de débogage pour différent besoin:
28
* Ce paquetage contient des fonctions de débogage pour différent besoin:
31
* - erreur de requête
29
* - erreur de requête
32
*
30
*
33
*@package Debogage
31
*@package Debogage
34
//Auteur original :
32
//Auteur original :
35
*@author            Jean-Pascal MILCENT <jpm@tela-botanica.org>
33
*@author            Jean-Pascal MILCENT <jpm@tela-botanica.org>
36
//Autres auteurs :
34
//Autres auteurs :
37
*@author            Alexandre GRANIER <alex@tela-botanica.org>
35
*@author            Alexandre GRANIER <alex@tela-botanica.org>
-
 
36
*@author            Laurent COUDOUNEAU <lc@gsite.org>
38
*@copyright         Tela-Botanica 2000-2004
37
*@copyright         Tela-Botanica 2000-2004
39
*@version           $Revision: 1.1 $ $Date: 2004-06-15 10:13:07 $
38
*@version           $Revision: 1.2 $ $Date: 2005-02-28 11:14:45 $
40
// +------------------------------------------------------------------------------------------------------+
39
// +------------------------------------------------------------------------------------------------------+
41
*/
40
*/
42
 
41
 
43
// +-------------------------------------------------------------------------+
42
// +-------------------------------------------------------------------------+
44
// |                          Liste des fonctions                            |
43
// |                          Liste des fonctions                            |
45
// +-------------------------------------------------------------------------+
44
// +-------------------------------------------------------------------------+
46
 
45
 
47
/**Fonction BOG_afficherErreurSql() - Permet d'afficher un message d'erreur sql complet.
46
/**Fonction BOG_afficherErreurSql() - Permet d'afficher un message d'erreur sql complet.
48
*
47
*
49
* Cette fonction permet d'afficher un ensemble de données suite à une erreur de reqête sql
48
* Cette fonction permet d'afficher un ensemble de données suite à une erreur de reqête sql
50
* permettant de trouver plus rapidement la source de l'erreur.
49
* permettant de trouver plus rapidement la source de l'erreur.
51
*
50
*
52
* @param string le nom du fichier d'où provient la requête erronée (utiliser __FILE__ lors de l'apple de cette fonction).
51
* @param string le nom du fichier d'où provient la requête erronée (utiliser __FILE__ lors de l'apple de cette fonction).
53
* @param integer le numéro de la ligne de la requête (utiliser __LINE__ lors de l'apple de cette fonction).
52
* @param integer le numéro de la ligne de la requête (utiliser __LINE__ lors de l'apple de cette fonction).
54
* @param string le message d'erreur fourni par le programmeur.
53
* @param string le message d'erreur fourni par le programmeur.
55
* @param string la requête sql erronée.
54
* @param string la requête sql erronée.
56
* @param string un éventuel commentaire complémentaire
55
* @param string un éventuel commentaire complémentaire
57
*
56
*
58
* @return string l'ensemble des messages d'erreur et des informations collectées.
57
* @return string l'ensemble des messages d'erreur et des informations collectées.
59
*/
58
*/
60
function BOG_afficherErreurSql ($nom_fichier_courant, $numero_ligne_courante, $message_erreur, $requete = '', $autre = '') 
59
function BOG_afficherErreurSql ($nom_fichier_courant, $numero_ligne_courante, $message_erreur, $requete = '', $autre = '') 
61
{
60
{
62
    $retour_erreur = "\n";
61
    $retour_erreur = "\n";
63
    $retour_erreur .= '<div id="zone_erreur">'."\n";
62
    $retour_erreur .= '<div id="zone_erreur">'."\n";
64
    $retour_erreur .= '<h1 > ERREUR SQL </h1><br />'."\n";
63
    $retour_erreur .= '<h1 > ERREUR SQL </h1><br />'."\n";
65
    $retour_erreur .= '<p>'."\n";
64
    $retour_erreur .= '<p>'."\n";
66
    $retour_erreur .= '<span class="champ_intitule" > Fichier : </span> ';
65
    $retour_erreur .= '<span class="champ_intitule" > Fichier : </span> ';
67
    $retour_erreur .= '<span class="champ_valeur" > '.$nom_fichier_courant.'</span><br />'."\n";
66
    $retour_erreur .= '<span class="champ_valeur" > '.$nom_fichier_courant.'</span><br />'."\n";
68
    
67
    
69
    $retour_erreur .= '<span class="champ_intitule" > Ligne n° : </span> ';
68
    $retour_erreur .= '<span class="champ_intitule" > Ligne n° : </span> ';
70
    $retour_erreur .= '<span class="champ_valeur" > '.$numero_ligne_courante.'</span><br />'."\n";
69
    $retour_erreur .= '<span class="champ_valeur" > '.$numero_ligne_courante.'</span><br />'."\n";
71
    
70
    
72
    $retour_erreur .= '<span class="champ_intitule" > Message erreur : </span> ';
71
    $retour_erreur .= '<span class="champ_intitule" > Message erreur : </span> ';
73
    $retour_erreur .= '<span class="champ_valeur" > '.$message_erreur.'</span><br />'."\n";
72
    $retour_erreur .= '<span class="champ_valeur" > '.$message_erreur.'</span><br />'."\n";
74
    
73
    
75
    if ($requete != '') {
74
    if ($requete != '') {
76
        $retour_erreur .= '<span class="champ_intitule" > Requete : </span> ';
75
        $retour_erreur .= '<span class="champ_intitule" > Requete : </span> ';
77
        $retour_erreur .= '<span class="champ_valeur" > '.$requete.' </span><br />'."\n";
76
        $retour_erreur .= '<span class="champ_valeur" > '.$requete.' </span><br />'."\n";
78
    }
77
    }
79
    
78
    
80
    if ($autre != '') {
79
    if ($autre != '') {
81
        $retour_erreur .= '<span class="champ_intitule" > Autres infos : </span> ';
80
        $retour_erreur .= '<span class="champ_intitule" > Autres infos : </span> ';
82
        $retour_erreur .= '<span class="champ_valeur" > '.$autre.' </span><br />'."\n";
81
        $retour_erreur .= '<span class="champ_valeur" > '.$autre.' </span><br />'."\n";
83
    }
82
    }
84
    $retour_erreur .= '</p>'."\n";
83
    $retour_erreur .= '</p>'."\n";
85
    $retour_erreur .= '</div>'."\n";
84
    $retour_erreur .= '</div>'."\n";
86
    return $retour_erreur;
85
    return $retour_erreur;
87
}
86
}
88
 
87
 
89
/* +--Fin du code ---------------------------------------------------------------------------------------+
88
/* +--Fin du code ---------------------------------------------------------------------------------------+
90
* $Log: not supported by cvs2svn $
89
* $Log: not supported by cvs2svn $
-
 
90
* Revision 1.1  2004/06/15 10:13:07  jpm
-
 
91
* Intégration dans Papyrus.
-
 
92
*
91
* Revision 1.4  2004/04/21 07:49:31  jpm
93
* Revision 1.4  2004/04/21 07:49:31  jpm
92
* Modification des commentaires.
94
* Modification des commentaires.
93
*
95
*
94
* Revision 1.3  2004/03/22 16:23:29  jpm
96
* Revision 1.3  2004/03/22 16:23:29  jpm
95
* Correction point-virgule en trop.
97
* Correction point-virgule en trop.
96
*
98
*
97
* Revision 1.2  2004/03/22 12:17:06  jpm
99
* Revision 1.2  2004/03/22 12:17:06  jpm
98
* Utilisation de class et id CSS à la place des attributs styles.
100
* Utilisation de class et id CSS à la place des attributs styles.
99
*
101
*
100
*
102
*
101
* +--Fin du code ----------------------------------------------------------------------------------------+
103
* +--Fin du code ----------------------------------------------------------------------------------------+
102
*/
104
*/
103
?>
105
?>