rollno, enrollmentid duplication

This commit is contained in:
venbatechnologies@gmail.com 2018-12-08 14:50:33 +05:30
parent 517253d8a1
commit 2bf83f5f99
5 changed files with 125 additions and 15 deletions

View File

@ -701,6 +701,8 @@ class Student_Controller extends REST_Controller {
// add new course for student // add new course for student
public function insertStudentCourse_post() { public function insertStudentCourse_post() {
$addStudent = $this->post('addStudent'); $addStudent = $this->post('addStudent');
$coursedata = $this->post('coursedata'); $coursedata = $this->post('coursedata');
$createdBy = $this->post('createdBy'); $createdBy = $this->post('createdBy');
@ -733,6 +735,9 @@ class Student_Controller extends REST_Controller {
} }
public function insertStudentImg_post() { public function insertStudentImg_post() {
$imagename = $_FILES['idStuProof']['name']; $imagename = $_FILES['idStuProof']['name'];
$size = $_FILES['idStuProof']['size']; $size = $_FILES['idStuProof']['size'];
$imageSource = $_FILES['idStuProof']['tmp_name']; $imageSource = $_FILES['idStuProof']['tmp_name'];

View File

@ -1176,10 +1176,36 @@ class Fees_status_model extends CI_Model
* */ * */
public function setFees($details=null,$jsonData=null){ public function setFees($details=null,$jsonData=null){
//echo 'in';
// print_r($details); // print_r($details);
//print_r($jsonData); //print_r($jsonData);
//die(); //die();
$RollNo= $details['RollNo'];
if($RollNo !='')
{
$this->db->select('*');
$this->db->from('T_Students_Fees_Status');
$this->db->where('RollNo',$RollNo);
$this->db->where('CourseID',$details['CourseID']);
$qry=$this->db->get();
$qry=$qry->result();
//echo count($qry);die();
if(count($qry)>0)
{
$result['setStatus'] = false;
$result['message'] = "RollNo Already Exists";
return $result;
}
}

View File

@ -1045,6 +1045,41 @@ class Student_model extends CI_Model {
// add student // add student
public function add_student($Arr, $courseArr, $imagename, $imageSource, $size) { public function add_student($Arr, $courseArr, $imagename, $imageSource, $size) {
// print_r($courseArr);die();
$Enrollment = $courseArr['EnrollmentID'];
if($Enrollment !='')
{
$this->db->select('*');
$this->db->from('T_Student_CourseDetails');
$this->db->where('EnrollmentID',$Enrollment);
$this->db->where('UniversityID',$courseArr['UniversityID']);
$qry=$this->db->get();
$qry=$qry->result();
//print_r($this->db->last_query());die();
//echo count($qry);die();
if(count($qry)>0)
{
$result['addStudentStatus'] = false;
$result['message'] = "EnrollmentID Already Exists";
return $result;
}
}
// echo $this->getBranchActiveStatusforStuAdd($courseArr['BranchID'])['branch_active_status'];exit(); // echo $this->getBranchActiveStatusforStuAdd($courseArr['BranchID'])['branch_active_status'];exit();
if ($this->getBranchActiveStatusforStuAdd($courseArr['BranchID']) ['branch_active_status'] === '1') { if ($this->getBranchActiveStatusforStuAdd($courseArr['BranchID']) ['branch_active_status'] === '1') {
// echo 'in';exit(); // echo 'in';exit();
@ -1159,6 +1194,9 @@ class Student_model extends CI_Model {
$result['message'] = "New Student cannot able to create for In-Active Branch"; $result['message'] = "New Student cannot able to create for In-Active Branch";
} }
return $result; return $result;
} }
// check existing data while update // check existing data while update
@ -1479,6 +1517,38 @@ class Student_model extends CI_Model {
// Update Student Course Details // Update Student Course Details
public function update_student_course($reqArr, $id) { public function update_student_course($reqArr, $id) {
$Enrollment = $reqArr['EnrollmentID'];
if($Enrollment !='')
{
$this->db->select('*');
$this->db->from('T_Student_CourseDetails');
$this->db->where('EnrollmentID',$Enrollment);
$this->db->where_not_in('StudentID', $reqArr['StudentID']);
$this->db->where_not_in('CourseID', $reqArr['CourseID']);
$qry=$this->db->get();
$qry=$qry->result();
//echo count($qry);die();
if(count($qry)>0)
{
$result['addStudentStatus'] = false;
$result['message'] = "EnrollmentID Already Exists";
return $result;
}
}
$this->db->select('*'); $this->db->select('*');
$this->db->from(STUDENTCOURSE); $this->db->from(STUDENTCOURSE);
$this->db->where('StudentID', $reqArr['StudentID']); $this->db->where('StudentID', $reqArr['StudentID']);

View File

@ -728,11 +728,11 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
//alert('set fee page');return false; //alert('set fee page');return false;
//console.log(form)
var firstError = null; var firstError = null;
if (form.$invalid) { if (form.$invalid) {
alert('if');
var field = null, firstError = null; var field = null, firstError = null;
for (field in form) { for (field in form) {
if (field[0] != '$') { if (field[0] != '$') {
@ -749,7 +749,7 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
swal("", "Please check session details/installment details", "warning"); swal("", "Please check session details/installment details", "warning");
} else { } else {
// alert('in')
/* if(isNaN(installment.date)){ /* if(isNaN(installment.date)){
$scope.pushDueDate1= $rootScope.lastInstallemtDate; $scope.pushDueDate1= $rootScope.lastInstallemtDate;
} }
@ -775,10 +775,14 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
}); });
}*/ }*/
if(updateModel.Sem_Year!='TC' && updateModel.Sem_Year!='PPC' && updateModel.Sem_Year!='DC' && updateModel.Sem_Year!='MC' && updateModel.Sem_Year!='OTHER'){ if(updateModel.Sem_Year!='TC' && updateModel.Sem_Year!='PPC' && updateModel.Sem_Year!='DC' && updateModel.Sem_Year!='MC' && updateModel.Sem_Year!='OTHER'){
var checkTotamt=0; var checkTotamt=0;
angular.forEach($rootScope.updateMoreItems, function (value, key) { angular.forEach($rootScope.updateMoreItems, function (value, key) {
console.log(value.Amount)
checkTotamt=parseInt(checkTotamt)+parseInt(value.Amount); checkTotamt=parseInt(checkTotamt)+parseInt(value.Amount);
if(isNaN(value.DueDate)){ if(isNaN(value.DueDate)){
@ -791,18 +795,21 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
$rootScope.updateMoreItems[key].DueDate=$scope.pushDueDate2; $rootScope.updateMoreItems[key].DueDate=$scope.pushDueDate2;
} }
}); });
if(parseInt($scope.setTotalAmount)<checkTotamt){
var statusUpdate=false; // console.log($scope.setTotalAmount);
swal("Please check total/installment amount "); //console.log(checkTotamt)
} // if(parseInt($scope.setTotalAmount)<checkTotamt){
else if(parseInt($scope.setTotalAmount)>checkTotamt){ // var statusUpdate=false;
var statusUpdate=false; // swal("Please check total/installment amount ");
swal("Please check total/installment amount "); // }
} // else if(parseInt($scope.setTotalAmount)>checkTotamt){
else if(parseInt($scope.setTotalAmount)==checkTotamt){ // var statusUpdate=false;
// swal("Please check total/installment amount ");
// }
// else if(parseInt($scope.setTotalAmount)==checkTotamt){
var statusUpdate=true; var statusUpdate=true;
} // }
} }
else{ else{
if(updateModel.Valid=='1'){ if(updateModel.Valid=='1'){

View File

@ -3097,6 +3097,8 @@ $scope.getPhoneNoHistoy = function(studentId)
$scope.studentFORM = { $scope.studentFORM = {
submit: function (form, myModel, myModelCourseAdd) { submit: function (form, myModel, myModelCourseAdd) {
// alert(JSON.stringify(myModelCourseAdd)); // alert(JSON.stringify(myModelCourseAdd));
//alert('ion');die();
var firstError = null; var firstError = null;
if (form.$invalid) { if (form.$invalid) {
var field = null, firstError = null; var field = null, firstError = null;