-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcancelar_ticket.php
143 lines (112 loc) · 4.32 KB
/
cancelar_ticket.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
//session_start();
//if(!isset($_SESSION)) { session_start(); }
require_once 'header.php';
error_reporting(E_ALL ^ E_WARNING);
require_once 'controllers/ControllerVentas.php';
$controller_Ventas = new ControllerVentas();
$nickname = $_SESSION['nickname'];
$id_user = $_SESSION['id_user'];
$tipo = $_SESSION['tipo'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>FIXCEL | Cancelación </title>
<link rel="shortcut icon" href="Images/login.png">
<!-- Bootstrap core CSS-->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom fonts for this template-->
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- Custom styles for this template-->
<link href="css/sb-admin.css" rel="stylesheet">
<!--ALERT -->
<script src="dist_alert/sweetalert-dev.js"></script>
<link rel="stylesheet" href="dist_alert/sweetalert.css">
<script >
function alerta(title)
{
swal({
title: title,
timer: 1900,
showConfirmButton: false
});
// setTimeout(next, 1000);
}
function next()
{
location.href="cancelar_ticket.php";
}
</script>
</head>
<body class="fixed-nav sticky-footer bg-dark" id="page-top">
<?php
//MENU DE OPCIONES // NAVBAR
include("menu.php");
if( isset($_POST['cancelar']) )
{
echo '<input type="cancelar" disabled>';
$resultado = $controller_Ventas->cancelar_venta($_REQUEST['id_ticket'],$id_user,$_REQUEST['observacion']);
if($resultado == 1)
{
$msgCreateOK = "Ticket cancelado con Éxito!";
echo '<script>alerta("'.$msgCreateOK.'");</script>';
}
if($resultado == 0)
{
$msgCreateKO = "Error al cancelar el Ticket!";
echo '<script>alerta("'.$msgAccesoOK.'");</script>';
}
if($resultado == 3)
{
$msgCreateKO = "El ticket ya habia sido canselado";
echo '<script>alerta("'.$msgCreateKO.'");</script>';
}
}
?>
<div class="content-wrapper">
<div class="container-fluid">
<!-- inicia div de consulta-->
<center><div class="card-header"><h4> Cancelar Venta </h4></div></center>
<form action="cancelar_ticket.php" method="post" data-ajax="false">
<div class="form-group">
<center><label for="exampleInputPassword1">No.Ticket a cancelar:</label></center>
<input type="text" class="form-control" id="id_ticket" name="id_ticket" placeholder="Id del ticket" required>
<center><label for="exampleTextarea">Observación de la cancelación</label></center>
<textarea class="form-control" id="observacion" name="observacion" rows="3" required></textarea>
</div>
<center> <input type="submit" class="btn btn-danger" id="cancelar" name="cancelar" value="Cancelar Venta"> </center>
</form>
<hr class="my-4">
<!-- termina div de registro de usuarios-->
</div>
<!-- /.container-fluid-->
<!-- /.content-wrapper-->
<!--Footer y Modales-->
<?php
include ("footer.php");
include ("modales.php");
?>
<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top">
<i class="fa fa-angle-up"></i>
</a>
<!-- Bootstrap core JavaScript-->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom scripts for all pages-->
<script src="js/sb-admin.min.js"></script>
<!-- Custom scripts for this page-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</div>
<script >
</script>
</body>
</html>