function view()
 {
     $this->usuario = new tab_usuario();
     $rows = $this->usuario->dbselectByField("usu_id", $_SESSION['USU_ID']);
     $row = $rows[0];
     $this->registry->template->usu_id = $row->usu_id;
     $this->registry->template->usu_nombres = $row->usu_nombres;
     $this->registry->template->usu_apellidos = $row->usu_apellidos;
     $this->registry->template->usu_fono = $row->usu_fono;
     $this->registry->template->usu_email = $row->usu_email;
     $this->registry->template->usu_nro_item = $row->usu_nro_item;
     $this->registry->template->usu_login = $row->usu_login;
     $contenedor = new contenedor();
     $this->registry->template->listaContenedorUsuario = $contenedor->listaContenedorUsuario($_SESSION['USU_ID']);
     $this->menu = new menu();
     $this->liMenu = $this->menu->imprimirMenu(VAR1, $_SESSION['USU_ID']);
     $this->registry->template->men_titulo = $this->liMenu;
     $this->registry->template->titulo = "PERFIL DEL USUARIO";
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "update";
     $this->registry->template->PATH_EVENT_DIALOG = "updatePass";
     $this->registry->template->PATH_J = "jquery";
     $this->registry->template->GRID_SW = "true";
     $this->registry->template->FORM_SW = "";
     $this->registry->template->show('headerG');
     $this->registry->template->show('usuario/tab_perfil.tpl');
     $this->registry->template->show('footer');
 }
Exemple #2
0
 function instalar()
 {
     if (!$this->db->field_exists('crm', 'scli')) {
         $mSQL = 'ALTER TABLE `scli`  ADD COLUMN `crm` INT(15) UNSIGNED NULL DEFAULT NULL';
         var_dump($this->db->simple_query($mSQL));
     }
     $this->prefijo = 'crm_';
     contenedor::instalar();
 }
 function obtenerCon()
 {
     $contenedor = new contenedor();
     $res = $contenedor->selectCon(0, $_REQUEST['Usu_id']);
     echo $res;
 }
 function add()
 {
     $contenedor = new contenedor();
     $this->registry->template->con_id = "";
     $this->registry->template->tipo_contenedores = $contenedor->obtenerTiposContenedor("");
     $this->registry->template->con_codigo = "";
     $this->registry->template->con_codbs = "";
     $usuario = new usuario();
     $adm = $usuario->esAdm();
     if ($adm) {
         $sel_usu = '<select name="usu_id" id="usu_id" class="required">';
         $sel_usu .= '<option value="">(seleccionar)</option>';
         $sel_usu .= $usuario->obtenerSelect($_SESSION['USU_ID']);
         $sel_usu .= '</select>';
         $this->registry->template->usuario = $sel_usu;
     } else {
         $this->registry->template->usuario = $usuario->obtenerNombre($_SESSION['USU_ID']);
         $this->registry->template->usu_id = $_SESSION['USU_ID'];
     }
     $this->registry->template->adm = $adm;
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_CONTROLADOR = 'contenedor';
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "save";
     $this->registry->template->GRID_SW = "false";
     $this->registry->template->PATH_J = "jquery-1.4.1";
     $this->menu = new menu();
     $this->liMenu = $this->menu->imprimirMenu(VAR1, $_SESSION['USU_ID']);
     $this->registry->template->men_titulo = $this->liMenu;
     $this->registry->template->show('headerG');
     $this->registry->template->show('tab_contenedor.tpl');
     $this->registry->template->show('footer');
 }
