-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathtickets.php
123 lines (111 loc) · 4.6 KB
/
tickets.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
<?php
$title ="Tickets | ";
include "head.php";
include "sidebar.php";
?>
<div class="right_col" role="main"><!-- page content -->
<div class="">
<div class="page-title">
<div class="clearfix"></div>
<div class="col-md-12 col-sm-12 col-xs-12">
<?php
include("modal/new_ticket.php");
include("modal/upd_ticket.php");
?>
<div class="x_panel">
<div class="x_title">
<h2>Gastos</h2>
<ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
</li>
<li><a class="close-link"><i class="fa fa-close"></i></a>
</li>
</ul>
<div class="clearfix"></div>
</div>
<!-- form seach -->
<form class="form-horizontal" role="form" id="gastos">
<div class="form-group row">
<label for="q" class="col-md-2 control-label">Nombre/Asunto</label>
<div class="col-md-4">
<input type="text" class="form-control" id="q" placeholder="Nombre del ticket" onkeyup='load(1);'>
</div>
<div class="col-md-3">
<button type="button" class="btn btn-default" onclick='load(1);'>
<span class="glyphicon glyphicon-search" ></span> Buscar</button>
<span id="loader"></span>
</div>
</div>
</form>
<!-- end form seach -->
<div class="x_content">
<div class="table-responsive">
<!-- ajax -->
<div id="resultados"></div><!-- Carga los datos ajax -->
<div class='outer_div'></div><!-- Carga los datos ajax -->
<!-- /ajax -->
</div>
</div>
</div>
</div>
</div>
</div>
</div><!-- /page content -->
<?php include "footer.php" ?>
<script type="text/javascript" src="js/ticket.js"></script>
<script type="text/javascript" src="js/VentanaCentrada.js"></script>
<script>
$("#add").submit(function(event) {
$('#save_data').attr("disabled", true);
var parametros = $(this).serialize();
$.ajax({
type: "POST",
url: "action/addticket.php",
data: parametros,
beforeSend: function(objeto){
$("#result").html("Mensaje: Cargando...");
},
success: function(datos){
$("#result").html(datos);
$('#save_data').attr("disabled", false);
load(1);
}
});
event.preventDefault();
})
$( "#upd" ).submit(function( event ) {
$('#upd_data').attr("disabled", true);
var parametros = $(this).serialize();
$.ajax({
type: "POST",
url: "action/updticket.php",
data: parametros,
beforeSend: function(objeto){
$("#result2").html("Mensaje: Cargando...");
},
success: function(datos){
$("#result2").html(datos);
$('#upd_data').attr("disabled", false);
load(1);
}
});
event.preventDefault();
})
function obtener_datos(id){
var description = $("#description"+id).val();
var title = $("#title"+id).val();
var kind_id = $("#kind_id"+id).val();
var project_id = $("#project_id"+id).val();
var category_id = $("#category_id"+id).val();
var priority_id = $("#priority_id"+id).val();
var status_id = $("#status_id"+id).val();
$("#mod_id").val(id);
$("#mod_title").val(title);
$("#mod_description").val(description);
$("#mod_kind_id").val(kind_id);
$("#mod_project_id").val(project_id);
$("#mod_category_id").val(category_id);
$("#mod_priority_id").val(priority_id);
$("#mod_status_id").val(status_id);
}
</script>