This commit is contained in:
dineshkumarkannan 2018-08-22 09:30:13 +05:30
commit acce228d61
6 changed files with 94 additions and 40 deletions

View File

@ -2,7 +2,6 @@
/*** controller***/
app.controller('report_certificateCtrl', ["$scope", "$filter","$rootScope","$modal", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',"dateListDescService",
function ($scope, $filter,$rootScope,$modal, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window, dateListDescService) {
/*
* auto call tracking
*/
@ -83,6 +82,32 @@ app.controller('report_certificateCtrl', ["$scope", "$filter","$rootScope","$mod
}
});
}
/* watch university model for bind batch objects*/
$scope.$watchCollection('univModel.university', function (newValue,oldValue) {
if(newValue==undefined || newValue==''){
$scope.filterBatchDetails="";
$scope.disableSubmit=true;
}
else{
if(angular.isString(newValue)){
$scope.filterBatchDetails=angular.fromJson(newValue);
$scope.disableSubmit=false;
}
}
});
// disable submit
$scope.$watchCollection('filters.from_date', function (newValue,oldValue) {
if(newValue==undefined || newValue=='' || newValue==null){
$scope.disableSubmit=true;
}
else{
$scope.disableSubmit=false;
}
});
$scope.onSubmit = function () {
//alert($scope.batch.name);

View File

@ -2,7 +2,6 @@
/*** controller***/
app.controller('report_markcard_statusCtrl', ["$scope", "$filter","$rootScope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',"dateListDescService","$modal",
function ($scope, $filter,$rootScope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window, dateListDescService,$modal,$log) {
/**
* auto call tracking
*/
@ -47,7 +46,7 @@ app.controller('report_markcard_statusCtrl', ["$scope", "$filter","$rootScope",
};
$scope.filters = function () {
var filterlist = {
var filterlist = {
method: 'POST',
url: apiPoint.url + 'report_filters/',
headers: {
@ -82,6 +81,19 @@ app.controller('report_markcard_statusCtrl', ["$scope", "$filter","$rootScope",
}
});
}
/* watch university model for bind batch objects*/
$scope.$watch('univModel.university', function (newValue,oldValue) {
if(newValue==undefined || newValue==''){
$scope.filterBatchDetails="";
}
else{
if(angular.isString(newValue)){
$scope.filterBatchDetails=angular.fromJson(newValue);
}
}
});
$scope.show = false;
$scope.onSubmit = function (form) {

View File

@ -71,7 +71,20 @@ app.controller('report_study_material_statusCtrl', ["$scope", "$filter","$rootSc
} else {
}
});
}
}
/* watch university model for bind batch objects*/
$scope.$watch('univModel.university', function (newValue,oldValue) {
if(newValue==undefined || newValue==''){
$scope.filterBatchDetails="";
}
else{
if(angular.isString(newValue)){
$scope.filterBatchDetails=angular.fromJson(newValue);
}
}
});
$scope.show = false;

View File

@ -35,24 +35,32 @@ td,th {
<div class="col-md-12">
<div class="row">
<div class="col-md-4">
<label for="form-field-select-2">
University
</label>
<select ui-select2 class="form-control" tabindex="1" class="cs-select cs-skin-elastic" name="university" ng-model="univModel.university" ng-options="details.universityName for details in university">
<select ui-select2 class="form-control" tabindex="1" class="cs-select cs-skin-elastic" name="university" ng-model="univModel.university" required>
<option value="" selected>Select University</option>
</select>
<!--details.universityName for details in university-->
<option ng-repeat="details in university" value="{{details}}">{{details.universityName}}</option>
</select>
<span style="color:red;" ng-if="show" ng-show="Form.university.$dirty && Form.university.$error.required">Please select University.</span>
</div>
<div class="col-md-4">
<label for="form-field-select-2">
Batch
</label>
<select ui-select2 class="form-control" tabindex="2" class="cs-select cs-skin-elastic" name="batch" ng-model="univModel.batch" ng-options="batchDetails.BatchCode as batchDetails.BatchName for batchDetails in univModel.university.batchDetails">
<select ui-select2 class="form-control" tabindex="2" class="cs-select cs-skin-elastic" name="batch" ng-model="univModel.batch" required>
<option value="" selected>Select Batch</option>
</select>
<option ng-repeat="batchDetails in filterBatchDetails.batchDetails" value="{{batchDetails.BatchCode}}">{{batchDetails.BatchName}}</option>
</select>
<span style="color:red;" ng-if="show" ng-show="Form.batch.$dirty && Form.batch.$error.required">Please select Batch.</span>
</div>
</div>
<div class="row">
@ -94,13 +102,10 @@ td,th {
</div> -->
<div class="col-md-3" style="padding-top: 2.3%;">
<div >
<button type="submit" class="btn btn-success btn-o" tabindex="8">
<button type="submit" class="btn btn-success btn-o" tabindex="8" ng-disabled="disableSubmit==true">
Submit
</button>
</div>
</div>
</div>

View File

@ -15,9 +15,6 @@
}
.table>tbody>tr>td { padding: 2px; }
</style>
</script>
<div class="container-fluid container-fullw bg-white">
<div ng-controller="report_markcard_statusCtrl" ng-init="filters()">
<form name="Form" id="form" novalidate ng-submit="onSubmit(Form)" method="post">
@ -26,26 +23,32 @@
<div class="col-md-12">
<div class="row">
<div class="col-md-3">
<label for="form-field-select-2">
University
</label>
<select ui-select2 class="form-control" tabindex="1" class="cs-select cs-skin-elastic" name="university" ng-model="univModel.university" ng-options="details.universityName for details in university" required>
<select ui-select2 class="form-control" tabindex="1" class="cs-select cs-skin-elastic" name="university" ng-model="univModel.university" required>
<option value="" selected>Select University</option>
</select>
<span style="color:red;" ng-if="show" ng-show="Form.university.$dirty && Form.university.$error.required">Please select University.</span>
<!--details.universityName for details in university-->
<option ng-repeat="details in university" value="{{details}}">{{details.universityName}}</option>
</select>
<span style="color:red;" ng-if="show" ng-show="Form.university.$dirty && Form.university.$error.required">Please select University.</span>
</div>
<div class="col-md-3">
<label for="form-field-select-2">
Batch
</label>
<select ui-select2 class="form-control" tabindex="2" class="cs-select cs-skin-elastic" name="batch" ng-model="univModel.batch" ng-options="batchDetails.BatchCode as batchDetails.BatchName for batchDetails in univModel.university.batchDetails" required>
<select ui-select2 class="form-control" tabindex="2" class="cs-select cs-skin-elastic" name="batch" ng-model="univModel.batch" required>
<option value="" selected>Select Batch</option>
</select>
<span style="color:red;" ng-if="show" ng-show="Form.batch.$dirty && Form.batch.$error.required">Please select Batch.</span>
<option ng-repeat="batchDetails in filterBatchDetails.batchDetails" value="{{batchDetails.BatchCode}}">{{batchDetails.BatchName}}</option>
</select>
<span style="color:red;" ng-if="show" ng-show="Form.batch.$dirty && Form.batch.$error.required">Please select Batch.</span>
</div>
<!-- <div class="col-md-3">
<label for="form-field-select-2">

View File

@ -23,37 +23,33 @@
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-3">
<label for="form-field-select-2">
University
</label>
<select ui-select2 class="form-control" tabindex="1" class="cs-select cs-skin-elastic" name="university" ng-model="univModel.university" ng-options="details.universityName for details in university" required>
<select ui-select2 class="form-control" tabindex="1" class="cs-select cs-skin-elastic" name="university" ng-model="univModel.university" required>
<option value="" selected>Select University</option>
</select>
<span style="color:red;" ng-if="show" ng-show="Form.university.$dirty && Form.university.$error.required">Please select University.</span>
<!--details.universityName for details in university-->
<option ng-repeat="details in university" value="{{details}}">{{details.universityName}}</option>
</select>
<span style="color:red;" ng-if="show" ng-show="Form.university.$dirty && Form.university.$error.required">Please select University.</span>
</div>
<div class="col-md-3">
<label for="form-field-select-2">
Batch
</label>
<select ui-select2 class="form-control" tabindex="2" class="cs-select cs-skin-elastic" name="batch" ng-model="univModel.batch" ng-options="batchDetails.BatchCode as batchDetails.BatchName for batchDetails in univModel.university.batchDetails" required>
<select ui-select2 class="form-control" tabindex="2" class="cs-select cs-skin-elastic" name="batch" ng-model="univModel.batch" required>
<option value="" selected>Select Batch</option>
</select>
<span style="color:red;" ng-if="show" ng-show="Form.batch.$dirty && Form.batch.$error.required">Please select Batch.</span>
<option ng-repeat="batchDetails in filterBatchDetails.batchDetails" value="{{batchDetails.BatchCode}}">{{batchDetails.BatchName}}</option>
</select>
<span style="color:red;" ng-if="show" ng-show="Form.batch.$dirty && Form.batch.$error.required">Please select Batch.</span>
</div>
<!-- <div class="col-md-3">
<label for="form-field-select-2">
Batch
</label>
<select class="form-control" tabindex="3" class="cs-select cs-skin-elastic" name="batch" ng-model="searchData.Batch" ng-change="getValueChange()">
<option value="" selected>Select Batch</option>
<option ng-repeat="itemBatch in batchData" value="{{itemBatch.BatchCode}}">{{itemBatch.BatchName}}</option>
</select>
</div> -->
<div class="col-md-2" style="padding-top: 2.3%;">
<div class="pull-right">