<?php

include_once 'Clases/Oficina.php';
$oficina = new Oficina();
//Obtener el id_rep
//$emailRep = $_SESSION['login_user'];
//$result = $rep->obtenerPorEmail($emailRep);
//$result2 = $result->fetch_array(MYSQLI_ASSOC);
//Aqui se guarda el id del representante
//$id_repOfi = $result2['id_rep'];
// se guarda en una variable el resultado de la consulta
// de las oficinas registradas a las que representa
//$result = $oficina->obtenerOficinasRep($id_repOfi);
$result = $oficina->obtenerOficinas();
?>


                    <label>Oficinas</label>
                    <select class="form-control" name="oficina" width="25px" required>
                             <option value="0">Elija oficina</option>

                         <?php 
while ($row = $result->fetch_array(MYSQLI_ASSOC)) {
    ?>
               
                            <option value="<?php 
    echo $row['oficina_id'];
    ?>
"><?php 
    echo $row['nom_oficina'];
    ?>
<?php

include 'Clases/Representante.php';
include 'Clases/Oficina.php';
session_start();
//instancias de las clases icluidas
$rep = new Representante();
$oficina = new Oficina();
//Guardamos en una variable el id del representante
$oficinaId = $_GET['officeId'];
//Obtenemos los datos de la tabla oficina
$oficina->setIdOficina($oficinaId);
$result = $oficina->obtenerIndividual();
$ofiDatos = $result->fetch_array(MYSQLI_ASSOC);
?>

<!DOCTYPE html>
<html>


<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>Sanco Business Solution </title>
 
<script type="text/javascript">
//<![CDATA[
try{if (!window.CloudFlare) {var CloudFlare=[{verbose:0,p:0,byc:0,owlid:"cf",bag2:1,mirage2:0,oracle:0,paths:{cloudflare:"/cdn-cgi/nexp/dok2v=1613a3a185/"},atok:"48364bb7d9e1a568908376793f36680f",petok:"c6423c715a13ccffdf6ebc8c1ebe7d8a77e3c0fa-1417034632-1800",zone:"adbee.technology",rocket:"0",apps:{"ga_key":{"ua":"UA-49262924-2","ga_bs":"2"}}}];!function(a,b){a=document.createElement("script"),b=document.getElementsByTagName("script")[0],a.async=!0,a.src="../../ajax.cloudflare.com/cdn-cgi/nexp/dok2v%3d919620257c/cloudflare.min.js",b.parentNode.insertBefore(a,b)}()}}catch(e){};
//]]>
</script>
<?php

include_once 'Clases/Oficina.php';
$oficina = new Oficina();
//Obtener el id_rep
$emailRep = $_SESSION['login_user'];
$result = $rep->obtenerPorEmail($emailRep);
$result2 = $result->fetch_array(MYSQLI_ASSOC);
//Aqui se guarda el id del representante
$id_repOfi = $result2['id_rep'];
// se guarda en una variable el resultado de la consulta
// de las oficinas registradas a las que representa
$result = $oficina->obtenerOficinasRep($id_repOfi);
?>


                    <label>Oficina a Representar</label>
                    <select class="form-control" name="oficina" width="25px" required>
                             <option value="0">-- --</option>

                         <?php 
while ($row = $result->fetch_array(MYSQLI_ASSOC)) {
    ?>
               
                            <option value="<?php 
    echo $row['oficina_id'];
    ?>
"><?php 
    echo $row['nom_oficina'];
    ?>
</option>
<?php

include_once './Clases/Representante.php';
include_once './Clases/Oficina.php';
$rep = new Representante();
$office = new Oficina();
session_start();
$tipo_usuario = $rep->getUserType($_SESSION['login_user']);
$tipo2 = $tipo_usuario->fetch_array(MYSQLI_ASSOC);
//Obtenemos el id del representante
$repId = $rep->obtenerOfficeId($_SESSION['login_user']);
$repId = $repId->fetch_array(MYSQLI_ASSOC);
$repId = $repId['id_rep'];
//Registrar representante
$salesId = "";
$idOficina = "";
//echo"aquitoy";
if (isset($_POST['asignar'])) {
    // echo"aquitoy2";
    $salesId = $_POST['sales'];
    $idOficina = $_POST['oficina'];
    //$repId = $repId['id_rep'];
    // echo $salesId;
    // echo $idOficina;
    // echo $repId;
    $office->agregarSales($salesId, $idOficina);
    // $rep->agregarSalesOficina($idOficina,$salesId);
    ?>
<script>
    alert('Datos ingresados satisfactoriamente');
</script>
Пример #5
0
 if (isset($_REQUEST['option_editar'])) {
     $nombre_oficina = htmlentities($_POST['nombre_oficina_adm']);
     $siglas_oficina = htmlentities($_POST['siglas_oficina_adm']);
     //$region_oficina    = htmlentities($_POST['region']);
     //$estado_oficina    = htmlentities($_POST['estados_region']);
     $direccion_oficina = htmlentities($_POST['direccion']);
     //$nacionalidad_jefe = htmlentities($_POST['nacionalidad']);
     $cedula_jefe = htmlentities($_POST['id_ciu']);
     $protocolo_jefe = htmlentities($_POST['tratamiento_protocolario']);
     $nombre1_jefe = htmlentities($_POST['prinom']);
     $nombre2_jefe = htmlentities($_POST['segnom']);
     $apellido1_jefe = htmlentities($_POST['priape']);
     $apellido2_jefe = htmlentities($_POST['segape']);
     $numero_resolucion = htmlentities($_POST['resolucion']);
     $fecha_resolucion = htmlentities($_POST['fecha_resolucion']);
     $oficina = new Oficina();
     $jefe = new JefeOficina();
     //Datos de la Oficina
     $oficina->__SET('id_oficina', $siglas_oficina);
     $oficina->__SET('id_jefe', $cedula_jefe);
     //$oficina           ->__SET('id_region' , $region_oficina);
     //$oficina           ->__SET('id_estado' , $estado_oficina);
     $oficina->__SET('siglas', $siglas_oficina);
     $oficina->__SET('nombre', $nombre_oficina);
     $oficina->__SET('direccion', $direccion_oficina);
     //Datos del jefe de Oficina
     //$jefe              ->__SET('nacionalidad'          , $nacionalidad_jefe);
     $jefe->__SET('id_jefe', $cedula_jefe);
     $jefe->__SET('primer_nombre', $nombre1_jefe);
     $jefe->__SET('segundo_nombre', $nombre2_jefe);
     $jefe->__SET('primer_apellido', $apellido1_jefe);
<?php

include 'Clases/Representante.php';
include 'Clases/Oficina.php';
session_start();
//instancias de las clases icluidas
$rep = new Representante();
$oficina = new Oficina();
//Guardamos en una variable el id del representante
$idRep = $_GET['idRep'];
//Obtenemos los datos de la tabla representante
$result = $rep->obtenerIndividual($idRep);
$repDatos = $result->fetch_array(MYSQLI_ASSOC);
//Guardamos en variable el id de la oficina del representante
$officeId = $repDatos['oficina_id'];
//Guardamos en variable el email del representante
$repEmail = $repDatos['email_rep'];
//Guardamos la fecha de representante en formato correcto
$fechaRep = date('m-d-Y', strtotime($repDatos['fecha_rep']));
//Obtenemos los datos de la tabla oficina
$oficina->setIdOficina($officeId);
$resultOfi = $oficina->obtenerIndividual();
$ofiDatos = $resultOfi->fetch_array(MYSQLI_ASSOC);
?>

<!DOCTYPE html>
<html>


<head>
<meta charset="UTF-8"/>
Пример #7
0
 function form_agregar()
 {
     $this->form_validation->set_rules('tipo', 'Tipo', 'trim|required');
     $this->form_validation->set_rules('nombre', 'Nombre', 'trim|required');
     $this->form_validation->set_rules('direccion', 'Dirección', 'trim|required');
     $this->form_validation->set_rules('sector_codigo', 'Sector', 'trim|required');
     $this->form_validation->set_rules('servicio_codigo', 'Servicio', 'trim|required');
     $respuesta = new stdClass();
     if ($this->form_validation->run() == TRUE) {
         $oficina = new Oficina();
         $oficina->tipo = $this->input->post('tipo');
         $oficina->nombre = $this->input->post('nombre');
         $oficina->direccion = $this->input->post('direccion');
         $oficina->horario = $this->input->post('horario');
         $oficina->telefonos = $this->input->post('telefonos');
         $oficina->fax = $this->input->post('fax');
         $oficina->sector_codigo = $this->input->post('sector_codigo');
         $oficina->servicio_codigo = $this->input->post('servicio_codigo');
         $oficina->lat = $this->input->post('lat');
         $oficina->lng = $this->input->post('lng');
         $oficina->director = $this->input->post('director');
         $oficina->movil = $this->input->post('movil');
         $oficina->save();
         $this->session->set_flashdata('message', 'Oficina creada exitosamente! :)');
         $respuesta->validacion = TRUE;
         $respuesta->redirect = site_url('backend/oficinas/');
     } else {
         $respuesta->validacion = FALSE;
         $respuesta->errores = validation_errors('<p class="error">', '</p>');
     }
     echo json_encode($respuesta);
 }
Пример #8
0
						</thead>
						<tbody>
							<?php 
foreach ($Ordenes as $orden) {
    ?>
								<tr>
									<td><?php 
    echo ($orden->id < 10 ? "000" : ($orden->id < 100 ? "00" : ($orden->id < 1000 ? "0" : ""))) . $orden->id;
    ?>
</td>
									<td><?php 
    echo date("Ymd", strtotime($orden->fechaSol)) . "-" . ($orden->idSolicitud < 10 ? "000" : ($orden->idSolicitud < 100 ? "00" : ($orden->idSolicitud < 1000 ? "0" : ""))) . $orden->idSolicitud;
    ?>
</td>
									<td><?php 
    echo Oficina::getNombre($orden->asignado_a);
    ?>
</td>
									<td><?php 
    echo date("d/m/Y", strtotime($orden->fecha_realizado));
    ?>
</td>
									<td><?php 
    echo date("H:i:s", strtotime($orden->fecha_realizado));
    ?>
</td>
									<td>
										<a href="<?php 
    echo Yii::app()->createUrl('orden/view', array('id' => $orden->id));
    ?>
" class="hidden-xs hidden-sm btn btn-sm btn-success">Ver</a>
<?php

error_reporting(0);
include 'Clases/Oficina.php';
include 'Clases/Representante.php';
require_once "../ClassesExcel/PHPExcel.php";
require_once "../ClassesExcel/PHPExcel/Reader/Excel2007.php";
//Objeto
$oficina = new Oficina();
$representante = new Representante();
session_start();
///para imprimier los reportes
$objReader = new PHPExcel_Reader_Excel2007();
//creamos objeto para leer del excel
$objPHPExcel = $objReader->load("../filesReports/template.xlsx");
$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
//obj
$i = 10;
// inicia a imprimir archivo excel
date_default_timezone_set('America/Los_Angeles');
// Uso horario
$date = date("d-m-Y-Hi");
// fecha y hora para adjuntar al archivo excel
$tipo_usuario = $representante->getUserType($_SESSION['login_user']);
$tipo2 = $tipo_usuario->fetch_array(MYSQLI_ASSOC);
//Variables
$idOficina = "";
$nomOfi = "";
$calleOfi = "";
$numOfi = "";
$ciudadOfi = "";