activity added
This commit is contained in:
parent
280c6aa338
commit
d490165321
@ -86,11 +86,11 @@ class University_model extends CI_Model
|
||||
// $this->db->where('Description', $arrayDetails['Description']);
|
||||
$checkExistActivity = $this->db->get(PICK_LIST_DETAILS);
|
||||
|
||||
if($checkExistActivity->result()){
|
||||
$result['activityStatus'] = false;
|
||||
$result['details'] = "This activity is already added";
|
||||
}
|
||||
else{
|
||||
// if($checkExistActivity->result()){
|
||||
// $result['activityStatus'] = false;
|
||||
// $result['details'] = "This activity is already added";
|
||||
// }
|
||||
// else{
|
||||
$this->db->insert(PICK_LIST_DETAILS, $arrayDetails);
|
||||
if($this->db->affected_rows() == '1'){
|
||||
$result['activityStatus'] = true;
|
||||
@ -100,7 +100,7 @@ class University_model extends CI_Model
|
||||
$result['activityStatus'] = false;
|
||||
$result['message'] = "Something went wrong.please try again";
|
||||
}
|
||||
}
|
||||
// }
|
||||
return $result;
|
||||
|
||||
}
|
||||
@ -134,7 +134,8 @@ class University_model extends CI_Model
|
||||
* update announcement details
|
||||
* created by Surendiran
|
||||
* */
|
||||
public function updateActivity($arrayDetails=null,$ListCode=null) {
|
||||
public function updateActivity($arrayDetails=null,$ListCode=null) {
|
||||
|
||||
$this->db->where('ListCode',$ListCode);
|
||||
$updateStatus=$this->db->update(PICK_LIST_DETAILS, $arrayDetails);
|
||||
if($updateStatus){
|
||||
|
||||
@ -19,7 +19,6 @@ app.controller("activityCtrl", ["$scope", "toaster", "$filter", "API_POINTS", "$
|
||||
* */
|
||||
$scope.editId = -1;
|
||||
$scope.setEditId = function (pid) {
|
||||
|
||||
$scope.editId = pid;
|
||||
$scope.viewId = -1;
|
||||
};
|
||||
@ -89,7 +88,7 @@ $scope.activityForm = {
|
||||
$state.go($state.current, {}, { reload: true });
|
||||
} else {
|
||||
$scope.ldloading1[loading.replace('-', '_')] = false;
|
||||
swal("Failed!", response.data.message, "error");
|
||||
swal("Failed!", response.data.details, "error");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -90,14 +90,13 @@
|
||||
|
||||
</td>-->
|
||||
<td>
|
||||
<a href="#" class="text-azure" id="editRowBtn{{p.ListCode}}" ng-click="setEditId(p.ListCode);"><b class="fa fa-hover fa-pencil " aria-hidden="true"></b>
|
||||
<a class="text-azure" id="editRowBtn{{p.ListCode}}" ng-click="setEditId(p.ListCode);"><b class="fa fa-hover fa-pencil " aria-hidden="true"></b>
|
||||
</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr ng-show="editId === p.ListCode" ng-if="editId === p.ListCode" >
|
||||
<td colspan="12" ng-include
|
||||
src="'assets/views/editActivityDetails.html'"></td>
|
||||
<td colspan="12" ng-include src="'assets/views/editActivityDetails.html'"></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
<!--<td>{{p.description}}</td>-->
|
||||
<td><span ng-if="p.IsActive == 1"> Active </span><span ng-if="p.IsActive == 0">InActive</span></td>
|
||||
<td>
|
||||
<a href="#" class="text-azure" id="editRowBtn{{p.ID}}" ng-click="setEditId(p.ID);"><b class="fa fa-hover fa-pencil " aria-hidden="true"></b>
|
||||
<a class="text-azure" id="editRowBtn{{p.ID}}" ng-click="setEditId(p.ID);"><b class="fa fa-hover fa-pencil " aria-hidden="true"></b>
|
||||
</a></td>
|
||||
|
||||
|
||||
|
||||
@ -1,102 +1,84 @@
|
||||
<form name="Form" id="form" novalidate>
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-12">
|
||||
<fieldset>
|
||||
<legend>
|
||||
Update Activity Details
|
||||
</legend>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3 form-group"
|
||||
ng-class="{'has-error':Form.ListCode.$dirty && Form.ListCode.$invalid, 'has-success':Form.ListCode.$valid}">
|
||||
<label>
|
||||
<fieldset>
|
||||
<legend>
|
||||
Update Activity Details
|
||||
</legend>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3 form-group" ng-class="{'has-error':Form.ListCode.$dirty && Form.ListCode.$invalid, 'has-success':Form.ListCode.$valid}">
|
||||
<label>
|
||||
Activity ID<span class="symbol required"></span>
|
||||
</label>
|
||||
|
||||
<input type="text" placeholder="Enter Activity ID"
|
||||
tabindex="1" class="form-control" name="ActivityID"
|
||||
ng-model="p.ListCode" readonly required/>
|
||||
<span class="error text-small block"
|
||||
ng-if="Form.ListCode.$dirty && Form.ListCode.$error.required">Activity ID is required</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3 form-group"
|
||||
ng-class="{'has-error':Form.ListName.$dirty && Form.ListName.$invalid, 'has-success':Form.ListName.$valid}">
|
||||
|
||||
<input type="text" placeholder="Enter Activity ID" tabindex="1" class="form-control" name="ActivityID" ng-model="p.ListCode"
|
||||
readonly required/>
|
||||
<span class="error text-small block" ng-if="Form.ListCode.$dirty && Form.ListCode.$error.required">Activity ID is required</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3 form-group" ng-class="{'has-error':Form.ListName.$dirty && Form.ListName.$invalid, 'has-success':Form.ListName.$valid}">
|
||||
<label>
|
||||
Activity Name <span class="symbol required"></span>
|
||||
</label>
|
||||
|
||||
<input type="text" placeholder="Enter Activity Name"
|
||||
tabindex="1" class="form-control" name="ListName"
|
||||
ng-model="p.ListName" required/>
|
||||
<span class="error text-small block"
|
||||
ng-if="Form.ListName.$dirty && Form.ListName.$error.required">Activity Name is required</span>
|
||||
<span class="error text-small block"
|
||||
ng-if="Form.ListName.$dirty && Form.ListName.$error.pattern">Invalid Activity Name </span>
|
||||
<input type="text" placeholder="Enter Activity Name" tabindex="1" class="form-control" name="ListName" ng-model="p.ListName"
|
||||
required/>
|
||||
<span class="error text-small block" ng-if="Form.ListName.$dirty && Form.ListName.$error.required">Activity Name is required</span>
|
||||
<span class="error text-small block" ng-if="Form.ListName.$dirty && Form.ListName.$error.pattern">Invalid Activity Name </span>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 form-group"
|
||||
ng-class="{'has-error':Form.Description.$dirty && Form.Description.$invalid, 'has-success':Form.Description.$valid}">
|
||||
</div>
|
||||
<div class="col-md-3 form-group" ng-class="{'has-error':Form.Description.$dirty && Form.Description.$invalid, 'has-success':Form.Description.$valid}">
|
||||
<label>
|
||||
Description <span class="symbol required"></span>
|
||||
</label>
|
||||
|
||||
<input type="text" placeholder="Enter Description Name"
|
||||
tabindex="1" class="form-control" name="Description"
|
||||
ng-model="p.Description" required/>
|
||||
<span class="error text-small block"
|
||||
ng-if="Form.Description.$dirty && Form.Description.$error.required">Description is required</span>
|
||||
<span class="error text-small block"
|
||||
ng-if="Form.Description.$dirty && Form.Description.$error.pattern">Invalid Description Code </span>
|
||||
<input type="text" placeholder="Enter Description Name" tabindex="1" class="form-control" name="Description" ng-model="p.Description"
|
||||
required/>
|
||||
<span class="error text-small block" ng-if="Form.Description.$dirty && Form.Description.$error.required">Description is required</span>
|
||||
<span class="error text-small block" ng-if="Form.Description.$dirty && Form.Description.$error.pattern">Invalid Description Code </span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>
|
||||
Active/De-Active
|
||||
</label>
|
||||
<div ng-if="p.IsActive==true">
|
||||
|
||||
<switch ng-model="p.IsActive" ng-init="p.IsActive = true" class="green"></switch>
|
||||
|
||||
</div>
|
||||
<div ng-if="p.IsActive==false">
|
||||
<switch ng-model="p.IsActive" ng-init="p.IsActive = false" class="green"></switch>
|
||||
|
||||
</div>
|
||||
|
||||
<div ng-if="p.IsActive==true">
|
||||
|
||||
<switch ng-model="p.IsActive" ng-init="p.IsActive = true" class="green"></switch>
|
||||
|
||||
</div>
|
||||
|
||||
<div ng-if="p.IsActive==false">
|
||||
<switch ng-model="p.IsActive" ng-init="p.IsActive = false" class="green"></switch>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="pull-right">
|
||||
<button type="submit" ladda="ldloading.zoom_in" tabindex="9" class="btn btn-wide btn-success" data-style="zoom-in" ng-click="updateActivity(p,Form,'zoom-in')">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="pull-right">
|
||||
<button type="submit" ladda="ldloading.zoom_in" tabindex="9" class="btn btn-wide btn-success" data-style="zoom-in" ng-click="updateActivity(p,Form,'zoom-in')">
|
||||
Save
|
||||
</button>
|
||||
|
||||
<input type="button" class="btn btn-warning btn-wide" tabindex="10" value="Cancel"
|
||||
ng-click="cancel();">
|
||||
|
||||
</input>
|
||||
</div>
|
||||
|
||||
<input type="button" class="btn btn-warning btn-wide" tabindex="10" value="Cancel" ng-click="cancel();">
|
||||
|
||||
</input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- class="editRowTd" -->
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<!-- class="editRowTd" -->
|
||||
Loading…
Reference in New Issue
Block a user