branch logo upload

This commit is contained in:
resicovenba 2017-12-09 17:18:27 +05:30
parent 65e718eaf0
commit ad48120648
7 changed files with 533 additions and 227 deletions

View File

@ -49,17 +49,25 @@ class Branch_Controller extends REST_Controller {
public function addBranchDetails_post()
{
$details['BranchCode'] = $this->post('branchCode');
$details['BranchName'] = $this->post('branchName');
$details['LogoPath'] = $this->post('logo');
// $details['LogoPath'] = $this->post('logo');
$details['MobileNumber'] = $this->post('primaryPhone');
$details['AlternateNumber'] = $this->post('secondaryPhone');
$details['LandlineNumber'] = $this->post('landLine');
$details['Address'] = $this->post('address');
$details['EmailID'] = $this->post('email');
$details['CreatedBy'] = $this->post('createdBy');
$details['IsActive'] = $this->post('status');
$branchDetails = $this->branch_model->addBranch($details);// Check if the users data store contains users (in case the database result returns NULL)
$details['IsActive'] = $this->post('status') == true ? 1 : 0;
$imageStat = $this->post('imageStatus');
$imagename = $imageStat == 1 ? $_FILES['logo']['name'] : '';
$size = $imageStat == 1 ? $_FILES['logo']['size'] : '';
$imageSource = $imageStat == 1 ? $_FILES['logo']['tmp_name'] : '';
$branchDetails = $this->branch_model->addBranch($details, $imageSource);// Check if the users data store contains users (in case the database result returns NULL)
if ($branchDetails)
{
$branchDetails['status'] = REST_Controller::HTTP_OK;
@ -117,10 +125,18 @@ class Branch_Controller extends REST_Controller {
$details['LandlineNumber'] = $this->post('landLine');
$details['Address'] = $this->post('address');
$details['EmailID'] = $this->post('email');
$details['IsActive'] = $this->post('status');
$details['UpdatedBy'] = $this->post('updatedBy');
$details['UpdatedOn'] = date("Y-m-d", time());
$updateDetails = $this->branch_model->updateBranch($details,$branchCode);// Check if the users data store contains users (in case the database result returns NULL)
$details['IsActive'] = $this->post('status') == true ? 1 : 0;
$details['UpdatedBy'] = $this->post('createdBy');
$date = date('Y-m-d H:i:s');
$details['UpdatedOn'] = $date;
$imageStat = $this->post('imageStatus');
$imagename = $imageStat == 1 ? $_FILES['logoEdit']['name'] : '';
$size = $imageStat == 1 ? $_FILES['logoEdit']['size'] : '';
$imageSource = $imageStat == 1 ? $_FILES['logoEdit']['tmp_name'] : '';
$updateDetails = $this->branch_model->updateBranch($details,$branchCode, $imageSource, $imageStat );// Check if the users data store contains users (in case the database result returns NULL)
if ($updateDetails)
{
$updateDetails['status'] = REST_Controller::HTTP_OK;

View File

@ -15,9 +15,14 @@ class Branch_model extends CI_Model {
* created by kms
* */
public function addBranch($arrayDetails=null)
public function addBranch($arrayDetails=null, $imageSource)
{
$target = "../images/logo/";
$getUploadStatus = $this-> upload_image($imageSource, $target);
$imageNameDb = $getUploadStatus['imageName'];
$arrayDetails['LogoPath'] = $getUploadStatus == true ? "logo/".$imageNameDb : '';
// print_r($arrayDetails['IsActive']);exit();
$this->db->select('BranchCode');
$this->db->where('BranchCode', $arrayDetails['BranchCode']);
if($this->db->get(BRANCH)->first_row()){
@ -80,12 +85,22 @@ class Branch_model extends CI_Model {
* created by kms
* */
public function updateBranch($arrayDetails=null,$branchCode=null)
public function updateBranch($arrayDetails=null,$branchCode=null, $imageSource, $imageStat)
{
if( $imageStat == 1 ) {
$target = "../images/logo/";
$getUploadStatus = $this-> upload_image($imageSource, $target);
$imageNameDb = $getUploadStatus['imageName'];
$arrayDetails['LogoPath'] = $getUploadStatus == true ? "logo/".$imageNameDb : null;
} else {
}
// print_r($arrayDetails['IsActive']);exit();
$this->db->where('BranchCode',$branchCode);
$upateStatus=$this->db->update(BRANCH, $arrayDetails);
if($upateStatus){
$result['branchStatus'] = true;
$result['message'] = "Successfully branch details updated";
}
@ -101,5 +116,21 @@ class Branch_model extends CI_Model {
}
// image upload in taget path
public function upload_image( $imageSource, $target ) {
$key2 = substr(str_shuffle('abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, 12);
$new_regNo = "Dri_" . $key2 . "." . 'jpeg';
$targetPlace = $target . $new_regNo;
// echo $targetPlace;exit();
if(!move_uploaded_file($imageSource , $targetPlace))
{
return $result['status'] = false;
} else {
$result['status'] = true;
$result['imageName'] = $new_regNo;
return $result;
}
}
}

View File

@ -49,6 +49,51 @@ app.controller('branchCtrl', ["$scope","toaster", "$filter", "ngTableParams", "A
$scope.viewId = pid;
$scope.editId = -1;
};*/
//-------------------------------------------------------------->
// getting for image to show
//-------------------------------------------------------------->
$scope.stepsModel = [];
$scope.imageUpload = function (event) {
var files = event.target.files; //FileList object
for (var i = 0; i < files.length; i++) {
var file = files[i];
var reader = new FileReader();
reader.onload = $scope.imageIsLoaded;
reader.readAsDataURL(file);
}
}
$scope.imageIsLoaded = function (e) {
$scope.$apply(function () {
// $scope.stepsModel.push(e.target.result);
$scope.stepsModel[0] = e.target.result;
});
}
//an array of files selected
$scope.files = [];
//listen for the file selected event
$scope.$on("fileSelected", function (event, args) {
$scope.$apply(function () {
//add the file object to the scope's files collection
$scope.files[0] = args.file;
});
});
// reset image
$scope.resetImage = function () {
$scope.files.length = 0;
$scope.stepsModel.length = 0;
}
/*
* Submit,update and reset branch details
* @params myModel
@ -72,41 +117,70 @@ app.controller('branchCtrl', ["$scope","toaster", "$filter", "ngTableParams", "A
angular.element('.ng-invalid[name=' + firstError + ']').focus();
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
} else {
$scope.ldloading1 = {};
$scope.ldloading1[loading.replace('-', '_')] = true;
var formData = new FormData();
var logo = $scope.files[0];
$scope.ldloading1[loading.replace('-', '_')] = true;
formData.append("branchCode", myModel.branchCode);
formData.append("branchName", myModel.branchName);
formData.append("email", myModel.email);
formData.append("primaryPhone", myModel.primaryPhone);
formData.append("secondaryPhone", myModel.secondaryPhone);
formData.append("landLine", myModel.landLine);
formData.append("address", myModel.address);
formData.append("status", myModel.switchsetting);
var checkImg = logo == undefined ? 0 : 1;
formData.append("imageStatus", checkImg);
formData.append("createdBy", JSON.parse(localStorage.getItem('localObj')).localUserID);
formData.append('logo', logo);
var addBranch = {
method: 'POST',
url: apiPoint.url + 'addBranchDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
branchCode: myModel.branchCode,
branchName: myModel.branchName,
email: myModel.email,
primaryPhone: myModel.primaryPhone,
secondaryPhone: myModel.secondaryPhone,
landLine: myModel.landLine,
address: myModel.address,
logo: myModel.logo,
status: myModel.switchsetting,
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID
$http.post(apiPoint.url + 'addBranchDetails/', formData, {
transformRequest: angular.identity,
headers: { 'Content-Type': undefined, 'Process-Data': false },
}).success(function (data) {
if (data.status==200 && data.branchStatus) {
$scope.ldloading1[loading.replace('-', '_')] = false;
swal("Success!", data.message, "success");
$state.go($state.current, {}, {reload: true});
} else {
$scope.ldloading1[loading.replace('-', '_')] = false;
swal("Failed!", data.message, "error");
}
};
$http(addBranch).then(function (response) {
if (response.data.status==200 && response.data.branchStatus) {
$scope.ldloading1[loading.replace('-', '_')] = false;
swal("Success!", response.data.message, "success");
$state.go($state.current, {}, {reload: true});
} else {
$scope.ldloading1[loading.replace('-', '_')] = false;
swal("Failed!", response.data.message, "error");
}
});
});
// var addBranch = {
// method: 'POST',
// url: apiPoint.url + 'addBranchDetails/',
// headers: {
// 'Content-Type': 'application/json'
// },
// data: {
// branchCode: myModel.branchCode,
// branchName: myModel.branchName,
// email: myModel.email,
// primaryPhone: myModel.primaryPhone,
// secondaryPhone: myModel.secondaryPhone,
// landLine: myModel.landLine,
// address: myModel.address,
// logo: myModel.logo,
// status: myModel.switchsetting,
// createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID
// }
// };
// $http(addBranch).then(function (response) {
// if (response.data.status==200 && response.data.branchStatus) {
// $scope.ldloading1[loading.replace('-', '_')] = false;
// swal("Success!", response.data.message, "success");
// $state.go($state.current, {}, {reload: true});
// } else {
// $scope.ldloading1[loading.replace('-', '_')] = false;
// swal("Failed!", response.data.message, "error");
// }
// });
}
@ -130,6 +204,46 @@ app.controller('branchCtrl', ["$scope","toaster", "$filter", "ngTableParams", "A
}
};
$scope.stepsModelEdit = [];
$scope.imageUploadEdit = function (event) {
var files = event.target.files; //FileList object
for (var i = 0; i < files.length; i++) {
var file = files[i];
var reader = new FileReader();
reader.onload = $scope.imageIsLoadedEdit;
reader.readAsDataURL(file);
}
}
$scope.imageIsLoadedEdit = function (e) {
$scope.$apply(function () {
// $scope.stepsModel.push(e.target.result);
$scope.stepsModelEdit[0] = e.target.result;
});
}
//an array of files selected
$scope.filesEdit = [];
//listen for the file selected event
$scope.$on("fileSelectedEdit", function (event, args) {
$scope.$apply(function () {
//add the file object to the scope's files collection
$scope.filesEdit[0] = args.file;
});
});
// reset image for Edit
$scope.resetImageEdit = function () {
$scope.filesEdit.length = 0;
$scope.stepsModelEdit.length = 0;
}
/*
* update the branch details
* created by kms
@ -155,39 +269,72 @@ app.controller('branchCtrl', ["$scope","toaster", "$filter", "ngTableParams", "A
$scope.ldloading = {};
$scope.ldloading[loading.replace('-', '_')] = true;
var formData = new FormData();
var logoEdit = $scope.filesEdit[0];
formData.append("branchCode", myModel.BranchCode);
formData.append("branchName", myModel.BranchName);
formData.append("email", myModel.EmailID);
formData.append("primaryPhone", myModel.MobileNumber);
formData.append("secondaryPhone", myModel.AlternateNumber);
formData.append("landLine", myModel.LandlineNumber);
formData.append("address", myModel.Address);
formData.append("status", myModel.IsActive);
formData.append("logo", myModel.LogoPath);
var update = {
method: 'POST',
url: apiPoint.url + 'updateBranchDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
branchCode: myModel.BranchCode,
branchName: myModel.BranchName,
email: myModel.EmailID,
primaryPhone: myModel.MobileNumber,
secondaryPhone: myModel.AlternateNumber,
landLine: myModel.LandlineNumber,
address: myModel.Address,
logo: myModel.LogoPath,
status: myModel.IsActive,
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID
}
};
$http(update).then(function (response) {
if (response.data.status==200 && response.data.branchStatus) {
$scope.ldloading[loading.replace('-', '_')] = false;
swal("Success!", response.data.message, "success");
$scope.editId = -1;
$scope.init();
var checkImg = logoEdit == undefined ? 0 : 1;
formData.append("imageStatus", checkImg);
formData.append("createdBy", JSON.parse(localStorage.getItem('localObj')).localUserID);
formData.append('logoEdit', logoEdit);
} else {
$scope.ldloading[loading.replace('-', '_')] = false;
swal("Failed!", response.data.message, "error");
}
});
$http.post(apiPoint.url + 'updateBranchDetails/', formData, {
transformRequest: angular.identity,
headers: { 'Content-Type': undefined, 'Process-Data': false },
}).success(function (data) {
if (data.status==200 && data.branchStatus) {
$scope.ldloading[loading.replace('-', '_')] = false;
swal("Success!", data.message, "success");
$scope.editId = -1;
$scope.init();
} else {
$scope.ldloading1[loading.replace('-', '_')] = false;
swal("Failed!", data.message, "error");
}
});
// var update = {
// method: 'POST',
// url: apiPoint.url + 'updateBranchDetails/',
// headers: {
// 'Content-Type': 'application/json'
// },
// data: {
// branchCode: myModel.BranchCode,
// branchName: myModel.BranchName,
// email: myModel.EmailID,
// primaryPhone: myModel.MobileNumber,
// secondaryPhone: myModel.AlternateNumber,
// landLine: myModel.LandlineNumber,
// address: myModel.Address,
// logo: myModel.LogoPath,
// status: myModel.IsActive,
// createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID
// }
// };
// $http(update).then(function (response) {
// if (response.data.status==200 && response.data.branchStatus) {
// $scope.ldloading[loading.replace('-', '_')] = false;
// swal("Success!", response.data.message, "success");
// $scope.editId = -1;
// $scope.init();
// } else {
// $scope.ldloading[loading.replace('-', '_')] = false;
// swal("Failed!", response.data.message, "error");
// }
// });
}
};
/*
@ -243,3 +390,37 @@ app.controller('branchCtrl', ["$scope","toaster", "$filter", "ngTableParams", "A
};
}]);
// file upload directive
app.directive('fileUpload', function () {
return {
scope: true, //create a new scope
link: function (scope, el, attrs) {
el.bind('change', function (event) {
var files = event.target.files;
//iterate files since 'multiple' may be specified on the element
for (var i = 0; i < files.length; i++) {
//emit event upward
scope.$emit("fileSelected", { file: files[i] });
}
});
}
};
});
// file upload directive
app.directive('fileUploadEdit', function () {
return {
scope: true, //create a new scope
link: function (scope, el, attrs) {
el.bind('change', function (event) {
var files = event.target.files;
//iterate files since 'multiple' may be specified on the element
for (var i = 0; i < files.length; i++) {
//emit event upward
scope.$emit("fileSelectedEdit", { file: files[i] });
}
});
}
};
});

View File

@ -4,8 +4,6 @@
border-radius: 60px;
box-shadow: 0px 0px 2px #007AFF;
padding: 0.5em 0.6em;
}
</style>
<!-- start: PAGE TITLE -->
@ -30,8 +28,14 @@
<div class="row">
<div ng-if="loader == ''" class="col-md-12" align="center">
<!--<img src="assets/images/ajax_loader_blue.gif" style="width: 5%; height: 30%">-->
<spinner name="html5spinner"> <div class="overlay"></div> <div class="spinner"> <div class="double-bounce1"></div> <div class="double-bounce2"></div> </div> <div class="please-wait">Please Wait...</div>
</spinner>
<spinner name="html5spinner">
<div class="overlay"></div>
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
<div class="please-wait">Please Wait...</div>
</spinner>
</div>
<div class="col-md-12" ng-if="emptyData == false && loader != ''" style="min-height: 281px;">
@ -39,80 +43,77 @@
records found... </h3></strong></p>
</div>
<div class="col-md-12" ng-if="emptyData == true">
<div class="row">
<div class="col-md-3">
<script>
$(function () {
$("#search").focus();
});
</script>
<input class="form-control" type="text" ng-model="search"
id="search" autofocus tabindex="1"
placeholder="Search"/><br><br>
</div>
<div class="row">
<div class="col-md-3">
<script>
$(function () {
$("#search").focus();
});
</script>
<input class="form-control" type="text" ng-model="search" id="search" autofocus tabindex="1" placeholder="Search" /><br><br>
</div>
<div class="table-responsive">
<fieldset>
</div>
<div class="table-responsive">
<fieldset>
<table class="table table-hover">
<thead>
<tr>
<th ng-click="sort('BranchCode')">Branch Code
<span class="glyphicon sort-icon" ng-show="sortKey=='BranchCode'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('BranchName')">Branch Name
<span class="glyphicon sort-icon" ng-show="sortKey=='BranchName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('Address')">Address
<span class="glyphicon sort-icon" ng-show="sortKey=='Address'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('EmailID')">Email Id
<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('MobileNumber')">Mobile Number
<span class="glyphicon sort-icon" ng-show="sortKey=='MobileNumber'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('AlternateNumber')">Alternate Mobile
<span class="glyphicon sort-icon" ng-show="sortKey=='AlternateNumber'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('LandlineNumber')">Landline Number
<span class="glyphicon sort-icon" ng-show="sortKey=='LandlineNumber'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th>
</th>
</tr>
</thead>
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10">
<tr>
<td>{{p.BranchCode}}</td>
<td>{{p.BranchName}}</td>
<td>{{p.Address}}</td>
<td>{{p.EmailID}}</td>
<td>{{p.MobileNumber}}</td>
<td>{{p.AlternateNumber}}</td>
<td>{{p.LandlineNumber}}</td>
<td>
<a class="text-azure" id="editRowBtn{{p.BranchCode}}" ng-click="setEditId(p.BranchCode);"><b class="fa fa-hover fa-pencil " aria-hidden="true"></b>
<thead>
<tr>
<th ng-click="sort('BranchCode')">Branch Code
<span class="glyphicon sort-icon" ng-show="sortKey=='BranchCode'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('BranchName')">Branch Name
<span class="glyphicon sort-icon" ng-show="sortKey=='BranchName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('Address')">Address
<span class="glyphicon sort-icon" ng-show="sortKey=='Address'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('EmailID')">Email Id
<span class="glyphicon sort-icon" ng-show="sortKey=='EmailID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('MobileNumber')">Mobile Number
<span class="glyphicon sort-icon" ng-show="sortKey=='MobileNumber'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('AlternateNumber')">Alternate Mobile
<span class="glyphicon sort-icon" ng-show="sortKey=='AlternateNumber'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('LandlineNumber')">Landline Number
<span class="glyphicon sort-icon" ng-show="sortKey=='LandlineNumber'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th>
</th>
</tr>
</thead>
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10">
<tr>
<td>{{p.BranchCode}}</td>
<td>{{p.BranchName}}</td>
<td>{{p.Address}}</td>
<td>{{p.EmailID}}</td>
<td>{{p.MobileNumber}}</td>
<td>{{p.AlternateNumber}}</td>
<td>{{p.LandlineNumber}}</td>
<td>
<a class="text-azure" id="editRowBtn{{p.BranchCode}}" ng-click="setEditId(p.BranchCode);"><b class="fa fa-hover fa-pencil " aria-hidden="true"></b>
</a></td>
</tr>
<tr ng-show="editId === p.BranchCode" ng-if="editId === p.BranchCode" style="width: ">
<td colspan="12" ng-include
src="'assets/views/editBranchDetails.html'"></td>
</tr>
</tbody>
</tr>
<tr ng-show="editId === p.BranchCode" ng-if="editId === p.BranchCode" style="width: ">
<td colspan="12" ng-include src="'assets/views/editBranchDetails.html'"></td>
</tr>
</tbody>
</table>
</fieldset>
</table>
</fieldset>
<dir-pagination-controls max-size="10" direction-links="true" boundary-links="true">
</dir-pagination-controls>
</div>
</div>
</div>
</div>
@ -148,128 +149,89 @@
</legend>
<div class="row">
<div class="col-md-4 form-group"
ng-class="{'has-error':Form.branchcode.$dirty && Form.branchcode.$invalid, 'has-success':Form.branchcode.$valid}">
<div class="col-md-4 form-group" ng-class="{'has-error':Form.branchcode.$dirty && Form.branchcode.$invalid, 'has-success':Form.branchcode.$valid}">
<label>
Branch Code <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Branch Code"
tabindex="1" class="form-control" name="branchcode"
ng-model="myModel.branchCode" ng-pattern="/^[a-zA-Z0-9.\s]*$/" required/>
<span class="error text-small block"
ng-if="Form.branchcode.$dirty && Form.branchcode.$error.required">Branch code is required</span>
<span class="error text-small block"
ng-if="Form.branchcode.$dirty && Form.branchcode.$error.pattern">Invalid branch code </span>
<input type="text" placeholder="Enter Branch Code" tabindex="1" class="form-control" name="branchcode" ng-model="myModel.branchCode"
ng-pattern="/^[a-zA-Z0-9.\s]*$/" required/>
<span class="error text-small block" ng-if="Form.branchcode.$dirty && Form.branchcode.$error.required">Branch code is required</span>
<span class="error text-small block" ng-if="Form.branchcode.$dirty && Form.branchcode.$error.pattern">Invalid branch code </span>
<!--<span class="success text-small"-->
<!--ng-if="Form.stopname.$valid">Thank You!</span>-->
</div>
<div class="col-md-4 form-group"
ng-class="{'has-error':Form.branchname.$dirty && Form.branchname.$invalid, 'has-success':Form.branchname.$valid}">
<div class="col-md-4 form-group" ng-class="{'has-error':Form.branchname.$dirty && Form.branchname.$invalid, 'has-success':Form.branchname.$valid}">
<label>
Branch Name <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Branch Name"
tabindex="2" class="form-control" name="branchname"
ng-model="myModel.branchName" ng-pattern="/^[a-zA-Z0-9.\s]*$/" required/>
<span class="error text-small block"
ng-if="Form.branchname.$dirty && Form.branchname.$error.required">Branch name is required</span>
<span class="error text-small block"
ng-if="Form.branchname.$dirty && Form.branchname.$error.pattern">Invalid branch name </span>
<input type="text" placeholder="Enter Branch Name" tabindex="2" class="form-control" name="branchname" ng-model="myModel.branchName"
ng-pattern="/^[a-zA-Z0-9.\s]*$/" required/>
<span class="error text-small block" ng-if="Form.branchname.$dirty && Form.branchname.$error.required">Branch name is required</span>
<span class="error text-small block" ng-if="Form.branchname.$dirty && Form.branchname.$error.pattern">Invalid branch name </span>
<!--<span class="success text-small"-->
<!--ng-if="Form.stopname.$valid">Thank You!</span>-->
</div>
<div class=" col-md-4 form-group"
ng-class="{'has-error':Form.Email.$dirty && Form.Email.$invalid, 'has-success':Form.Email.$valid}">
<div class=" col-md-4 form-group" ng-class="{'has-error':Form.Email.$dirty && Form.Email.$invalid, 'has-success':Form.Email.$valid}">
<label>
Email ID <span class="symbol required"></span>
</label>
<input type="email" tabindex="3"
placeholder="Enter Email ID"
class="form-control"
name="Email"
ng-pattern="/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i"
ng-model="myModel.email" required>
<span class="error text-small block"
ng-if="Form.Email.$dirty && Form.primaryEmail.$invalid"
ng-hide="Form.Email.$error.email">Email is required.</span>
<span class="error text-small block"
ng-if="Form.Email.$error.email">Please, enter a valid email address.</span>
<input type="email" tabindex="3" placeholder="Enter Email ID" class="form-control" name="Email" ng-pattern="/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i"
ng-model="myModel.email" required>
<span class="error text-small block" ng-if="Form.Email.$dirty && Form.primaryEmail.$invalid" ng-hide="Form.Email.$error.email">Email is required.</span>
<span class="error text-small block" ng-if="Form.Email.$error.email">Please, enter a valid email address.</span>
<!--<span style="color:#000" class="success text-small"
ng-if="Form.primaryEmail.$valid">It's a valid e-mail!</span>-->
</div>
</div>
<div class="row">
<div class="col-md-4 form-group"
ng-class="{'has-error':Form.primaryPhone.$dirty && Form.primaryPhone.$invalid, 'has-success':Form.primaryPhone.$valid}">
<div class="col-md-4 form-group" ng-class="{'has-error':Form.primaryPhone.$dirty && Form.primaryPhone.$invalid, 'has-success':Form.primaryPhone.$valid}">
<label>
Mobile Number <span
class="symbol required"></span>
</label>
<input type="text" name="primaryPhone" tabindex="4"
placeholder="Enter Mobile Number"
class="form-control"
ng-model="myModel.primaryPhone"
ng-minlength="10" ng-maxlength="12"
ng-pattern="/^[0-9]*$/" required>
<span class="error text-small block"
ng-if="Form.primaryPhone.$dirty && Form.primaryPhone.$invalid"
ng-hide="Form.primaryPhone.$error.maxlength || Form.primaryPhone.$error.minlength || Form.primaryPhone.$error.pattern">Phone number is required.</span>
<span class="error text-small block"
ng-if="Form.primaryPhone.$error.maxlength || Form.primaryPhone.$error.minlength || Form.primaryPhone.$error.pattern">Enter a valid phone number</span>
<input type="text" name="primaryPhone" tabindex="4" placeholder="Enter Mobile Number" class="form-control" ng-model="myModel.primaryPhone"
ng-minlength="10" ng-maxlength="12" ng-pattern="/^[0-9]*$/" required>
<span class="error text-small block" ng-if="Form.primaryPhone.$dirty && Form.primaryPhone.$invalid" ng-hide="Form.primaryPhone.$error.maxlength || Form.primaryPhone.$error.minlength || Form.primaryPhone.$error.pattern">Phone number is required.</span>
<span class="error text-small block" ng-if="Form.primaryPhone.$error.maxlength || Form.primaryPhone.$error.minlength || Form.primaryPhone.$error.pattern">Enter a valid phone number</span>
<!-- <span class="success text-small"
ng-if="Form.primaryPhone.$valid">Thank You!</span>-->
</div>
<div class="col-md-4 form-group"
ng-class="{'has-error':Form.secondaryPhone.$dirty && Form.secondaryPhone.$invalid, 'has-success':Form.secondaryPhone.$valid}">
<div class="col-md-4 form-group" ng-class="{'has-error':Form.secondaryPhone.$dirty && Form.secondaryPhone.$invalid, 'has-success':Form.secondaryPhone.$valid}">
<label class="control-label">
Alternate Mobile Number
</label>
<input type="text" name="secondaryPhone" tabindex="5"
placeholder="Enter Alternate Mobile Number"
class="form-control"
ng-model="myModel.secondaryPhone"
ng-minlength="10" ng-maxlength="12"
ng-pattern="/^[0-9]*$/"/>
<span class="error text-small block"
ng-if="Form.secondaryPhone.$error.maxlength || Form.secondaryPhone.$error.minlength || Form.secondaryPhone.$error.pattern">Enter a valid phone number</span>
<input type="text" name="secondaryPhone" tabindex="5" placeholder="Enter Alternate Mobile Number" class="form-control" ng-model="myModel.secondaryPhone"
ng-minlength="10" ng-maxlength="12" ng-pattern="/^[0-9]*$/" />
<span class="error text-small block" ng-if="Form.secondaryPhone.$error.maxlength || Form.secondaryPhone.$error.minlength || Form.secondaryPhone.$error.pattern">Enter a valid phone number</span>
</div>
<div class="col-md-4 form-group"
ng-class="{'has-error':Form.Landline.$dirty && Form.Landline.$invalid, 'has-success':Form.Landline.$valid}">
<label class="control-label">
<div class="col-md-4 form-group" ng-class="{'has-error':Form.Landline.$dirty && Form.Landline.$invalid, 'has-success':Form.Landline.$valid}">
<label class="control-label">
Landline Number
</label>
<input type="text" name="Landline" tabindex="6"
placeholder="Enter Landline Number"
class="form-control"
ng-model="myModel.landLine"
ng-minlength="11" ng-maxlength="13"
ng-pattern="/^[0-9-]*$/"/>
<span class="error text-small block"
ng-if="Form.Landline.$error.maxlength || Form.Landline.$error.minlength || Form.Landline.$error.pattern">Enter a valid number</span>
</div>
<input type="text" name="Landline" tabindex="6" placeholder="Enter Landline Number" class="form-control" ng-model="myModel.landLine"
ng-minlength="11" ng-maxlength="13" ng-pattern="/^[0-9-]*$/" />
<span class="error text-small block" ng-if="Form.Landline.$error.maxlength || Form.Landline.$error.minlength || Form.Landline.$error.pattern">Enter a valid number</span>
</div>
</div>
<div class="row">
<div class="col-md-4 form-group"
ng-class="{'has-error':Form.address.$dirty && Form.address.$invalid, 'has-success':Form.address.$valid}">
<label>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.address.$dirty && Form.address.$invalid, 'has-success':Form.address.$valid}">
<label>
Address<span class="symbol required"></span>
</label>
<textarea placeholder="Enter Address" tabindex="7"
class="form-control textdsc" name="address"
ng-model="myModel.address" required></textarea>
<span class="error text-small block"
ng-if="Form.address.$dirty && Form.address.$invalid">Address is required</span>
<!--<span class="success text-small"-->
<!--ng-if="Form.address.$valid">Thank You!</span>-->
</div>
<textarea placeholder="Enter Address" tabindex="7" class="form-control textdsc" name="address" ng-model="myModel.address"
required></textarea>
<span class="error text-small block" ng-if="Form.address.$dirty && Form.address.$invalid">Address is required</span>
<!--<span class="success text-small"-->
<!--ng-if="Form.address.$valid">Thank You!</span>-->
</div>
<div class="col-md-4">
<label>
Active/De-Active
@ -293,20 +255,62 @@
</div>
<div class="col-md-3">
<form name="Form" id="form1" novalidate ng-submit="form.submit(Form,myModel)" method="post">
<div class="file-upload">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<div class="user-image">
<h5>Branch Logo</h5>
<div class=" margin-bottom-5">
</div>
</div>
<!--<input type="file" file-model="idProof"
accept="image/*" onchange="angular.element(this).scope().imageUpload(event)"/>-->
<div>
<div ng-repeat="step in stepsModel">
<!--<a class="close-thin"></a>-->
<img class="thumb" ng-src="{{step}}" />
<div class="col-md-12">
<div class="pull-right">
<button class="btn btn-success btn-o btn-sm margin-right-15" type="button" ng-click="resetImage()">Reset
</button>
</div>
</div>
</div>
</div>
<input type="file" accept="image/*" file-upload onchange="angular.element(this).scope().imageUpload(event)" />
<style>
.thumb {
width: 130px;
height: 140px;
margin: 18px;
float: left;
}
.uploader {
clear: both;
}
</style>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<div class="col-md-12">
<div class="pull-right">
<button type="submit" ladda="ldloading1.zoom_in" tabindex="9" class="btn btn-wide btn-success" data-style="zoom-in">
Submit
</button>
<!-- <button type="submit" class="btn btn-success btn-o" tabindex="8">
<!-- <button type="submit" class="btn btn-success btn-o" tabindex="8">
Submit
</button>-->
<button type="reset" class="btn btn-warning btn-wide" tabindex="10"
ng-click="branchForm.reset(Form)">
<button type="reset" class="btn btn-warning btn-wide" tabindex="10" ng-click="branchForm.reset(Form)">
Reset
</button>
</div>
@ -320,9 +324,4 @@
</tabset>
</div>
</div>
<!-- end: LIST GROUP -->
<!-- end: LIST GROUP -->

View File

@ -132,7 +132,7 @@
<!--<span class="success text-small"-->
<!--ng-if="Form.address.$valid">Thank You!</span>-->
</div>
<div class="col-md-4">
<div class="col-md-2">
<label>
Active/De-Active
</label>
@ -147,6 +147,72 @@
</div>
</div>
<div class="col-md-2">
<img class="thumb prof" ng-src="images/{{p.LogoPath}}" />
<style>
.thumb {
width: 130px;
height: 140px;
margin: 18px;
float: left;
}
.prof {
border: 2px solid #2C3543;
}
.uploader {
clear: both;
}
</style>
</div>
<div class="col-md-4">
<form name="Form" id="form1" novalidate ng-submit="form.submit(Form,myModel)" method="post">
<div class="file-upload">
<div class="row">
<div class="col-md-4">
<h5>Update Logo</h5>
<div class=" margin-bottom-5">
</div>
<input type="file" accept="image/*" ng-init="resetImageEdit()" file-upload-edit onchange="angular.element(this).scope().imageUploadEdit(event)"
/>
</div>
<div class="col-md-2">
<div class="form-group">
<div class="user-image">
</div>
<!--<input type="file" file-model="idProof"
accept="image/*" onchange="angular.element(this).scope().imageUpload(event)"/>-->
<div>
<div ng-repeat="step in stepsModelEdit">
<!--<a class="close-thin"></a>-->
<img class="thumb" ng-src="{{step}}" />
<div class="col-md-12">
<div class="pull-right">
<button class="btn btn-success btn-o btn-sm margin-right-15" type="button" ng-click="resetImageEdit()">Reset
</button>
</div>
</div>
</div>
</div>
<style>
.thumb {
width: 130px;
height: 140px;
margin: 18px;
float: left;
}
.uploader {
clear: both;
}
</style>
</div>
</div>
</div>
</div>
</form>
</div>
</div>

View File

@ -285,6 +285,19 @@
</a>
</li>
<li ng-class="{'active open':$state.includes('app.myprofile')}">
<a ui-sref="app.myprofile">
<div class="item-content">
<div class="item-media">
<i class="ti-id-badge"></i>
</div>
<div class="item-inner">
<span class="title" translate="sidebar.nav.profile.MAIN">MY PROFILE </span>
</div>
</div>
</a>
</li>
</ul>
<!-- end: Staff -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB