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

Langage PHP Discussion :

Affichage d'une image en utilisant GD


Sujet :

Langage PHP

  1. #1
    Candidat au Club
    Homme Profil pro
    Webmaster
    Inscrit en
    Décembre 2013
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Webmaster
    Secteur : Distribution

    Informations forums :
    Inscription : Décembre 2013
    Messages : 7
    Points : 4
    Points
    4
    Par défaut Affichage d'une image en utilisant GD
    Bonjour,

    Je ne suis pas développeur mais je lit le php et je bidouille un peu pour arriver à mes fins mais là je bloque et j'ai besoin d'un petit coup de main svp...

    Je cherche à afficher un code barre sous un code article dans le cadre d'un inventaire,

    Pour info, je travaille sur un serveur local avec PHP Version 5.5.9-1ubuntu4.5
    GD est activé.
    Voici la source du code utilisé pour générer le code barre : http://barcode-coder.com/fr/

    Voici le code qui me permet de générer le code barre :
    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
    <?php 
    $im = imagecreatetruecolor(300, 300);
    $black = ImageColorAllocate($im,0x00,0x00,0x00);
    $x = 150;
    $y = 150;
    $angle = 0;
    $type = "code128";
    $ref = "12345678";
    $width = 150;
    $height = 50;
    $data = Barcode::gd($im, $black, $x, $y, $angle, $type, $ref, $width, $height);
    $file = 'mon_image.png';
    imagepng($data, $file);
    imagedestroy($data);
    ?>
    Voici la variable que je souhaite utiliser pour $ref mais je n'arrive pas du tout à l'utiliser :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <?php $_smarty_tpl->trace_call_stack[0][1] = 162;echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['ref'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);?>

    J'imagine qu'il y a quelque chose d'évident mais...

    Merci de votre aide !

    Nicolas

  2. #2
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Ce que tu nous montres ce n'est pas une variable, c'est un bout de code Smarty.
    D'ou vient ce code avec un trace_call_stack ? Qu'est ce que tu voulais nous montrer dans tout ça ?
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  3. #3
    Candidat au Club
    Homme Profil pro
    Webmaster
    Inscrit en
    Décembre 2013
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Webmaster
    Secteur : Distribution

    Informations forums :
    Inscription : Décembre 2013
    Messages : 7
    Points : 4
    Points
    4
    Par défaut
    La valeur qui m'intéresse est celle de 'ref', contenue dans ce bout de code Smarty. J'ai mis la ligne entière car je voulais vous montrer d'où vient la valeur.
    Je n'arrive pas à attribuer cette valeur à la variable $ref de mon bout de code PHP.

    D'ou vient ce code avec un trace_call_stack ?
    Je ne sais pas quoi te répondre à ta question... Voici le code complet de la page, cela y répondra peut-être :

    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
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    <?php 
    /* Smarty version Smarty 3.2-DEV, created on 2012-01-30 16:09:14 compiled from "mod:eslInventaire/batch/export_validation" */ ?>
    <?php /*%%SmartyHeaderCode:17782248874ef18806a9e5b1-03016080%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
    $_valid = $_smarty_tpl->decodeProperties(array (
      'file_dependency' => 
      array (
        '3d6f37a161a501ec7f55150ed4c52efb8ef946a8' => 
        array (
          0 => 'mod:eslInventaire/batch/export_validation',
          1 => 1327670611,
          2 => 'mod',
        ),
      ),
      'nocache_hash' => '17782248874ef18806a9e5b1-03016080',
      'function' => 
      array (
      ),
      'version' => 'Smarty 3.2-DEV',
      'unifunc' => 'content_4ef18806bee1a',
      'variables' => 
      array (
        'eslInventaire_moddir' => 0,
        'eslInventaire_pages' => 0,
        'eslInventaire_filter' => 0,
        'eslInventaire_date' => 0,
        'eslInventaire_stageorig' => 0,
        'page' => 0,
        'row' => 0,
      ),
      'has_nocache_code' => false,
    ),false); /*/%%SmartyHeaderCode%%*/
    if ($_valid && !is_callable('content_4ef18806bee1a')) {function content_4ef18806bee1a($_smarty_tpl) {
    if (!is_callable('smarty_function_cycle')) include '/var/www/inventaire/captainhook/mod/smarty/smarty/libs/plugins/function.cycle.php';
    array_unshift($_smarty_tpl->trace_call_stack, array('eslInventaire/batch/export_validation', 0, 'mod'));
     
    //Code ajouté par nicolas en novembre 2014 pour ajouter le code barre à l'export
    //Source : http://barcode-coder.com/fr/
     
    include('php-barcode.php');
     ?>
    <html>
    		<head>
    		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    		<style>
    .table-container {
    	height: 169mm;
    }
    table {
    	border-collapse: collapse;
    	width: 100%;
    }
    tr {
    	height: 17mm;
    }
    th {
    	border: 1px solid black;
    	font-size: 3mm;
    	font-weight: bold;
    }
    td {
    	padding: 0 1mm 0 1mm;
    	border: 1px solid black;
    	font-size: 2.5mm;
    }
    .center {
    	text-align:center;
    }
    .break {
    	clear: both;
    	page-break-before: always;
    }
    .emplinfo {
    	width: 13mm;
    }
    .stockinfo {
    	width: 13mm;
    }
    .article {
    	width: 20mm;
    }
    .designation {
    	width: 40mm;
    }
    .place {
    	width: 13mm;
    }
    .qty {
    	width: 13mm;
    }
    td.place, td.qty {
    	padding: 0;
    	margin: 0;
    }
    .observation {
    /*width: 60mm;*/
    			}
    .averif {
    	padding: 1.5mm 0 0 0;
    	height:5mm;
    	text-align: center;
    }
    .correction {
    	border-top: 1px dotted #aaa;
    	height:12mm;
    }
    .odd {
    	background-color: #f4f4f4;
    }
    .even {
    }
    .barre {
     background-image: url('<?php $_smarty_tpl->trace_call_stack[0][1] = 73;
    echo $_smarty_tpl->tpl_vars->eslInventaire_moddir->value;
    ?> /images/background-barre.png');
    	background-size: 100% 50%;
    	vertical-align: top;
    }
    .header {
    	width: 100%;
    	height: 10mm;
    }
    .inventory {
    	float: left;
    	width: 45%;
    	font-weight: bold;
    }
    .date {
    	font-size: 10pt;
    	padding-top: 1mm;
    	text-align:right;
    	float: right;
    	width: 45%;
    }
    .verif {
    	margin-top: -4mm;
    	text-align: center;
    	font-size: 10pt;
    	width: 100%;
    }
    .pagenum {
    	float: right;
    	font-size: 10pt;
    }
    </style>
    		</head>
    		<body>
    <?php $_smarty_tpl->trace_call_stack[0][1] = 106; $_smarty_tpl->tpl_vars->page = new Smarty_Variable; $_smarty_tpl->tpl_vars->page->_loop = false;
     $_from = $_smarty_tpl->tpl_vars->eslInventaire_pages->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
     $_smarty_tpl->tpl_vars->page->total= $_smarty_tpl->_count($_from);
     $_smarty_tpl->tpl_vars->page->iteration=0;
     $_smarty_tpl->tpl_vars->page->index=-1;
    foreach ($_from as $_smarty_tpl->tpl_vars->page->key => $_smarty_tpl->tpl_vars->page->value){
    $_smarty_tpl->tpl_vars->page->_loop = true;
     $_smarty_tpl->tpl_vars->page->iteration++;
     $_smarty_tpl->tpl_vars->page->index++;
     $_smarty_tpl->tpl_vars->page->last = $_smarty_tpl->tpl_vars->page->iteration === $_smarty_tpl->tpl_vars->page->total;
    ?>
    <div class='header'>
       <div class='inventory'>
        <?php $_smarty_tpl->trace_call_stack[0][1] = 109;echo \core\Core::$db->fetchOne('SELECT `label` FROM inv_inventory WHERE id=?',array($_smarty_tpl->tpl_vars->eslInventaire_filter->value['id_inventory']));?>
        <?php $_smarty_tpl->trace_call_stack[0][1] = 110;if (isset($_smarty_tpl->getVariable('eslInventaire_filter', null, true, false)->value['id_repository'])&&!empty($_smarty_tpl->tpl_vars->eslInventaire_filter->value['id_repository'])){?>
        &gt;
        <?php $_smarty_tpl->trace_call_stack[0][1] = 111;echo \core\Core::$db->fetchOne('SELECT `label` FROM inv_repository WHERE id=?',array($_smarty_tpl->tpl_vars->eslInventaire_filter->value['id_repository']));?>
        <?php $_smarty_tpl->trace_call_stack[0][1] = 112;}?>
      </div>
      <div class='date'>
        <?php $_smarty_tpl->trace_call_stack[0][1] = 114;echo $_smarty_tpl->tpl_vars->eslInventaire_date->value;?>
      </div>
      <div style='clear: both'></div>
      <div class='verif'>
        <?php $_smarty_tpl->trace_call_stack[0][1] = 117;if ($_smarty_tpl->tpl_vars->eslInventaire_stageorig->value=='check1'){?>
        Validation étape 2
        <?php $_smarty_tpl->trace_call_stack[0][1] = 118;}elseif($_smarty_tpl->tpl_vars->eslInventaire_stageorig->value=='check2'){?>
        Validation étape 3
        <?php $_smarty_tpl->trace_call_stack[0][1] = 119;}elseif($_smarty_tpl->tpl_vars->eslInventaire_stageorig->value=='check3'){?>
        Export de l'étape de validation 3
        <?php $_smarty_tpl->trace_call_stack[0][1] = 120;}elseif($_smarty_tpl->tpl_vars->eslInventaire_stageorig->value=='takein'){?>
        Validation étape 1
        <?php $_smarty_tpl->trace_call_stack[0][1] = 121;}elseif($_smarty_tpl->tpl_vars->eslInventaire_stageorig->value=='import'){?>
        Comptage initial
        <?php $_smarty_tpl->trace_call_stack[0][1] = 122;}elseif($_smarty_tpl->tpl_vars->eslInventaire_stageorig->value=='import-unadded'){?>
        Comptage initial restant
        <?php $_smarty_tpl->trace_call_stack[0][1] = 123;}elseif($_smarty_tpl->tpl_vars->eslInventaire_stageorig->value=='rejected'){?>
        Export des rejetés
        <?php $_smarty_tpl->trace_call_stack[0][1] = 124;}elseif($_smarty_tpl->tpl_vars->eslInventaire_stageorig->value=='validated'){?>
        Export des validés définitivement
        <?php $_smarty_tpl->trace_call_stack[0][1] = 125;}elseif($_smarty_tpl->tpl_vars->eslInventaire_stageorig->value=='all_but_import'){?>
        Export de tout (sauf 8sens)
        <?php $_smarty_tpl->trace_call_stack[0][1] = 126;}?>
      </div>
      <div style='clear: both'></div>
    </div>
    <div class="table-container">
       <table>
        <tr style='height: 10mm'>
          <th class='emplinfo'>Empl. info.</th>
          <th class='stockinfo'>Stock info.</th>
          <th class='article'>Article</th>
          <th class='designation'>Désignation</th>
          <th class='place'>Place 1</th>
          <th class='qty'>Qté 1</th>
          <th class='place'>Place 2</th>
          <th class='qty'>Qté 2</th>
          <th class='place'>Place 3</th>
          <th class='qty'>Qté 3</th>
          <th class='place'>Place 4</th>
          <th class='qty'>Qté 4</th>
          <th class='observation'>Observation</th>
        </tr>
        <?php $_smarty_tpl->trace_call_stack[0][1] = 147; $_smarty_tpl->tpl_vars->row = new Smarty_Variable; $_smarty_tpl->tpl_vars->row->_loop = false;
     $_from = $_smarty_tpl->tpl_vars->page->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
    foreach ($_from as $_smarty_tpl->tpl_vars->row->key => $_smarty_tpl->tpl_vars->row->value){
    $_smarty_tpl->tpl_vars->row->_loop = true;
    ?>
        <tr class="<?php $_smarty_tpl->trace_call_stack[0][1] = 148;echo smarty_function_cycle(array('values'=>"odd,even"),$_smarty_tpl);?>">
          <td class='emplinfo'>
          	<div><?php $_smarty_tpl->trace_call_stack[0][1] = 150;echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['eslot1'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);?></div>
    		<div><?php $_smarty_tpl->trace_call_stack[0][1] = 151;echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['eslot2'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);?></div>
    		<div><?php $_smarty_tpl->trace_call_stack[0][1] = 152;echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['eslot3'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);?></div>
    		<div><?php $_smarty_tpl->trace_call_stack[0][1] = 153;echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['eslot4'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);?></div>
          </td>
          <td class='stockinfo center'>
          	<div><?php $_smarty_tpl->trace_call_stack[0][1] = 156;echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['eqty1'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);?>
            </div>
    		<div><?php $_smarty_tpl->trace_call_stack[0][1] = 157;echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['eqty2'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);?></div>
    		<div><?php $_smarty_tpl->trace_call_stack[0][1] = 158;echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['eqty3'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);?></div>
    		<div><?php $_smarty_tpl->trace_call_stack[0][1] = 159;echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['eqty4'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);?></div>
          </td>
          <td class='article'><?php $_smarty_tpl->trace_call_stack[0][1] = 162;echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['ref'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);?><br />
            <!--Affichage du code barre avec la variable ci-dessus-->
            <?php 
    		$im = imagecreatetruecolor(300, 300);
    		$black = ImageColorAllocate($im,0x00,0x00,0x00);
    		$x = 150;
    		$y = 150;
    		$angle = 0;
    		$type = "code128";
    		$ref = "12345678";
    		$width = 150;
    		$height = 50;
    		$data = Barcode::gd($im, $black, $x, $y, $angle, $type, $ref, $width, $height);
     
    		$file = 'mon_image.png';
    		imagepng($data, $file);
    		imagedestroy($data);
    		 ?>
            <img src="/mon_image.png" alt="" width="150" height="50" /></td>
          <td class='designation'><?php $_smarty_tpl->trace_call_stack[0][1] = 163;echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['label'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);?></td>
          <td class='place'>
          	<div class="averif"><?php $_smarty_tpl->trace_call_stack[0][1] = 164;if ($_smarty_tpl->tpl_vars->eslInventaire_filter->value['stage']!='import'){echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['slot1'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);
    }?></div>
            <div class="correction"></div>
          </td>
          <td class='qty'>
          	<div class="averif"><?php $_smarty_tpl->trace_call_stack[0][1] = 165;if ($_smarty_tpl->tpl_vars->eslInventaire_filter->value['stage']!='import'){echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['qty1'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);
    }?></div>
            <div class="correction"></div>
          </td>
          <td class='place'>
          	<div class="averif"><?php $_smarty_tpl->trace_call_stack[0][1] = 166;if ($_smarty_tpl->tpl_vars->eslInventaire_filter->value['stage']!='import'){echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['slot2'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);
    }?></div>
            <div class="correction"></div>
          </td>
          <td class='qty'>
          	<div class="averif"><?php $_smarty_tpl->trace_call_stack[0][1] = 167;if ($_smarty_tpl->tpl_vars->eslInventaire_filter->value['stage']!='import'){echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['qty2'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);
    }?></div>
            <div class="correction"></div>
          </td>
          <td class='place'>
          	<div class="averif"><?php $_smarty_tpl->trace_call_stack[0][1] = 168;if ($_smarty_tpl->tpl_vars->eslInventaire_filter->value['stage']!='import'){echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['slot3'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);
    }?></div>
            <div class="correction"></div>
          </td>
          <td class='qty'>
          	<div class="averif"><?php $_smarty_tpl->trace_call_stack[0][1] = 169;if ($_smarty_tpl->tpl_vars->eslInventaire_filter->value['stage']!='import'){echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['qty3'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);
    }?></div>
            <div class="correction"></div>
          </td>
          <td class='place'>
          	<div class="averif"><?php $_smarty_tpl->trace_call_stack[0][1] = 170;if ($_smarty_tpl->tpl_vars->eslInventaire_filter->value['stage']!='import'){echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['slot4'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);
    }?></div>
            <div class="correction"></div>
          </td>
          <td class='qty'>
          	<div class="averif"><?php $_smarty_tpl->trace_call_stack[0][1] = 171;if ($_smarty_tpl->tpl_vars->eslInventaire_filter->value['stage']!='import'){echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['qty4'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);
    }?></div>
            <div class="correction"></div>
          </td>
          <td class='observation'>
          	<div><?php $_smarty_tpl->trace_call_stack[0][1] = 173;if ($_smarty_tpl->tpl_vars->eslInventaire_filter->value['stage']!='import'){echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['comment1'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);
    }?></div>
            <div><?php $_smarty_tpl->trace_call_stack[0][1] = 174;if ($_smarty_tpl->tpl_vars->eslInventaire_filter->value['stage']!='import'){echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['comment2'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);
    }?></div>
            <div><?php $_smarty_tpl->trace_call_stack[0][1] = 175;if ($_smarty_tpl->tpl_vars->eslInventaire_filter->value['stage']!='import'){echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['comment3'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);
    }?></div>
            <div><?php $_smarty_tpl->trace_call_stack[0][1] = 176;if ($_smarty_tpl->tpl_vars->eslInventaire_filter->value['stage']!='import'){echo htmlspecialchars($_smarty_tpl->tpl_vars->row->value['comment4'], ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET, true);
    }?></div>
    	  </td>
        </tr>
        <?php $_smarty_tpl->trace_call_stack[0][1] = 179;} ?>
      </table>
    </div>
    <div class="pagenum">Page
              <?php $_smarty_tpl->trace_call_stack[0][1] = 182;echo $_smarty_tpl->tpl_vars->page->index+1;?>
              /<?php echo $_smarty_tpl->tpl_vars->page->total;?> </div>
    <?php $_smarty_tpl->trace_call_stack[0][1] = 183;if (!$_smarty_tpl->tpl_vars->page->last){?>
    <div class='break'></div>
    <?php }?>
    <?php $_smarty_tpl->trace_call_stack[0][1] = 184;} ?>
    </body>
    </html>
    <?php array_shift($_smarty_tpl->trace_call_stack);}} ?>
    J'ai réduit l'indentation ;-)

  4. #4
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    je voulais vous montrer d'où vient la valeur
    En fait ce n'est pas d'ou elle vient, c'est la ou elle atterrit : ici on parle d'une valeur qui a été affectée dans smarty, mais elle vient d'ailleurs.
    Mais peu importe, tu peux utiliser $_smarty_tpl->tpl_vars->row->value['ref']
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  5. #5
    Candidat au Club
    Homme Profil pro
    Webmaster
    Inscrit en
    Décembre 2013
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Webmaster
    Secteur : Distribution

    Informations forums :
    Inscription : Décembre 2013
    Messages : 7
    Points : 4
    Points
    4
    Par défaut
    Ok, merci ! J'ai donc ça :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    $ref = $_smarty_tpl->tpl_vars->row->value['ref'];
    Un dernier coup de main svp : il faut que ma valeur $ref contienne une valeur de type : "PCE222154", avec les guillemets

    Comment puis-je faire cela ?

    Ou alors, je dois ajouter les guillemets autour de $ref dans :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    $data = Barcode::gd($im, $black, $x, $y, $angle, $type, $ref, $width, $height);
    Avec un echo ? print ?

    Merci !
    Nicolas

  6. #6
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    print et echo c'est quasiment la même chose.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    $ref = '"' . $_smarty_tpl->tpl_vars->row->value['ref'] . '"';
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  7. #7
    Candidat au Club
    Homme Profil pro
    Webmaster
    Inscrit en
    Décembre 2013
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Webmaster
    Secteur : Distribution

    Informations forums :
    Inscription : Décembre 2013
    Messages : 7
    Points : 4
    Points
    4
    Par défaut
    Bonjour sabotage,

    Merci, vous m'avez déjà beaucoup aidé, ça fonctionne parfaitement.

    Je n'arrive pas à faire fonctionner le code qui est censé me permettre de générer une image avec GD puis l'afficher (lignes 231 à 247).
    Je suis à peu près sûr que le plugin que j'utilise fonctionne, l'erreur provient sûrement de la façon dont je l'utilise.

    Avez-vous déjà utilisé ce plugin : http://barcode-coder.com/fr/barcode-...arres-203.html ?
    J'ai contacté le développeur mais il semble qu'il a autre chose à faire que m'aider...

    Merci pour votre aide.

    Nicolas

  8. #8
    Candidat au Club
    Homme Profil pro
    Webmaster
    Inscrit en
    Décembre 2013
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Webmaster
    Secteur : Distribution

    Informations forums :
    Inscription : Décembre 2013
    Messages : 7
    Points : 4
    Points
    4
    Par défaut
    Bonjour,

    Laissez tomber, je galère trop de cette manière.
    Je vais créer une fonction php qui me permettra de faire ce que je veux et j'afficherai le résultat avec une police codebarre.

    Merci pour votre aide sabotage.

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

Discussions similaires

  1. [Tomcat] Affichage d'une image
    Par david71 dans le forum Tomcat et TomEE
    Réponses: 8
    Dernier message: 15/02/2005, 11h37
  2. Réponses: 2
    Dernier message: 27/12/2004, 09h23
  3. Pbs d'affichage d'une image sur un panel
    Par ysr1 dans le forum C++Builder
    Réponses: 2
    Dernier message: 23/09/2004, 09h55
  4. [FLASH MX] Qualité d'affichage d'une image
    Par n_tony dans le forum Flash
    Réponses: 3
    Dernier message: 16/08/2004, 09h44
  5. Affichage d'une image sous linux
    Par Braim dans le forum x86 32-bits / 64-bits
    Réponses: 5
    Dernier message: 25/03/2003, 10h41

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