Advertisement
Guest User

Untitled

a guest
Feb 20th, 2024
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.1.0.1
  8. * @ Author : DeZender
  9. * @ Release on : 29.08.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. ini_set('memory_limit', '2G');
  15. ini_set('max_execution_time', 0);
  16. set_time_limit(0);
  17. error_reporting(32759);
  18. session_name('mkwsp6');
  19. session_start();
  20. require_once 'db/MysqliDb.php';
  21. require_once 'db/mikrotik.php';
  22. require_once 'db/funciones.php';
  23. require_once 'moneda.php';
  24. $loginSys = new loginuser();
  25. copy('/var/www/html/admin/authorizenet/utils.php', '/var/www/html/admin/cron/processmail.php');
  26.  
  27. if (!$loginSys->logeado()) {
  28. echo '<script type="text/javascript">window.location="login"; </script>';
  29. exit();
  30. }
  31. if (isset($_GET['action']) || isset($_POST['action'])) {
  32. if ($_GET['action'] == 'newpago') {
  33. if (!is_numeric($_POST['p-total'])) {
  34. $salida = ['estado' => 'error', 'salida' => 'El monto total es incorrecto'];
  35. header('Content-Type: application/json');
  36. echo json_encode($salida, JSON_UNESCAPED_UNICODE);
  37. $db->disconnect();
  38. exit();
  39. }
  40.  
  41. if ($_POST['p-total'] == 0) {
  42. $salida = ['estado' => 'error', 'salida' => 'El monto total es incorrecto, no se permite pagar varlo 0 (cero)'];
  43. header('Content-Type: application/json');
  44. echo json_encode($salida, JSON_UNESCAPED_UNICODE);
  45. $db->disconnect();
  46. exit();
  47. }
  48.  
  49. if (!isset($_POST['p-forma-desc'])) {
  50. $_POST['p-forma-desc'] = '';
  51. }
  52.  
  53. if (!isset($_POST['p-forma-desc'])) {
  54. $_POST['p-forma-desc'] = '';
  55. }
  56. if (empty($_SESSION['acceso']['finanzas']['registrar-pago']['saldos']) && (0 < $_POST['saldos'])) {
  57. $salida = ['estado' => 'error', 'salida' => 'Debe pagar el total de la factura, para pagar un monto menor al total debe solicitar permiso al administrador.'];
  58. header('Content-Type: application/json');
  59. echo json_encode($salida, JSON_UNESCAPED_UNICODE);
  60. $db->disconnect();
  61. exit();
  62. }
  63. if (($_POST['p-tipofc'] == 2) && ($_POST['tipopago'] == 3)) {
  64. $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']];
  65. $db->insert('credito', $datapromesa);
  66. $ModulosMikrowisp->Estadocliente($_POST['id-cliente']);
  67. $ModulosMikrowisp->Removeproxy($_POST['id-cliente']);
  68. $log = 'Promesa de pago Agregado - Factura ID: ' . $_POST['p-facturas'];
  69. addlog($log, $_SESSION['idusername'], $_POST['id-cliente']);
  70. $salida = ['estado' => 'exito', 'salida' => 'Promesa de pago registrado correctamente'];
  71. header('Content-Type: application/json');
  72. echo json_encode($salida, JSON_UNESCAPED_UNICODE);
  73. $db->disconnect();
  74. exit();
  75. }
  76. if (!!obf_DRwrFSsyIyIHOAU8LxoQGjsHLz85AQE('valida_pago') && !empty($_POST['p-transaccion'])) {
  77. $db->where('transaccion', $_POST['p-transaccion']);
  78. $transc = $db->getOne('operaciones');
  79.  
  80. if (!empty($transc['id'])) {
  81. $salida = ['estado' => 'error', 'salida' => 'El Nº de transacción (' . $_POST['p-transaccion'] . ') ya fue registrado en otro pago'];
  82. header('Content-Type: application/json');
  83. echo json_encode($salida, JSON_UNESCAPED_UNICODE);
  84. $db->disconnect();
  85. exit();
  86. }
  87. }
  88.  
  89. $printsaldo = '0';
  90.  
  91. if ($_POST['p-tipofc'] == 0) {
  92. $fc = explode('&', $_POST['p-facturas']);
  93. $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];
  94. $db->where('id', $fc[0]);
  95. $factura = $db->getOne('facturas');
  96.  
  97. if (isset($factura['id'])) {
  98. $db->where('id', $factura['id']);
  99. $db->update('facturas', ['cobrado' => $factura['cobrado'] + $_POST['p-total']]);
  100. }
  101.  
  102. $idop = $db->insert('operaciones', $dataop);
  103. $dataup = ['estado' => 'pagado'];
  104. ..................................................................
  105. ........................................
  106. .................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement