<?php 

class Delete extends CI_Controller
{
    function __construct()
    {
        parent::__construct();
        $this->load->model('Delete_data');
        $this->load->model('Common_model');
    }
     public function del_clients($c_id)
   {
        $this->Delete_data->delclient($c_id);
        $this->session->set_flashdata('delete_pcategory','Product deleted successfully..');
        redirect('App/clients','location');
   }
    public function del_job($id)
   {
        $this->Delete_data->deljob($id);
        $this->session->set_flashdata('delete_pcategory','Product deleted successfully..');
        redirect('App/jobs','location');
   }
    public function del_slider($s_id)
    {
        $this->Delete_data->delslider($s_id);
        $this->session->set_flashdata('delete_slider','Slider deleted successfully..');
        redirect('index.php/App/slider','location');
    }
    public function del_article($a_id)
    {
        $this->Common_model->deleteall('a_id',$a_id,'articles');
        $this->session->set_flashdata('delete_product','Blogs  deleted successfully..');
        redirect('index.php/App/article', 'location');
    }
    public function del_images($a_id)
    {
         $image = $this->Common_model->select_by_id('a_id',$a_id, 'add_image');
         foreach($image as $row);
         $p_id = $row->p_id;         
         $this->Common_model->deleteall('a_id',$a_id,'add_image');
         $this->session->set_flashdata('delete_product','Data  deleted successfully..');        
         redirect('index.php/App/add_image/'.$p_id, 'location');
    }
    public function del_certificate($c_id)
    {
        $data = array(
        'c_status' => '0'
        );
        $this->Common_model->update_id('c_id',$c_id,$data,'certificates');
        $this->session->set_flashdata('delete','Data deleted successfully..');
        redirect('index.php/App/certificates', 'location');
    }
    public function del_infra($in_id)
    {
        $this->Delete_data->delinfra($in_id);
        $this->session->set_flashdata('delete_infra','Data deleted successfully..');
        redirect('index.php/App/infra_s', 'location');
    }
     public function del_faq($id)
    {
        $this->Delete_data->del_faq($id);
        $this->session->set_flashdata('delete','Data deleted successfully..');
        redirect('index.php/App/faq', 'location');
    }
    public function del_consultancy($id)
    {
        $this->Delete_data->del_consultancy($id);
        $this->session->set_flashdata('delete','Data deleted successfully..');
        redirect('index.php/App/consultancy', 'location');
    }
     public function del_service($s_id)
    {
        $this->Delete_data->del_service($s_id);
        $this->session->set_flashdata('delete','Service deleted successfully..');
        redirect('index.php/App/service','location');
    }
    public function del_pgallery($g_id)
    {
        $this->Delete_data->del_pgallery($g_id);
        $this->session->set_flashdata('delete_gallery','Gallery deleted successfully..');
        redirect('index.php/App/project_gallery','location');
    }
    public function del_gallery($g_id)
   {
        $this->Delete_data->delgallery($g_id);
        $this->session->set_flashdata('delete_gallery','Gallery deleted successfully..');
        redirect('index.php/App/gallery','location');
   }
   public function del_gtype($gt_id)
   {
        $this->Delete_data->del_gtype($gt_id);
        $this->session->set_flashdata('delete_gallerytype','Gallery Type deleted successfully..');
        redirect('index.php/App/gallery_type','location');
   }
   public function del_video($v_id)
   {
        $this->Delete_data->del_video($v_id);
        $this->session->set_flashdata('delete_video','Video link deleted successfully..');
        redirect('index.php/App/video','location');
   }
    public function del_test($t_id)
   {
        $this->Delete_data->del_test($t_id);
        $this->session->set_flashdata('delete_test','Testmonial deleted successfully..');
        redirect('index.php/App/testmonial','location');
   }
    public function del_product_cat($pt_id) 
   {
        $this->Delete_data->delpcat($pt_id);
        $this->session->set_flashdata('delete_pcategory','Product deleted successfully..');
        redirect('index.php/App/product_category','location');
   }
   public function del_products($p_id)
    {
        $this->Delete_data->delproduct($p_id);
        $this->session->set_flashdata('delete_product','Product  deleted successfully..');
        redirect('index.php/App/products', 'location');
    }
    
   public function del_news($n_id)
   {
        $this->Delete_data->delnews($n_id);
        $this->session->set_flashdata('delete_news','News  deleted successfully..');
        redirect('app/news','location');
   }
   
   public function del_pdf($p_id)
   {
        $this->Delete_data->del_pdf($p_id);
        redirect('app/pdf','location'); 
   }
}
