Exemple #1
0
 function anularPagoAlumno($rut, $trans_ID)
 {
     $mensualidades = $this->obtenerMensualidad($rut);
     $class_transaccion = new transaccion();
     $detalles = $class_transaccion->obtenerDetalleTransaccion($trans_ID);
     //dpr($mensualidades);
     //dpr($detalles);
     if (count($detalles) > 0) {
         foreach ($detalles as $det_ID => $det_datos) {
             if ($det_datos['det_cuota'] == "deuda") {
                 $pago_men[$det_datos['det_cuota']] = $mensualidades[$det_datos['det_cuota']] + $det_datos['det_monto'];
             } else {
                 $pago_men[$det_datos['det_cuota']] = $mensualidades[$det_datos['det_cuota']] - $det_datos['det_monto'];
             }
         }
     }
     DBBegin($this->dbh);
     DBSQLUpdate($pago_men, array("rut" => $rut), "mensualidades");
     $datos_anular['anu_usuario'] = $_SESSION['usuario']->login;
     $datos_anular['anu_fecha'] = date('Y-m-d');
     $datos_anular['anu_hora'] = date('H:i');
     $anu_ID = $class_transaccion->insertarAnulacion($datos_anular);
     $class_transaccion->eliminarHistorial($trans_ID);
     $class_transaccion->actualizarTransacciones(array("FK_anulaciones_anu_ID" => $anu_ID), array("trans_ID" => $trans_ID));
     DBCommit($this->dbh);
 }
Exemple #2
0
$class_mensualidad = new mensualidad();
$class_alumno = new alumno();
$class_transaccion = new transaccion();
$transacciones = $class_transaccion->obtenerTransacciones($rut);
$alumno = $class_alumno->obtenerAlumno($rut);
if ($_SESSION['token'] != $token) {
    session_destroy();
    moveLocation("../ingreso.php", 0, 2);
}
if (isset($_POST['trans'])) {
    foreach ($_POST['trans'] as $trans_ID => $datos) {
        $datos_historial['numboleta'] = $datos['trans_num_boleta'];
        $datos_historial['tipo'] = $datos['tipo'];
        if ($datos_historial['numboleta'] > 0) {
            $class_transaccion->actualizarHistorial($datos_historial, array('FK_transaccion_trans_ID' => $trans_ID));
            $class_transaccion->actualizarTransacciones(array("trans_num_boleta" => $datos['trans_num_boleta'], 'trans_tipo_pago' => $datos['tipo']), array('trans_ID' => $trans_ID));
        }
    }
    moveLocation("SEC-historial.php", 0, $rut, "rut");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <link rel="stylesheet" href="../jquery.tablesorter/css/jq.css" type="text/css" media="print, projection, screen" />
    <link rel="stylesheet" href="../jquery.tablesorter/themes/blue/style.css" type="text/css" id="" media="print, projection, screen" />
    <link rel="stylesheet" href="../css/main.css" type="text/css" id="" media="print, projection, screen" />
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Historial</title>
    <link href="../css/dock_menu.css" rel="stylesheet" type="text/css" />
</head>