-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbcn_UnidNegocios.php
124 lines (116 loc) · 3.65 KB
/
bcn_UnidNegocios.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
<?php
$idunidad = formData("id{$_modulo}","post",0);//"id";
if ($accionBCN!="Mostrar{$menu}"){
$idBCN = formData("id{$_modulo}","post",0);
$disabled = false;
if ($idBCN>0){
$form_titulo = "Editar Unidad";
if ($accionBCN=="Ver{$modulo}"){ $form_titulo = "Ver {$modulo}"; $disabled = true; }
$where = array("idunidad" => $idBCN);
$res = $CONBCN->seleccionar($tabla,"*",$where);
foreach ($res as $rs) {
$nombre = $rs->nombre;
$visible = $rs->visible;
$idplanta = $rs->idplanta;
}
} else {
$form_titulo = "Nuevo Unidad";
$name = "";
$objetivo = "";
$visible = 1;
}
?>
<div class="page-header">
<h1>
<?php echo $form_titulo; ?>
</h1>
</div><!-- /.page-header -->
<div class="row">
<div class="col-xs-12">
<div class="row">
<div id="div_left" class="col-sm-12">
<?php
//echo " ($idplanta)";
$CTRL->initForm($modulo,$idBCN);
$CTRL->inputHidden(array("ID"=>"descrip", "VALUE"=>$nombre));
$CTRL->inputHidden(array("ID"=>"idunidad", "VALUE"=>$idunidad));
?>
<div class="form-group">
<?php $CTRL->inputText(array("ID"=>"nombre", "VALUE"=>$nombre, "LABEL"=>"Nombre Unidad", "PLACEHOLDER"=>"Gerente", "REQUIRED"=>true, "DISABLED"=>$disabled )); ?>
</div>
<div class="form-group">
<?php $arr_tipo3 = traerDatosTipoArray("mdl_user_cat_planta","idplanta","name",array("visible" => 1));
$CTRL->select(array("ID"=>"idplanta", "VALUE"=>$idplanta, "LABEL"=>"Planta", "REQUIRED"=>true, "ITEMS"=>$arr_tipo3, "COL_FIELD" => 3, "DISABLED"=>$disabled ));?>
</div>
<div class="form-group">
<?php $CTRL->select(array("ID"=>"visible", "VALUE"=>$visible, "LABEL"=>"Visible", "REQUIRED"=>true, "ITEMS"=>array("1"=>"SI", "0"=>"NO"),"DISABLED"=>$disabled )); ?>
</div>
<?php
$CTRL->groupButtons($modulo,$accionBCN);
$CTRL->endForm();
?>
</div>
</div>
</div><!-- /.col -->
</div><!-- /.row -->
<?php } else { ?>
<div class="page-header">
<h1>
<?php echo formatTitle($descriptor); ?>
<small>
<i class="ace-icon fa fa-angle-double-right"></i>
Agregue un nueva Unidad o seleccione el que desee editar, eliminar
</small>
<?php $CTRL->newButton($modulo); ?>
</h1>
</div><!-- /.page-header -->
<div class="row">
<div class="col-xs-12">
<?php $CTRL->initForm($modulo,0,true); ?>
<table id="dynamic-table" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th width="10%">ID</th>
<th width="35%">Unidad</th>
<th width="35%">Planta</th>
<th width="10%">Visible</th>
<th>Opc.</th>
</tr>
</thead>
<tbody>
<?
$res = $CONBCN->seleccionar($tabla,"*","");
foreach ($res as $rs) {
?>
<tr>
<td ><?php echo $rs->idunidad; ?></td>
<td ><?php echo $rs->nombre; ?></td>
<?php
$tabla= "mdl_user_cat_planta";
$where = array("idplanta" => $rs->idplanta);
$res2 = $CONBCN->seleccionar($tabla,"*",$where);
$planta ="";
foreach ($res2 as $rs2) {
$planta = $rs2->name;
}
?>
<td ><?php echo $planta; ?></td>
<td>
<?php if ($rs->visible==1){ ?>
<span class="label label-sm label-success">SI</span>
<?php } else { ?>
<span class="label label-sm label-warning">NO</span>
<?php } ?>
</td>
<td><?php $CTRL->panelButtons($modulo,$rs->idunidad); ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<?php
}
?>