batchschdule changes

This commit is contained in:
gayathri1990 2018-09-11 12:55:03 +05:30
parent 525232c197
commit bdafbe2108
6 changed files with 82 additions and 31 deletions

View File

@ -16,7 +16,7 @@ class HallTickets_Controller extends REST_Controller {
function __construct() function __construct()
{ {
// Construct the parent class // Construct the parent class
parent::__construct(); parent::__construct();
// Configure limits on our controller methods // Configure limits on our controller methods
@ -320,13 +320,27 @@ class HallTickets_Controller extends REST_Controller {
$branchId = $this->post('branchId'); $branchId = $this->post('branchId');
$Cdate = new DateTime('now',new DateTimeZone('Asia/Kolkata')); $Cdate = new DateTime('now',new DateTimeZone('Asia/Kolkata'));
$CreatedOn = $Cdate->format('Y-m-d H:i:s'); $CreatedOn = $Cdate->format('Y-m-d H:i:s');
/////////check semcoursemapping//// $fileArray = array();
// $data['subjectDetails'] = $this->Hallticket_model->getSubjectDetails($universityID,$tempCourseArray,$branchId); foreach($filedetails as $filedetailsarray)
$data['subjectDetails'] = $this->Hallticket_model->getExistDetailsfileupload($university,$courseArray,$branchId); {
// print_r( $data['subjectDetails']); $fileArray[]=$filedetailsarray['SubjectID'];
if($data['subjectDetails'] == 1 ) }
$data['subjectDetails'] = $this->Hallticket_model->getExistDetailsfileupload($university,$courseArray,$branchId);
// print_r( $data['subjectDetails']);
if($data['subjectDetails'] == 1 )
{ {
foreach($courseArray as $CourseDatialArray)
$data['SubjectMappingDetails'] = $this->Hallticket_model->getSubjectMappingDetails($university,$courseArray,$branchId);
$maparray=array();
foreach ( $data['SubjectMappingDetails'] as $object)
{
$maparray[]=$object->SubjectCode;
}
if ($fileArray == $maparray)
{
foreach($courseArray as $CourseDatialArray)
{ {
$course=$CourseDatialArray; $course=$CourseDatialArray;
$schedulemaster = array('UniversityID'=>$university,'CourseID'=>$course,'BranchCode'=>$branchId,'CreatedBy'=>$requestedBy,'CreatedOn'=>$CreatedOn); $schedulemaster = array('UniversityID'=>$university,'CourseID'=>$course,'BranchCode'=>$branchId,'CreatedBy'=>$requestedBy,'CreatedOn'=>$CreatedOn);
@ -355,28 +369,35 @@ class HallTickets_Controller extends REST_Controller {
'status' => REST_Controller::HTTP_NOT_FOUND 'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); ], REST_Controller::HTTP_NOT_FOUND);
} }
}
else
{
$this->response([
'message' => 'Records Do Not Match With Mapped Subjects!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND);
}
} }
// else if($data['subjectDetails'] == 0) // else if($data['subjectDetails'] == 0)
else else
{ {
$this->response([ $this->response([
'message' => 'Please Mapping the course supject!', 'message' => ' Course Mapping for the Subject Not Found !',
'status' => REST_Controller::HTTP_NOT_FOUND 'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); ], REST_Controller::HTTP_NOT_FOUND);
} }
// else{
// $this->response([
// 'message' => 'No records found!',
// 'status' => REST_Controller::HTTP_NOT_FOUND
// ], REST_Controller::HTTP_NOT_FOUND);
// }
/////////////////////
} }
public function SaveAllBatchSchedule_post() public function SaveAllBatchSchedule_post()

View File

@ -10,7 +10,7 @@
class Hallticket_model extends CI_Model class Hallticket_model extends CI_Model
{ {
/* /*
* get university details * get university details
* created by velz * created by velz
@ -122,7 +122,7 @@ class Hallticket_model extends CI_Model
and bsm.CourseID=semmaster.CourseID and bsm.CourseID=semmaster.CourseID
LEFT JOIN T_Batch_Schedule_Child bsc ON bsc.SchId = bsm.SchId and bsc.SubjectID=semchild.SubjectID LEFT JOIN T_Batch_Schedule_Child bsc ON bsc.SchId = bsm.SchId and bsc.SubjectID=semchild.SubjectID
LEFT JOIN T_SubjectMaster sm ON sm.SubjectID=semchild.SubjectID LEFT JOIN T_SubjectMaster sm ON sm.SubjectID=semchild.SubjectID
WHERE semchild.isActive = '1' and bsm.SchId='".$mapid."' WHERE semchild.isActive = '1' and bsm.SchId='".$mapid."'
group by semchild.SubjectID,semchild.MapID"; group by semchild.SubjectID,semchild.MapID";
$b=$this->db->query($sql); $b=$this->db->query($sql);
//print_r($b); //print_r($b);
@ -135,8 +135,8 @@ group by semchild.SubjectID,semchild.MapID";
$this->db->select('T_Batch_Schedule_Child.SchId,T_Batch_Schedule_Child.SubjectID,T_Batch_Schedule_Child.ScheduleDate,T_Batch_Schedule_Child.FromTime,T_Batch_Schedule_Child.ToTime,T_Batch_Schedule_Child.SchChildId,T_Batch_Schedule_Child.SchId'); $this->db->select('T_Batch_Schedule_Child.SchId,T_Batch_Schedule_Child.SubjectID,T_Batch_Schedule_Child.ScheduleDate,T_Batch_Schedule_Child.FromTime,T_Batch_Schedule_Child.ToTime,T_Batch_Schedule_Child.SchChildId,T_Batch_Schedule_Child.SchId');
$this->db->from('T_Batch_Schedule_Master SCM'); $this->db->from('T_Batch_Schedule_Master SCM');
$this->db->join('T_Batch_Schedule_Child','T_Batch_Schedule_Child.SchId = SCM.SchId'); $this->db->join('T_Batch_Schedule_Child','T_Batch_Schedule_Child.SchId = SCM.SchId');
//$this->db->where('SCM.BranchCode',$branchcode); $this->db->where('SCM.BranchCode',$branchcode);
// $this->db->where('T_Batch_Schedule_Child.SchId',$mapid); $this->db->where('T_Batch_Schedule_Child.SchId',$mapid);
$this->db->where('T_Batch_Schedule_Child.SubjectID',$row->SubjectID); $this->db->where('T_Batch_Schedule_Child.SubjectID',$row->SubjectID);
$existsheduledetails = $this->db->get(); $existsheduledetails = $this->db->get();
//print_r($existsheduledetails); //print_r($existsheduledetails);
@ -200,16 +200,16 @@ group by semchild.SubjectID,semchild.MapID";
public function getExistDetailsfileupload($universityID,$courseIDS,$branchId) public function getExistDetailsfileupload($universityID,$courseIDS,$branchId)
{ {
// print_r($courseIDS);
// echo $universityID;
$i=0; $i=0;
foreach($courseIDS as $c) foreach($courseIDS as $c)
{ {
// $tempCourseArray= $c['CourseID']; // $tempCourseArray= $c['CourseID'];
$this->db->select ('count(*) as count'); $this->db->select ('count(*) as count,T_SemSubMap_Child.SubjectID');
$this->db->from('T_SemSubMap_Master'); $this->db->from('T_SemSubMap_Master');
$this->db->join('T_SemSubMap_Child','T_SemSubMap_Child.MapID=T_SemSubMap_Master.MapID');
$this->db->where('UniversityID',$universityID); $this->db->where('UniversityID',$universityID);
$this->db->where('CourseID',$c); $this->db->where('CourseID',$c);
$result = $this->db->get(); $result = $this->db->get();
@ -235,6 +235,35 @@ public function getExistDetailsfileupload($universityID,$courseIDS,$branchId)
* @params university id and CourseID * @params university id and CourseID
* created by Bala * created by Bala
* */ * */
public function getSubjectMappingDetails($universityID,$courseIDS,$branchId)
{
foreach($courseIDS as $c)
{
// $tempCourseArray= $c['CourseID'];
$this->db->select ('T_SubjectMaster.SubjectCode');
$this->db->from('T_SemSubMap_Master');
$this->db->join('T_SemSubMap_Child','T_SemSubMap_Child.MapID=T_SemSubMap_Master.MapID');
$this->db->join('T_SubjectMaster','T_SubjectMaster.SubjectID=T_SemSubMap_Child.SubjectID');
$this->db->where('T_SemSubMap_Master.UniversityID',$universityID);
$this->db->where('T_SemSubMap_Master.CourseID',$c);
$this->db->where('T_SubjectMaster.BranchCode',$branchId);
$result = $this->db->get();
}
return $result->result();
}
/*
* check existing data,only batchschedule.
* @params university id and CourseID
* created by Bala
* */
public function getExistDetails($universityID,$courseIDS,$branchId) public function getExistDetails($universityID,$courseIDS,$branchId)
{ {

View File

@ -14,7 +14,7 @@ app.controller('schCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableP
$scope.myModelAdd = { $scope.myModelAdd = {
"date": "", "date": "",
"periodStart": "", "periodStart": "",
"periodEnd":"", "periodEnd":"",
}; };
@ -384,7 +384,7 @@ $scope.UploadFileData = function (FileDetails,myModel,courseDetails) {
swal("", "Saved Successfully", "success"); swal("", "Saved Successfully", "success");
$state.go($state.current, {}, {reload: true}); $state.go($state.current, {}, {reload: true});
} else { } else {
swal("", "Please Mapping the course supject", "error"); swal("",response.data.message, "error");
$state.go($state.current, {}, {reload: true}); $state.go($state.current, {}, {reload: true});
} }
},function(error){ },function(error){

View File

@ -16,7 +16,7 @@
} }
a { a {
color: #007AFF; color: #007AFF;
} }
</style> </style>
@ -167,7 +167,8 @@
<fieldset> <fieldset>
<js-xls onread="readUploadBatchDetails" onerror="error"></js-xls> <js-xls onread="readUploadBatchDetails" onerror="error"></js-xls>
<br> <br>
<a href="https://www.w3schools.com/html/" target="_top">Sample Format</a>
<a target="_blank" href="C:\xampp\htdocs\apollodec\Apollo\images\Batchschedule.xlsx">Sample Format</a>
<button type="button" class="btn btn-success btn-o" style="float: right" ng-click="UploadFileData(extractFileDetails,myModel,selectedCourseNameC)"> Submit</button> <button type="button" class="btn btn-success btn-o" style="float: right" ng-click="UploadFileData(extractFileDetails,myModel,selectedCourseNameC)"> Submit</button>
</fieldset> </fieldset>

View File

@ -6,7 +6,7 @@
<legend> <legend>
Update Schedule Details Update Schedule Details
</legend> </legend>
<div class="row" > <div class="row" >
<div class="panel panel-white" id="sub"> <div class="panel panel-white" id="sub">
<div class="panel-heading border-light"> <div class="panel-heading border-light">
<!--<h4 class="panel-title text-pink">Schedule Details</h4> <!--<h4 class="panel-title text-pink">Schedule Details</h4>

Binary file not shown.