PHP Classes

File: fwphp/01mater/shop/ch24_guitar_shop/account/account_view.php

Recommend this page to a friend!
  Classes of Slavko Srakocic  >  B12 PHP FW  >  fwphp/01mater/shop/ch24_guitar_shop/account/account_view.php  >  Download  
File: fwphp/01mater/shop/ch24_guitar_shop/account/account_view.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change:
Date: 2 months ago
Size: 2,694 bytes


Class file image Download
<?php include '../view/header.php'; ?>
include '../view/sidebar.php'; ?>
    <h1>My Account</h1>
    <p><?php echo $customer_name . ' (' . $email . ')'; ?></p>
    <form action="." method="post">
        <input type="hidden" name="action" value="view_account_edit">
        <input type="submit" value="Edit Account">
    <h2>Shipping Address</h2>
    <p><?php echo htmlspecialchars($shipping_address['line1']); ?><br>
        <?php if ( strlen($shipping_address['line2']) > 0 ) : ?>
<?php echo htmlspecialchars($shipping_address['line2']); ?><br>
        <?php endif; ?>
<?php echo htmlspecialchars($shipping_address['city']); ?>, <?php
echo htmlspecialchars($shipping_address['state']); ?>
<?php echo htmlspecialchars($shipping_address['zipCode']); ?><br>
        <?php echo htmlspecialchars($shipping_address['phone']); ?>
    <form action="." method="post">
        <input type="hidden" name="action" value="view_address_edit">
        <input type="hidden" name="address_type" value="shipping">
        <input type="submit" value="Edit Shipping Address">
    <h2>Billing Address</h2>
    <p><?php echo htmlspecialchars($billing_address['line1']); ?><br>
        <?php if ( strlen($billing_address['line2']) > 0 ) : ?>
<?php echo htmlspecialchars($billing_address['line2']); ?><br>
        <?php endif; ?>
<?php echo htmlspecialchars($billing_address['city']); ?>, <?php
echo htmlspecialchars($billing_address['state']); ?>
<?php echo htmlspecialchars($billing_address['zipCode']); ?><br>
        <?php echo htmlspecialchars($billing_address['phone']); ?>
    <form action="." method="post">
        <input type="hidden" name="action" value="view_address_edit">
        <input type="hidden" name="address_type" value="billing">
        <input type="submit" value="Edit Billing Address">
    <?php if (count($orders) > 0 ) : ?>
<h2>Your Orders</h2>
            <?php foreach($orders as $order) :
$order_id = $order['orderID'];
$order_date = strtotime($order['orderDate']);
$order_date = date('M j, Y', $order_date);
$url = $app_path . 'account' .
'?action=view_order&order_id=' . $order_id;
                    Order # <a href="<?php echo $url; ?>">
                    <?php echo $order_id; ?></a> placed on
                    <?php echo $order_date; ?>
            <?php endforeach; ?>
    <?php endif; ?>
<?php include '../view/footer.php'; ?>

For more information send a message to info at phpclasses dot org.