$generalListCertificateModalTable6Title = array("Int Desc.", "Int Carr.", "Nac Desc.", "Nac Carr.");
         $generalListCertificateModalTable7Title = array("Tipo", "Modelo", "Mac", "Localização", "Loc. Aceita", "Estado");
         break;
     default:
         $generalListCertificateModalTable1Title = array("Visit type", "Created cert. date", "Technical id", "Email client", "Service plan", "CPE type", "CPE model", "CPE mac", "Housing type", "CPE location", "Accept location proposal", "Observation", "Wifi own", "Certificate state", "Active cert. date", "Receptor name", "Relationship", "Floor", "Technical order");
         $generalListCertificateModalTable3Title = array("Location", "Nat up.", "Nat down.", "Int up.", "Int down.", "Signal");
         $generalListCertificateModalTable4Title = array("Spe", "Avg", "Tim", "Siz", "Tlo", "Tco", "Tpr", "Tst", "Url");
         $generalListCertificateModalTable5Title = array("Avg", "Max", "Min", "Jit", "Los", "Rec", "Snd", "Url");
         $generalListCertificateModalTable6Title = array("Int down.", "Int up.", "Nat down.", "Nat up.");
         $generalListCertificateModalTable7Title = array("Type", "Model", "Mac", "Location", "Loc accept", "Status");
         break;
 }
 $i = populateTableCells($objPHPExcel, 3, $generalListCertificateModalTable1Title, $generalListCertificateModalTable1Content, 0, PHPExcel_Cell::stringFromColumnIndex($x), PHPExcel_Cell::stringFromColumnIndex($x + 1));
 $objPHPExcel->getActiveSheet()->getStyle(PHPExcel_Cell::stringFromColumnIndex($x) . "3:" . PHPExcel_Cell::stringFromColumnIndex($x) . ($i - 1))->applyFromArray(getPropertiesLateralLeftText());
 if (count($value["Pruebas_ST"]) > 0) {
     $Pruebas_ST = getArrayObjectPruebas_ST($value["Pruebas_ST"][0]);
     $generalListCertificateModalTable2Title = array("Ubicación cpe", "Nacional subida", "Nacional descarga", "Internacional subida", "Internacional descarga");
     // traduccion lenguaje
     switch ($_POST["language"]) {
         case 'en':
             $generalListCertificateModalTable2Title = array("CPE location", "National upload", "National download", "International upload", "International download");
             break;
         case 'pt_BR':
             $generalListCertificateModalTable2Title = array("Localização CPE", "Nac Carr.", "Nac Desc.", "Int Carr.", "Int Desc.");
             break;
         default:
             $generalListCertificateModalTable2Title = array("CPE location", "National upload", "National download", "International upload", "International download");
             break;
     }
     $generalListCertificateModalTable2Content = array($CPE[4], $Pruebas_ST[0], $Pruebas_ST[1], $Pruebas_ST[2], $Pruebas_ST[3]);
     $start = PHPExcel_Cell::stringFromColumnIndex($x) . ($i + 1);
        }
    }
}
function excelCreateNewSheet($objPHPExcel, $nameSheet)
{
    $objPHPExcel->createSheet();
    $objPHPExcel->setActiveSheetIndex(1);
    $objPHPExcel->getActiveSheet()->setTitle("hla");
}
if (checkExistPostVariable($data)) {
    $data = getDecodeJsonObject($data);
    $id = getObjectKeyExist($data["_id"]) ? $data["_id"] : null;
    $Extensores = getObjectKeyExist($data["Extensores"]) ? getArrayObjectExtensores($data["Extensores"]) : false;
    $Pruebas_Wifi = getObjectKeyExist($data["Pruebas_Wifi"]) ? $data["Pruebas_Wifi"] : null;
    // si el tamaño es mayor a cero entonces hay prueba st, en caso de que no halla se le asignara un valor false
    $Pruebas_ST = getArrayObjectPruebas_ST($data["Pruebas_ST"][0]);
    $CPE = getArrayObjectCPE($data["CPE"][0]);
    $Locaciones = getArrayObjectLocaciones($data["Locaciones"][0]["habitaciones"]);
    $General = getArrayObjectGeneral($data["General"][0]);
    $WifiCertificateFrequency24 = getArrayObjectWifiCertificateFrequency($data["Pruebas_Wifi"][0]["habitacion"], 2.4);
    $WifiCertificateFrequency5 = getArrayObjectWifiCertificateFrequency($data["Pruebas_Wifi"][0]["habitacion"], 5);
} else {
    echo "no existo";
}
$generalListCertificateTitles = array("Detalle certificado", "Speedtest cpe cableado", "Habitaciones", "Certificados wifi a frecuencia 2.4 Ghz", "Certificados wifi a frecuencia 5 Ghz", "Especificaciones extensores instalados");
$generalListCertificateSheetWifiTitles = array("Prueba Descarga", "Prueba Ping", "Dispositivos en la red", "Prueba Speedtest", "Redes Visibles", "Datos Prueba");
switch ($_POST["language"]) {
    case 'en':
        $generalListCertificateTitles = array("Certificates details", "Speed test cpe wiring", "Rooms", "Certificates 2.4GHz wireless frequency", "Certificates 5GHz wireless frequency", "Specifications extenders installed");
        $generalListCertificateSheetWifiTitles = array("Download test ", "Ping test ", "Sniffer ", "Speed test ", "Wi-Fi network available ", "Test data");
        break;
 $data = getPostValues($data);
 $language = $_POST["language"];
 loadExcel();
 $objPHPExcel = new PHPExcel();
 setDocumentProperties($objPHPExcel);
 //START construir contenido del archivo
 setOrientationSizeScalingPage($objPHPExcel);
 foreach ($data as $index => $valor) {
     // ecuacion para calcular el salto de números de filas
     $rowContent = ($index + 1) * 3 - 1;
     // ecuacion para determinar el número de fila correspondiente al titulo
     $rowTitle = $rowContent - 1;
     $General = getArrayObjectGeneral($valor["General"][0], $language);
     $CPE = getArrayObjectCPE($valor["CPE"][0], $language);
     $Locaciones = getArrayObjectLocaciones($valor["Locaciones"][0]["habitaciones"], $language);
     $Pruebas_ST = count($valor["Pruebas_ST"]) > 0 ? getArrayObjectPruebas_ST($valor["Pruebas_ST"][0], $language) : "";
     $generalListCertificateModalTable1Content = array($visitType[$General[5]][$language], $General[7], $General[2], $General[3], $General[10], $CPE[0], $CPE[1], $CPE[2], $housingType[$valor["Locaciones"][0]["tipo_vivienda"]][$language], $CPE[4], $wifiExistAndOwnWifi[$CPE[5]][$language], $CPE[6], $wifiExistAndOwnWifi[$General[8]][$language], $statusCertificate[$General[4]][$language], $General[9], $General[13], $General[14], $General[15], $General[16]);
     if (count($valor["Pruebas_ST"]) > 0) {
         $generalListCertificateModalTable2Content = array($CPE[4], $Pruebas_ST[0], $Pruebas_ST[1], $Pruebas_ST[2], $Pruebas_ST[3]);
     }
     /*  fecha emision y Id tecnico*/
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A' . $rowTitle, $generalListCertificateCreatedCcertTechnicalId[$language])->setCellValue('A' . $rowContent, $General[7] . ' ' . $General[2]);
     /* Q hab frec 2,4 */
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('B' . $rowTitle, $generalListCertificateRoomFrequency24[$language])->setCellValue('B' . $rowContent, sizeQuantyCertificatesByFrequency($valor, '2.4'));
     /* Q hab frec 5 */
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('C' . $rowTitle, $generalListCertificateRoomFrequency5[$language])->setCellValue('C' . $rowContent, sizeQuantyCertificatesByFrequency($valor, '5'));
     /* Detalle certificado correspondiente al id cliente */
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('E' . $rowTitle, $generalListCertificateTitles[$language][0] . ' ' . $General[1]);
     $positionColumn = generateCertificateGeneralData($objPHPExcel, "F", $rowTitle, $generalListCertificateModalTable1Content, $generalListCertificateModalTable1Title);
     if (count($valor["Pruebas_ST"]) > 0) {
         /* Speedtest Cableado */