certificate new files added

This commit is contained in:
venbatechnologies@gmail.com 2017-12-14 11:23:38 +05:30
parent 2ccd49bea5
commit ac98ea44f6
18 changed files with 652 additions and 0 deletions

View File

@ -0,0 +1,138 @@
<?php
/**
* Created by Visual Studio Code.
* User: Surendiran
* Date: 12/11/17
* Time: 03:26 PM
*/
defined('BASEPATH') OR exit('No direct script access allowed');
// This can be removed if you use __autoload() in config.php OR use Modular Extensions
/** @noinspection PhpIncludeInspection */
require_once APPPATH . '/libraries/REST_Controller.php';
/**
* This is an example of a few basic user interaction methods you could use
* all done with a hardcoded array
*
* @package CodeIgniter
* @subpackage Rest Server
* @category Controller
* @author
* @license MIT
* @link
*/
class Certificate_Controller extends REST_Controller {
function __construct()
{
// Construct the parent class
parent::__construct();
// Configure limits on our controller methods
// Ensure you have created the 'limits' table and enabled 'limits' within application/config/rest.php
$this->methods['addCertificateDetails_get']['limit'] = 500; // 500 requests per hour per user/key
$this->methods['addCertificateDetails_post']['limit'] = 100; // 100 requests per hour per user/key
$this->methods['addCertificateDetails_delete']['limit'] = 50; // 50 requests per hour per user/key
$this->methods['getCertificateDetails_post']['limit'] = 500; // 50 requests per hour per user/key
$this->methods['updateCertificateDetails_post']['limit'] = 500;
// load the model
$this->load->model('Certificate_model', 'certificate_model');
}
/*
* This method used to add Certificate details
* created by Surendiran
* */
public function addCertificateDetails_post()
{
$now = new DateTime();
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
$details['CertificateName'] = $this->post('certificateName');
$details['CreatedBy'] = $this->post('createdBy');
$details['IsActive'] = $this->post('status');
$details['CreatedOn'] = $now->format('Y-m-d H:i:s');
$certificateDetails = $this->certificate_model->addcertificate($details);// Check if the users data store contains users (in case the database result returns NULL)
if ($certificateDetails)
{
$certificateDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($certificateDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'Something went wrong.please try again!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
/*
* get Certificate details
* created by Surendiran
* */
public function getCertificateDetails_post()
{
$requestedBy = $this->post('requestedBy');
$getCertificate = $this->certificate_model->getCertificate($requestedBy);
if ($getCertificate)
{
$getCertificate['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getCertificate, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'No records found!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
/*
* update the Certificate details
* created by Surendiran
* */
public function updateCertificateDetails_post()
{
$now = new DateTime();
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
$updateID = $this->post('updateID');
$details['CertificateName'] = $this->post('certificateName');
$details['IsActive'] = $this->post('status');
$details['UpdatedBy'] = $this->post('updatedBy');
$details['UpdatedOn'] = $now->format("Y-m-d H:i:s");
$certificateDetails = $this->certificate_model->update($details,$updateID);// Check if the users data store contains users (in case the database result returns NULL)
if ($certificateDetails)
{
$certificateDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($certificateDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'Something went wrong.please try again!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
}

View File

View File

View File

@ -0,0 +1,107 @@
<?php
/**
* Created by Visual Studio Code.
* User: Surendiran
* Date: 11/13/17
* Time: 8:03 PM
*/
defined('BASEPATH') OR exit('No direct script access allowed');
class Certificate_model extends CI_Model {
/*
* add Certificate details
* params:CertificateName,activestatus
* created by Surendiran
* */
public function addcertificate($arrayDetails=null)
{
$this->db->select('CertificateName');
$this->db->where('CertificateName', $arrayDetails['CertificateName']);
if($this->db->get(CERTIFICATION_MASTER)->first_row()){
$result['certificateStatus'] = false;
$result['message'] = "Certificate name is already exist!";
} else {
$this->db->insert(CERTIFICATION_MASTER, $arrayDetails);
if($this->db->affected_rows() == '1'){
$result['certificateStatus'] = true;
$result['message'] = "Successfully Certificate name is added";
}
else {
$result['certificateStatus'] = false;
$result['message'] = "Something went wrong.please try again";
}
}
return $result;
}
/*
* get Certificate details
* parama id
* created by Surendiran
* */
public function getCertificate()
{
$this->db->select('CertificationID,CertificateName,CreatedOn,IsActive');
$this->db->order_by('CertificationID','DESC');
$certificateDetails = $this->db->get(CERTIFICATION_MASTER);
if($certificateDetails->result()){
$result['certificateStatus'] = true;
$result['details'] = $certificateDetails->result();
}
else {
$result['certificateStatus'] = false;
$result['message'] = "No records found!";
}
return $result;
}
/*
* update Certificate details
* created by Surendiran
* */
public function update($arrayDetails=null,$CertificationID=null)
{
$this->db->select('CertificateName');
$this->db->where('CertificateName', $arrayDetails['CertificateName']);
$this->db->where_not_in('CertificationID', $CertificationID);
if($this->db->get(CERTIFICATION_MASTER)->first_row()){
$result['certificateStatus'] = false;
$result['message'] = "Certificate name is already exist!";
} else {
$this->db->where('CertificationID',$CertificationID);
$this->db->update(CERTIFICATION_MASTER, $arrayDetails);
if($this->db->affected_rows() == '1'){
$result['certificateStatus'] = true;
$result['message'] = "Successfully Certificate name is updated";
}
else {
$result['certificateStatus'] = false;
$result['message'] = "Something went wrong.please try again";
}
}
return $result;
}
}

0
Apollo/api/application/models/Fees_status_model.php Normal file → Executable file
View File

0
Apollo/api/application/models/Status_model.php Normal file → Executable file
View File

View File

@ -0,0 +1,197 @@
'use strict';
/**
* controllers for ng-table
* Simple table with sorting and filtering on AngularJS
*/
// var helloApp = angular.module("helloApp", []);
app.controller("certificateCtrl", ["$scope", "toaster", "$filter", "API_POINTS", "$localStorage", "$http", "$state", function ($scope, toaster, $filter, apiPoint, $localStorage, $http, $state) {
$scope.myModel = {
"CertificateName": "",
"switchsetting": true
};
/*
* edit Certificate details
* created by Surendiran
* */
$scope.editId = -1;
$scope.setEditId = function (pid) {
$scope.editId = pid;
$scope.viewId = -1;
};
/*
* cancel edit div
* created by Surendiran
* */
$scope.cancel = function () {
$scope.init();
$scope.editId = -1;
};
// sorting function for table params
$scope.sort = function(keyname){
$scope.sortKey = keyname; //set the sortKey to the param passed
$scope.reverse = !$scope.reverse; //if true make it false and vice versa
}
$scope.certificateForm = {
submit: function (form, myModel,loading) {
var firstError = null;
if (form.$invalid) {
var field = null, firstError = null;
for (field in form) {
if (field[0] != '$') {
if (firstError === null && !form[field].$valid) {
firstError = form[field].$name;
}
if (form[field].$pristine) {
form[field].$dirty = true;
}
}
}
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 addcertificate = {
method: 'POST',
url: apiPoint.url + 'addCertificateDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
certificateName: myModel.CertificateName,
status: myModel.switchsetting,
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID
}
};
$http(addcertificate).then(function (response) {
if (response.data.status == 200 && response.data.certificateStatus) {
$scope.ldloading1[loading.replace('-', '_')] = false;
$scope.init();
swal("Success!", response.data.message, "success");
$state.go($state.current, {}, { reload: true });
} else {
$scope.ldloading1[loading.replace('-', '_')] = false;
swal("Failed!", response.data.message, "error");
}
});
}
},
};
/*
*get Certificate details when page loading called from view file
*
* created by Surendiran
* */
$scope.loader='';
$scope.emptyData='';
$scope.init = function () {
var getCertificate = {
method: 'POST',
url: apiPoint.url + 'getCertificateDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
}
};
$http(getCertificate).then(function (response) {
if (response.data.status==200 && response.data.certificateStatus) {
$scope.emptyData=true;
$scope.loader=true;
$scope.statusInfo = response.data.details;
} else {
$scope.emptyData=false;
$scope.loader=true;
$scope.statusInfo='';
}
});
};
/*
* update the Certificate details
* created by Surendiran
* */
$scope.updateCertificate = function (myModel, form, loading) {
var firstError = null;
if (form.$invalid) {
var field = null, firstError = null;
for (field in form) {
if (field[0] != '$') {
if (firstError === null && !form[field].$valid) {
firstError = form[field].$stop_name;
}
if (form[field].$pristine) {
form[field].$dirty = true;
}
}
}
angular.element('.ng-invalid[name=' + firstError + ']').focus();
} else {
$scope.ldloading = {};
$scope.ldloading[loading.replace('-', '_')] = true;
var update = {
method: 'POST',
url: apiPoint.url + 'updateCertificateDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
updateID: myModel.CertificationID,
certificateName: myModel.CertificateName,
status: myModel.IsActive,
updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
}
};
$http(update).then(function (response) {
if (response.data.status==200 && response.data.certificateStatus) {
$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");
}
});
}
};
}]);

0
Apollo/assets/js/controllers/feesStatusCtrl.js Normal file → Executable file
View File

0
Apollo/assets/js/controllers/myProfileCtrl.js Normal file → Executable file
View File

0
Apollo/assets/js/controllers/statusCtrl.js Normal file → Executable file
View File

View File

View File

@ -0,0 +1,140 @@
<style>
b.fa {
display: inline-block;
border-radius: 60px;
box-shadow: 0px 0px 2px #007AFF;
padding: 0.5em 0.6em;
}
</style>
<section id="page-title">
<div class="row">
<div class="col-sm-8">
<h1 class="mainTitle" translate="Certificate Details"></h1>
</div>
<div ncy-breadcrumb></div>
</div>
</section>
<div class="container-fluid container-fullw bg-white">
<div ng-controller="certificateCtrl">
<form name="Form" id="form" novalidate ng-submit="certificateForm.submit(Form, myModel, 'zoom-in')" method="post">
<fieldset>
<legend>Add Certificate Details</legend>
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-4 form-group"
ng-class="{'has-error':Form.CertificateName.$dirty && Form.CertificateName.$invalid, 'has-success':Form.CertificateName.$valid}">
<label>
Certificate Name <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Certificate Name"
tabindex="1" class="form-control" name="CertificateName"
ng-model="myModel.CertificateName" capitalize required/>
<span class="error text-small block"
ng-if="Form.CertificateName.$dirty && Form.CertificateName.$error.required">Certificate Name is required</span>
<span class="error text-small block"
ng-if="Form.CertificateName.$dirty && Form.CertificateName.$error.pattern">Invalid Certificate name </span>
</div>
<!--<div class="col-md-4">
<label>
Active/De-Active
</label>
<div ng-switch="myModel.switchsetting">
<div ng-switch-when="true">
<switch ng-model="myModel.switchsetting" ng-init="myModel.switchsetting = true" class="green"></switch>
</div>
<div ng-switch-when="false">
<switch ng-model="myModel.switchsetting" ng-init="myModel.switchsetting = false" class="green"></switch>
</div>
<div ng-switch-default>
<switch ng-model="myModel.switchsetting" ng-init="myModel.switchsetting = true" class="green"></switch>
</div>
</div>
</div>-->
<div class="col-md-2" style="padding-top: 2.3%;">
<div class="pull-right">
<button type="submit" ladda="ldloading1.zoom_in" tabindex="2" class="btn btn-wide btn-success" data-style="zoom-in">
Submit
</button>
<!-- <button type="submit" class="btn btn-success btn-o" tabindex="8">
Submit
</button>-->
<!--<button type="reset" class="btn btn-warning btn-wide" tabindex="3"
ng-click="statusForm.reset(Form)">
Reset
</button>-->
</div>
</div>
</div>
</div>
</div>
</fieldset>
</form>
<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="5"
placeholder="Search"/><br><br>
</div>
</div>
<table class="table table-hover" ng-init="init();">
<thead>
<tr>
<th ng-click="sort('CertificationID')">Certification ID
<span class="glyphicon sort-icon" ng-show="sortKey=='CertificationID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"> </span>
</th>
<th ng-click="sort('CertificateName')">Certificate Nmae
<span class="glyphicon sort-icon" ng-show="sortKey=='CertificateName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"> </span>
</th>
<th></th>
</tr>
</thead>
<tbody dir-paginate="p in statusInfo|orderBy:sortKey:reverse|filter:search:strict|itemsPerPage:10">
<tr>
<td>{{p.CertificationID}}</td>
<td>{{p.CertificateName}}</td>
<td>
<a class="text-azure" id="editRowBtn{{p.CertificationID}}" ng-click="setEditId(p.CertificationID);"><b class="fa fa-hover fa-pencil " aria-hidden="true"></b>
</a>
</td>
</tr>
<tr ng-show="editId === p.CertificationID" ng-if="editId === p.CertificationID">
<td colspan="12" ng-include src="'assets/views/editCertificationDetails.html'"></td>
</tr>
</tbody>
</table>
<dir-pagination-controls max-size="10" direction-links="true" boundary-links="true">
</dir-pagination-controls>
</div>
</div>

View File

@ -0,0 +1,70 @@
<form name="Form" id="form" novalidate>
<div class="row">
<div class="col-md-12">
<div class="col-md-12">
<fieldset>
<legend>
Update Certificate Details
</legend>
<div class="row">
<div class="col-md-3 form-group" ng-class="{'has-error':Form.CertificationID.$dirty && Form.CertificationID.$invalid, 'has-success':Form.CertificationID.$valid}">
<label>
Certificate ID<span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Certificate ID" tabindex="1" class="form-control" name="CertificationID" ng-model="p.CertificationID"
readonly required/>
<span class="error text-small block" ng-if="Form.CertificationID.$dirty && Form.CertificationID.$error.required">Certificate ID is required</span>
</div>
<div class="col-md-3 form-group" ng-class="{'has-error':Form.CertificateName.$dirty && Form.CertificateName.$invalid, 'has-success':Form.CertificateName.$valid}">
<label>
Certificate Name <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Certificate Name" tabindex="1" class="form-control" name="CertificateName" ng-model="p.CertificateName" capitalize
required/>
<span class="error text-small block" ng-if="Form.CertificateName.$dirty && Form.CertificateName.$error.required">Certificate Name is required</span>
<span class="error text-small block" ng-if="Form.CertificateName.$dirty && Form.CertificateName.$error.pattern">Invalid Certificate Name </span>
</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>
</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="updateCertificate(p,Form,'zoom-in')">
Save
</button>
<input type="button" class="btn btn-warning btn-wide" tabindex="10" value="Cancel" ng-click="cancel();">
</input>
</div>
</div>
</div>
</fieldset>
</div>
</div>
</form>
<!-- class="editRowTd" -->

0
Apollo/assets/views/myProfile/myProfile.html Normal file → Executable file
View File

0
Apollo/assets/views/status-update/fees_status.html Normal file → Executable file
View File

View File

0
Apollo/images/employee/Dri_9jwuh7dZD2na.jpeg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

0
Apollo/images/student/default.jpeg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB