//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"/>
<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">
<?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>
 $lat = $output->results[0]->geometry->location->lat;
 $long = $output->results[0]->geometry->location->lng;
 //debug de los valores
 //echo $idOficina."<br>";
 //echo $nomOfi."<br>";
 //echo $calleOfi."<br>";
 //echo $numOfi."<br>";
 //echo $ciudadOfi."<br>";
 //echo $cpOfi."<br>";
 //echo $estadoOfi."<br>";
 //echo $telOficina."<br>";
 //echo $faxOficina."<br>";
 //echo $website."<br>";
 //echo $lat."<br>";
 //echo $long;
 $oficina->setIdOficina($idOficina);
 $oficina->setNombre($nomOfi);
 $oficina->setCalle($calleOfi);
 $oficina->setNumero($numOfi);
 $oficina->setCiudad($ciudadOfi);
 $oficina->setEstado($estadoOfi);
 $oficina->setCP($cpOfi);
 //$oficina->setEmail($website);
 $oficina->setTel($telOficina);
 $oficina->setFax($faxOficina);
 $oficina->setWebsite($website);
 $oficina->setLat($lat);
 $oficina->setLon($long);
 $oficina->setRepId($repId);
 // $oficina->set
 $oficina->setFechaOficina($fecha);