[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/admin/ -> tax_classes.php (source)

   1  <?php
   2  //

   3  // +----------------------------------------------------------------------+

   4  // |zen-cart Open Source E-commerce                                       |

   5  // +----------------------------------------------------------------------+

   6  // | Copyright (c) 2003 The zen-cart developers                           |

   7  // |                                                                      |

   8  // | http://www.zen-cart.com/index.php                                    |

   9  // |                                                                      |

  10  // | Portions Copyright (c) 2003 osCommerce                               |

  11  // +----------------------------------------------------------------------+

  12  // | This source file is subject to version 2.0 of the GPL license,       |

  13  // | that is bundled with this package in the file LICENSE, and is        |

  14  // | available through the world-wide-web at the following url:           |

  15  // | http://www.zen-cart.com/license/2_0.txt.                             |

  16  // | If you did not receive a copy of the zen-cart license and are unable |

  17  // | to obtain it through the world-wide-web, please send a note to       |

  18  // | license@zen-cart.com so we can mail you a copy immediately.          |

  19  // +----------------------------------------------------------------------+

  20  //  $Id: tax_classes.php 3780 2006-06-16 03:04:43Z drbyte $

  21  //

  22    require ('includes/application_top.php');
  23  
  24    $action = (isset($_GET['action']) ? $_GET['action'] : '');
  25  
  26    if (zen_not_null($action)) {
  27      switch ($action) {
  28        case 'insert':
  29          $tax_class_title = zen_db_prepare_input($_POST['tax_class_title']);
  30          $tax_class_description = zen_db_prepare_input($_POST['tax_class_description']);
  31  
  32          $db->Execute("insert into " . TABLE_TAX_CLASS . "
  33                      (tax_class_title, tax_class_description, date_added)
  34                      values ('" . zen_db_input($tax_class_title) . "',
  35                              '" . zen_db_input($tax_class_description) . "',
  36                              now())");
  37  
  38          zen_redirect(zen_href_link(FILENAME_TAX_CLASSES));
  39          break;
  40        case 'save':
  41          $tax_class_id = zen_db_prepare_input($_GET['tID']);
  42          $tax_class_title = zen_db_prepare_input($_POST['tax_class_title']);
  43          $tax_class_description = zen_db_prepare_input($_POST['tax_class_description']);
  44  
  45          $db->Execute("update " . TABLE_TAX_CLASS . "
  46                        set tax_class_id = '" . (int)$tax_class_id . "',
  47                            tax_class_title = '" . zen_db_input($tax_class_title) . "',
  48                            tax_class_description = '" . zen_db_input($tax_class_description) . "',
  49                            last_modified = now()
  50                        where tax_class_id = '" . (int)$tax_class_id . "'");
  51  
  52          zen_redirect(zen_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tax_class_id));
  53          break;
  54        case 'deleteconfirm':
  55          // demo active test

  56          if (zen_admin_demo()) {
  57            $_GET['action']= '';
  58            $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
  59            zen_redirect(zen_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page']));
  60          }
  61          $tax_class_id = zen_db_prepare_input($_GET['tID']);
  62  
  63          $db->Execute("delete from " . TABLE_TAX_CLASS . "
  64                        where tax_class_id = '" . (int)$tax_class_id . "'");
  65  
  66          zen_redirect(zen_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page']));
  67          break;
  68      }
  69    }
  70  ?>
  71  <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  72  <html <?php echo HTML_PARAMS; ?>>
  73  <head>
  74  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  75  <title><?php echo TITLE; ?></title>
  76  <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
  77  <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
  78  <script language="javascript" src="includes/menu.js"></script>
  79  <script language="javascript" src="includes/general.js"></script>
  80  <script type="text/javascript">
  81    <!--
  82    function init()
  83    {
  84      cssjsmenu('navbar');
  85      if (document.getElementById)
  86      {
  87        var kill = document.getElementById('hoverJS');
  88        kill.disabled = true;
  89      }
  90    }
  91    // -->

  92  </script>
  93  </head>
  94  <body onLoad="init()">
  95  <!-- header //-->
  96  <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
  97  <!-- header_eof //-->
  98  
  99  <!-- body //-->
 100  <table border="0" width="100%" cellspacing="2" cellpadding="2">
 101    <tr>
 102  <!-- body_text //-->
 103      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 104        <tr>
 105          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
 106            <tr>
 107              <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
 108              <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
 109            </tr>
 110          </table></td>
 111        </tr>
 112        <tr>
 113          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
 114            <tr>
 115              <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 116                <tr class="dataTableHeadingRow">
 117                  <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TAX_CLASS_ID; ?></td>
 118                  <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TAX_CLASSES; ?></td>
 119                  <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
 120                </tr>
 121  <?php
 122    $classes_query_raw = "select tax_class_id, tax_class_title, tax_class_description, last_modified, date_added from " . TABLE_TAX_CLASS . " order by tax_class_title";
 123    $classes_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $classes_query_raw, $classes_query_numrows);
 124    $classes = $db->Execute($classes_query_raw);
 125    while (!$classes->EOF) {
 126      if ((!isset($_GET['tID']) || (isset($_GET['tID']) && ($_GET['tID'] == $classes->fields['tax_class_id']))) && !isset($tcInfo) && (substr($action, 0, 3) != 'new')) {
 127        $tcInfo = new objectInfo($classes->fields);
 128      }
 129  
 130      if (isset($tcInfo) && is_object($tcInfo) && ($classes->fields['tax_class_id'] == $tcInfo->tax_class_id)) {
 131        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=edit') . '\'">' . "\n";
 132      } else {
 133        echo'              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $classes->fields['tax_class_id']) . '\'">' . "\n";
 134      }
 135  ?>
 136                  <td class="dataTableContent"><?php echo $classes->fields['tax_class_id']; ?></td>
 137                  <td class="dataTableContent"><?php echo $classes->fields['tax_class_title']; ?></td>
 138                  <td class="dataTableContent" align="right"><?php if (isset($tcInfo) && is_object($tcInfo) && ($classes->fields['tax_class_id'] == $tcInfo->tax_class_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $classes->fields['tax_class_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
 139                </tr>
 140  <?php
 141      $classes->MoveNext();
 142    }
 143  ?>
 144                <tr>
 145                  <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 146                    <tr>
 147                      <td class="smallText" valign="top"><?php echo $classes_split->display_count($classes_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_TAX_CLASSES); ?></td>
 148                      <td class="smallText" align="right"><?php echo $classes_split->display_links($classes_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>
 149                    </tr>
 150  <?php
 151    if (empty($action)) {
 152  ?>
 153                    <tr>
 154                      <td colspan="2" align="right"><?php echo '<a href="' . zen_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&action=new') . '">' . zen_image_button('button_new_tax_class.gif', IMAGE_NEW_TAX_CLASS) . '</a>'; ?></td>
 155                    </tr>
 156  <?php
 157    }
 158  ?>
 159                  </table></td>
 160                </tr>
 161              </table></td>
 162  <?php
 163    $heading = array();
 164    $contents = array();
 165  
 166    switch ($action) {
 167      case 'new':
 168        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_TAX_CLASS . '</b>');
 169  
 170        $contents = array('form' => zen_draw_form('classes', FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&action=insert'));
 171        $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
 172        $contents[] = array('text' => '<br>' . TEXT_INFO_CLASS_TITLE . '<br>' . zen_draw_input_field('tax_class_title', '', zen_set_field_length(TABLE_TAX_CLASS, 'tax_class_title')));
 173        $contents[] = array('text' => '<br>' . TEXT_INFO_CLASS_DESCRIPTION . '<br>' . zen_draw_input_field('tax_class_description', '', zen_set_field_length(TABLE_TAX_CLASS, 'tax_class_description')));
 174        $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_insert.gif', IMAGE_INSERT) . '&nbsp;<a href="' . zen_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
 175        break;
 176      case 'edit':
 177        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_TAX_CLASS . '</b>');
 178  
 179        $contents = array('form' => zen_draw_form('classes', FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=save'));
 180        $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
 181        $contents[] = array('text' => '<br>' . TEXT_INFO_CLASS_TITLE . '<br>' . zen_draw_input_field('tax_class_title', $tcInfo->tax_class_title, zen_set_field_length(TABLE_TAX_CLASS, 'tax_class_title')));
 182        $contents[] = array('text' => '<br>' . TEXT_INFO_CLASS_DESCRIPTION . '<br>' . zen_draw_input_field('tax_class_description', $tcInfo->tax_class_description, zen_set_field_length(TABLE_TAX_CLASS, 'tax_class_description')));
 183        $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . zen_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
 184        break;
 185      case 'delete':
 186        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_TAX_CLASS . '</b>');
 187  
 188        $contents = array('form' => zen_draw_form('classes', FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=deleteconfirm'));
 189        $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
 190        $contents[] = array('text' => '<br><b>' . $tcInfo->tax_class_title . '</b>');
 191        $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . zen_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
 192        break;
 193      default:
 194        if (isset($tcInfo) && is_object($tcInfo)) {
 195          $heading[] = array('text' => '<b>' . $tcInfo->tax_class_title . '</b>');
 196  
 197          $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
 198          $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($tcInfo->date_added));
 199          $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($tcInfo->last_modified));
 200          $contents[] = array('text' => '<br>' . TEXT_INFO_CLASS_DESCRIPTION . '<br>' . $tcInfo->tax_class_description);
 201        }
 202        break;
 203    }
 204    if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
 205      echo '            <td width="25%" valign="top">' . "\n";
 206  
 207      $box = new box;
 208      echo $box->infoBox($heading, $contents);
 209  
 210      echo '            </td>' . "\n";
 211    }
 212  ?>
 213            </tr>
 214          </table></td>
 215        </tr>
 216      </table></td>
 217  <!-- body_text_eof //-->
 218    </tr>
 219  </table>
 220  <!-- body_eof //-->
 221  
 222  <!-- footer //-->
 223  <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
 224  <!-- footer_eof //-->
 225  <br>
 226  </body>
 227  </html>
 228  <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics