示例#1
0
 public function action_deptosinteres2()
 {
     $vista = 'empresas/departamentos_interes';
     if (isset($_POST['guardar']) and $_POST['guardar'] == "Guardar Seleccionados") {
         //print_r($_POST);
         if (!empty($_POST['reg'])) {
             $registros = array_keys($_POST['reg']);
             $registros = implode(",", $registros);
             $registros = explode(",", $registros);
             //print_r($registros);
             //print_r($_POST['ide']);
             $modeldeptosinteres = new Model_Departamentosinteres();
             $modeldeptosinteres->guardardeptosinteres2($registros, $_POST['ide']);
         } else {
             echo '<script>alert("Eliga al menos un departamento.");</script>';
         }
     }
     $this->template->title .= 'Departamentos de Interes para la Empresa';
     $this->template->descripcion = '';
     $this->template->styles = array('media/jqwidgets/styles/jqx.darkblue.css' => 'all', 'media/jqwidgets/styles/jqx.office.css' => 'all', 'media/jqwidgets/styles/jqx.base.css' => 'all');
     $tiposi = 'si';
     $user = $this->user;
     $idu = $this->user->id;
     $oEmpresas = new Model_Consultores();
     $resultDatos = $oEmpresas->datosconsultor2($this->user->username);
     $resultDatos = $resultDatos[0];
     $this->template->content = View::factory($vista)->bind('user', $user)->bind('ide', $resultDatos['id'])->bind('consultor', $tiposi)->bind('idu', $idu);
 }
示例#2
0
 public function action_guardarcalificacion()
 {
     $ide = $_POST['ide'];
     $session = Session::instance();
     $user = $session->get('auth_user');
     if ($_POST['idclasificacion'] == '1') {
         $oempresas = new Model_Empresas();
         $result = $oempresas->verificahabilitado($ide);
     } elseif ($_POST['idclasificacion'] == '3') {
         $oconsultor = new Model_Consultores();
         $result = $oconsultor->verifyestado($ide);
     }
     $oempresas = new Model_Empresas();
     $result = $oempresas->verificahabilitado($ide);
     if ($result == "ok") {
         $calificaciones = ORM::factory('calificaciones');
         $calificaciones->id_empresa = $ide;
         $calificaciones->id_user = $user->id;
         $calificaciones->calificacion = $_POST['calificacion'];
         $calificaciones->comentario = $_POST['comentario'];
         $calificaciones->fecha_registro = date('Y-m-d H:i:s');
         $calificaciones->id_clasificacion = $_POST['idclasificacion'];
         $calificaciones->save();
         echo json_encode(1);
     } else {
         echo json_encode(3);
     }
 }
示例#3
0
 public function action_registroexitoso2($idvery)
 {
     //$encrypt = Encrypt::instance('tripledes');
     //$decrypt = $encrypt->decode($idvery);
     //$decryptO = $this->decrypt($idvery,"a9hcSLRvA3LkFc7EJgxXIKQuz1ec91J7P6WNq1IaxMZp4CTj5m31gZLARLxI1jD");
     //list ( $decrypt,$cuerpo) = explode ( "#",$decryptO);
     $oConsultores = new Model_Consultores();
     $resultVery = $oConsultores->veryficarcodigo($idvery);
     $resultVery = $resultVery[0];
     if ($resultVery['resultado'] == 1) {
         $resultVeryco = $oConsultores->veryficarcorreo($resultVery['mail']);
         $resultVeryco = $resultVeryco[0];
         if ($resultVeryco['resultado'] > 1) {
             $mensaje = utf8_encode("Error: Ya existe este correo registrado. Comuníquese con nosotros a los números de la Pagina web <a href='http://www.aevivienda.gob.bo'>www.aevivienda.gob.bo</a> o envíenos un correo a info@aevivienda.gob.bo");
         } else {
             //$mensaje="En breve se le procedera a enviar los datos necesarios para acceder al Sistema de Registro de Empresas.";
             $mensaje = "Estos son los datos para ingresar al sistema, complete toda la informacion solicitada e imprima su Certificado de Habilitacion. Tambien le enviaremos un email con estos datos de acceso al sistema.";
             $contraseña = mt_rand(1999, 9999);
             $auth = Auth::instance();
             $password = $auth->hash_password($contraseña);
             $user = ORM::factory('users');
             $user->username = $resultVery['mail'];
             $user->password = $password;
             $user->nombre = $resultVery['nombre_completo'];
             $user->email = $resultVery['mail'];
             $user->nivel = 7;
             $user->save();
             // ----------------- registro de la tabla 'roles_users'
             $u = ORM::factory('user', $user->id);
             $u->add('roles', 1);
             $consultores = ORM::factory('consultores', $resultVery['id']);
             $consultores->user_id = $user->id;
             $consultores->estado = 2;
             $consultores->save();
             $destinatario = $resultVery['mail'];
             $asunto = "Datos para el ingreso al sistema de la AEVIVIENDA";
             $cuerpo = '
             <p>Datos para el ingreso al sistema de la AEVIVIENDA</p>
             <table style="width: 813px; height: 240px;" border="0">
             <tbody>
             <tr>
             <td><span style="font-family: arial,helvetica,sans-serif; font-size: large;">Se&ntilde;ores:</span></td>
             <td>&nbsp;</td>
             </tr>
             <tr>
             <td><span style="color: #0000ff;"><strong><span style="font-size: large;"><span style="font-family: arial,helvetica,sans-serif;">' . $resultVery['nombre_completo'] . '</span>:</span></strong></span></td>
             <td>&nbsp;</td>
             </tr>
             <tr class="tablerow1">
             <td style="text-align: justify;">
             <p><span style="font-family: arial,helvetica,sans-serif; font-size: large;">Su verificaci&oacute;n fue exitosa, su usuario y contrase&ntilde;a son los siguientes:</span></p>
             <p><span style="background-color: #ffffff; font-size: x-large;"><strong><span style="color: #993300;">Usuario</span></strong> : ' . $resultVery['mail'] . '</span></p>
             <p><span style="background-color: #ffffff; font-size: x-large;"><strong><span style="color: #993300;">Contrase&ntilde;a</span></strong>: ' . $contraseña . '</span></p> 
             <p>&nbsp;</p>
             <p><span style="font-family: arial,helvetica,sans-serif; font-size: large;">Ingrese al Sistema para complementar sus datos, Direcci&oacute;n:<a href="http://entidad.aevivienda.gob.bo/registroempresas/selecciontipo/">http://entidad.aevivienda.gob.bo/registroempresas/selecciontipo/</a></span></p>
             <p>&nbsp;</p>
             <p>&nbsp;</p>
             <p>&nbsp;</p>
             <p><span style="text-decoration: underline;"><em><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Notificaci&oacute;n autom&aacute;tica generada por la Agencia Estatal de Vivienda.</span></em></span></p>
             </td>
             <td>&nbsp;</td>
             </tr>
             </tbody>
             </table>
             ';
             $headers = "MIME-Version: 1.0\r\n";
             $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
             $headers .= "From: Unidad de Sistemas <*****@*****.**>\r\n";
             //$headers .= "Reply-To: mmejia@aevivienda.gob.bo\r\n";
             //$headers .= "Return-path: obarreta@aevivienda.gob.bo\r\n";
             $headers .= "Cc: registro.entidad@aevivienda.gob.bo\r\n";
             mail($destinatario, $asunto, $cuerpo, $headers);
         }
     } else {
         $mensaje = utf8_encode("Hubo un problema en su verificación. Comuníquese con nosotros a los números de la Pagina web <a href='http://www.aevivienda.gob.bo'>www.aevivienda.gob.bo</a> o envíenos un correo a info@aevivienda.gob.bo.");
     }
     $vista = 'empresas/registro_exitoso';
     $this->template->title .= '::Confirmacion Registro de Consultor';
     $this->template->titulo = '';
     $this->template->descripcion = 'Detalle del Sistema';
     $this->template->content = View::factory($vista)->bind('resultado1', $idvery)->bind('resultado2', $decrypt)->bind('mensaje', $mensaje)->bind('usuario', $resultVery['mail'])->bind('contraseña', $contraseña);
 }
