IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

Tags are closed in a wrong order for [table]


Sujet :

PHP & Base de données

  1. #1
    Membre averti
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Août 2020
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Transports

    Informations forums :
    Inscription : Août 2020
    Messages : 16
    Par défaut Tags are closed in a wrong order for [table]
    bonjour , je veux generer un pdf pour tous ces tableau mais je sais pas d'ou vient l'erreur , toute mes tables sont bien fermer..
    merci d'avance..
    voilà le code de la page complet
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    <?php ob_start(); ?>
    <?php require_once '../helpers' . DIRECTORY_SEPARATOR . 'requires.php'; ?>
    <link rel="icon" href="https://www.didaetoileservice.ma/wp-content/uploads/2020/01/LogoDidaSite.png" />
     
     
    <link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800,900" rel="stylesheet">
     
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/style2.css" media="screen">
    <link media="print" href="../css/print.css"  type="text/css" rel="stylesheet" />
    <body>
        <style>   
            .tableaux{
                display:inline-block;
                vertical-align:top;
            }</style>
    <?php
    require_once '../helpers' . DIRECTORY_SEPARATOR . 'requires.php';
     
    $id_ja = $_GET['id'];
    $query = "select j_a.type_ja,site.nom_site from detail_ja INNER join j_a on detail_ja.id_ja=j_a.id_ja  INNER join site on detail_ja.id_site=site.id_site where detail_ja.id_ja='$id_ja' ";
    $rslt = mysqli_query($conn, $query);
    if ($rslt) {
        $row = mysqli_fetch_array($rslt);
        $site = $row['nom_site'];
        $type_ja = $row['type_ja'];
    }
    ?><div><br><table border='1'  style="text-align: center; border: 1px solid #000000; border-collapse: collapse; ">
                <tbody>
                    <tr >
                        <td style="width: 30%; height: 1px; border: 2px solid #000000; " colspan="1" rowspan="4" nowrap="nowrap"><img src="../img/fr.png"></td>
                        <td style="width: 30%; height: 1px; border: 2px solid #000000; " colspan="1" rowspan="2" nowrap="nowrap">Enregistrement</td>
                        <td style="width: 30%; border: 2px solid #000000; " colspan="2" rowspan="1" nowrap="nowrap">EN-S03-03</td>
                    </tr>
                    <tr>
                        <td style="width: 30%; border: 2px solid #000000; " colspan="2" rowspan="1" nowrap="nowrap">Version: 01</td>
                    </tr>
                    <tr>
                        <td style="width: 30%; height: 1px; border: 2px solid #000000;" colspan="1" rowspan="2" >Journée Alimentaire <b><?php echo $type_ja; ?></b></td>
                        <td style="width: 30%; border: 2px solid #000000; " colspan="2" rowspan="1" nowrap="nowrap" >Date d'application : 01/10/2019</td>
                    </tr>
    </tbody>
            </table>
        </div>
        <div>
            <br><br><br>
            <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Le : <?php echo date('d/m/Y'); ?></label>
            <br><br>
            <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Site : <?php echo $site; ?></label>
        </div>
        <h2 style="text-align: center"><u>Détails De L'Entrée</u></h2>
    <?php
    $id = $_GET['id'];
    $date = $_GET['date'];
    $site = $_SESSION['id_site'];
    $query1 = "select produits.Id_produit,designation,det_quantite,unite,prix from detail_srt join produits on produits.Id_produit=detail_srt.Id_produit where id_site='$site' and date='$date' ";
     
    $rslt1 = mysqli_query($conn, $query1);
    $tot1 = 0;
    ?><input  name="datee" value="<?php print $date ?>"  hidden="" >
    <h3><u>Sorties</u></h3>
        <table border='1' id='customers'>
            <thead class='thead-dark'><tr><th>reference</th><th>designation</th><th>Quantité</th><th>unite</th><th>prix</th><th>VAleur</th></tr></thead>
    <?php
    while ($row1 = mysqli_fetch_array($rslt1)):
        $sum1 = $row1['det_quantite'] * $row1['prix'];
     
        $tot1 = $tot1 + $sum1;
        ?><tr><td><?php print $row1['Id_produit']; ?></td>
                    <td><?php print $row1['designation']; ?></td>
                    <td><?php print $row1['det_quantite']; ?></td>
                    <td><?php print $row1['unite']; ?></td>
                    <td><?php print $row1['prix']; ?></td>
    <td> <?php print $sum1; ?></td>
    <?php endwhile; ?>      </tr>
            <tr><td>Total</td><td></td><td></td><td></td><td></td><td><?php print $tot1; ?></td></tr></table> 
    <br><h3><u>Entrées</u></h3>
     
    <?php
    $query = "select produits.Id_produit,designation,det_quantite,unite,prix,dlc,nom_frs from detail_ent join fournisseurs on detail_ent.id_frs=fournisseurs.id_frs join produits on produits.Id_produit=detail_ent.Id_produit  where id_site='$site' and date='$date' ";
     
    $rslt = mysqli_query($conn, $query);
    $row = mysqli_num_rows($rslt);
    if ($row > 0) {
        $tot = 0;
        ?>
    <table border='1' id='customers'>
                <thead class='thead-dark'><tr><th>reference</th><th>designation</th><th>Quantité</th><th>unite</th><th>prix</th><th>DLC</th><th>Fournisseur</th><th>VAleur</th></tr></thead>
    <?php
        while ($row = mysqli_fetch_array($rslt)):
            $sum = $row['det_quantite'] * $row['prix'];
     
            $tot = $tot + $sum;
            ?><tr>
                        <td><?php print $row['Id_produit']; ?></td>
                        <td><?php print $row['designation']; ?></td>
                        <td><?php print $row['det_quantite']; ?></td>
                        <td><?php print $row['unite']; ?></td>
                        <td><?php print $row['prix']; ?></td>
                        <td><?php print $row['dlc']; ?></td>
                        <td> <?php print $row['nom_frs']; ?></td>
                        <td> <?php print $sum; ?></td>
                    <?php endwhile; ?>      </tr>
                <tr><td>Total</td><td></td><td></td><td></td><td></td><td></td><td></td><td><?php print $tot; ?></td></tr></table> 
            <br><h3><u>Journée Alimentaire: Sortie</u></h3>
            <?php
            $tot = 0;
        }
        ?>
        <?php
        $type_site = $_SESSION['type_site'];
     
        $quer = "select clients.id_client,type_client,prix_repas from clients join prix_marche on prix_marche.id_pm=clients.id_pm where etab='$type_site'";
        $rsl = mysqli_query($conn, $quer);
        $tot3 = 0;
        ?>
        <div class="tableaux"> <br><br><table border='1' id='customers' style="width: 50% !important;  margin-left:auto !important;
                                              margin-right:auto !important;">
                <thead class='thead-dark'><tr><th></th><th>Repas</th></thead>
     
                <?php
                $totati = 0;
                $toti = 0;
                while ($rowi = mysqli_fetch_array($rsl)):
                    ?>       
     
        <?php $quer0 = "select id_repas,name from repas";
        $rs = mysqli_query($conn, $quer0);
        ?> <tr><td colspan="1" rowspan="3" style=" text-transform: uppercase"><?php print $rowi['type_client'] ?></td>
     
        <?php while ($rowo = mysqli_fetch_array($rs)):
            ?><td ><?php print $rowo['name'] ?></td>
    </tr>
    <?php endwhile; ?> 
    <?php endwhile; ?> 
    </table> </div>
        <div class="tableaux"> <br><br><table border='1' id='customers' style="width: 50% !important;  margin-left:auto !important;
                                              margin-right:auto !important;">
                <thead class='thead-dark'><tr><th>effectifs</th></thead>
                <?php
                $queryy = "select id_client,effectif,total_ja,total from detail_ja join j_a on detail_ja.id_ja=j_a.id_ja where detail_ja.id_ja='$id' ";
                $rslti = mysqli_query($conn, $queryy);
                while ($rowu = mysqli_fetch_array($rslti)):
                    ?> 
                    <tr>
                        <td ><?php print $rowu['effectif'] ?></td>
    </tr>
    <?php endwhile; ?></table></div>
    <div class="tableaux"> <br><br><table border='1' id='customers' style="width: 50% !important;  margin-left:auto !important;
                                              margin-right:auto !important;">
                <thead class='thead-dark'><tr><th>Total</th></thead>
                <?php
                $queryy = "select total from detail_ja  where detail_ja.id_ja='$id' group by total ";
                $rslti = mysqli_query($conn, $queryy);
                while ($rowu = mysqli_fetch_array($rslti)):
                    ?> 
                    <tr>
                        <td height="101px"><?php print $rowu['total'] ?></td>
     </tr><?php endwhile; ?></table></div>
        <div class="tableaux"><br><br><table border='1' id='customers' style="width: 50% !important;  margin-left:auto !important;margin-right:auto !important;">
                <thead class='thead-dark'><tr><th>Total</th></thead>
                            <?php
                            $queryy = "select total_ja from j_a   where id_ja='$id' ";
                            $rslti = mysqli_query($conn, $queryy);
                            while ($rowu = mysqli_fetch_array($rslti)):
                                ?> 
                    <tr>
                        <td height="202px"><?php print $rowu['total_ja'] ?></td>
                    </tr>
    <?php endwhile;?></table></div></body>
        <?phpob_flush(); ?>
    <?php
     
    use Spipu\Html2Pdf\Html2Pdf;
     
    require_once(dirname(__FILE__) . '/../pdf/vendor/autoload.php');
     
     
     
    $content = ob_get_clean();
     
     
    $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8');
    $html2pdf->setDefaultFont('Helvetica');
     
    $html2pdf->pdf->SetDisplayMode('fullpage');
    $html2pdf->WriteHTML($content);
     
    $html2pdf->Output(__DIR__ . "/cmd_pdf/cmd_$id_ja.pdf", 'I');

  2. #2
    Membre émérite
    Homme Profil pro
    Technicien maintenance
    Inscrit en
    Novembre 2012
    Messages
    381
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Vienne (Poitou Charente)

    Informations professionnelles :
    Activité : Technicien maintenance
    Secteur : Administration - Collectivité locale

    Informations forums :
    Inscription : Novembre 2012
    Messages : 381
    Par défaut
    Bonjour,

    Les lignes doivent également être fermées, pas seulement les tables.

    Dans la boucle while ligne 65, des lignes sont créées en commençant avec <tr> ligne 69. Ces lignes ne sont jamais fermées. On trouve seulement une fin de ligne </tr> après la boucle, ligne 75.

    Idem avec l'autre boucle qui commence en ligne 90.

    Le </tr> ligne 133 est mal placé. Situé où il est, un </tr> est ajouté après chaque cellule de tableau et pas seulement en fin de ligne.

  3. #3
    Membre averti
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Août 2020
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Transports

    Informations forums :
    Inscription : Août 2020
    Messages : 16
    Par défaut
    effectivement , vous avez raison j'ai mal fermé les <tr>
    maintenant ils me disent que c'est thead qui n'est pas fermé dans le bon ordre :/ j'ai pas trouver d'ou vient l'erreur

  4. #4
    Membre émérite
    Homme Profil pro
    Technicien maintenance
    Inscrit en
    Novembre 2012
    Messages
    381
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Vienne (Poitou Charente)

    Informations professionnelles :
    Activité : Technicien maintenance
    Secteur : Administration - Collectivité locale

    Informations forums :
    Inscription : Novembre 2012
    Messages : 381
    Par défaut
    Lignes 151 et 161, il manque le </tr> avant le </thead>

  5. #5
    Membre averti
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Août 2020
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Transports

    Informations forums :
    Inscription : Août 2020
    Messages : 16
    Par défaut
    Merci beaucoup pour votre aide ça m'est trés utile... Html2pdf est trés sensible on doit faire les choses comme il le faut sinon ca beug
    Maintenant le probléme avec le <tr>... je suis vraiment désolé mais je fais mon mieux pour trouver l'erreur mais j'arrive pas vu que je suis débutant
    Grand merci

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 0
    Dernier message: 04/10/2019, 20h23
  2. Réponses: 1
    Dernier message: 14/03/2017, 16h14
  3. Réponses: 2
    Dernier message: 13/01/2015, 15h14
  4. Réponses: 22
    Dernier message: 18/02/2010, 18h59
  5. in_array : Wrong datatype for second argument
    Par yann123456 dans le forum Langage
    Réponses: 15
    Dernier message: 19/03/2009, 14h46

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo