<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Delete_ctrl extends user_index {
 
	
	public function __construct(){
		parent::__construct();
		$data = array();
	}
	
	/*----------------- delete item -----------------*/
	public function delete_details($type,$id,$return_id=''){
		switch ($type) {
			case '1':
				$this->db->where('cl_id',$id)->delete("class_list");
				$this->session->set_flashdata('tos_success', 'class details deleted.');
				redirect('class_ctrl/class_division_list');
				break;
			case '2':
				$this->db->where('dl_id',$id)->delete("division_list");
				$this->session->set_flashdata('tos_success', 'division details deleted.');
				redirect('class_ctrl/class_division_list');
				break;
			case '3':
				$this->db->where('cl_id',$id)->delete("course_list");
				$this->session->set_flashdata('tos_success', 'course details deleted.');
				redirect('course_ctrl/course_list');
				break;
			case '4':
				$this->db->where('rl_id',$id)->delete("register_list");
				$this->session->set_flashdata('tos_success', 'staff details deleted.');
				redirect('re_user_ctrl/registered_list');
				break;			
			case '5':
				$this->db->where('smcl_id',$id)->delete("study_material_category_list");
				$this->session->set_flashdata('tos_success', 'categoty deleted.');
				redirect('login_ctrl/study_material_category_list');
				break;
			case '6':
				$this->db->where('sml_id',$id)->delete("study_material_list");
				$this->session->set_flashdata('tos_success', 'study material details deleted.');
				redirect('login_ctrl/study_material_list/'.$return_id);
				break;
			case '7':
				$this->db->where('col_id',$id)->delete("course_offerings_list");
				$this->session->set_flashdata('tos_success', 'COURSE OFFERING DETAILS deleted.');
				redirect('settings_ctrl/course_offerings_list');
				break;
			case '8':
				$this->db->where('segl_id',$id)->delete("segment_list");
				$this->session->set_flashdata('tos_success', 'segment deleted.');
				redirect('settings_ctrl/segment_list');
				break;
			case '9':
				$this->db->where('bl_id',$id)->delete("batch_list");
				$this->session->set_flashdata('tos_success', 'batch deleted.');
				redirect('settings_ctrl/batch_list');
				break;
			case '10':
				$this->db->where('templ_id',$id)->delete("template_list");
				$this->session->set_flashdata('tos_success', 'template deleted.');
				redirect('settings_ctrl/template_list');
				break;


			
		}


		
	}

	
	
	
	
}
