39 lines
1.0 KiB
Plaintext
39 lines
1.0 KiB
Plaintext
|
//Remove Existing One
|
||
|
$existingRow=$this->Semester_model->getSemesterDetail($id);
|
||
|
//echo $this->db->last_query();
|
||
|
if($existingRow->num_rows()>0)
|
||
|
{
|
||
|
//echo "test";exit;
|
||
|
$primaryId=array();
|
||
|
foreach($existingRow->result() as $list)
|
||
|
{
|
||
|
$primaryId[]=$list->id ;
|
||
|
}
|
||
|
}
|
||
|
//Remove Row
|
||
|
$diff=array_diff($primaryId,$semesterDetailId);
|
||
|
//print_r ($diff);exit;
|
||
|
if($diff>0)
|
||
|
{
|
||
|
//echo "sdsds";exit;
|
||
|
foreach($diff as $value)
|
||
|
{
|
||
|
$where=array('id'=>$value);
|
||
|
$tablename="semesterdetail";
|
||
|
$values=array('status'=>0);
|
||
|
if($SEMESTERDETAILID!=""){
|
||
|
$result=$this->Commonsql_model->updateTable($tablename,$where,$values);}
|
||
|
//echo $this->db->last_query();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
//New Row Insertion
|
||
|
if($subjectDetailId[$key]=="")
|
||
|
{
|
||
|
$tablename='semesterdetail';
|
||
|
$data=array('semesterId'=>$id,
|
||
|
'degreeId'=>$DEGREEID,
|
||
|
'subjectId'=>$SUBID,
|
||
|
'status'=>1);
|
||
|
$result=$this->Commonsql_model->insert_table($tablename,$data);
|
||
|
}
|