diff --git a/Apollo/api/application/config/constants.php b/Apollo/api/application/config/constants.php index ab3fa057..04c7ea41 100755 --- a/Apollo/api/application/config/constants.php +++ b/Apollo/api/application/config/constants.php @@ -120,6 +120,7 @@ defined('BRANCH') OR define('BRANCH','T_BranchMaster'); defined('STAFF') OR define('STAFF','T_StaffDetails'); defined('STAFF_BRANCH') OR define('STAFF_BRANCH','T_Staff_BranchAccess'); defined('UNIVERSITY') OR define('UNIVERSITY','T_UniversityMaster'); +defined('UNIVERSITYFILE') OR define('UNIVERSITYFILE','T_University_File_List'); defined('COURSE') OR define('COURSE','T_CourseMaster'); defined('COURSE_FEES') OR define('COURSE_FEES','T_Course_Fees_Details'); defined('LEAD_DETAILS') OR define('LEAD_DETAILS','T_Lead_Details'); diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index d757c011..a986a01f 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -157,6 +157,8 @@ $route['getDashboardCallTrack'] = 'Call_Tracking_Controller/getDashboardCallTrac $route['getTotalStudent'] = 'Dashboard_Controller/getTotalStudent'; $route['getTotalEmployee'] = 'Dashboard_Controller/getTotalEmployee'; $route['getTotalUsers'] = 'Dashboard_Controller/getTotalUsers'; +$route['getUniversityRegisteredStudent'] = 'Dashboard_Controller/getUniversityRegisteredStudent'; +$route['getDashboradStudentPendingFees'] = 'Dashboard_Controller/getDashboradStudentPendingFees'; /*login page announcement*/ $route['getLoginAnnouncementDetails'] = 'Login_Controller/getLoginAnnouncementDetails'; @@ -319,4 +321,5 @@ $route['report_wav_ref'] = 'Report/wav_ref'; $route['report_examfee'] = 'Report/examfee'; $route['report_balfee'] = 'Report/balfee'; $route['report_lead'] = 'Report/lead'; +$route['insertUniversityfile'] = 'UniversityFile_Controller/insertUniversityfile'; diff --git a/Apollo/api/application/controllers/Dashboard_Controller.php b/Apollo/api/application/controllers/Dashboard_Controller.php index 30cd7d1f..d19b0293 100755 --- a/Apollo/api/application/controllers/Dashboard_Controller.php +++ b/Apollo/api/application/controllers/Dashboard_Controller.php @@ -89,4 +89,25 @@ class Dashboard_Controller extends REST_Controller { ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } + /* + * get university based student registration details for dash board + * created by kms + * */ + public function getUniversityRegisteredStudent_post(){ + $data = $this->post('data'); + $getRegisteredDetails = $this->dashboard_model->get_univ_registered_student($data); + if ($getRegisteredDetails) { + $getRegisteredDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getRegisteredDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'No users 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/controllers/UniversityFile_Controller.php b/Apollo/api/application/controllers/UniversityFile_Controller.php new file mode 100644 index 00000000..93b35b04 --- /dev/null +++ b/Apollo/api/application/controllers/UniversityFile_Controller.php @@ -0,0 +1,350 @@ +methods['getUniversity_post']['limit'] = 100; + $this->methods['chkUnivIdExistDetail_post']['limit'] = 100; + $this->methods['getDefaultActivityDetails_post']['limit'] = 100; + $this->methods['updateDefaultActivityDetails_post']['limit'] = 100; + + // load the university model + $this->load->model('Universityfile_model', 'universityfile_model'); + } + + // get university details + public function getUniversity_post() { + $reqData = $this->post('data'); + $loginUserId = $reqData['localUserID']; + $loginUserBranchId = $reqData['localBranchID']; + $loginUserType = $reqData['localType']; + $getUniversityListDetails = $this->universityfile_model->get_university_list($loginUserBranchId);// Check if the employee exist + if ($getUniversityListDetails) + { + $getUniversityListDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getUniversityListDetails, 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 + } + + } + + //update university details + public function updateUniversityDetail_post() { + + + //s print_r($_FILES); + $imagename=''; + $size=''; + $imageSource=''; + + if(!empty($_FILES)) + { + $imagename = $_FILES['idProof']['name']; + $size = $_FILES['idProof']['size']; + $imageSource = $_FILES['idProof']['tmp_name']; + } + + + // echo $imagename; + // echo $size; + // echo $imageSource; + // die(); + + + $reqData = $this->post('data'); + $data = json_decode($reqData, true); + $req['UpdatedBy'] = $this->post('updatedBy'); + $date = date('Y-m-d H:i:s'); + $req['UpdatedOn'] = $date; + $req['UniversityName']= $data['UniversityName']; + $req['UniversityShortName']= $data['UniversityShortName']; + $req['MobileNumber']= $data['MobileNumber']; + $req['EmailID']= $data['EmailID']; + $req['Address']= $data['Address']; + $req['IsActive']= $data['IsActive']; + $req['BranchCode'] = $this->post('branchCode'); + $req['ID']= $data['ID']; + + $updateFor = $data['UniversityID']; + + + $updateUniversityDetail = $this->university_model->update_university_details($updateFor, $req,$imagename,$imageSource,$size);// Check if the employee exist + if ($updateUniversityDetail) + { + $updateUniversityDetail['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($updateUniversityDetail, 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 + } + + } + + // check university details exist + public function chkUnivIdExistDetail_post() { + + $data = $this->post('data'); + $check = $this->post('check'); + $branchCode = $this->post('branchCode'); + + $checkUnivExist = $this->university_model->check_Univ_Exist($data, $check,$branchCode);// 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 insertUniversityfile_post() { + + + + $imagename=''; + $size=''; + $imageSource=''; + + + if(!empty($_FILES)) + { + $imagename = $_FILES['idProof']['name']; + $size = $_FILES['idProof']['size']; + $imageSource = $_FILES['idProof']['tmp_name']; + } + // echo $imagename; + // echo $size; + // echo $imageSource; + + + $reqData = $this->post('data'); + $temp = json_decode($reqData, true); + + //print_r($reqData); + //die(); + // $req['CreatedBy'] = $this->post('createdBy'); + $date = date('Y-m-d H:i:s'); + //$req['CreatedOn'] = $date; + $req['UniversityName']= $temp['UniversityName']; + + + + // $insertUniv = $this->universityfile_model->insert_Univfile($req,$imagename,$imageSource,$size); + $insertUniv = $this->universityfile_model->insert_Univfile($req,$imagename); + print_r($insertUniv); + // 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 + } + + } + + /* + * add activity details + * created Surendiran + * */ + + public function addActivityDetails_post() { + $now = new DateTime(); + $now->setTimezone(new DateTimezone('Asia/Kolkata')); + $details['ActivityID'] = $this->post('activityID'); + $details['ActivityName'] = $this->post('activityName'); + $details['Description'] = $this->post('description'); + $details['CreatedBy'] = $this->post('createdBy'); + $details['CreatedOn'] = $now->format('Y-m-d H:i:s'); + $details['IsActive'] = $this->post('status'); + $details['BranchCode'] = $this->post('branchCode'); + $jsonData=$this->post('activityStatus'); + $activityDetails = $this->university_model->addActivity($details,$jsonData);// Check if the users data store contains users (in case the database result returns NULL) + if ($activityDetails) { + $activityDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($activityDetails, 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 activity details + * created by Surendiran + * */ + public function getActivityDetails_post() + { + $requestedBy = $this->post('requestedBy'); + $requestedBranch = $this->post('branchCode'); + $getActivity = $this->university_model->getActivity($requestedBy,$requestedBranch); + if ($getActivity) + { + $getActivity['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getActivity, 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 activity details + * created by Surendiran + * */ + public function updateActivityDetails_post() + { + + $now = new DateTime(); + $now->setTimezone(new DateTimezone('Asia/Kolkata')); + $details['ActivityID'] = $this->post('activityID'); + $details['ActivityName'] = $this->post('activityName'); + $details['Description'] = $this->post('description'); + $details['IsActive'] = $this->post('status'); + $details['UpdatedBy'] = $this->post('updatedBy'); + $details['UpdatedOn'] = $now->format('Y-m-d H:i:s'); + $details['BranchCode'] = $this->post('branchCode'); + $jsonData=$this->post('activityStatus'); + $activityDetails = $this->university_model->updateActivity($details,$jsonData);// Check if the users data store contains users (in case the database result returns NULL) + + if ($activityDetails) + { + $activityDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($activityDetails, 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 default activity details + * created by kms + * */ + public function getDefaultActivityDetails_post() + { + $requestedBy = $this->post('requestedBy'); + $requestedBranch = $this->post('requestedBranch'); + $getDefaultActivity = $this->university_model->getDefaultActivity($requestedBy, $requestedBranch); + if ($getDefaultActivity) + { + $getDefaultActivity['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getDefaultActivity, 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 default activity status + * created by kms + * */ + + public function updateDefaultActivityDetails_post() + { + $now = new DateTime(); + $now->setTimezone(new DateTimezone('Asia/Kolkata')); + $details['StudentActivityCode'] = $this->post('activityID'); + $details['StatusCode'] = $this->post('activityName'); + //$details['IsActive'] = $this->post('status'); + $details['UpdatedBy'] = $this->post('updatedBy'); + $details['BranchCode'] = $this->post('reqBranch'); + $details['UpdatedOn'] = $now->format('Y-m-d H:i:s'); + $jsonData=$this->post('activityStatus'); + $activityDetails = $this->university_model->updateDefaultActivity($details,$jsonData);// Check if the users data store contains users (in case the database result returns NULL) + + if ($activityDetails) + { + $activityDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($activityDetails, 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 + } + + + } + + +} diff --git a/Apollo/api/application/controllers/University_Controller.php b/Apollo/api/application/controllers/University_Controller.php index be738955..84be2013 100755 --- a/Apollo/api/application/controllers/University_Controller.php +++ b/Apollo/api/application/controllers/University_Controller.php @@ -34,7 +34,7 @@ class University_Controller extends REST_Controller { $this->methods['updateDefaultActivityDetails_post']['limit'] = 100; // load the university model - $this->load->model('University_model', 'university_model'); + $this->load->model('Universityfile_model', 'universityfile_model'); } // get university details @@ -43,7 +43,7 @@ class University_Controller extends REST_Controller { $loginUserId = $reqData['localUserID']; $loginUserBranchId = $reqData['localBranchID']; $loginUserType = $reqData['localType']; - $getUniversityListDetails = $this->university_model->get_university_list($loginUserBranchId);// Check if the employee exist + $getUniversityListDetails = $this->universityfile_model->get_university_list($loginUserBranchId);// Check if the employee exist if ($getUniversityListDetails) { $getUniversityListDetails['status'] = REST_Controller::HTTP_OK; diff --git a/Apollo/api/application/models/Dashboard_model.php b/Apollo/api/application/models/Dashboard_model.php index 94b5af7d..bd127be4 100755 --- a/Apollo/api/application/models/Dashboard_model.php +++ b/Apollo/api/application/models/Dashboard_model.php @@ -69,6 +69,43 @@ class Dashboard_model extends CI_Model } return $result; } + /* + * get university registerd student details + * created by kms + * */ + public function get_univ_registered_student($details){ + $this->db->distinct(); + $this->db->select('UniversityID,UniversityName'); + $this->db->from(UNIVERSITY); + $this->db->order_by('ID','DESC'); + $this->db->where('BranchCode',$details['localBranchID']); + $getUnivDetails = $this->db->get(); + if($getUnivDetails->result()){ + $resultDetails['resultStatus']=true; + foreach ($getUnivDetails->result() as $rows){ + $fetchDetails['UniversityID']=$rows->UniversityID; + $fetchDetails['UniversityName']=$rows->UniversityName; + $this->db->select('StudentID'); + $this->db->from(STUDENTCOURSE); + $this->db->where('BranchID',$details['localBranchID']); + $this->db->where('UniversityID',$rows->UniversityID); + $getRegisterDetails = $this->db->get(); + if($getRegisterDetails->num_rows()>0){ + $fetchDetails['StudentCounts']=$getRegisterDetails->num_rows(); + } + else{ + $fetchDetails['StudentCounts']=0; + } + $getArray[]=$fetchDetails; + } + $resultDetails['details']=$getArray; + } + else{ + $resultDetails['resultStatus']=false; + $resultDetails['Message']="No records found!"; + } + return $resultDetails; + } } \ No newline at end of file diff --git a/Apollo/api/application/models/Hallticket_model.php b/Apollo/api/application/models/Hallticket_model.php index ed4d9859..9761e348 100755 --- a/Apollo/api/application/models/Hallticket_model.php +++ b/Apollo/api/application/models/Hallticket_model.php @@ -793,8 +793,9 @@ class Hallticket_model extends CI_Model //GET Year Based Semester if($ind['SemID'] == 1)//First Year { - for($i = 1;$i <= 2; $i++) - { + $i = 1; + // for($i = 1;$i <= 1; $i++) + // { $sql = "SELECT T_SemSubMap_Child.SubjectID,T_SubjectMaster.SubjectCode,T_SubjectMaster.SubjectName,T_SemSubMap_Master.SemesterID,T_Batch_Schedule_Child.ScheduleDate,T_Batch_Schedule_Child.FromTime,T_Batch_Schedule_Child.ToTime FROM T_SemSubMap_Child JOIN T_SubjectMaster on T_SemSubMap_Child.SubjectID = T_SubjectMaster.SubjectID JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 @@ -807,15 +808,16 @@ class Hallticket_model extends CI_Model //array_push($id['FeeDetails'][$key2],$ind); - } + // } array_splice($id['FeeDetails'][$key2],0,6,$in1); } else if($ind['SemID'] == 2)//Sec Year { - for($j = 3;$j <= 4; $j++) - { + $j = 3; + // for($j = 3;$j <= 3; $j++) + // { $sql = "SELECT T_SemSubMap_Child.SubjectID,T_SubjectMaster.SubjectCode,T_SubjectMaster.SubjectName,T_SemSubMap_Master.SemesterID,T_Batch_Schedule_Child.ScheduleDate,T_Batch_Schedule_Child.FromTime,T_Batch_Schedule_Child.ToTime FROM T_SemSubMap_Child JOIN T_SubjectMaster on T_SemSubMap_Child.SubjectID = T_SubjectMaster.SubjectID JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 @@ -828,15 +830,16 @@ class Hallticket_model extends CI_Model //array_push($id['FeeDetails'][$key2],$ind); - } + // } array_splice($id['FeeDetails'][$key2],0,6,$in2); } else if($ind['SemID'] == 3) { - for($k = 5;$k <= 6; $k++) - { + $k = 5; + // for($k = 5;$k <= 5; $k++) + // { $sql = "SELECT T_SemSubMap_Child.SubjectID,T_SubjectMaster.SubjectCode,T_SubjectMaster.SubjectName,T_SemSubMap_Master.SemesterID,T_Batch_Schedule_Child.ScheduleDate,T_Batch_Schedule_Child.FromTime,T_Batch_Schedule_Child.ToTime FROM T_SemSubMap_Child JOIN T_SubjectMaster on T_SemSubMap_Child.SubjectID = T_SubjectMaster.SubjectID JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 @@ -849,15 +852,16 @@ class Hallticket_model extends CI_Model //array_push($id['FeeDetails'][$key2],$ind); - } + // } array_splice($id['FeeDetails'][$key2],0,6,$in3); } else if($ind['SemID'] == 4) { - for($l = 7;$l <= 8; $l++) - { + $l = 7; + // for($l = 7;$l <= 7; $l++) + // { $sql = "SELECT T_SemSubMap_Child.SubjectID,T_SubjectMaster.SubjectCode,T_SubjectMaster.SubjectName,T_SemSubMap_Master.SemesterID,T_Batch_Schedule_Child.ScheduleDate,T_Batch_Schedule_Child.FromTime,T_Batch_Schedule_Child.ToTime FROM T_SemSubMap_Child JOIN T_SubjectMaster on T_SemSubMap_Child.SubjectID = T_SubjectMaster.SubjectID JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 @@ -870,7 +874,7 @@ class Hallticket_model extends CI_Model //array_push($id['FeeDetails'][$key2],$ind); - } + // } array_splice($id['FeeDetails'][$key2],0,6,$in4); } diff --git a/Apollo/api/application/models/Universityfile_model.php b/Apollo/api/application/models/Universityfile_model.php new file mode 100644 index 00000000..d3bee638 --- /dev/null +++ b/Apollo/api/application/models/Universityfile_model.php @@ -0,0 +1,462 @@ +db->select('*'); + $this->db->where('BranchCode',$loginUserBranchId); + $this->db->order_by('CreatedOn', 'DESC'); + $this->db->from(UNIVERSITY); + $univDetails = $this->db->get(); + $universityDetails = $univDetails->result(); + if (count($universityDetails) > 0) { + $results['univList'] = true; + $results['university_details'] = $universityDetails; + } else { + $results['univList'] = false; + $results['message'] = 'No record found'; + } + return $results; + + print_r($results); + } + + // update univesity details + public function update_university_details($updateFor, $Arr,$imageName, $imageSource, $imageSize) { + + if($imageSource == '') + { + //echo "if"; + $imageNameDb = 'default.jpeg'; + // $Arr['ProfilePicPath'] = "university/".$imageNameDb; + } + + else + { + //echo "else"; + $target = "../images/university/"; + $getUploadStatus = $this->upload_image($imageSource, $imageSize, $target); + $imageNameDb = $getUploadStatus['status'] == true ? $getUploadStatus['imageName'] : $getUploadStatus['imageName'] = 'default.jpeg'; + // echo $imageNameDb; + $Arr['ProfilePicPath'] = "university/".$imageNameDb; + } + + + // print_r($Arr); + // die(); + + + $this->db->where('UniversityID', $updateFor); + $this->db->where('BranchCode', $Arr['BranchCode']); + $this->db->where('ID', $Arr['ID']); + $this->db->update(UNIVERSITY, $Arr); + if ($this->db->affected_rows() == '1') { + $result['updateUniversityStatus'] = true; + $result['message'] = "Successfully University details Updated"; + } else { + $result['updateUniversityStatus'] = false; + $result['message'] = "University details not Updated"; + } + return $result; + } + + // check exist details + public function check_Univ_Exist($data, $check,$branchCode) { + // check univ with branch code + $this->db->select('*'); + $this->db->from(UNIVERSITY); + $this->db->where('UniversityID', $data); + $this->db->where('BranchCode', $branchCode); + 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_Univfile($arr,$imageName, $imageSource, $imageSize) { + + + + if($imageSource == '') + { + //echo "if"; + $imageNameDb = 'default.jpeg'; + $arr['ProfilePicPath'] = "university/".$imageNameDb; + } + + else + { + //echo "else"; + $target = "../images/university/"; + $getUploadStatus = $this->upload_image($imageSource, $imageSize, $target); + $imageNameDb = $getUploadStatus['status'] == true ? $getUploadStatus['imageName'] : $getUploadStatus['imageName'] = 'default.jpeg'; + // echo $imageNameDb; + $arr['ProfilePicPath'] = "university/".$imageNameDb; + } + + + // // echo $imageName; + // // echo $imageSource; + // // echo $imageSize; + // echo $imageSource; + //die(); + $this->db->select('*'); + $this->db->from(UNIVERSITYFILE); + $this->db->where('UniversityID', $arr['UniversityID']); + $this->db->where('BranchCode', $arr['BranchCode']); + if ($this->db->get()->first_row()) { + $result['addUniv'] = false; + $result['message'] = "This University Id is already exist!"; + } else { + $this->db->insert(UNIVERSITYFILE, $arr); + if ($this->db->affected_rows() == '1') { + $result['addUniv'] = true; + $result['message'] = "Successfully University file added"; + } else { + $result['addUniv'] = false; + $result['message'] = "Something went wrong.please try again"; + } + return $result; + } + + } + + public function addActivity($arrayDetails=null,$jsonData=null) + { + $this->db->select('ActivityID,ActivityName'); + $this->db->where('ActivityName', $arrayDetails['ActivityName']); + $this->db->where('BranchCode', $arrayDetails['BranchCode']); + if($this->db->get(ACTIVITY)->first_row()){ + $result['activityStatus'] = false; + $result['message'] = "Activity name is already exist!"; + } + else{ + $this->db->insert(ACTIVITY, $arrayDetails); + if($this->db->affected_rows() == '1'){ + $last = $this->db->order_by('ActivityID',"desc")->limit(1)->get(ACTIVITY)->row(); + $lastActivityID=$last->ActivityID; + + if($jsonData){ + + foreach ($jsonData as $srow){ + $status_array["StatusName"]=$srow['id']; + $status_array["ActivityID"]=$lastActivityID; + $status_array["IsActive"]=$arrayDetails['IsActive']; + $status_array["CreatedBy"]=$arrayDetails['CreatedBy']; + $status_array["CreatedOn"]=$arrayDetails['CreatedOn']; + $this->db->insert(ACTIVITY_STATUS, $status_array); + } + } + $result['activityStatus'] = true; + $result['message'] = "Successfully activity details added"; + + } + else { + $result['activityStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + } + + + + return $result; + + } + + /* + * get Activity details + * parama id + * created by Surendiran + * */ + + public function getActivity($requestedBy=null,$requestedBranch=null) + { + $this->db->distinct(); + $this->db->where('BranchCode',$requestedBranch); + $this->db->order_by('ActivityID','DESC'); + $this->db->select('ActivityID,ActivityName,Description,IsActive'); + $activityDetails=$this->db->get(ACTIVITY); + if($activityDetails->result()){ + + $activity_result['activityStatus'] = true; + foreach ($activityDetails->result() as $row){ + $result_array['ActivityID'] = $row->ActivityID; + $result_array['ActivityName'] = $row->ActivityName; + $result_array['IsActive'] = $row->IsActive; + $result_array['Description'] = $row->Description; + $this->db->select('AVS.StatusID,PLD.ListCode,PLD.ListName'); + $this->db->from(ACTIVITY_STATUS .' as AVS'); + $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = AVS.StatusName'); + $this->db->where('AVS.ActivityID',$row->ActivityID); + $this->db->where('AVS.IsActive','1'); + $result_array['statusDetails']=$this->db->get()->result(); + $result[]=$result_array; + } + + $activity_result['details'] = $result; + + + } + else { + $activity_result['activityStatus'] = false; + $activity_result['details'] = "No records found!"; + } + $activity_result['masterStatusList']=$this->getAllStatusList('1',$requestedBranch); + return $activity_result; + + } + /* + * get status details + * created by kms + * */ + + public function getAllStatusList($groupName=null, $branch = null) + { + $this->db->select('ListCode,ListName'); + $this->db->where('ListGroup',$groupName); + $this->db->where('IsActive','1'); + $this->db->where('BranchCode', $branch); + $this->db->order_by('ListCode','ASC'); + $status = $this->db->get(PICK_LIST_DETAILS); + return $status->result(); + } + + + /* + * update activity details details + * created by Surendiran + * */ + public function updateActivity($arrayDetails=null,$jsonData=null) { + + $this->db->select('ActivityName'); + $this->db->where('ActivityName',$arrayDetails['ActivityName']); + $this->db->where('ActivityID !=',$arrayDetails['ActivityID']); + $this->db->where('BranchCode',$arrayDetails['BranchCode']); + if($this->db->get(ACTIVITY)->first_row()){ + $result['activityStatus'] = false; + $result['message'] = "Activity name is already exist!"; + } + else{ + + $this->db->where('ActivityID ',$arrayDetails['ActivityID']); + $updateStatus=$this->db->update(ACTIVITY, $arrayDetails); + if($updateStatus){ + $deactiveStatus['IsActive']=false; + $deactiveStatus['UpdatedBy']=$arrayDetails['UpdatedBy']; + $deactiveStatus['UpdatedOn']=$arrayDetails['UpdatedOn']; + $this->db->where('ActivityID ',$arrayDetails['ActivityID']); + $updateActivityStatusDeactive = $this->db->update(ACTIVITY_STATUS, $deactiveStatus); + if($updateActivityStatusDeactive){ + + if($jsonData){ + + foreach ($jsonData as $urow){ + + $this->db->select('StatusName'); + $this->db->where('StatusName',$urow); + $this->db->where('ActivityID',$arrayDetails['ActivityID']); + if($this->db->get(ACTIVITY_STATUS)->first_row()){ + $existStatusUpdate['IsActive']=true; + $existStatusUpdate['UpdatedBy']=$arrayDetails['UpdatedBy']; + $existStatusUpdate['UpdatedOn']=$arrayDetails['UpdatedOn']; + $this->db->where('StatusName',$urow); + $this->db->where('ActivityID',$arrayDetails['ActivityID']); + $this->db->update(ACTIVITY_STATUS, $existStatusUpdate); + } + else{ + $update_array["StatusName"]=$urow; + $update_array["ActivityID"]=$arrayDetails['ActivityID']; + $update_array["IsActive"]=true; + $update_array["CreatedBy"]=$arrayDetails['UpdatedBy']; + $update_array["CreatedOn"]=$arrayDetails['UpdatedOn']; + $this->db->insert(ACTIVITY_STATUS, $update_array); + + } + + } + } + else{ + $activateStatus['IsActive']=true; + $this->db->where('ActivityID ',$arrayDetails['ActivityID']); + $this->db->update(ACTIVITY_STATUS, $activateStatus); + + } + + + + $result['activityStatus'] = true; + $result['message'] = "Successfully activity details updated"; + } + + + } + else { + $result['activityStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + + } + + return $result; + } + + /* + * get default activity details + * created by kms + * */ + public function getDefaultActivity($reqBy, $reqBranch) + { + $arr = array('ListGroup'=>2,'ListGroup'=>6); + $this->db->distinct(); + $this->db->select('ListName,ListCode,IsActive'); + $this->db->order_by('ListName','ASC'); + $this->db->or_where('ListGroup','2'); + $this->db->or_where('ListGroup','6'); + $this->db->or_where('ListGroup','7'); + $this->db->or_where('ListGroup','8'); + $this->db->or_where('ListGroup','9'); + $defaultActivityDetails=$this->db->get(PICK_LIST_DETAILS); + if($defaultActivityDetails->result()){ + $activity_result['activityStatus'] = true; + foreach ($defaultActivityDetails->result() as $row){ + $result_array['ActivityID'] = $row->ListCode; + $result_array['ActivityName'] = $row->ListName; + $result_array['IsActive'] = $row->IsActive; + $this->db->select('DA.StudentActivityCode,PLD.ListCode,PLD.ListName'); + $this->db->from(DEFAULTACTIVITY .' as DA'); + $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = DA.StatusCode'); + // $this->db->where('PLD.IsActive','1'); + $this->db->where('DA.IsActive','1'); + $this->db->where('DA.BranchCode', $reqBranch); + // $this->db->where('PLD.BranchCode', $reqBranch); + $this->db->where('DA.StudentActivityCode',$row->ListCode); + $result_array['statusDetails']=$this->db->get()->result(); + $result[]=$result_array; + } + $activity_result['details'] = $result; + } + else { + $activity_result['activityStatus'] = false; + $activity_result['details'] = "No records found!"; + } + $activity_result['masterStatusList']=$this->getAllStatusList('1', $reqBranch); + return $activity_result; + + } + /* + * update default activity status + * created by kms + * */ + public function updateDefaultActivity($arrayDetails=null,$jsonData=null) { + + $branchCode = $arrayDetails['BranchCode']; + $deactiveStatus['IsActive']=false; + $deactiveStatus['UpdatedBy']=$arrayDetails['UpdatedBy']; + $deactiveStatus['UpdatedOn']=$arrayDetails['UpdatedOn']; + $this->db->where('BranchCode',$branchCode); + $this->db->where('StudentActivityCode ',$arrayDetails['StudentActivityCode']); + $updateActivityStatusDeactive = $this->db->update(DEFAULTACTIVITY, $deactiveStatus); + if($updateActivityStatusDeactive){ + + if($jsonData){ + + foreach ($jsonData as $urow){ + + $this->db->select('StatusCode'); + $this->db->where('StatusCode',$urow); + $this->db->where('BranchCode',$branchCode); + $this->db->where('StudentActivityCode',$arrayDetails['StudentActivityCode']); + if($this->db->get(DEFAULTACTIVITY)->first_row()){ + $existStatusUpdate['IsActive']=true; + $existStatusUpdate['UpdatedBy']=$arrayDetails['UpdatedBy']; + $existStatusUpdate['UpdatedOn']=$arrayDetails['UpdatedOn']; + $this->db->where('StatusCode',$urow); + $this->db->where('StudentActivityCode',$arrayDetails['StudentActivityCode']); + $this->db->update(DEFAULTACTIVITY, $existStatusUpdate); + } + else{ + $update_array["StatusCode"]=$urow; + $update_array["StudentActivityCode"]=$arrayDetails['StudentActivityCode']; + $update_array["IsActive"]=true; + $update_array["CreatedBy"]=$arrayDetails['UpdatedBy']; + $update_array["CreatedOn"]=$arrayDetails['UpdatedOn']; + $update_array["BranchCode"]= $branchCode; + $this->db->insert(DEFAULTACTIVITY, $update_array); + + } + + } + } + /*else{ + $activateStatus['IsActive']=true; + $this->db->where('StudentActivityCode ',$arrayDetails['StudentActivityCode']); + $this->db->update(DEFAULTACTIVITY, $activateStatus); + + }*/ + + + + $result['activityStatus'] = true; + $result['message'] = "Successfully status updated"; + } + + + + else { + $result['activityStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + + + + return $result; + } + + + // image upload in taget path + public function upload_image( $imageSource, $size, $target ) { + + //echo "fn"; + $key2 = substr(str_shuffle('abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, 12); + $new_regNo = "Dri_" . $key2 . "." . 'jpeg'; + $targetPlace = $target . $new_regNo; + // echo $imageSource; + // exit(); + if(!move_uploaded_file($imageSource , $targetPlace)) + {//echo "if"; + return $result['status'] = false; + + $result['imageName'] = $new_regNo; + } + else + { + // echo "else"; + $result['status'] = true; + $result['imageName'] = $new_regNo; + + return $result; + } + } + +} \ No newline at end of file diff --git a/Apollo/assets/i18n/en.json b/Apollo/assets/i18n/en.json index f2cdad8a..9bc2b399 100755 --- a/Apollo/assets/i18n/en.json +++ b/Apollo/assets/i18n/en.json @@ -81,6 +81,7 @@ "report": { "TITLE": "REPORTS", "studmatstatus": "STUDY MATERIAL STATUS ", + "unidataupload":"UNIVERSITY DATA UPLOAD", "mstatus": "MARK CARD STATUS ", "certificate_status": "CERTIFICATE STATUS ", "certificate_mark_status": "MARKCARD/CERTIFICATE ISSUED STATUS ", diff --git a/Apollo/assets/js/config.constant.js b/Apollo/assets/js/config.constant.js index 7c846dc0..040f2eab 100755 --- a/Apollo/assets/js/config.constant.js +++ b/Apollo/assets/js/config.constant.js @@ -205,6 +205,7 @@ app.constant('JS_REQUIRES', { 'htmlToPlaintext': 'assets/js/filters/htmlToPlaintext.js', // reports 'reportCtrl':'assets/js/controllers/reportCtrl.js', + 'report_university_file_uploadCtrl':'assets/js/controllers/report_university_file_uploadCtrl.js', 'report_study_material_statusCtrl':'assets/js/controllers/report_study_material_statusCtrl.js', 'report_markcard_statusCtrl':'assets/js/controllers/report_markcard_statusCtrl.js', 'report_certificateCtrl':'assets/js/controllers/report_certificateCtrl.js', diff --git a/Apollo/assets/js/config.router.js b/Apollo/assets/js/config.router.js index e384da6e..7ac6422a 100755 --- a/Apollo/assets/js/config.router.js +++ b/Apollo/assets/js/config.router.js @@ -585,6 +585,12 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com ncyBreadcrumb: { label: 'Reports' } + }).state('app.reports.universityfileupload', { + url: '/report_university_file_uploadCtrl', + templateUrl: "assets/views/report_universityfileupload.html", + resolve: loadSequence('ui.select','report_university_file_uploadCtrl','ngTable', 'ladda', 'angular-ladda'), + title: 'university file upload', + }).state('app.reports.studymaterial', { url: '/report_study_material_statusCtrl', templateUrl: "assets/views/report_studymaterialstatus.html", diff --git a/Apollo/assets/js/controllers/dashboardCtrl.js b/Apollo/assets/js/controllers/dashboardCtrl.js index b424092e..d27167a3 100755 --- a/Apollo/assets/js/controllers/dashboardCtrl.js +++ b/Apollo/assets/js/controllers/dashboardCtrl.js @@ -10,7 +10,7 @@ app.controller('dashboardCtrl', ["$scope","$rootScope", "toaster", "$filter", "n * this method called from view ng-init directive * created by kms * */ - + $scope.getLoginType=JSON.parse(localStorage.getItem('localObj')).localType; $scope.initCallTracking = function () { $rootScope.pendingFolloupDetails = []; var getCallTrack = { @@ -184,10 +184,11 @@ app.controller('OnotherCtrl', ["$scope", "toaster", "$filter", "$http", "API_POI var localDetails = ipCookie('cookiechk'); $scope.init = function () { - $scope.this_Student = 0; - $scope.this_Staff = 0; - $scope.this_TotalUser = 0; - $scope.getTotalUsers(); + // $scope.this_Student = 0; + // $scope.this_Staff = 0; + // $scope.this_TotalUser = 0; + // $scope.getTotalUsers(); + $scope.getUniversityRegisteredDetails(); } @@ -284,6 +285,34 @@ app.controller('OnotherCtrl', ["$scope", "toaster", "$filter", "$http", "API_POI legendTemplate: '
| SNO | STUDENT NAME | COURSE | SEM/YEAR | ENROLLMENT NO | SUBJECT CODE | SUBJECT NAME | BOOKLET NO | STUDENT SUGNATURE | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| SNO | STUDENT NAME | COURSE | SEM/YEAR | ENROLLMENT NO | SUBJECT CODE | SUBJECT NAME | BOOKLET NO | STU SIGN | |||||||||||||||||||||||||||||||||||
| {{($index+1)}} | {{student.Firstname}} {{student.Lastname}} | {{student.CourseName}} | {{student.Sem_Year}} | {{student.EnrollmentID}} | {{student.SubjectCode}} | {{student.SubjectName}} | @@ -43,7 +46,7 @@ |
| SNO | STUDENT NAME | COURSE | SEM/YEAR | ENROLLMENT NO | SUBJECT CODE | SUBJECT NAME | BOOKLET NO | STUDENT SUGNATURE | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| SNO | STUDENT NAME | COURSE | SEM/YEAR | ENROLLMENT NO | SUBJECT CODE | SUBJECT NAME | BOOKLET NO | STU SIGN | |||
| {{($index+1)}} | {{student.Firstname}} {{student.Lastname}} | {{student.CourseName}} | {{student.Sem_Year}} | {{student.EnrollmentID}} | {{student.SubjectCode}} | {{student.SubjectName}} | diff --git a/Apollo/assets/views/hallticket/generatehallticket.html b/Apollo/assets/views/hallticket/generatehallticket.html index 8832f41f..25644140 100755 --- a/Apollo/assets/views/hallticket/generatehallticket.html +++ b/Apollo/assets/views/hallticket/generatehallticket.html @@ -27,11 +27,11 @@ | Status | -+ | Action | {{p.UniversityName}} | {{p.CourseName}} | ACTIVE - DEACTIVE | + DEACTIVE +
- {{p.Comments}}
+ {{p.Comments}}
|