Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require('../model/database.php');
- require('../model/registration_db.php');
- if (isset($_POST['action']))
- {
- $action = $_POST['action'];
- }
- else if (isset($_GET['action']))
- {
- $action = $_GET['action'];
- }
- else
- {
- $action = 'product_login';
- }
- echo $action;
- if ($action == 'product_login')
- {
- include('product_login.php');
- }
- if ($action == 'get_customer_registrations')
- {
- if (!isset($email))
- {
- $email = filter_input(INPUT_POST, 'email');
- }
- if (empty($email))
- {
- //Page displayed when search field is left blank upon clicking submit.
- $error = "Please enter an email address into the search field.";
- include('../view/header.php');
- include('../errors/error_no_header_footer.php');
- include('../errors/error_customer_login.php');
- include ('../view/footer.php');
- }
- else
- {
- //Code to display customer first & last name based upon submitted email address.
- $customers = search_customer_email($email); //DISPLAYS FIRST & LAST NAME
- //VARIABLES FOR THIS ACTION
- $email = filter_input(INPUT_POST, 'email');
- $productCode = filter_input(INPUT_POST, 'productCode');
- $cust_ID = filter_input(INPUT_POST, 'customerID');
- $numOfProducts = get_products();
- $customer = get_customer($cust_ID);
- $exists = check_registration($cust_ID, $productCode);
- $numProductRows = $numOfProducts->rowCount();
- //Code to return row count of products registered to the customerID.
- $numCustomerRegistrations = count_all_registrations($cust_ID); //< --- GIVES ROWCOUNT
- //Code to obtain products that are already registered to the email address.
- $registrations = get_products_by_customer($email); //DISPLAYS LIST OF ALREADY REGISTERED PRODUCTS
- //Display pre registered products in a neat little table!
- include('product_register.php');
- }
- }
- if ($action == 'register_product')
- {
- echo $product['productCode'];
- echo $product['name'];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement