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 :

Problème de popUp


Sujet :

Langage PHP

  1. #1
    Débutant
    Technicien maintenance
    Inscrit en
    Mai 2007
    Messages
    123
    Détails du profil
    Informations personnelles :
    Âge : 38

    Informations professionnelles :
    Activité : Technicien maintenance

    Informations forums :
    Inscription : Mai 2007
    Messages : 123
    Points : 37
    Points
    37
    Par défaut Problème de popUp
    J'ai une page sur laquelle j'affiche plusieurs images en petit, et quand je clique sur l'image normalement j'ai une fenêtre popUp qui s'ouvre et qui m'affiche l'image en grand. Pour le moment, j'ai la fenêtre qui s'ouvre mais elle affiche rien

    Le code de la première page avec les images en petits :

    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
     
    <script language="javascript"><!--
    function popupWindow(url) {
      window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
    }
    //--></script>
    <div id="productInfo">  
     
    <?php if ($messageStack->size('header') > 0) echo '<div class="messageStack">'.$messageStack->output('header').'</div>' ;?>
    <?php if ($messageStack->size('review') > 0) echo '<div class="messageStack">'.$messageStack->output('review').'</div>' ;?>
     
    <?php
      if ($product_check['total'] < 1) {
    ?>
     
        <div class="infoText"><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></div>
     
        <div class="navBt">
         <?php echo '<a class="navBt" href="' . tep_href_link(FILENAME_DEFAULT) . '">' . IMAGE_BUTTON_CONTINUE . '</a>'; ?>
        </div>
     
    <?php
      } else {
        $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image1,  p.products_image2,  p.products_image3,  p.products_image4,  pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
        $product_info = tep_db_fetch_array($product_info_query);
     
        tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$_GET['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
     
        if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
          $products_price = '<del>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</del> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
        } else {
          $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
        }
     
     
    ?>
     
        <h1 class="<?php echo $language ;?>"><?php echo $product_info['products_name']; ?></h1>
     
    <?php
        if (tep_not_null($product_info['products_image'])) {
    ?>
       <div id="productImage" align="center">
     
    	 <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '</a></p><br><br>'; ?>
          <p class="productModel"><?php echo $product_info['products_model']; ?></p>
    <table border="0"> 
    <tr valign="middle">
    <td align="center">  <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br>'; ?><?php
                    ?><p><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_IMAGE) . '\')">' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?></p>
    </td>
    <td align="center">  <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image2'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></p><br><br>'; ?>
     
    				  <p><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_IMAGE) . '\')">' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?></p>
    </td>
    <td align="center">  <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image3'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></p><br><br>'; ?>
                      <p><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_IMAGE) . '\')">' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?></p>
    </td>
    <td align="center">  <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image4'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></p><br><br>'; ?>
                        <p><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_IMAGE) . '\')">' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?></p>
    </td>
    </tr>
    	  </div>
     
     
    <?php
        }
     
    // temp convertion des tags html en xhtml
    $badguy = array("<br>","<s>","<u>","</s>","</u>","&");
    $goodguy = array("<br />","<del>","<span class=\"underline\">","</del>","</span>","&amp;");
    ?>
           <div id="productInfos">
    <?php $sql = "SELECT * FROM " . TABLE_PRODUCTS ." WHERE products_id='".$_GET['products_id']."'";
    $res = mysql_query($sql) or die ('Erreur SQL : impossible d\'effectuer la requête : <br />'.$sql);
    $total = mysql_num_rows($res);
    if ($total) {
    	while($row = mysql_fetch_array($res)) {
    	?>
    	<table align="left" border="1">
     
    	<tr>
    	<td>
    	<font face="Verdana">
            <?php echo Modèle; ?>
    		</td>
    		<td>
            <?php echo $row['products_model']; ?>
    		</font>
    </td>
    </tr>
    <tr>
    	<td>
    	<font face="Verdana">
            <?php echo Coloris; ?>
    		</td>
    		<td>
            <?php echo $row['products_coloris']; ?>
    		</font>
    </td>
    </tr>
    <tr>
    	<td>
    	<font face="Verdana">
            <?php echo Puissance; ?>
    		</td>
    		<td>
            <?php echo $row['products_puissance']; ?>
    		</font>
    </td>
    </tr>
    <tr>
    	<td>
    		<font face="Verdana">
            <?php echo Rendement; ?>
    		</td>
    		<td>
            <?php echo $row['products_rendement']; ?>
    			</font>
    </td>
    </tr>
    <tr>
    	<td>
    		<font face="Verdana">
            <?php echo Dimension; ?>
    		</td>
    		<td>
            <?php echo $row['products_dimension']; ?>
    			</font>
    </td>
    </tr>
    	<tr>
    	<td>
    		<font face="Verdana">
            <?php echo Prix; ?>
    		</td>
    		<td>
            <?php echo $row['products_price']; ?>
    			</font>
    </td>
    </tr>
    	<tr>
    	<td>
    		<font face="Verdana">
            <?php echo "Taille bûche"; ?>
    		</td>
    		<td>
            <?php echo $row['products_taille_buche']; ?>
    			</font>
    </td>
    </tr>
     
     
    <?php    }
     
    }
    ?>
    </div>	   
        <div id="productDescription">
     
    <tr>
    <td>
    	<font face="Verdana">
    <?php echo "Commentaire" ?>
    	</font>
    </td>
    <td>
    	<?php 
     
    	  echo stripslashes(str_replace($badguy,$goodguy,$product_info['products_description'])); ?>
    </td>
    </tr>
    </font>
    </table>    
     
    	</div> 
     
        <?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?>
     
    <?php
        $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$_GET['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
        $products_attributes = tep_db_fetch_array($products_attributes_query);
        if ($products_attributes['total'] > 0) {
    ?>
     
     <div id="productOptions">
          <h4><?php echo TEXT_PRODUCT_OPTIONS ;?></h4>
     
    <?php
        $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$_GET['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
     
        while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
          $products_options_array = array();
          $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$_GET['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
     
          while ($products_options = tep_db_fetch_array($products_options_query)) {
            $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
     
            if ($products_options['options_values_price'] != '0') {
              $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
            }
     
          }
     
            if (isset($cart->contents[$_GET['products_id']]['attributes'][$products_options_name['products_options_id']])) {
              $selected_attribute = $cart->contents[$_GET['products_id']]['attributes'][$products_options_name['products_options_id']];
            } else {
              $selected_attribute = false;
            }
    ?>
          <p>
            <label for="product_option"><?php echo $products_options_name['products_options_name'] . ':'; ?></label>
            <?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', 'product_option',$products_options_array, $selected_attribute); ?>
          </p>
     
    <?php
          }
    ?>
        </div>
     
    <?php
        }
     ?>    
    <?php /*    <p class="formBt">
           <?php
            echo tep_draw_hidden_field('products_id', $product_info['products_id']);
            echo TEXT_PREFIX_QTY.tep_draw_input_field('products_quantity', 'products_quantity', '1', 'size="2"');
          ?>
          <input class="submitBt" type="submit" value="<?php echo IMAGE_BUTTON_IN_CART; ?>"  />
        </p>
    */ ?>
    </form>
     
     
    <?php
     
      if (tep_not_null($product_info['products_url'])) {
    ?>
     
      <p id="productUrl"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&amp;goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></p>
     
    <?php
      }
     
      if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
    ?>
     
      <p id="productDateAvalaible"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></p>
     
    <?php
      } else {
    ?>
     
    <?php /*  <p id="productDateAdded"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></p>
    */ ?>
    <?php
      }
    ?>
          <div id="productInfoBack" class="navBt">
             <?php echo '<a class="navBt" href="javascript: history.go(-1)">' . IMAGE_BUTTON_BACK . '</a>'; ?>
          </div>
     
    <?php
         include(DIR_WS_CLASSES . 'xml.php');
         $xml_file = DIR_WS_TEMPLATES . $template .'/desc.xml' ;
         $xml_options = new xml2object();
         $xml_content = join(file($xml_file), "");
         $theme_options = $xml_options->parse($xml_content);
     
         if ( $theme_options->template->infos1 == 'tab1' ) {
     
                 require(DIR_WS_MODULES . 'product_info_tab.php') ;
     
         } else {
    ?>
    <?php /*
      <div id="reviews"><?php require(DIR_WS_MODULES . 'product_reviews.php') ; ?></div>
    */ ?>
    <?php
     
    /*  if (($osCSS_Cache->read('alsoPurchased-' . $language .'-pID-'.$product_info['products_id'], 3600) === false) ) {
        $osCSS_Cache->startBuffer();  
        include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
        $osCSS_Cache->stopBuffer();  
      }
      echo $osCSS_Cache->getCache();
    
    */
        }
     
      }
    ?>
     
    <!-- extra divs to add extra pictures. -->
    <div class="extraDiv1"><span></span></div>
    <div class="extraDiv2"><span></span></div>
    <div class="extraDiv3"><span></span></div>
    <div class="extraDiv4"><span></span></div>
    <div class="extraDiv5"><span></span></div> 
     
    </div>
    Et celui de la page popUp

    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
    <?php
      require('includes/application_top.php');
     
      $navigation->remove_current_page();
     
      $products_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image1,  p.products_image2,  p.products_image3,  p.products_image4,  pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
      $products = tep_db_fetch_array($products_query);
    ?>
    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html <?php echo HTML_PARAMS; ?>>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
    <title><?php echo $product['products_name']; ?></title>
    <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
    <script language="javascript"><!--
    var i=0;
    function resize() {
      if (navigator.appName == 'Netscape') i=40;
      if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i);
      self.focus();
    }
    //--></script>
    </head>
    <body onload="resize();">
    <?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']); ?>
    </body>
    </html>
    <?php require('includes/application_bottom.php'); ?>

  2. #2
    Membre régulier
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    238
    Détails du profil
    Informations personnelles :
    Localisation : Tunisie

    Informations forums :
    Inscription : Mai 2006
    Messages : 238
    Points : 103
    Points
    103
    Par défaut
    tu utilise la fonction popupWindow(url) pour ouvrir une nouvelle fenêtre (pop up) ?

    tu l'a mis en commentaire ?

  3. #3
    Débutant
    Technicien maintenance
    Inscrit en
    Mai 2007
    Messages
    123
    Détails du profil
    Informations personnelles :
    Âge : 38

    Informations professionnelles :
    Activité : Technicien maintenance

    Informations forums :
    Inscription : Mai 2007
    Messages : 123
    Points : 37
    Points
    37
    Par défaut
    Citation Envoyé par Chikh001 Voir le message
    tu utilise la fonction popupWindow(url) pour ouvrir une nouvelle fenêtre (pop up) ?

    tu l'a mis en commentaire ?
    Oui j'utilise la fonction popupWindow(url) pour ouvrir ma fenêtre popUp

    ET il me semble pas qu'elle soit en commentaire. Si elle l'était quand je clique sur mon image rien ne se passerait alors que là j'ai bien ma fenêtre qui s'ouvre mais il n'y a rien d'afficher dedans.

  4. #4
    Membre régulier
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    238
    Détails du profil
    Informations personnelles :
    Localisation : Tunisie

    Informations forums :
    Inscription : Mai 2006
    Messages : 238
    Points : 103
    Points
    103
    Par défaut
    dans le problème est dans la deuxième.
    Essaye d'afficher ta requête dans la deuxième fenêtre (pop up) pour s'assurer qu'elle est correcte.

    En faite il y a des GET dans ta pop up mais j'ai pas vu comment tu as passé les paramaitre à cette page ?

  5. #5
    Débutant
    Technicien maintenance
    Inscrit en
    Mai 2007
    Messages
    123
    Détails du profil
    Informations personnelles :
    Âge : 38

    Informations professionnelles :
    Activité : Technicien maintenance

    Informations forums :
    Inscription : Mai 2007
    Messages : 123
    Points : 37
    Points
    37
    Par défaut
    Dans ma page popup_image.php (la 2), cette ligne :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']); ?>
    quand je regarde le code de la pages il n'y a que

    images (le répertoire avec mes images) / et rien ensuite, donc je suppose que c'est mes gets qui fonctionnent pas, mais je sais pas comment faire pour qu'ils fonctionnent.

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

Discussions similaires

  1. Calendrier problème de popup et de positionnement
    Par 12_darte_12 dans le forum Général JavaScript
    Réponses: 3
    Dernier message: 20/03/2006, 15h08
  2. Problème menu popup
    Par ptitJP dans le forum MFC
    Réponses: 8
    Dernier message: 10/03/2006, 14h16
  3. Problème fermeture popup
    Par nicolb dans le forum Général JavaScript
    Réponses: 5
    Dernier message: 25/02/2006, 08h53
  4. Fonction ASP: problème avec popup
    Par claralavraie dans le forum ASP
    Réponses: 6
    Dernier message: 07/02/2006, 10h31
  5. Problème Formulaire + popup + page PHP
    Par nesbla dans le forum Général JavaScript
    Réponses: 7
    Dernier message: 25/02/2005, 00h10

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