⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adm_addproduct.php

📁 这个版本只是修正了一些BUG
💻 PHP
字号:
<?php
/*
	adm_addproduct.php

	Version  : 1.0.0
	Author   : Tracemouse (tracemouse@msn.com)
	Copyright: http://www.vitci.com
	Writed   : 2003/08/20
	Modified : 2003/12/15
*/

require "./common.php";
$file_name='./adm_addproduct.php';
require "../include/catalog.php";


if (!$editsubmit)     //未发送表单
{
	$ourprice=$marketprice='0.00';
    $query = $db->query("SELECT paraid,paraname FROM $table_parameters ORDER BY paraid");
	$para_select = "<select size=1 name=paraid>";
 	$isselected='';
 	$paraid=0;
 	while($dbq_rec = $db->fetch_array($query))
    {
   		$isselected = ($dbq_rec['paraid'] == $paraid)?"selected":"";
   		$para_select = $para_select."<option ".$isselected." value=".$dbq_rec['paraid'].">".$dbq_rec['paraname']."</option>";
 	}
 	$para_select = $para_select."</select>";
 	//$query = $db->query("SELECT sortid,sortname FROM $table_sorts");
 	//$isselected='';
 	$sortid=0;
 	/*
 	$sort_select = "<select size=1 name=sortid>";
 	while($dbq_rec = $db->fetch_array($query)){
   		$isselected = ($dbq_rec['sortid'] == $sortid)?"selected":"";
   		$sort_select = $sort_select."<option ".$isselected." value=".$dbq_rec['sortid'].">".$dbq_rec['sortname']."</option>";
 	}
 	$sort_select = $sort_select."</select>";   */
 	$sort_select = getsortselect($sortid);
 	$display = 'edit';
}
elseif ($editsubmit)           //发送表单处理
{
    if(empty($productname))
    	gotourl($language['alt_null_keyword']);
    if(($ourprice <= 0)||($marketprice <= 0))
    	gotourl($language['alt_num_price']);
    $sqlstr="INSERT INTO $table_products(productname,sortid,posttime,ourprice,marketprice,".
    		"smallimg,largeimg,notes,paraid) ".
    		"VALUES('$productname',$sel_sortid,$timestamp,$ourprice,".
    		"$marketprice,'$smallimg','$largeimg','$Post',$paraid)";
  	if(!($query=$db->query($sqlstr)))
    	gotourl($language['db_err']."<br>".$sqlstr,$file_name);
  	$productid=$db->insert_id();
  	if ($paraid > 1)
   		gotourl($language['editsuccess'],'./adm_addpara.php?productid='.$productid);
  	else
   		gotourl($language['editsuccess'],'./adm_product.php?searchsubmit=act&productname='.$productname);
}

include template('addproduct');
?>

⌨️ 快捷键说明

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