This commit is contained in:
gayathri1990 2018-08-19 11:51:26 +05:30
commit 5cc08d3a32
3 changed files with 18 additions and 13 deletions

View File

@ -317,7 +317,8 @@ class HallTickets_Controller extends REST_Controller {
{
$schedulearray = $this->post('updatescheduledetails');
$updateBy = $this->post('createdBy');
$res = $this->Hallticket_model->scheduleUpdate($schedulearray,$updateBy);
$scheduleID = $this->post('scheduleID');
$res = $this->Hallticket_model->scheduleUpdate($schedulearray,$updateBy,$scheduleID);
if(count($res) > 0 )
{

View File

@ -791,11 +791,12 @@ class Hallticket_model extends CI_Model
else if(strcasecmp($ind['Type'],'sem') == 0 && strcasecmp($ind['SubType'],'year') == 0)
{
//GET Year Based Semester
if($ind['SemID'] == 1)//First Year
{
$i = 1;
// for($i = 1;$i <= 1; $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
@ -808,7 +809,7 @@ class Hallticket_model extends CI_Model
//array_push($id['FeeDetails'][$key2],$ind);
// }
}
array_splice($id['FeeDetails'][$key2],0,6,$in1);
}
@ -1248,9 +1249,9 @@ class Hallticket_model extends CI_Model
}
public function scheduleUpdate($schedulearray,$up)
public function scheduleUpdate($schedulearray,$up,$scheduleID)
{
//print_r($schedulearray);die();
$MasterID = "";
foreach($schedulearray as $shed)
{
@ -1259,7 +1260,7 @@ class Hallticket_model extends CI_Model
$sudate = $shed['scheduleDate'];
$SubDate = date("Y-m-d", strtotime($sudate));
$MasterID = $shed['SchId'];
//echo $SchId;
$SubjectID = $shed['SubjectID'];
$scheduleStart = $shed['scheduleStart'];
$scheduleEnd = $shed['scheduleEnd'];
@ -1268,17 +1269,19 @@ class Hallticket_model extends CI_Model
{
$schedulchildUpdate = array('ScheduleDate'=>$SubDate,'FromTime'=>$scheduleStart,'ToTime'=>$scheduleEnd);
//print_r($schedulchild);
$this->db->trans_start();
$this->db->where('T_Batch_Schedule_Child.SchChildId',$ChildID);
$this->db->where('T_Batch_Schedule_Child.SubjectID',$SubjectID);
$this->db->where('T_Batch_Schedule_Child.SchId',$MasterID);
$this->db->update('T_Batch_Schedule_Child',$schedulchildUpdate);
$this->db->trans_complete();
}
else
{
$schedulchildInsert = array('SchId'=>$MasterID,'SubjectID'=>$SubjectID,'ScheduleDate'=>$SubDate,'FromTime'=>$scheduleStart,'ToTime'=>$scheduleEnd,'IsActive'=>$isactive);
$schedulchildInsert = array('SchId'=>$scheduleID,'SubjectID'=>$SubjectID,'ScheduleDate'=>$SubDate,'FromTime'=>$scheduleStart,'ToTime'=>$scheduleEnd,'IsActive'=>$isactive);
$this->db->trans_start();
$this->db->insert('T_Batch_Schedule_Child',$schedulchildInsert);
$this->db->trans_complete();

View File

@ -50,7 +50,7 @@ app.controller('schCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableP
$scope.editId = pid;
$scope.courseCode = cid;
var mappingid = schid;
$scope.mappingid = schid;
//alert(mappingid+'n');
var getsheduledetails = {
method: 'POST',
@ -60,7 +60,7 @@ app.controller('schCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableP
},
data: {
//requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
mapid:mappingid,
mapid:$scope.mappingid,
subid:subid,
branchcode:branchid,
@ -449,7 +449,8 @@ app.controller('schCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableP
updatescheduledetails : $scope.UpdatescheduledDetails,
//status: myModel.IsActive,
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
scheduleID:$scope.mappingid
}
};
$http(update).then(function (response) {