示例#4
0
 public function action_registrarproveedor($tipo)
 {
     $vista = 'proveedores/registro_proveedor';
     if (isset($_POST['guardar'])) {
         $emailuniq = $_POST['mail'];
         $oEmpresas = new Model_Empresas();
         $resp = $oEmpresas->emailrepetido($emailuniq);
         $oconsultores = new Model_Consultores();
         $resp1 = $oconsultores->emailrepetidoconsultor($emailuniq);
         if ($resp and $resp1) {
             $empresas = ORM::factory('empresas');
             $empresas->nombre_proponente = $_POST['nombre_proponente'];
             $empresas->pais = $_POST['pais'];
             if ($_POST['pais'] != 1) {
                 $empresas->ciudad = 10;
             } else {
                 $empresas->ciudad = $_POST['ciudad'];
             }
             $empresas->direccion = $_POST['direccion'];
             $empresas->nit = $_POST['nit'];
             list($dia, $mes, $anio) = explode("/", $_POST['nit_fecha_expedicion']);
             $fecha = $anio . "-" . $mes . "-" . $dia;
             $empresas->nit_fecha_expedicion = $fecha;
             $empresas->matricula = $_POST['matricula'];
             list($dia, $mes, $anio) = explode("/", $_POST['matricula_fecha_expedicion']);
             $fecha = $anio . "-" . $mes . "-" . $dia;
             $empresas->matricula_fecha_expedicion = $fecha;
             $empresas->paterno_representante = $_POST['paterno_representante'];
             $empresas->materno_representante = $_POST['materno_representante'];
             $empresas->nombres_representante = $_POST['nombres_representante'];
             $empresas->ci_representante = $_POST['ci_representante'];
             $empresas->ci_expedido = $_POST['ci_expedido'];
             $empresas->testimonio = $_POST['testimonio'];
             $empresas->testimonio_emision = $_POST['testimonio_emision'];
             list($dia, $mes, $anio) = explode("/", $_POST['testimonio_fecha_expedido']);
             $fecha = $anio . "-" . $mes . "-" . $dia;
             $empresas->testimonio_fecha_expedido = $fecha;
             $empresas->fax = $_POST['fax'];
             $empresas->telefonos = $_POST['telefonos'];
             $empresas->celular = $_POST['celular'];
             $empresas->mail = $_POST['mail'];
             $empresas->mail_opcional = $_POST['mail_opcional'];
             $empresas->estado = 1;
             $empresas->tipo = $tipo;
             $empresas->id_rubroarea = 17;
             $empresas->fecha_insert = date('Y-m-d H:m:i');
             $empresas->save();
             $passregistro = $this->encrypt($empresas->id . "#" . "a9hcSLRvA3LkFc7EJgxXIKQuz1ec91J7P6WNq1IaxMZp4CTj5m31gZLARLxI1jD", "a9hcSLRvA3LkFc7EJgxXIKQuz1ec91J7P6WNq1IaxMZp4CTj5m31gZLARLxI1jD");
             $destinatario = $_POST['mail'];
             $asunto = "Confirmación de registro de Entidad Ejecutora  - AEVIVIENDA";
             $cuerpo = '
                 <html>
                 <head>
                 <title>Confirmación de registro de Entidad Ejecutora  - AEVIVIENDA</title>
                 </head>
                 <body>
                 <table style="width: 813px; height: 240px;" border="0">
                 <tbody>
                 <tr>
                 <td><span style="font-family: arial,helvetica,sans-serif; font-size: large;">Se&ntilde;ores:</span></td>
                 <td>&nbsp;</td>
                 </tr>
                 <tr>
                 <td><strong><span style="font-size: large;"><span style="font-family: arial,helvetica,sans-serif;">' . $_POST['nombre_proponente'] . '</span>:</span></strong></td>
                 <td>&nbsp;</td>
                 </tr>
                 <tr>
                 <td style="text-align: justify;">
                 <p><span style="font-family: arial,helvetica,sans-serif; font-size: large;">Bienvenido a la Agencia Estatal de Vivienda</p>
                 <p><span style="font-family: arial,helvetica,sans-serif; font-size: large;">Para Finalizar el registro, ingrese al siguiente enlace ó copie el mismo en un navegador Web:</p> 
                 <p><span style="background-color: #ffffff;"><strong><a href="http://entidad.aevivienda.gob.bo/proveedores/registroexitoso/' . $passregistro . '">http://entidad.aevivienda.gob.bo/proveedores/registroexitoso/' . $passregistro . '</a></p>
                 <p><span style="background-color: #ffffff;">Por favor no responda a este mensaje. En caso de que se le presente alguna duda o inquietud, puede contactarnos a traves de la direccion electronica </span></strong></span>info@aevivienda.gob.bo<br /></span></p>
                 <p>&nbsp;</p>
                 <p>&nbsp;</p>
                 <p>&nbsp;</p>
                 <p>&nbsp;</p>
                 <p><span style="text-decoration: underline;"><em><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Notificaci&oacute;n autom&aacute;tica generada por la Agencia Estatal de Vivienda.</span></em></span></p>
                 </td>
                 <td>&nbsp;</td>
                 </tr>
                 </tbody>
                 </table>
                 </body>
                 </html>
                 ';
             $headers = "MIME-Version: 1.0\r\n";
             $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
             $headers .= "From: Unidad de Sistemas <*****@*****.**>\r\n";
             //$headers .= "Reply-To: mmejia@aevivienda.gob.bo\r\n";
             //$headers .= "Return-path: obarreta@aevivienda.gob.bo\r\n";
             $headers .= "Cc: registro.entidad@aevivienda.gob.bo\r\n";
             //mail($destinatario,$asunto,$cuerpo,$headers);
             //$this->request->redirect('proveedores/confirmaciones/'.$passregistro);
             //$this->request->redirect('proveedores/registroexitoso/'.$passregistro);
             $this->request->redirect('proveedores/registroexitoso/' . $empresas->id);
         } else {
             echo '<script>alert("La direccion de correo ya fue registrada.");</script>';
         }
     }
     $oPaises = ORM::factory('paises')->find_all();
     $paises = array();
     foreach ($oPaises as $p) {
         $paises[$p->id] = $p->pais;
     }
     $oCiudades = ORM::factory('ciudades')->find_all();
     $ciudades = array();
     foreach ($oCiudades as $d) {
         $ciudades[$d->id] = $d->ciudad;
     }
     $oDepartamentos = ORM::factory('departamentos')->find_all();
     $departamentos = array();
     foreach ($oDepartamentos as $d) {
         $departamentos[$d->id] = $d->departamento;
     }
     $this->template->title .= '::Registro de Proveedores';
     $this->template->titulo = '';
     $this->template->descripcion = 'Detalle del Sistema';
     $this->template->content = View::factory($vista)->bind('paises', $paises)->bind('departamentos', $departamentos)->bind('ciudades', $ciudades);
 }