p!ranha?
Server IP : 103.169.32.36  /  Your IP : 216.73.217.13
Web Server : Apache
System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/dpmptsp/public_html/newsigniter/application/controllers/back/

Upload File :
Curr3nt_D!r [ Writeable ] D0cum3nt_r0Ot [ Writeable ]

 
Command :
Current File : /home/dpmptsp/public_html/newsigniter/application/controllers/back/Album.php
<?php 
defined('BASEPATH') OR exit('No direct script access allowed');

class Album extends CI_Controller {

   var $table = 'album';
	var $tableJoin = '';
	var $id = 'id';
	var $column_order = ['', 'album_name', 'photo', 'album_seo', 'is_active'];
	var $column_search = ['album_name', 'photo', 'album_seo', 'is_active'];

   public function __construct()
	{
		parent::__construct();
      $this->load->model('my_model', 'my');
      $this->load->model('album_model', 'album');
   }
   
	public function ajax_list()
   {
      $list = $this->my->get_datatables();
      $data = [];
      $no = 1;

      foreach($list as $li){
         $row = [];
         $row[] = $no++;
         $row[] = $li->album_name;
         
         if($li->photo){
            $row[] = '<a href="' . base_url('images/album/' . $li->photo).'" target="_blank"><img src="'.base_url('images/album/' . $li->photo) . '" class="img-responsive" style="max-height:150px; max-width:250px;"/></a>';
         }else{
            $row[] = '(No photo)';
         }

         if($li->album_seo){
            $row[] = '<a href="' . base_url('article/gallery/' . $li->album_seo).'" target="_blank">' .'article/gallery/' . $li->album_seo . '</a>';
         }else{
            $row[] = '(No Link)';
         }

			$row[] = $li->is_active;
         $row[] = 
         '<a class="btn btn-sm btn-warning text-white" href="#" 
         title="Edit" onclick="edit_album('."'" . $li->id . "'".')">
			<i class="fa fa-pencil-alt mr-1"></i> Edit</a>

			<a class="btn btn-sm btn-danger" href="#" 
			title="Delete" onclick="delete_album('."'".$li->id."'".')">
			<i class="fa fa-trash mr-1"></i> Delete</a>';
         $data[] = $row;
      }

      $output = [
         'draw'            => $_POST['draw'],
         'recordsTotal'    => $this->my->count_all(),
         'recordsFiltered' => $this->my->count_filtered(),
         'data'            => $data
      ];

      echo json_encode($output);
	}

	public function get_data()
   {
      $data = $this->my->get_by_id($this->input->post('id', true));
      echo json_encode($data);
	}

	public function action()
	{
      $this->form_validation->set_rules('album_name','Album Name','trim|required');

      if($this->form_validation->run() != false){

         $data = [
            'album_name' => $this->input->post('album_name', true),
            'album_seo' => slugify($this->input->post('album_name', true)),
            'is_active' => $this->input->post('is_active', true),
         ];

         if($this->input->post('remove_photo')){
            if(file_exists('images/album/' . $this->input->post('remove_photo')) && $this->input->post('remove_photo')){
               $this->album->deleteImage($this->input->post('remove_photo'));
            }

            $data['photo'] = '';
         }

         $id = $this->input->post('id', true);

         // For Insert Album
         if(empty($id)){
            
            if(!empty($_FILES['photo']['name'])){
               $upload = $this->album->uploadImage();	
               $data['photo'] = $upload;
            }
            
            $this->my->save($data);
            $status = true;
         }
         // For Update Album
         else{
            if(!empty($_FILES['photo']['name'])){
               $upload = $this->album->uploadImage();
               $album = $this->my->get_by_id($id);

               if(file_exists('images/album/' . $album->photo) && $album->photo){
                  unlink('images/album/' . $album->photo);
               }

               $data['photo'] = $upload;
            }

            $this->my->update(['id' => $id], $data);
            $status = true;
         }

         echo json_encode(["status" => $status]);         
      }
   }

	public function delete(){
      $album = $this->my->get_by_id($this->input->post('id', true));

      if(file_exists('images/album/' . $album->photo) && $album->photo){
         $this->album->deleteImage($album->photo);
      }

		$this->my->delete($this->input->post('id', true));
		echo json_encode(["status" => TRUE]);
   }
   

}

/* End of file Album.php */
N4m3
5!z3
L45t M0d!f!3d
0wn3r / Gr0up
P3Rm!55!0n5
0pt!0n5
..
--
January 03 2025 03:29:07
0 / 0
0755
Album.php
4.015 KB
December 31 2020 02:24:50
0 / 0
0644
Banner.php
2.73 KB
January 14 2025 07:47:46
0 / 0
0644
Category.php
2.239 KB
December 31 2020 02:24:50
0 / 0
0644
Contact.php
1.758 KB
December 31 2020 02:24:50
0 / 0
0644
Gallery.php
4.183 KB
December 31 2020 02:24:50
0 / 0
0644
Identity.php
2.493 KB
January 03 2025 03:19:55
0 / 0
0644
Menu.php
2.077 KB
December 31 2020 02:24:50
0 / 0
0644
Posting.php
9.308 KB
January 20 2025 04:26:34
0 / 0
0644
Submenu.php
2.393 KB
May 22 2021 13:05:32
0 / 0
0644