Hi guys me again!
My system just crashed I have restored it to the original config and spec but I am getting a parse error:
Parse error: parse error in order_fns.php on line 51
code block reads:
function insert_order($order_details)
{
global $total_price;
global $cart;
//extract order_details out as variables
extract($order_details);
//set shipping address same as address
if(!$ship_name&&!$ship_1st_add&&!$ship_2nd_add&&!$ship_city&&!$ship_state&&!$ship_zip&&!$ship_country)
{
$ship_name = $name;
$ship_1st_add = $first_add;
$ship_2nd_add = $second_add;
$ship_city = $city;
$ship_state = $state;
$ship_zip = $zip;
$ship_country = $country;
}
$conn = db_connect();
//insert customer address
$query = "select customerid from contact where
name = '$name' and 1st_add = '$first_add'
and 2nd_add ='$second_add' and town = '$city' and state = '$state'
and zip = '$zip' and country = '$country'";
$result = mysql_query($query);
if(mysql_numrows($result)>0)
{
$customer_id = mysql_result($result, 0, "customerid"
;
}
else
{
$query = "insert into contact values
('', '$first_add', '$second_add','$city','$zip', '$email', '$fax', '$name', '$country', '$state', '$tel' );
$result = mysql_query($query);
if (!$result)
return false;
}
$query = "select customerid from customers where
name = '$name' and 1st_add = '$first_add'
and 2nd_add = '$second_add' and
town = '$city' and state = '$state'
and zip = '$zip' and country = '$country'";
$result = mysql_query($query);
if(mysql_numrows($result)>0)
$customerid = mysql_result($result, 0, "customerid"
;
else
return false;
$date = date("Y-m-d"
;
$query = "insert into orders values
('', $customerid, $total_price, '$date', 'PARTIAL', '$ship_name',
'$ship_1st_add','$ship_2nd_add', '$ship_city','$ship_state','$ship_zip',
'$ship_country')";
$result = mysql_query($query);
if (!$result)
return false;
$query = "select orderid from orders where
customerid = $customerid and
amount > $total_price-.001 and
amount < $total_price+.001 and
date = '$date' and
order_status = 'PARTIAL' and
ship_name = '$ship_name' and
ship_1st_add = '$ship_1st_add' and
ship_2nd_add = '$ship_2nd_add' and
ship_city = '$ship_city' and
ship_state = '$ship_state' and
ship_zip = '$ship_zip' and
ship_country = '$ship_country'";
$result = mysql_query($query);
if(mysql_numrows($result)>0)
$orderid = mysql_result($result, 0, "orderid"
;
else
return false;
// insert each product
foreach($cart as $productID => $quantity)
{
$detail = get_product_details($productId);
$query = "delete from order_items where
orderid = '$orderid' and productId = '$productId'";
$result = mysql_query($query);
$query = "insert into order_items values
('$orderid', '$productID', ".$detail["price"].", $quantity)";
$result = mysql_query($query);
if(!$result)
return false;
}
return $orderid;
}
can't see anything my self but maybe some one else can
My system just crashed I have restored it to the original config and spec but I am getting a parse error:
Parse error: parse error in order_fns.php on line 51
code block reads:
function insert_order($order_details)
{
global $total_price;
global $cart;
//extract order_details out as variables
extract($order_details);
//set shipping address same as address
if(!$ship_name&&!$ship_1st_add&&!$ship_2nd_add&&!$ship_city&&!$ship_state&&!$ship_zip&&!$ship_country)
{
$ship_name = $name;
$ship_1st_add = $first_add;
$ship_2nd_add = $second_add;
$ship_city = $city;
$ship_state = $state;
$ship_zip = $zip;
$ship_country = $country;
}
$conn = db_connect();
//insert customer address
$query = "select customerid from contact where
name = '$name' and 1st_add = '$first_add'
and 2nd_add ='$second_add' and town = '$city' and state = '$state'
and zip = '$zip' and country = '$country'";
$result = mysql_query($query);
if(mysql_numrows($result)>0)
{
$customer_id = mysql_result($result, 0, "customerid"
}
else
{
$query = "insert into contact values
('', '$first_add', '$second_add','$city','$zip', '$email', '$fax', '$name', '$country', '$state', '$tel' );
$result = mysql_query($query);
if (!$result)
return false;
}
$query = "select customerid from customers where
name = '$name' and 1st_add = '$first_add'
and 2nd_add = '$second_add' and
town = '$city' and state = '$state'
and zip = '$zip' and country = '$country'";
$result = mysql_query($query);
if(mysql_numrows($result)>0)
$customerid = mysql_result($result, 0, "customerid"
else
return false;
$date = date("Y-m-d"
$query = "insert into orders values
('', $customerid, $total_price, '$date', 'PARTIAL', '$ship_name',
'$ship_1st_add','$ship_2nd_add', '$ship_city','$ship_state','$ship_zip',
'$ship_country')";
$result = mysql_query($query);
if (!$result)
return false;
$query = "select orderid from orders where
customerid = $customerid and
amount > $total_price-.001 and
amount < $total_price+.001 and
date = '$date' and
order_status = 'PARTIAL' and
ship_name = '$ship_name' and
ship_1st_add = '$ship_1st_add' and
ship_2nd_add = '$ship_2nd_add' and
ship_city = '$ship_city' and
ship_state = '$ship_state' and
ship_zip = '$ship_zip' and
ship_country = '$ship_country'";
$result = mysql_query($query);
if(mysql_numrows($result)>0)
$orderid = mysql_result($result, 0, "orderid"
else
return false;
// insert each product
foreach($cart as $productID => $quantity)
{
$detail = get_product_details($productId);
$query = "delete from order_items where
orderid = '$orderid' and productId = '$productId'";
$result = mysql_query($query);
$query = "insert into order_items values
('$orderid', '$productID', ".$detail["price"].", $quantity)";
$result = mysql_query($query);
if(!$result)
return false;
}
return $orderid;
}
can't see anything my self but maybe some one else can