示例#1
0
function save_billing_address()
{
    global $db;
    $data = $_SESSION['PayerAddress'];
    $countries = get_coutries();
    $args = array(':first_name' => $data['first_name'], ':last_name' => $data['last_name'], ':street1' => $data['street1'], ':street2' => $data['street2'], ':city_name' => $data['city_name'], ':state_or_province' => $data['state_or_province'], ':country' => $countries[$data['country']][1], ':postal_code' => $data['postal_code'], ':phone' => $data['phone'], ':email' => $data['email'], ':shipping' => isset($data['shipping']));
    $query = "INSERT INTO address (\n\t\t\tfirst_name,\n\t\t\tlast_name,\n\t\t\tstreet1,\n\t\t\tstreet2,\n\t\t\tcity_name,\n\t\t\tstate_or_province,\n\t\t\tcountry,\n\t\t\tpostal_code,\n\t\t\tphone,\n\t\t\temail,\n\t\t\tshipping\n\t\t) VALUES (\n\t\t\t:first_name,\n\t\t\t:last_name,\n\t\t\t:street1,\n\t\t\t:street2,\n\t\t\t:city_name,\n\t\t\t:state_or_province,\n\t\t\t:country,\n\t\t\t:postal_code,\n\t\t\t:phone,\n\t\t\t:email,\n\t\t\t:shipping\n\t\t)";
    $db->query($query, $args);
    return $db->lastInsertId();
}
示例#2
0
文件: index.php 项目: jabouzi/paypal
<?php

include 'includes/config.php';
$countries = get_coutries();
?>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<meta charset="UTF-8">
		<meta http-equiv="cache-control" content="public">
		<meta http-equiv="expires" content="Fri, 30 Dec 2013 12:00:00 GMT">

		<title>Paypal Payments</title>
		<meta name="description" content="Shopping cart">
		<meta name="keywords" content="">
		<meta name="robots" content="index,follow">
		<meta name="author" content="Skander Software Solutions">
		<link rel="stylesheet" type="text/css" media="screen, projection" href="assets/reset.css">
		<link rel="stylesheet" type="text/css" media="screen, projection" href="assets/paypal.css">
		<link rel="stylesheet" type="text/css" media="print" href="assets/print.css">
		<script type="text/javascript" src="assets/jquery.min.js"></script>
		<script type="text/javascript" src="assets/functions.js"></script>
		<script type="text/javascript" src="assets/vform.js"></script>
		<script type="text/javascript" src="assets/states.json"></script>
	</head>
	<body>
		<div id="wrap">
			<div id="shop">
				<div id="wrapper">
					<section class="section">