<?php
render('_header')?>
<div data-role="page">
<script>
function validateForm()
{
var x=document.forms["myForm"]["fname"].value;
if (x==null || x=="")
  {
  alert("First name is required");
  return false;
  }
var x=document.forms["myForm"]["lname"].value;
if (x==null || x=="")
  {
  alert("Last name is required");
  return false;
  }
var x=document.forms["myForm"]["cname"].value;
if (x==null || x=="")
  {
  alert("Company name  is required");
  return false;
  }
var x=document.forms["myForm"]["uname"].value;
if (x==null || x=="")
  {
  alert("User name is required");
  return false;
  }
var x=document.forms["myForm"]["email"].value;
if (x==null || x=="")
  {
  alert("Email address is required");
  return false;
  }
var x=document.forms["myForm"]["pass2"].value;
if (x==null || x=="")
  {
  alert("Robot test is required");
  return false;
  }
}
</script>
<?
$companies = bill_get_companies();
?>
	<div data-role="header" data-theme="a">
           <table width="90%"><tr><td>
                <a href="https://wtrbill.com" target="_blank"><img src="assets/img/WtrBillLogo.svg" alt="WtrBill.com" height="70" width="95"/></a></td>
                <td width="85%">
                <h1>Pay My WtrBill</h1>
                    </td></tr>
                    <tr><td></td><td width="85%">Please choose your utility,</td></tr>
                    <tr><td></td><td width="85%">enter your username and password</td></tr>
                    <tr><td></td><td width="85%">and click the login button!</td></tr>
            </table>
	</div>
    <form method="post" >
        <table width="90%"><tr><td style="padding:10px 20px 0px 182px">

        <label for="companies">Please choose your utility company:</label><br/>
        <select name="companies" id="companies">
            <?
            for ($i=0;$i<count($companies);$i++) {
                echo '<option value="'. $companies[$i]['id']. '">'.$companies[$i]['name'].'</option>';
                }
            ?>
        </select></td></tr><tr><td style="padding:5px 20px 0px 182px">
        <label for="login"></label>
        <input type="hidden" name="login" id="login" value="true" />
        <label for="uname">Username:</label>
        <input type="text" name="name" id="uname" data-mini="true" />
        </td></tr><tr><td style="padding:5px 20px 0px 182px">
        <label for="uname">Password:</label>
        <input type="password" name="pass" id="pword" data-mini="true" />
        <button type="submit" data-theme="a">Login</button>
    </td></tr></table>
    </form>
    <table width="90%"><tr><td>
        <td width="85%"></td></tr>
                    <tr><td></td><td width="85%"><h3>Contact your utility office to setup access!</h3></td></tr>
            </table>
<?php render('_footer')?>