麻辣堂|资源主站|开发论坛|在线手册
首页 Apache Linux Java MySQL 注册帮助 
PHP项目开发组是PHP开发资源网于2007组年建成立的项目开发团队,目前核心开发成员有27人, 项目协作成员8名.下设7个开发组,主要承接大/中型网站项目开发任务。

    由于开发任务较多,人员比较紧张,现面向社会招聘全职或者兼职开发人员,不管你是在校大学生,还是全职开发人员,以及SOHO都可以联系本站,我们可以长期合作,并为您带来丰厚的报酬。
  您现在的位置:PHP开发资源网 > 麻辣堂 > 详细资料
待解决
购物车不解
悬赏分:20 - 2007年08月22日

上网下载了一个购物车,可以用了,但我想那些被放进购物篮的产品按他们的编号排序,怎样怎样改,才行,以下是我下载的购物车的代码:
[php]
class Basket {
var $basket_count;
var $basket_item_id;
var $basket_item_name;
var $basket_item_quantity;
var $basket_item_data;
var $basket_item_price;
var $basket_item_tax;
var $basket_item_color;
var $basket_item_size;

function Basket() {
$this->basket_count=0;
}
function Add_Item($ID,$name,$quantity=1,$price=0,$data='',$tax,$color,$size,$weight) {

$this->basket_item_id[$this->basket_count]=$ID;//ÉÌÆ·ID
$this->basket_item_name[$this->basket_count]=$name;//ÉÌÆ·Ãû³Æ
$this->basket_item_quantity[$this->basket_count]=$quantity;//ÉÌÆ·ÊýÁ¿
$this->basket_item_data[$this->basket_count]=$data;//ÈÕÆÚ
$this->basket_item_price[$this->basket_count]=$price;//¼Û¸ñ
$this->basket_item_tax[$this->basket_count]=$tax;
$this->basket_item_color[$this->basket_count]=$color;
$this->basket_item_size[$this->basket_count]=$size;
$this->basket_item_weight[$this->basket_count]=$weight;

$this->basket_count++;
return ($this->basket_count-1);
}
function Del_Item($pos) {
$this->basket_item_id[$pos]='';
}
function Get_Item_ID($pos) {
return $this->basket_item_id[$pos];
}
function Get_Item_Name($pos) {
return $this->basket_item_name[$pos];
}
function Get_Item_Price($pos) {
return $this->basket_item_price[$pos];
}
function Get_Item_Quantity($pos) {
return $this->basket_item_quantity[$pos];
}
function Get_Item_Data($pos) {
return $this->basket_item_data[$pos];
}
function Get_Item_Tax($pos) {
return $this->basket_item_tax[$pos];
}
function Get_Item_Color($pos) {
return $this->basket_item_color[$pos];
}
function Get_Item_Size($pos) {
return $this->basket_item_size[$pos];
}
function Get_Item_Weight($pos) {
return $this->basket_item_weight[$pos];
}
function Set_Item_Quantity($pos,$quantity) {
$this->basket_item_quantity[$pos]=$quantity;
}
function Set_Item_Data($pos,$data) {
$this->basket_item_data[$pos]=$data;
}
function Enum_Items($start=false) {
static $current;
if ($current>=$this->basket_count) return -1;
if (!$start) {
$current++;
} else {
$current=0;
}
while (($this->basket_item_id[$current]=='') && ($current<$this->basket_count)) {
$current++;
}
return ($current<$this->basket_count) ? $current : -1;
}
function Empty_Basket() {
$this->basket_count=0;
}
function Get_Basket_Count() {
$num=0;
for ($i=0;$i<$this->basket_count;$i++) {
if ($this->basket_item_id[$i]!='') $num++;
}
return $num;
}
}
[/php]

提问者:和记   08-22 12:12
答复
路过。。。顺便帮顶:)
回答者:玉米づ冰冻可乐 - 瓦岗村民 8-22 09:10
我也来回答:
不管你有没有帮助我们,瓦岗寨8万村民将感谢你。。。。。

为防止灌水,您需要计算一道数学题: 答案:
12 + 70 = ? 请将计算结果填在上面

 
[]
©2007 PhpRes.COM