-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform_salida.php
More file actions
205 lines (151 loc) · 6.47 KB
/
form_salida.php
File metadata and controls
205 lines (151 loc) · 6.47 KB
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<?php
require_once("funciones.php");
if(!permiso($perfil,"realizar_envio")){
echo "Permisos insuficientes";
exit;
}
Mostrar();
exit;
// *******************************************************************************
// *******************************************************************************
function mostrar(){
global $perfil,$userid;
global $mysqli_link;
global $mensaje, $mensajeok;
global $googleEmail,$googleImage,$googleName;
include("header.inc.php");
?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Formulario de Envío</h1>
</div>
<div class="col-sm-6">
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<section class="content">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<?php
if(isset($mensaje)){
echo '<div class="alert alert-danger alert-dismissable divider shake wow" id="alert" data-wow-duration="2s" >
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<p><i class="fa fa-ban"></i> '.$mensaje.'</p>
</div>';
}
if(isset($mensajeok)){
echo '<div class="alert alert-success alert-dismissable divider shake wow" id="alert" data-wow-duration="2s" >
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<p><i class="fa fa-check"></i> '.$mensajeok.'</p>
</div>';
}
?>
<form role="form" action="index.php" method="post">
<div class="card-body">
<div class="form-group">
<label>Destinatario:</label>
<div class="input-group">
<div class="input-group-prepend">
<select class="custom-select" name="destinatario" id="destinatario" required>
<?php
if($perfil>0){
// muestra todos los perfiles
$sql = "select id,
if ( nombre != '' ,concat(nombre,' ',apellido,' (',telegram,')'),
email)
from users order by nombre";
}else{
// solo perfiles > 0
$sql = "select id,
if ( nombre != '' ,concat(nombre,' ',apellido,' (',telegram,')'),
email)
from users
where perfil > 0
order by nombre";
}
$Result = mysqli_query($mysqli_link,$sql);
while( $Reg = mysqli_fetch_row($Result) ) {
echo "<option value='".$Reg[0]."'>".$Reg[1]."</option>";
}
?>
</select>
</div>
</div>
</div>
<div class="form-group">
<label>Insumo:</label>
<div class="input-group">
<div class="input-group-prepend">
<select class="custom-select" name="insumo" id="insumo" required>
<?php
$sql = "select id,nombre from insumos where activo = '1' order by nombre";
$Result = mysqli_query($mysqli_link,$sql);
while( $Reg = mysqli_fetch_row($Result) ) {
echo "<option value='".$Reg[0]."'>".$Reg[1]."</option>";
}
?>
</select>
</div>
</div>
</div>
<div class="form-group">
<label for="nombre">Unidades</label>
<input type="text" name="unidades" class="form-control" id="unidades" placeholder="Unidades" required>
</div>
<div class="form-group">
<label for="nombre">Comentario</label>
<input type="text" name="comentario" class="form-control" id="comentario" placeholder="Comentario" >
</div>
</div>
<div class="card-footer">
<button type="submit" name="confirmar-salida" value="1" class="btn btn-primary">Confirmar</button>
</div>
</form>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
</div>
<!-- /.content-wrapper -->
<?php
include("footer.inc.php");
?>
<script src="AdminLTE/plugins/moment/moment.min.js"></script>
<script src="AdminLTE/plugins/inputmask/min/jquery.inputmask.bundle.min.js"></script>
<script src="AdminLTE/plugins/select2/js/select2.full.min.js"></script>
<script src="AdminLTE/plugins/bootstrap4-duallistbox/jquery.bootstrap-duallistbox.min.js"></script>
<script>
(function() {
'use strict';
window.addEventListener('load', function() {
var forms = document.getElementsByClassName('needs-validation');
var validation = Array.prototype.filter.call(forms, function(form) {
form.addEventListener('submit', function(event) {
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add('was-validated');
}, false);
});
}, false);
})();
</script>
</body>
</html>
<?php
}
?>