Exemple #5
0
 function instalar()
 {
     $gsercampos = $this->db->list_fields('gser');
     if (!in_array('ordeni', $gsercampos)) {
         $mSQL = 'ALTER TABLE `gser`  ADD COLUMN `ordeni` INT(15) UNSIGNED NULL DEFAULT NULL AFTER `compra`';
         $this->db->simple_query($mSQL);
     }
     if (!$this->db->table_exists('itordi')) {
         $mSQL = "CREATE TABLE `itordi` (\n\t\t\t\t`numero` INT(15) UNSIGNED NOT NULL,\n\t\t\t\t`fecha` DATE NULL DEFAULT NULL,\n\t\t\t\t`codigo` CHAR(15) NULL DEFAULT NULL,\n\t\t\t\t`descrip` CHAR(45) NULL DEFAULT NULL,\n\t\t\t\t`cantidad` DECIMAL(10,3) NULL DEFAULT NULL,\n\t\t\t\t`costofob` DECIMAL(17,2) NULL DEFAULT NULL,\n\t\t\t\t`importefob` DECIMAL(17,2) NULL DEFAULT NULL,\n\t\t\t\t`gastosi` DECIMAL(17,2) NULL DEFAULT NULL,\n\t\t\t\t`costocif` DECIMAL(17,2) NULL DEFAULT NULL,\n\t\t\t\t`importecif` DECIMAL(17,2) NULL DEFAULT NULL,\n\t\t\t\t`importeciflocal` DECIMAL(17,2) NULL DEFAULT NULL COMMENT 'importe cif en moneda local',\n\t\t\t\t`importecifreal` DECIMAL(17,2) NULL DEFAULT NULL COMMENT 'importe cif en moneda local al cambio real',\n\t\t\t\t`codaran` CHAR(15) NULL DEFAULT NULL,\n\t\t\t\t`arancel` DECIMAL(7,2) NULL DEFAULT NULL,\n\t\t\t\t`montoaran` DECIMAL(17,2) NULL DEFAULT NULL,\n\t\t\t\t`gastosn` DECIMAL(17,2) NULL DEFAULT NULL,\n\t\t\t\t`costofinal` DECIMAL(17,2) NULL DEFAULT NULL,\n\t\t\t\t`importefinal` DECIMAL(17,2) NULL DEFAULT NULL,\n\t\t\t\t`costoreal` DECIMAL(17,2) NULL DEFAULT NULL COMMENT 'costo unitario al dolar real',\n\t\t\t\t`importereal` DECIMAL(17,2) NULL DEFAULT NULL COMMENT 'importe al dolar real',\n\t\t\t\t`participam` DECIMAL(9,6) NULL DEFAULT NULL,\n\t\t\t\t`participao` DECIMAL(9,6) NULL DEFAULT NULL,\n\t\t\t\t`arancif` DECIMAL(17,4) NULL DEFAULT '0.0000' COMMENT 'Monto del valor en base al cual se calcula el motoaran',\n\t\t\t\t`iva` DECIMAL(17,2) NULL DEFAULT NULL,\n\t\t\t\t`precio1` DECIMAL(15,2) NULL DEFAULT NULL,\n\t\t\t\t`precio2` DECIMAL(15,2) NULL DEFAULT NULL,\n\t\t\t\t`precio3` DECIMAL(15,2) NULL DEFAULT NULL,\n\t\t\t\t`precio4` DECIMAL(15,2) NULL DEFAULT NULL,\n\t\t\t\t`estampa` DATE NULL DEFAULT NULL,\n\t\t\t\t`hora` CHAR(8) NULL DEFAULT NULL,\n\t\t\t\t`usuario` CHAR(12) NULL DEFAULT NULL,\n\t\t\t\t`id` INT(20) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\t\tPRIMARY KEY (`id`),\n\t\t\t\tINDEX `numero` (`numero`)\n\t\t\t)\n\t\t\tCOLLATE='latin1_swedish_ci'\n\t\t\tENGINE=MyISAM\n\t\t\tROW_FORMAT=FIXED\n\t\t\tAUTO_INCREMENT=1";
         $this->db->simple_query($mSQL);
     }
     $itcampos = $this->db->list_fields('itordi');
     if (!in_array('importecifreal', $itcampos)) {
         $mSQL = "ALTER TABLE `itordi`  ADD COLUMN `importecifreal` DECIMAL(17,2) NULL DEFAULT NULL COMMENT 'importe cif en moneda local al cambio real' AFTER `importeciflocal`";
         $this->db->simple_query($mSQL);
     }
     if (!in_array('costoreal', $itcampos)) {
         $mSQL = "ALTER TABLE `itordi`  ADD COLUMN `costoreal` DECIMAL(17,2) NULL DEFAULT NULL COMMENT 'costo unitario al dolar real' AFTER `importefinal`,  ADD COLUMN `importereal` DECIMAL(17,2) NULL DEFAULT NULL COMMENT 'importe al dolar real' AFTER `costoreal`";
         $this->db->simple_query($mSQL);
     }
     if (!$this->db->table_exists('ordi')) {
         $mSQL = "CREATE TABLE `ordi` (\n\t\t\t\t`numero` INT(15) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\t\t`fecha` DATE NULL DEFAULT NULL,\n\t\t\t\t`status` CHAR(1) NOT NULL DEFAULT '' COMMENT 'Estatus de la Compra Abierto, Eliminado y Cerrado',\n\t\t\t\t`proveed` VARCHAR(5) NULL DEFAULT NULL COMMENT 'Proveedor',\n\t\t\t\t`nombre` VARCHAR(40) NULL DEFAULT NULL COMMENT 'Nombre del Proveedor',\n\t\t\t\t`agente` CHAR(5) NULL DEFAULT NULL COMMENT 'Agente Aduanal (Proveedor)',\n\t\t\t\t`nomage` VARCHAR(40) NULL DEFAULT NULL COMMENT 'Agente Aduanal (Proveedor)',\n\t\t\t\t`montofob` DECIMAL(19,2) NULL DEFAULT NULL COMMENT 'Total de la Factura extranjera',\n\t\t\t\t`gastosi` DECIMAL(19,2) NULL DEFAULT NULL COMMENT 'Gastos Internacionales (Fletes, Seguros, etc)',\n\t\t\t\t`montocif` DECIMAL(19,2) NULL DEFAULT NULL COMMENT 'Monto FOB+gastos Internacionales',\n\t\t\t\t`aranceles` DECIMAL(19,2) NULL DEFAULT NULL COMMENT 'Suma del Impuesto Arancelario',\n\t\t\t\t`gastosn` DECIMAL(19,2) NULL DEFAULT NULL COMMENT 'Gastos Nacionales',\n\t\t\t\t`montotot` DECIMAL(19,2) NULL DEFAULT NULL COMMENT 'Monto CIF + Gastos Nacionales',\n\t\t\t\t`montoiva` DECIMAL(19,2) NULL DEFAULT NULL COMMENT 'Monto del IVA pagado',\n\t\t\t\t`montoexc` DECIMAL(12,2) NULL DEFAULT NULL,\n\t\t\t\t`arribo` DATE NULL DEFAULT NULL COMMENT 'Fecha de Llegada',\n\t\t\t\t`factura` VARCHAR(20) NULL DEFAULT NULL COMMENT 'Nro de Factura',\n\t\t\t\t`cambioofi` DECIMAL(17,2) NOT NULL DEFAULT '0.00' COMMENT 'Cambio Fiscal US\$ X Bs.',\n\t\t\t\t`cambioreal` DECIMAL(17,2) NOT NULL DEFAULT '0.00' COMMENT 'Cambio Efectivamente Aplicado',\n\t\t\t\t`peso` DECIMAL(12,2) NOT NULL DEFAULT '0.00' COMMENT 'Peso total',\n\t\t\t\t`condicion` TEXT NULL,\n\t\t\t\t`transac` VARCHAR(8) NOT NULL DEFAULT '',\n\t\t\t\t`estampa` DATE NOT NULL DEFAULT '0000-00-00',\n\t\t\t\t`usuario` VARCHAR(12) NOT NULL DEFAULT '',\n\t\t\t\t`hora` VARCHAR(8) NOT NULL DEFAULT '',\n\t\t\t\t`dua` CHAR(30) NULL DEFAULT NULL COMMENT 'DECLARACION UNICA ADUANAS',\n\t\t\t\t`cargoval` DECIMAL(19,2) NULL DEFAULT NULL COMMENT 'Diferencia Cambiara \$ oficial y aplicado',\n\t\t\t\t`control` VARCHAR(8) NULL DEFAULT NULL COMMENT 'Apuntador a la factura con la que se relaciono',\n\t\t\t\t`crm` INT(11) UNSIGNED NULL DEFAULT NULL COMMENT 'Apuntador al conetendor',\n\t\t\t\t`estimadif` DECIMAL(10,2) NULL DEFAULT '0' COMMENT 'Diferencia en la estimacion',\n\t\t\t\tPRIMARY KEY (`numero`)\n\t\t\t)\n\t\t\tCOLLATE='latin1_swedish_ci'\n\t\t\tENGINE=MyISAM\n\t\t\tROW_FORMAT=DYNAMIC\n\t\t\tAUTO_INCREMENT=1";
         $this->db->simple_query($mSQL);
     }
     $campos = $this->db->list_fields('ordi');
     if (!in_array('estimadif', $campos)) {
         $mSQL = "ALTER TABLE `ordi`ADD COLUMN `estimadif` DECIMAL(10,2) NULL DEFAULT '0' COMMENT 'Diferencia en la estimacion' AFTER `crm`";
         $this->db->simple_query($mSQL);
     }
     if (!$this->db->table_exists('ordiva')) {
         $mSQL = "CREATE TABLE `ordiva` (\n\t\t\t\t`id` INT(15) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\t\t`ordeni` INT(15) UNSIGNED NULL DEFAULT NULL,\n\t\t\t\t`tasa` DECIMAL(7,2) NULL DEFAULT NULL,\n\t\t\t\t`base` DECIMAL(10,2) NULL DEFAULT NULL,\n\t\t\t\t`montoiva` DECIMAL(10,2) NULL DEFAULT NULL,\n\t\t\t\t`concepto` VARCHAR(100) NULL DEFAULT NULL,\n\t\t\t\tPRIMARY KEY (`id`),\n\t\t\t\tUNIQUE INDEX `ordi` (`ordeni`, `tasa`)\n\t\t\t)\n\t\t\tCOLLATE='latin1_swedish_ci'\n\t\t\tENGINE=MyISAM\n\t\t\tROW_FORMAT=DEFAULT\n\t\t\tAUTO_INCREMENT=1";
         $this->db->simple_query($mSQL);
     }
     if (!$this->db->table_exists('gseri')) {
         $mSQL = "CREATE TABLE `gseri` (\n\t\t\t`ordeni` INT(15) UNSIGNED NOT NULL,\n\t\t\t`fecha` DATE NOT NULL DEFAULT '0000-00-00',\n\t\t\t`numero` VARCHAR(8) NOT NULL DEFAULT '',\n\t\t\t`concepto` VARCHAR(40) NULL DEFAULT NULL,\n\t\t\t`monto` DECIMAL(19,2) NULL DEFAULT NULL,\n\t\t\t\t`proveed` VARCHAR(5) NULL DEFAULT '',\n\t\t\t\t`nombre` VARCHAR(30) NULL DEFAULT '',\n\t\t\t\t`usuario` VARCHAR(12) NULL DEFAULT NULL,\n\t\t\t\t`estampa` DATE NULL DEFAULT NULL,\n\t\t\t\t`hora` VARCHAR(8) NULL DEFAULT NULL,\n\t\t\t\t`id` INT(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\tPRIMARY KEY (`id`)\n\t\t\t)\n\t\t\tCOLLATE='latin1_swedish_ci'\n\t\t\tENGINE=MyISAM\n\t\t\tROW_FORMAT=DYNAMIC\n\t\t\tAUTO_INCREMENT=1";
         $this->db->simple_query($mSQL);
     }
     if (!$this->db->table_exists('ordiestima')) {
         $mSQL = "CREATE TABLE `ordiestima` (\n\t\t\t\t`id` INT(15) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\t\t`ordeni` INT(15) UNSIGNED NULL DEFAULT NULL,\n\t\t\t\t`monto` DECIMAL(10,2) NULL DEFAULT NULL,\n\t\t\t\t`concepto` VARCHAR(100) NULL DEFAULT NULL,\n\t\t\t\tPRIMARY KEY (`id`),\n\t\t\t\tINDEX `ordi` (`ordeni`)\n\t\t\t)\n\t\t\tCOLLATE='latin1_swedish_ci'\n\t\t\tENGINE=MyISAM\n\t\t\tROW_FORMAT=DEFAULT";
         $this->db->simple_query($mSQL);
     }
     $this->prefijo = 'crm_';
     contenedor::instalar();
 }