@ -0,0 +1,41 @@ |
|||||
|
<div class="container"> |
||||
|
<div class="row"> |
||||
|
<div class="col-sm-4"> |
||||
|
|
||||
|
</div> |
||||
|
<div class="col-sm-4"> |
||||
|
<div class="panel"> |
||||
|
<div class="panel-heading c_deepPurple300"> |
||||
|
<h3 class="panel-title">Signup</h3> |
||||
|
</div> |
||||
|
<div class="panel-body"> |
||||
|
<div class="form-group"> |
||||
|
<input ng-model="user.adminPassword" abmFormControl class="form-control" id="inputAdminPassword" placeholder="AdminPassword" type="password"> |
||||
|
</div> |
||||
|
<div class="form-group label-floating"> |
||||
|
<input ng-model="user.username" abmFormControl class="form-control" id="inputUsername" placeholder="Username" type="text"> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<input ng-model="user.password" abmFormControl class="form-control" id="inputPassword" placeholder="Password" type="password"> |
||||
|
</div> |
||||
|
<div class="form-group label-floating"> |
||||
|
<input ng-model="user.email" abmFormControl class="form-control" id="inputEmail" placeholder="Email" type="text"> |
||||
|
</div> |
||||
|
<div class="form-group label-floating"> |
||||
|
<input ng-model="user.phone" abmFormControl class="form-control" id="inputPhone" placeholder="Phone" type="text"> |
||||
|
</div> |
||||
|
<div class="form-group label-floating"> |
||||
|
<input ng-model="user.telegram" abmFormControl class="form-control" id="inputTelegram" placeholder="Telegram" type="text"> |
||||
|
</div> |
||||
|
<a ng-href="#!/login" class="btn btn-raised c_grey500">Back</a> |
||||
|
<div ng-click="doLogin()" class="btn btn-raised c_deepPurple300 pull-right">Login</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="col-sm-4"> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
@ -0,0 +1,42 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
angular.module('app.signup', ['ngRoute']) |
||||
|
|
||||
|
.config(['$routeProvider', function($routeProvider) { |
||||
|
$routeProvider.when('/signup', { |
||||
|
templateUrl: 'views/signup/signup.html', |
||||
|
controller: 'SignupCtrl' |
||||
|
}); |
||||
|
}]) |
||||
|
|
||||
|
.controller('SignupCtrl', function($scope, $http, $routeParams) { |
||||
|
$scope.user = {}; |
||||
|
$scope.doLogin = function() { |
||||
|
console.log('Doing login', $scope.user); |
||||
|
|
||||
|
$http({ |
||||
|
url: urlapi + 'admin/signup', |
||||
|
method: "POST", |
||||
|
data: $scope.user |
||||
|
}) |
||||
|
.then(function(response) { |
||||
|
console.log("response: "); |
||||
|
console.log(response.data); |
||||
|
if (response.data.success == true) |
||||
|
{ |
||||
|
localStorage.setItem("cic_admin_token", response.data.token); |
||||
|
localStorage.setItem("cic_admin_userdata", JSON.stringify(response.data.user)); |
||||
|
window.location.reload(); |
||||
|
}else{ |
||||
|
console.log("login failed"); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
function(response) { // optional
|
||||
|
// failed
|
||||
|
console.log(response); |
||||
|
}); |
||||
|
|
||||
|
}; |
||||
|
}); |