diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php
index a4247a73..83e5cd2b 100644
--- a/Apollo/api/application/config/routes.php
+++ b/Apollo/api/application/config/routes.php
@@ -78,7 +78,9 @@ $route['addLeadTrackingDetails'] = 'Call_Tracking_Controller/addLeadTrackingDeta
$route['getTrackingDetails'] = 'Call_Tracking_Controller/getTrackingDetails';
$route['updateFollowupDetails'] = 'Call_Tracking_Controller/updateFollowupDetails';
$route['loadFollowupDetails'] = 'Call_Tracking_Controller/loadFollowupDetails';
-$route['getUniversity'] = 'University_Controller/getUniversity';
+$route['insertUniversity'] = 'University_Controller/insertUniversity';
+$route['getUniversity'] = 'University_Controller/getUniversity';
+$route['chkUnivIdExistDetail'] = 'University_Controller/chkUnivIdExistDetail';
$route['updateUniversityDetail'] = 'University_Controller/updateUniversityDetail';
$route['getCourseDetails'] = 'Course_Controller/getCourseDetails';
$route['addCourseDetails'] = 'Course_Controller/addCourseDetails';
diff --git a/Apollo/api/application/controllers/University_Controller.php b/Apollo/api/application/controllers/University_Controller.php
index 2d35e64c..9da2bf8b 100644
--- a/Apollo/api/application/controllers/University_Controller.php
+++ b/Apollo/api/application/controllers/University_Controller.php
@@ -28,13 +28,14 @@ class University_Controller extends REST_Controller {
{
// Construct the parent class
parent::__construct();
- $this->methods['getUniversity_post']['limit'] = 100;
- // load the employee model
+ $this->methods['getUniversity_post']['limit'] = 100;
+ $this->methods['chkUnivIdExistDetail_post']['limit'] = 100;
+ // load the university model
$this->load->model('University_model', 'university_model');
}
+ // get university details
public function getUniversity_post() {
-
$reqData = $this->post('data');
$loginUserId = $reqData['localUserID'];
$loginUserBranchId = $reqData['localBranchID'];
@@ -57,6 +58,7 @@ class University_Controller extends REST_Controller {
}
+ //update university details
public function updateUniversityDetail_post() {
$reqData = $this->post('data');
@@ -89,4 +91,60 @@ class University_Controller extends REST_Controller {
}
}
+
+ // check university details exist
+ public function chkUnivIdExistDetail_post() {
+
+ $data = $this->post('data');
+ $check = $this->post('check');
+
+ $checkUnivExist = $this->university_model->check_Univ_Exist($data, $check);// Check if the employee exist
+ if ($checkUnivExist)
+ {
+ $checkUnivExist['status'] = REST_Controller::HTTP_OK;
+ // Set the response and exit
+ $this->response($checkUnivExist, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
+ }
+ else
+ {
+ // Set the response and exit
+ $this->response([
+ 'message' => 'No list were found',
+ 'status' => REST_Controller::HTTP_NOT_FOUND
+ ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
+ }
+
+ }
+
+ // insert university details
+ public function insertUniversity_post() {
+ $reqData = $this->post('data');
+ $req['CreatedBy'] = $this->post('createdBy');
+ $date = date('Y-m-d H:i:s');
+ $req['CreatedOn'] = $date;
+ $req['UniversityName']= $reqData['UniversityName'];
+ $req['UniversityShortName']= $reqData['UniversityShortName'];
+ $req['MobileNumber']= $reqData['MobileNumber'];
+ $req['EmailID']= $reqData['EmailID'];
+ $req['Address']= $reqData['Address'];
+ $req['IsActive']= $reqData['switchsetting'];
+ $req['UniversityID']= $reqData['UniversityID'];
+
+ $insertUniv = $this->university_model->insert_Univ($req);// Check if the employee exist
+ if ($insertUniv)
+ {
+ $insertUniv['status'] = REST_Controller::HTTP_OK;
+ // Set the response and exit
+ $this->response($insertUniv, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
+ }
+ else
+ {
+ // Set the response and exit
+ $this->response([
+ 'message' => 'No list were found',
+ 'status' => REST_Controller::HTTP_NOT_FOUND
+ ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
+ }
+
+ }
}
diff --git a/Apollo/api/application/models/University_model.php b/Apollo/api/application/models/University_model.php
index 7b80f5d7..7d570ecd 100644
--- a/Apollo/api/application/models/University_model.php
+++ b/Apollo/api/application/models/University_model.php
@@ -19,7 +19,6 @@ class University_model extends CI_Model
*/
// get university list
-
public function get_university_list() {
$this->db->select('*');
$this->db->order_by('CreatedOn', 'DESC');
@@ -36,6 +35,7 @@ class University_model extends CI_Model
return $results;
}
+ // update univesity details
public function update_university_details($updateFor, $Arr) {
$this->db->where('UniversityID', $updateFor);
$this->db->update(UNIVERSITY, $Arr);
@@ -48,5 +48,33 @@ class University_model extends CI_Model
}
return $result;
}
+
+ // check exist details
+ public function check_Univ_Exist($data, $check) {
+ // check update for mobile number
+ $this->db->select('*');
+ $this->db->from(UNIVERSITY);
+ $this->db->where('UniversityID', $data);
+ if ($this->db->get()->first_row()) {
+ $result['existUniv'] = true;
+ $result['message'] = "This University Id is already exist!";
+ } else {
+ $result['existUniv'] = false;
+ }
+ return $result;
+ }
+
+ // add university details
+ public function insert_Univ($arr) {
+ $this->db->insert(UNIVERSITY, $arr);
+ if ($this->db->affected_rows() == '1') {
+ $result['addUniv'] = true;
+ $result['message'] = "Successfully University details added";
+ } else {
+ $result['addUniv'] = false;
+ $result['message'] = "Something went wrong.please try again";
+ }
+ return $result;
+ }
}
\ No newline at end of file
diff --git a/Apollo/assets/js/controllers/universityCtrl.js b/Apollo/assets/js/controllers/universityCtrl.js
index 2928919e..34e8b793 100644
--- a/Apollo/assets/js/controllers/universityCtrl.js
+++ b/Apollo/assets/js/controllers/universityCtrl.js
@@ -74,7 +74,7 @@ app.controller('universityCtrl', ["$scope", "toaster", "$filter", "ngTableParams
}
};
$http(checkReq).then(function (response) {
- if (response.data.existEmpId == true) {
+ if (response.data.existUniv === true) {
swal("Warning!", response.data.message, "warning");
$scope.myModel.UniversityID = '';
} else {
@@ -134,4 +134,61 @@ app.controller('universityCtrl', ["$scope", "toaster", "$filter", "ngTableParams
}
}
+ // add university
+ $scope.universityForm = {
+ submit: function (form, myModel) {
+ 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.myModel.switchsetting = $scope.myModel.switchsetting === true ? 1 : 0;
+ var req = {
+ method: 'POST',
+ url: apiPoint.url + 'insertUniversity/',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ data: {
+ data: $scope.myModel,
+ createdBy: localDetails.localUserID,
+ }
+ };
+ $http(req).then(function (response) {
+ if (response.data.addUniv == true) {
+ swal("Success!", response.data.message, "success");
+ $state.go($state.current, {}, { reload: true });
+ } else {
+ // $scope.ldloading1[loading.replace('-', '_')] = false;
+ swal("Failed!", response.data.message, "error");
+ }
+ });
+ }
+ },
+ reset: function (form) {
+
+ // $scope.myModel = angular.copy($scope.master);
+ form.$setPristine(true);
+ $scope.myModel = {
+ 'UniversityID': '',
+ 'UniversityName': '',
+ 'UniversityShortName': '',
+ 'MobileNumber': '',
+ 'EmailID': '',
+ 'Address': '',
+ };
+ }
+ }
+
}]);
diff --git a/Apollo/assets/views/dashboard.html b/Apollo/assets/views/dashboard.html
index 18cddc1e..2c8d547a 100644
--- a/Apollo/assets/views/dashboard.html
+++ b/Apollo/assets/views/dashboard.html
@@ -1,676 +1,37 @@
+
+
+
- Sales
-
- Earnings
-
- Referrals
- {{ mainTitle }}
- overview & stats
-
-
-
-
- To add users, you need to be signed in as the super user. -
-- - view more - -
+We are building something very cool stay turned and be patient. your patience will be well paid
+- The Manage Orders tool provides a view of all your orders. -
-- - view more - -
-- Store, modify, and extract information from your database. -
-- - view more - -
-| 1 | -Google Chrome | -4909 | -- |
| 2 | -Mozilla Firefox | -3857 | -- |
| 3 | -Safari | -1789 | -- |
| 4 | -Internet Explorer | -612 | -- |
| 1 | -Google Chrome | -5228 | -- |
| 2 | -Mozilla Firefox | -2853 | -- |
| 3 | -Safari | -1948 | -- |
| 4 | -Internet Explorer | -456 | -- |
| UI DesignerPeter Clark | -
-
-
- view more
-
- |
- |
| Content DesignerNicole Bell | -
-
-
- view more
-
- |
- |
| Visual DesignerSteven Thompson | -
-
-
- view more
-
- |
- |
| Senior DesignerKenneth Ross | -
-
-
- view more
-
- |
- |
| Web EditorElla Patterson | -
-
-
- view more
-
- |
-
| Visual DesignerSteven Thompson | -
-
-
- view more
-
- |
- |
| Senior DesignerKenneth Ross | -
-
-
- view more
-
- |
- |
| Web EditorElla Patterson | -
-
-
- view more
-
- |
-
- - Steven - - has completed his account. -
-- Staff Meeting -
-- Completed new layout. -
-- Contacted - - Microsoft - - for license upgrades. -
-- Started development new site -
-- Lunch with - - Nicole - - . -
-- server Maintenance. -
-