Вход Регистрация
Файл: CloudBox-main/CloudBox/fus/models/admin_models/File_Model.php
Строк: 57
<?php

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

/* * *******************************************#
  #      User Management System                 #
  #*********************************************#
  #      Author:     Atique IT                  #
  #      Email:      info@atique-it.com         #
  #      Website:    http://atique-it.com       #
  #                                             #
  #      Version:    15.2.1                     #
  #      Copyright:  (c) 2015 - Atique IT       #
  #                                             #
  #*********************************************# */

class File_Model extends MSN_Model {

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

    private 
$_file 'tbl_file';
    private 
$_folder 'tbl_folder';

    public function 
insert_file_info($folder_id$file_name){
        
$data['file_name'] = $file_name;
        
$data['folder_id'] = $folder_id;
        
$this->db->insert($this->_file$data);
        return 
$this->db->insert_id();
    }
    
    public function 
get_all_file_info_by_folder_id($folder_id){
        
$query_result $this->db->select('*')
                ->
where('folder_id'$folder_id)
                ->
where('deletion_status'0)
                ->
order_by('file_id''desc')
                ->
get($this->_file);
        
$result $query_result->result_array();
        if (!empty(
$result)) {
            return 
$result;
        }
    }
    
    public function 
delete_file_by_id($file_id) {
        
$this->db->update($this->_file, array('deletion_status' => 1), array('file_id' => $file_id));
        return 
$this->db->affected_rows();
    }
    
    public function 
get_file_by_id($file_id){
        
$result $this->db->get_where($this->_file, array('file_id' => $file_id));
        return 
$result->row_array();
    }
    
    
    
//////////////////////////////////////////////////////
    
    
public function get_all_folder_info(){
        
$query_result $this->db->select('*')
                ->
where('user_id'$this->session->userdata('user_id'))
                ->
where('deletion_status'0)
                ->
order_by('folder_id''desc')
                ->
get($this->_folder);
        
$result $query_result->result_array();
        if (!empty(
$result)) {
            return 
$result;
        }
    }
    
    public function 
create_new_folder() {
        
$data['folder_title'] = $this->input->post('folder_title'TRUE);
        
$data['user_id'] = $this->session->userdata('user_id');
        
$this->db->insert($this->_folder$data);
        return 
$this->db->insert_id();
    }
    
    public function 
get_folder_info_by_id($folder_id){
        
$result $this->db->get_where($this->_folder, array('folder_id' => $folder_id));
        return 
$result->row_array();
    }
    
    public function 
delete_folder_info_by_id($folder_id){
        
$this->db->update($this->_folder, array('deletion_status' => 1), array('folder_id' => $folder_id));
        return 
$this->db->affected_rows();
    }
}
Онлайн: 1
Реклама