products_attributes_add_p.php

来自「全新且完善的强大网上商店系统」· PHP 代码 · 共 318 行 · 第 1/2 页

PHP
318
字号
<center>&nbsp;<?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>&nbsp;<?php echo '<a href="' . tep_href_link('admincp.php', 'act=products_attributes_add_p&attribute_page=' . $attribute_page, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a>&nbsp;</center>
</form>      
<?php
          }
          break;
      }
      

}else{

   if (!isset($attribute_page)) {
       $attribute_page = 1;
   }
   $prev_attribute_page = $attribute_page - 1;
   $next_attribute_page = $attribute_page + 1;
?>
<br>
<table cellspacing="0" cellpadding="0" border="0" width="100%" align="center">
<tr><td bgcolor="<?=BORDERCOLOR?>">
<table border="0" cellspacing="<?=BORDERWIDTH?>" cellpadding="<?=TABLESPACE?>" width="100%">
<tr bgcolor="<?=ALTBG2?>">
<form name="attributes" action="<?php echo tep_href_link('admincp.php', 'act=products_attributes_add_p&action=add_product_attributes&option_page=' . $option_page . '&value_page=' . $value_page . '&attribute_page=' . $attribute_page); ?>" method="post">
            <td colspan="7">
<?php
   $per_page = MAX_ROW_LISTS_OPTIONS;
   $attributes = "select pa.* from $table_products_attributes pa left join $table_products_description pd on pa.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by pd.products_name";
   $attribute_query = $db->query($attributes);

   $attribute_page_start = ($per_page * $attribute_page) - $per_page;
   $num_rows = $db->num_rows($attribute_query);

   if ($num_rows <= $per_page) {
       $num_pages = 1;
   } else if (($num_rows % $per_page) == 0) {
       $num_pages = ($num_rows / $per_page);
   } else {
       $num_pages = ($num_rows / $per_page) + 1;
   }
   $num_pages = (int) $num_pages;

   $attributes = $attributes . " LIMIT $attribute_page_start, $per_page";

   if ($prev_attribute_page) {
       echo '<a href="' . tep_href_link('admincp.php', 'act=products_attributes&attribute_page=' . $prev_attribute_page) . '"> &lt;&lt; </a> | ';
   }

   for ($i = 1; $i <= $num_pages; $i++) {
      if ($i != $attribute_page) {
          echo '<a href="' . tep_href_link('admincp.php', 'act=products_attributes_add_p&attribute_page=' . $i) . '">' . $i . '</a> | ';
      } else {
          echo '<b><font color="red">' . $i . '</font></b> | ';
      }
   }

   if ($attribute_page != $num_pages) {
       echo '<a href="' . tep_href_link('admincp.php', 'act=products_attributes_add_p&attribute_page=' . $next_attribute_page) . '"> &gt;&gt; </a>';
   }
?>
            </td>
          </tr>
</table></td></tr></table>
<br>          
<table cellspacing="0" cellpadding="0" border="0" width="100%" align="center">
<tr><td bgcolor="<?=BORDERCOLOR?>">
<table border="0" cellspacing="<?=BORDERWIDTH?>" cellpadding="<?=TABLESPACE?>" width="100%">
          <tr class="header">
            <td width="8%">&nbsp;<?php echo TABLE_HEADING_ID; ?>&nbsp;</td>
            <td width="12%">&nbsp;<?php echo TABLE_HEADING_PRODUCT; ?>&nbsp;</td>
            <td width="12%">&nbsp;<?php echo TABLE_HEADING_OPT_NAME; ?>&nbsp;</td>
            <td >&nbsp;<?php echo TABLE_HEADING_OPT_VALUE; ?>&nbsp;</td>
            <td align="right" width="12%">&nbsp;<?php echo TABLE_HEADING_OPT_PRICE; ?>&nbsp;</td>
            <td align="center" width="8%">&nbsp;<?php echo TABLE_HEADING_OPT_PRICE_PREFIX; ?>&nbsp;</td>
            <td align="center" width="15%">&nbsp;<?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
          </tr>
<?php
   $next_id = 1;
   $attributes = $db->query($attributes);
   while ($attributes_values = $db->fetch_array($attributes)) {
      $products_name_only = tep_get_products_name($attributes_values['products_id']);
      $options_name = tep_options_name($attributes_values['options_id']);
      $values_name = tep_values_name($attributes_values['options_values_id']);
      $rows++;
?>
          <tr bgcolor="<?=ALTBG2?>">
<?php
      
?>          <td class="smallText">&nbsp;<?php echo $attributes_values["products_attributes_id"]; ?>&nbsp;</td>
            <td class="smallText">&nbsp;<?php echo $products_name_only; ?>&nbsp;</td>
            <td class="smallText">&nbsp;<?php echo $options_name; ?>&nbsp;</td>
            <td class="smallText">&nbsp;<?php echo $values_name; ?>&nbsp;</td>
            <td align="right" class="smallText">&nbsp;<?php echo $attributes_values["options_values_price"]; ?>&nbsp;</td>
            <td align="center" class="smallText">&nbsp;<?php echo $attributes_values["price_prefix"]; ?>&nbsp;</td>
            <td align="center" class="smallText">&nbsp;<?php echo '<a href="' . tep_href_link('admincp.php', 'act=products_attributes_add_p&type=update_attribute&attribute_id=' . $attributes_values['products_attributes_id'] . '&attribute_page=' . $attribute_page, 'NONSSL') . '">'; ?><?=IMAGE_UPDATE?></a>&nbsp;&nbsp;<?php echo '<a href="' . tep_href_link('admincp.php', 'act=products_attributes_add_p&type=delete_product_attribute&attribute_id=' . $attributes_values['products_attributes_id'] . '&attribute_page=' . $attribute_page, 'NONSSL') , '">'; ?><?=IMAGE_DELETE?></a>&nbsp;</td>
         </tr>
<?php
   }
?>
          <tr bgcolor="<?=ALTBG2?>">
            <td colspan="2">&nbsp;<select name="products_id">
<?php
     $products = $db->query("select p.products_id, pd.products_name from $table_products p, $table_products_description pd where pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "' order by pd.products_name");
     while ($products_values = $db->fetch_array($products)) {
        echo '<option name="' . $products_values['products_name'] . '" value="' . $products_values['products_id'] . '">' . $products_values['products_name'] . '</option>';
     } 
?>
            </select>&nbsp;</td>
            <td class="smallText">&nbsp;<select name="options_id">
<?php
    $options = $db->query("select * from $table_products_options where language_id = '" . $languages_id . "' order by products_options_name");
    while ($options_values = $db->fetch_array($options)) {
       echo '<option name="' . $options_values['products_options_name'] . '" value="' . $options_values['products_options_id'] . '">' . $options_values['products_options_name'] . '</option>';
    } 
?>
            </select>&nbsp;</td>
            <td class="smallText">&nbsp;<select name="values_id">
<?php
    $values = $db->query("select * from $table_products_options_values where language_id = '" . $languages_id . "' order by products_options_values_name");
    while ($values_values = $db->fetch_array($values)) {
       echo '<option name="' . $values_values['products_options_values_name'] . '" value="' . $values_values['products_options_values_id'] . '" size="20">' . $values_values['products_options_values_name'] . '</option>';
    } 
?>
            </select>&nbsp;</td>
            <td align="right">&nbsp;<input type="text" name="value_price" size="6">&nbsp;</td>
            <td align="right">&nbsp;<input type="text" name="price_prefix" size="2" value="+">&nbsp;</td>
            <td align="center"></td>
          </tr>
<?php
    if (DOWNLOAD_ENABLED == 'true') {
        $products_attributes_maxdays  = DOWNLOAD_MAX_DAYS;
        $products_attributes_maxcount = DOWNLOAD_MAX_COUNT;
?>
          <tr bgcolor="<?=ALTBG2?>">
            <td colspan="7">
              <table>
                <tr class="<?php echo (!($rows % 2)? 'attributes-even' : 'attributes-odd');?>">
                  <td><?php echo TABLE_HEADING_DOWNLOAD; ?>&nbsp;</td>
                  <td><?php echo TABLE_TEXT_FILENAME; ?></td>
                  <td><?php echo tep_draw_input_field('products_attributes_filename', $products_attributes_filename, 'size="15"'); ?>&nbsp;</td>
                  <td><?php echo TABLE_TEXT_MAX_DAYS; ?></td>
                  <td><?php echo tep_draw_input_field('products_attributes_maxdays', $products_attributes_maxdays, 'size="5"'); ?>&nbsp;</td>
                  <td><?php echo TABLE_TEXT_MAX_COUNT; ?></td>
                  <td><?php echo tep_draw_input_field('products_attributes_maxcount', $products_attributes_maxcount, 'size="5"'); ?>&nbsp;</td>
                </tr>
              </table>
            </td>
          </tr>
<?
   }
?>
         
</table></td></tr></table>
<br>
<center><?php echo tep_image_submit('button_insert.gif', IMAGE_INSERT); ?></center>

</form>
<?php
}
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?