<?php
try {
  error_reporting(E_ALL); ini_set('display_errors', 1);
  require_once "./pineapple.php";
  require_once "./mysql/helper.php";
  pineapple_html_begin("Pineapple PNP", "Promotional Credits");

  $db = db_connect("pontech_pineapplepnp");

  //print("<pre>\n");
  //print_r($_POST);
  //print_r($_SESSION);  // Warning, printing session vars could lead to security issues
  //print("</pre>\n");
	
	if(!isset($_SESSION['email']))
  {
		echo "<br>You must sign in to view this page<br>";
    goto exit_page;
  }
  
  if($_SESSION['admin'] != '1') {
    ?>
      <h1>This account does not have priveliges for viewing this page</h1>
    <?php
    goto exit_page;
  }
  
  $email = $_SESSION['email'];
  
  ?>
  <form method="post" action="pineapple_promotional_credit_detail.php" name="customer_email_form">
    <td align="right">Customer E-Mail Address</td>
      <td>
        <input name="customer_email" type="text" maxlength="100" size="25" />
      </td>
      <input type="submit" value="Submit"/>
  </form>
  <?php
  
  $db = NULL;
  
exit_page:

	pineapple_script_end();
	pineapple_html_end();
}
catch (PDOException $e)
{
  print ("<br />$e");
}
?>