ÿØÿàJFIFHHÿá .
BSA HACKER
Logo of a company Server : Apache
System : Linux nusantara.hosteko.com 4.18.0-553.16.1.lve.el8.x86_64 #1 SMP Tue Aug 13 17:45:03 UTC 2024 x86_64
User : koperas1 ( 1254)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /home/koperas1/public_html/app/Models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/koperas1/public_html/app/Models/Video_model.php
<?php

namespace App\Models;

use CodeIgniter\Model;

class Video_model extends Model
{
    protected $table              = 'video';
    protected $primaryKey         = 'id_video';
    protected $returnType         = 'array';
    protected $useSoftDeletes     = false;
    protected $allowedFields      = ['id_video', 'judul', 'video', 'keterangan'];
    protected $useTimestamps      = false;
    protected $createdField       = 'tanggal_post';
    protected $updatedField       = 'tanggal';
    protected $deletedField       = 'deleted_at';
    protected $validationRules    = [];
    protected $validationMessages = [];
    protected $skipValidation     = false;

    // listing
    public function listing()
    {
        $builder = $this->db->table('video');
        $builder->orderBy('video.id_video', 'DESC');
        $query = $builder->get();

        return $query->getResultArray();
    }

    // total
    public function total()
    {
        $builder = $this->db->table('video');
        $builder->select('COUNT(*) AS total');
        $builder->orderBy('video.id_video', 'DESC');
        $query = $builder->get();

        return $query->getRowArray();
    }

    // detail
    public function detail($id_video)
    {
        $builder = $this->db->table('video');
        $builder->where('id_video', $id_video);
        $builder->orderBy('video.id_video', 'DESC');
        $query = $builder->get();

        return $query->getRowArray();
    }

    // read
    public function read($slug_video)
    {
        $builder = $this->db->table('video');
        $builder->where('slug_video', $slug_video);
        $builder->orderBy('video.id_video', 'DESC');
        $query = $builder->get();

        return $query->getRowArray();
    }
}