Skip to content
Permalink
c66bdfe2cd
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
143 lines (133 sloc) 9.24 KB
<div data-ng-controller="userController" data-ng-init="getUserInfo()">
<a id="top"></a>
<div class="col-md-6 col-md-offset-3">
<h2>Your Account Information</h2>
<div ng-show="messages" class="alert alert-danger">{{messages}}</div>
<form name="form" role="form">
<div class="form-group" ng-class="{ 'has-error': form.firstName.$dirty && form.firstName.$error.required }">
<label for="username">First name</label>
<input type="text" name="firstName" id="firstName" class="form-control" ng-model="user.FName" required />
<span ng-show="form.firstName.$dirty && form.firstName.$error.required" class="help-block">First name is required</span>
</div>
<div class="form-group" ng-class="{ 'has-error': form.lastName.$dirty && form.lastName.$error.required }">
<label for="username">Last name</label>
<input type="text" name="lastName" id="Text1" class="form-control" ng-model="user.LName" required />
<span ng-show="form.lastName.$dirty && form.lastName.$error.required" class="help-block">Last name is required</span>
</div>
<div class="form-group" ng-class="{ 'has-error': form.addr.$dirty && form.addr.$error.required }">
<label for="addr">Address</label>
<input type="text" name="addr" id="addr" class="form-control" ng-model="user.Address" required />
<span ng-show="form.addr.$dirty && form.addr.$error.required" class="help-block">Address is required</span>
</div>
<div class="form-group" ng-class="{ 'has-error': form.city.$dirty && form.city.$error.required }">
<label for="city">City</label>
<input type="text" name="city" id="city" class="form-control" ng-model="user.City" required />
<span ng-show="form.city.$dirty && form.city.$error.required" class="help-block">City is required</span>
</div>
<div class="form-group" ng-class="{ 'has-error': form.state.$dirty && form.state.$error.required }">
<label for="state">State</label>
<input type="text" name="state" id="state" class="form-control" ng-model="user.State" required />
<span ng-show="form.state.$dirty && form.state.$error.required" class="help-block">State is required</span>
</div>
<div class="form-group" ng-class="{ 'has-error': form.country.$dirty && form.country.$error.required }">
<label for="country">Country</label>
<input type="text" name="country" id="country" class="form-control" ng-model="user.Country" required />
<span ng-show="form.country.$dirty && form.country.$error.required" class="help-block">Country is required</span>
</div>
<div class="form-group" ng-class="{ 'has-error': form.postal.$dirty && form.postal.$error.required }">
<label for="postal">Zip Code</label>
<input type="text" name="postal" id="postal" class="form-control" ng-model="user.Post" required />
<span ng-show="form.postal.$dirty && form.postal.$error.required" class="help-block">Postal is required</span>
</div>
<div class="form-group" ng-class="{ 'has-error': form.phone.$dirty && form.phone.$error.required }">
<label for="phone">Phone Number</label>
<input type="text" name="phone" id="phone" class="form-control" ng-model="user.Phone" required />
<span ng-show="form.phone.$dirty && form.phone.$error.required" class="help-block">Phone number is required</span>
</div>
<div class="form-group" ng-class="{ 'has-error': form.fax.$dirty && form.fax.$error.required }">
<label for="fax">Fax Number</label>
<input type="text" name="fax" id="fax" class="form-control" ng-model="user.Fax" required />
<span ng-show="form.fax.$dirty && form.fax.$error.required" class="help-block">Fax number is required</span>
</div>
<div class="form-group" ng-class="{ 'has-error': form.email.$dirty && form.email.$error.required }">
<label for="email">Email</label>
<input type="text" name="email" id="email" class="form-control" ng-model="user.Email" required />
<span ng-show="form.email.$dirty && form.email.$error.required" class="help-block">Email is required</span>
</div>
<div class="form-group">
<label for="company">Company name (Optional)</label>
<input type="text" name="company" id="company" class="form-control" ng-model="user.Company" />
</div>
<div class="form-actions">
<button type="submit" ng-disabled="form.$invalid || vm.dataLoading" data-ng-click="updateUser(user)" class="btn btn-primary">Submit Changes</button>
</div>
</form><br /><br />
<h2>Add Payment Methods</h2>
<label for=" type">Payment Type</label>
<select name="type" ng-model="data.type">
<option value="CC">Credit Card</option>
<option value="AP">Apple Pay</option>
<option value="GP">Google Pay</option>
</select><br><br />
<!-- Apple Pay -->
<form name="appleform" role="form" ng-show="data.type == 'AP'">
<div class="form-group" ng-class="{ 'has-error': appleform.token.$dirty && appleform.token.$error.required}">
<label for="token">Token</label>
<input type="text" name="token" id="token" class="form-control" ng-model="data.token" required />
<span ng-show="appleform.token.$dirty && appleform.token.$error.required" class="help-block">Token is required</span>
</div>
<label>
Set as Default:
<input type="checkbox" ng-model="data.default"
ng-true-value="1" ng-false-value="1">
</label><br />
<div class="form-actions">
<button type="submit" ng-show="data.type" ng-disabled="appleform.$invalid || vm.dataLoading" data-ng-click="addPayment(data)" class="btn btn-primary">Submit Payment</button>
</div>
</form>
<!-- Google Pay -->
<form name="gform" role="form" ng-show="data.type == 'GP'">
<div class="form-group" ng-class="{ 'has-error': gform.token.$dirty && gform.token.$error.required}">
<label for="token">Token</label>
<input type="text" name="token" id="token" class="form-control" ng-model="data.token" required />
<span ng-show="gform.token.$dirty && gform.token.$error.required" class="help-block">Token is required</span>
</div>
<div class="form-group" ng-class="{ 'has-error': gform.email.$dirty && gform.email.$error.required}">
<label for="email">Email Address</label>
<input type="text" name="email" id="email" class="form-control" ng-model="data.email" required />
<span ng-show="gform.email.$dirty && gform.email.$error.required" class="help-block">Email is required</span>
</div>
<label>
Set as Default:
<input type="checkbox" ng-model="data.default"
ng-true-value="1" ng-false-value="1">
</label><br />
<div class="form-actions">
<button type="submit" ng-show="data.type" ng-disabled="gform.$invalid || vm.dataLoading" data-ng-click="addPayment(data)" class="btn btn-primary">Submit Payment</button>
</div>
</form>
<!-- Credit Card -->
<form name="cform" role="form" ng-show="data.type == 'CC'">
<div class="form-group" ng-class="{ 'has-error': cform.num.$dirty && cform.num.$error.required}">
<label for="num">Credit Card Number</label>
<input type="text" name="num" id="num" class="form-control" ng-model="data.num" required />
<span ng-show="cform.num.$dirty && cform.num.$error.required" class="help-block">Credit Card Number is required</span>
</div>
<div class="form-group" ng-class="{ 'has-error': cform.date.$dirty && cform.date.$error.required}">
<label for="date">Expiration Date</label>
<input type="text" name="date" id="date" class="form-control" ng-model="data.date" ng-pattern='/^((199\d)|([2-9]\d{3}))-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/' required />
<span ng-show="cform.date.$dirty && cform.date.$error.required" class="help-block">Credit Card Number is required</span>
<span ng-show="cform.date.$error.pattern">Incorrect Format, should be YYYY-MM-DD</span>
</div>
<label>
Set as Default:
<input type="checkbox" ng-model="data.default"
ng-true-value="1" ng-false-value="1">
</label><br />
<div class="form-actions">
<button type="submit" ng-show="data.type" ng-disabled="cform.$invalid || vm.dataLoading" data-ng-click="addPayment(data)" class="btn btn-primary">Submit Payment</button>
</div>
</form>
<br /><br />
</div>
</div>