KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.41 (Ubuntu)
System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64
User : www-data ( 33)
PHP Version : 8.2.12
Disable Function : NONE
Directory :  /var/www/parasoffline.edukrypt.in/application/models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/parasoffline.edukrypt.in/application/models/Schedule_model.php
<?php

class Schedule_model extends MY_Model
{

	// Total
	public function check_permission_posts_count($admin_id)
	{
		$this->db->select('live_schedule.*,livestream.name as server,users.username as user, au.username as admin');
		$this->db->from('live_schedule');
		$this->db->join('livestream', 'livestream.id = live_schedule.stream_id');
		$this->db->join('users', 'users.id = live_schedule.user_id');
		$this->db->join('admin_users as au', 'au.id = live_schedule.admin_id');
		$this->db->where('live_schedule.admin_id', $admin_id);

		$query = $this->db->get();
		if ($query->num_rows() > 0) {
			return $query->num_rows();
		}

		return 0;
	}

	public function check_permission_posts($limit, $start, $order, $dir, $admin_id)
	{
		$this->db->select('live_schedule.*,livestream.name as server,users.username as user, au.username as admin');
		$this->db->from('live_schedule');
		$this->db->join('livestream', 'livestream.id = live_schedule.stream_id');
		$this->db->join('users', 'users.id = live_schedule.user_id');
		$this->db->join('admin_users as au', 'au.id = live_schedule.admin_id');
		$this->db->where('live_schedule.admin_id', $admin_id);

		$this->db->limit($limit, $start);
		$this->db->order_by($order, $dir);
		$query = $this->db->get();

		if ($query->num_rows() > 0) {
			return $query->result();
		}

		return [];
	}

	function check_permission_posts_search($limit, $start, $search, $order, $dir, $admin_id)
	{
		$this->db->select('live_schedule.*,livestream.name as server,users.username as user, au.username as admin');
		$this->db->from('live_schedule');
		$this->db->join('livestream', 'livestream.id = live_schedule.stream_id');
		$this->db->join('users', 'users.id = live_schedule.user_id');
		$this->db->join('admin_users as au', 'au.id = live_schedule.admin_id');
		$this->db->where('live_schedule.admin_id', $admin_id);

		if (!empty($search)) {
			$this->db->like('users.username', $search);
			$this->db->or_like('live_schedule.user_id', $search);
		}

		$this->db->limit($limit, $start);
		$this->db->order_by($order, $dir);
		$query = $this->db->get();

		if ($query->num_rows() > 0) {
			return $query->result();
		} else {
			return [];
		}
	}

	public function check_permission_posts_search_count($search, $admin_id)
	{
		$this->db->select('live_schedule.*,livestream.name as server,users.username as user, au.username as admin');
		$this->db->from('live_schedule');
		$this->db->join('livestream', 'livestream.id = live_schedule.stream_id');
		$this->db->join('users', 'users.id = live_schedule.user_id');
		$this->db->join('admin_users as au', 'au.id = live_schedule.admin_id');
		$this->db->where('live_schedule.admin_id', $admin_id);

		if (!empty($search)) {
			$this->db->like('users.username', $search);
			$this->db->or_like('live_schedule.user_id', $search);
		}

		$query = $this->db->get();

		if ($query->num_rows() > 0) {
			return $query->num_rows();
		}

		return 0;
	}
}

Anon7 - 2021