<?php require "config/db_ivr.conf.php"; require "servicio/Conexion.class.php"; require "modelo/empresa.class.php"; $obj_empresa = new Empresa(); $obj_empresa->conectar(); ?> <aside class="right-side"> <section class="content-header"> <h1> Empresa </h1> </section> <section class="content"> <div class="row"> <div class="col-xs-12"> <a class="btn btn-primary btn-block" href="./?vista=new_empresa">Nuevo</a> <hr> <div class="box box-primary"> <div class="box-header"> <h3 class="box-title">Registros</h3> <div class="box-tools"> <div class="input-group"> <input type="text" id="table_search" class="form-control input-sm pull-right" style="width: 220px;" placeholder="Buscar ..." /> <div class="input-group-btn"> <button class="btn btn-sm btn-default"><i class="fa fa-search"></i></button> </div> </div> </div>
<?php require "../config/db_ivr.conf.php"; require "../servicio/Conexion.class.php"; require "../modelo/empresa.class.php"; $obj_empresa = new Empresa(); if ($obj_empresa->conectar()) { $operacion = (int) $_REQUEST['tipo_operacion']; $nombre_empresa = (string) $_REQUEST['txtEmpresa']; $direccion = (string) $_REQUEST['txtDireccion']; $telefono_1 = (string) $_REQUEST['txtTelefono_1']; $telefono_2 = (string) $_REQUEST['txtTelefono_2']; $email = (string) $_REQUEST['txtEmail']; $website = (string) $_REQUEST['txtWebsite']; if ($operacion == 1) { $activo = (bool) 1; } else { $activo = (bool) $_REQUEST['chk_activo']; } $telefono_1 = str_replace("-", "", $telefono_1); $telefono_2 = str_replace("-", "", $telefono_2); $array_info = array($nombre_empresa, $direccion, $telefono_1, $telefono_2, $email, $website, $activo); if ($operacion == 1) { //INSERTAR $bandera = $obj_empresa->new_empresa($array_info); } elseif ($operacion == 2) { //MODIFICAR $bandera = $obj_empresa->update_empresa($_REQUEST["id_empresa"], $array_info); } elseif ($operacion == 3) { //ELIMINAR $bandera = $obj_empresa->delete_empresa($_REQUEST["id_empresa"]);