tax_classes.php

来自「全新且完善的强大网上商店系统」· PHP 代码 · 共 143 行

PHP
143
字号
<?php
/*
  [SOOBIC!] admin/tax_classes.php 

	Version: 1.5
	Author: soolan (soolan@qq.com)
	Copyright: soolan (www.soobic.com)
	Last Modified: 2005/4/5 10:00

*/

if(!defined('IN_SOOBIC')) {
        exit('Access Denied');
}

cpheader();

include ("admin/languages/".$language."/tax_classes.php");

//$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : $HTTP_POST_VARS['action']);

if ($action) {
    switch ($action) {
      case 'new':
        $tax_class_title = safe_input($HTTP_POST_VARS['tax_class_title']);
        $tax_class_description = safe_input($HTTP_POST_VARS['tax_class_description']);
        $db->query("insert into $table_tax_class (tax_class_title, tax_class_description, date_added) values ('" . ($tax_class_title) . "', '" . ($tax_class_description) . "', now())");
        cpmsg("Soolan!税别成功添加。",tep_href_link('admincp.php', 'act=tax_classes')); 
        break;
      case 'save':
        $tax_class_id = safe_input($HTTP_POST_VARS['tID']);
				$tax_class_title = safe_input($HTTP_POST_VARS['tax_class_title']);
        $tax_class_description = safe_input($HTTP_POST_VARS['tax_class_description']);

        $db->query("update $table_tax_class set  tax_class_title = '" . ($tax_class_title) . "', tax_class_description = '" . ($tax_class_description) . "', last_modified = now() where tax_class_id = '" . (int)$tax_class_id . "'");
        cpmsg("Soolan!税别成功编辑。",tep_href_link('admincp.php', 'act=tax_classes&page=' . $HTTP_GET_VARS['page'] )); 
        break;
      case 'delete':
        $tax_class_id = safe_input($HTTP_GET_VARS['tID']);

        $db->query("delete from $table_tax_class where tax_class_id = '" . (int)$tax_class_id . "'");
        cpmsg("Soolan!税别成功删除。",tep_href_link('admincp.php', 'act=tax_classes&page=' . $HTTP_GET_VARS['page']));  
        break;
    }
}elseif($type){
    switch ($type) {
      case 'delete':
        cpmsg("本操作不可恢复,您确定要删除该税别?", tep_href_link('admincp.php', 'act=tax_classes&page=' . $HTTP_GET_VARS['page'].'&tID='.$tID.'&action=delete', 'NONSSL'), "form");
      break;
      case 'edit':
        $query = $db->query("select tax_class_id, tax_class_title, tax_class_description, last_modified, date_added from $table_tax_class  where tax_class_id = '" . (int)$tID. "'"); 
				$tax_classes = $db->fetch_array($query); 
?>

<form method="post" action="<?=tep_href_link('admincp.php','act=tax_classes')?>">
<input type="hidden" name="action" value="save">
<input type="hidden" name="tID" value="<?=$tax_classes['tax_class_id']?>">
<table cellspacing="0" cellpadding="0" border="0" width="80%" align="center">
<tr><td bgcolor="<?=BORDERCOLOR?>">
<table border="0" cellspacing="<?=BORDERWIDTH?>" cellpadding="<?=TABLESPACE?>" width="100%">

<tr class="header"><td colspan="2"><?=TEXT_INFO_HEADING_EDIT_TAX_CLASS?></td></tr>
<tr align="center" bgcolor="<?=ALTBG1?>"><td width="40%" align="right"><?=TEXT_INFO_CLASS_TITLE?></td>
<td align="left"><input type="text" size="50" name="tax_class_title" value="<?=$tax_classes['tax_class_title']?>"></td>
</tr>
<tr align="center" bgcolor="<?=ALTBG2?>"><td align="right"><?=TEXT_INFO_CLASS_DESCRIPTION?></td>
<td align="left"><textarea name="tax_class_description" wrap="soft" cols="70" rows="3"><?=$tax_classes['tax_class_description']?></textarea></td>
</tr>
<tr align="center" bgcolor="<?=ALTBG1?>"><td width="40%" align="right"><?=TEXT_INFO_DATE_ADDED?></td>
<td align="left"><?=$tax_classes['date_added']?></td>
</tr>
<tr align="center" bgcolor="<?=ALTBG1?>"><td width="40%" align="right"><?=TEXT_INFO_LAST_MODIFIED?></td>
<td align="left"><?=$tax_classes['last_modified']?></td>
</tr> 
</table></td></tr></table><br><center><?=$warning?>
<input type="submit" name="submit" value="提   交">&nbsp;
</center></form><br><br>


<?
      break;
      
    }

}else{
    if($page) {
	      	$start_limit = ($page - 1) * MAX_DISPLAY_SEARCH_RESULTS ;
    } else {
	        $start_limit = 0;
	        $page = 1;
    }
    
    $query = $db->query("SELECT COUNT(*) from $table_tax_class");
    $multipage = multi($db->result($query, 0), MAX_DISPLAY_SEARCH_RESULTS, $page, "admincp.php?act=tax_classes".($desc ? "&desc=$desc" : NULL));
    $query = $db->query("select tax_class_id, tax_class_title, tax_class_description, last_modified, date_added from $table_tax_class order by tax_class_title LIMIT $start_limit, ".MAX_DISPLAY_SEARCH_RESULTS);
		$altbg1 = ALTBG1;
	  $altbg2 = ALTBG2;
	  $productcount = 0;
?>
<br><br>
<?=$multipage?> 
<table cellspacing="0" cellpadding="0" border="0" width="95%" align="center" style="word-break:break-all;">
<tr><td bgcolor="<?=BORDERCOLOR?>">
<table border="0" cellspacing="<?=BORDERWIDTH?>" cellpadding="<?=TABLESPACE?>" width="100%">
<tr class="header"><td><?=TABLE_HEADING_TAX_CLASSES?></td><td width="50%" align="center"><?=TEXT_INFO_CLASS_DESCRIPTION?></td><td width="20%" align="center"><?=TABLE_HEADING_ACTION?></td></tr>
<?
    
		while ($classes = $db->fetch_array($query)) {
         $bgno = $productcount++ % 2 + 1;
         $classes['tax_class_description']=wordscut($classes['tax_class_description'],100)
?>
<tr bgcolor="<?=${'altbg'.$bgno}?>"><td><?=$classes['tax_class_title']?></td><td><?=$classes['tax_class_description']?></td><td align="center"><a href="<?=tep_href_link('admincp.php', 'act=tax_classes&page=' . $HTTP_GET_VARS['page'] . '&type=edit&tID=' . $classes['tax_class_id'])?>">详情</a>&nbsp;&nbsp;&nbsp;<a href="<?=tep_href_link('admincp.php', 'act=tax_classes&page=' . $HTTP_GET_VARS['page'] . '&type=delete&tID=' .$classes['tax_class_id'])?>">删除</a></td></tr>


<?
    }
?>
</table></td></tr></table>   
<?=$multipage?>      
<br><br>

<form method="post" action="<?=tep_href_link('admincp.php','act=tax_classes')?>">
<input type="hidden" name="action" value="new">
<table cellspacing="0" cellpadding="0" border="0" width="80%" align="center">
<tr><td bgcolor="<?=BORDERCOLOR?>">
<table border="0" cellspacing="<?=BORDERWIDTH?>" cellpadding="<?=TABLESPACE?>" width="100%">
<tr class="header"><td colspan="7"><?=TEXT_INFO_INSERT_INTRO?></td></tr>
<tr align="center" bgcolor="<?=ALTBG1?>"><td width="40%" align="right"><?=TEXT_INFO_CLASS_TITLE?></td>
<td align="left"><input type="text" size="50" name="tax_class_title"></td>
</tr>
<tr align="center" bgcolor="<?=ALTBG2?>"><td align="right"><?=TEXT_INFO_CLASS_DESCRIPTION?></td>
<td align="left"><textarea name="tax_class_description" wrap="soft" cols="70" rows="3"></textarea></td>
</tr>
</table></td></tr></table><br><center><?=$warning?>
<input type="submit" name="submit" value="提   交">&nbsp;
</center></form><br><br>
    
    
<?    
}
?>

⌨️ 快捷键说明

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