Buenas les cuento en donde trabajo hay un problema con un sector del servidor todos los datos se descargan bien alli se maneja una data grande bueno , el problema surge cuando se va a descargar algo solo descarga 500 registros las descargas se hacen por conexión ssh les dejo el codigo para que lo revisen y me den una solución para resolver ese problema y gracias por la ayuda.
en el primer archivo
:::::::::::::::::::::::::::::::::::::::::::::::: si no encuentra problema en el primer archivo entonces sera en el segundo que esta el problema en este otro y con el que estamos trabajando buscando posibles errores pero nada siempre descarga solo los 500 registros y no lo logra descarga completo ...............
¿Si Alguien podria ayudar estaria agradecido gracias!?
<?php
function parseoDuvalPAOSAL_PAOPAOhtml($tabla, $tipo, $bd, $nivel, $optionals)
{
global $con,$conMaster,$Errors,$Download,$Parseo;
$optionals = json_decode(json_encode($optionals), false);
$show=0;
$totalInsert = 50;
// die();
$ruta = $_SERVER['DOCUMENT_ROOT'].'/spidersReloaded/download/psummary/florida/'.strtolower($tipo).'/'.$bd.'/';
if (is_dir($ruta)) {
$queryc='';
$queryd='';
$c=0;
$d=0;
echo PHP_EOL.' Inicio del Parseo '.date("H:i:s");
$results = '';
$dir_iterator = new RecursiveDirectoryIterator($ruta);
$iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::CHILD_FIRST);
//foreach (glob($ruta.'*.html') as $archivo) {
foreach ($iterator as $archivo) {
if (!preg_match('/\.$/', $archivo)) {
echo 'Archivo--> '.$archivo.PHP_EOL;
if (!$con->ping()) {
die('Conexion Closed By User');
}
$Var = array(
'parcelId'=>'','Xcode'=>'','CCode'=>'','CCodeD'=>'','address'=>'','assesedV'=>'',
'bath'=>'','beds'=>'','Hbath'=>'','bHeated'=>'','book'=>'','page'=>'','cfn'=>'',
'buildingV'=>'','landV'=>'','legal'=>'','saleDate'=>'','salePrice'=>'','SDName'=>'',
'taxableV'=>'','yearBuilt'=>'','ownerCountry'=>'','ownerCity2'=>'','posibleNewAddress'=>'',
'tSqft'=>'','lSqft'=>'','city'=>'','ownerName'=>'','ownerAddress'=>'','ownerCity'=>'',
'ownerState'=>'','ownerZip'=>'','zip'=>'','ffc'=>''
);
$htmlBase = $html = file_get_contents($archivo);
//echo 'HTML--> '.PHP_EOL.PHP_EOL.'HTML BASE ['.$htmlBase.']';
if ($html === false) {
echo PHP_EOL.'No se logro Obtener el Contenido del Archivo '.$archivo;
echo PHP_EOL.'Readfile => '.PHP_EOL.readfile($archivo).PHP_EOL;
echo PHP_EOL.'Intentando de Nuevo';
$htmlBase = $html = file_get_contents($archivo);
}
preg_match('/([\0]+)/i', $html, $aux);
array_shift($aux);
foreach ($aux as $key => $value) {
$html = str_replace($value, ' ', $html);
}
$html = str_replace('</TD>', '|</TD>', $html);
$html = str_replace('</td>', '|</td>', $html);
$html = str_replace('</TH>', '|</TH>', $html);
$html = str_replace('</th>', '|</th>', $html);
$html = str_replace('<br>', '|<br>', $html);
$html = str_replace('<BR>', '|<BR>', $html);
$contentTable = $Parseo->getXpathHtml($html, false);
/************ParcelID************/
$results = $Parseo->queryDom($contentTable, "//span[@id='ctl00_cphBody_lblRealEstateNumber']");
//if ($results->length>0) {
// $Var['parcelId'] = preg_replace('/[^0-9A-Za-z]/', '', $results->item(0)->nodeValue);
//}
if ($results->length == 0) {
$results = $Parseo->queryDom($contentTable, "//tr//th[contains(.,'RE #')]/following-sibling::td");
}
if ($results->length>0) {
foreach ($results as $index => $links) {
echo PHP_EOL.$index.' --> '.$Parseo->getHtmlDom($links).' Termina'.PHP_EOL;
$Var['parcelId'] = str_replace("ParcelDetails", '', $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^a-zA-Z0-9]/'));
}
} else {
echo 'No encotro el ParcelId'.PHP_EOL.PHP_EOL.'HTML BASE ['.$htmlBase.']';
}
if (!empty($Var['parcelId'])) {
/************OWNER INFO************/
//echo PHP_EOL.' Extrayendo Owner Info'.date("H:i:s");
$results = $Parseo->queryDom(
$contentTable,
"//span[@id='ctl00_cphBody_repeaterOwnerInformation_ctl00_lblMailingAddressLine2']"
);
foreach ($results as $index => $links) {
$Var['ownerAddress'] = $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^a-zA-Z0-9,\s]/');
}
if (empty($Var['ownerAddress'])) {
$results = $Parseo->queryDom(
$contentTable,
"//span[@id='ctl00_cphBody_repeaterOwnerInformation_ctl00_lblMailingAddressLine1']"
);
foreach ($results as $index => $links) {
$Var['ownerAddress'] = $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^a-zA-Z0-9,\s]/');
}
}
$results = $Parseo->queryDom(
$contentTable,
"//span[@id='ctl00_cphBody_repeaterOwnerInformation_ctl00_lblMailingAddressLine3']"
);
foreach ($results as $index => $links) {
$tempAddress = $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^a-zA-Z0-9-,\s]/');
$aux = explode(',', $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^a-zA-Z0-9-,\s]/'));
$Var['ownerCity'] = trim($aux[0]);
$aux = explode(' ', trim($aux[1]));
$Var['ownerState'] = trim($aux[0]);
if (count($aux)>1) {
$Var['ownerZip'] = trim($aux[1]);
}
}
if (strlen($Var['ownerState'])<>2) {
$Var = array_merge($Var, $Parseo->googleSearch(trim($Var['ownerAddress']).' '.trim($tempAddress)));
} else {
$Var['ownerCountry'] = 'USA';
}
/************PROPERTY ADDRESS************/
//echo PHP_EOL.' Extrayendo PROPERTY ADDRESS'.date("H:i:s");
$temp=array();
$results = $Parseo->queryDom($contentTable, "//span[@id='ctl00_cphBody_lblPrimarySiteAddressLine1']");
foreach ($results as $index => $links) {
$temp[] = $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^a-zA-Z0-9\#\-\,\s]/');
}
if (count($temp)>0) {
$Var['address'] = implode(' ', $temp);
}
$results = $Parseo->queryDom($contentTable, "//span[@id='ctl00_cphBody_lblPrimarySiteAddressLine2']");
$temp = '';
foreach ($results as $index => $links) {
$temp = strtoupper($Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^a-zA-Z0-9\#\-\s]/'));
}
if (!empty($temp)) {
$aux = explode(' ', trim($temp));
$Var['zip'] = array_pop($aux);
$Var['state'] = array_pop($aux);
$Var['city'] = implode(' ', $aux);
/*if(count($aux)==3){
$Var['zip'] = array_pop($aux);
$Var['state'] = array_pop($aux);
$Var['city'] = implode(' ',$aux);
}else{*/
/*$tempCity = trim(str_replace($state.' '.$zip,'',$temp));
$temp = explode(' ',trim($tempCity));
$queryS = "
SELECT
IF(LOCATE(' ',city)>0
,SUBSTRING_INDEX(city,' ',-1)
,'') AS `last`,city,state_code
FROM spidersmaestros.cities
WHERE LOCATE(' ',city)>0 AND state_code='FL'
ORDER BY LENGTH(city) DESC
";
$specialCityCases = array();
if(!$resultS = $conMaster->query($queryS)){
die(PHP_EOL .'Error: '. __LINE__ .' File: '. __FILE__ .
' MySQL: (' . $conMaster->errno . ') ' . $conMaster->error);
}
$cS=0;
while($rowS = $resultS->fetch_assoc()){
$specialCityCases[$cS]['last'] = $rowS['last'];
$specialCityCases[$cS]['city'] = $rowS['city'];
$specialCityCases[$cS]['state'] = $rowS['state_code'];
$cS++;
}
$resultS->free_result();
if($show==1){
echo "<br>------End Query".date('H:i:s a');
}
//echo "<br>Vamos a Buscar a ".$temp[count($temp)-1]."<br>";
//echo "<pre>";print_r($temp);echo "</pre>";//die();
//echo "<pre>";print_r($specialCityCases);echo "</pre>";//die();
//if its tru, the last position is the state and penultimate are the city
//echo "<br>Buscar: ".$aux[count($aux)-1];
if($show==1){
echo "<br>------Inicio si Existe el Caso".date('H:i:s a');
}
if(in_array_r($temp[count($temp)-1],$specialCityCases)){
//echo "<br>Special: ".$aux[count($aux)-2];
$bandera = true;
foreach($specialCityCases as $value){
if($bandera){
//echo "<br>$value[city] -> ".trim($Var['address']);
if(strpos('|||'.trim($tempCity),$value['city'])){
//echo "<br>$value[city] -> ".trim($tempAddress)." Coinside";
$Var['city'] = $value['city'];
$bandera = false;
}
}
}
//if not found. leave it
if(empty($Var['city'])){
$Var['city'] = $tempCity;
}
}
}*/
}
/************LAND VALUE************/
//echo PHP_EOL.' Extrayendo LAND VALUE'.date("H:i:s");
$results = $Parseo->queryDom($contentTable, "//span[@id='ctl00_cphBody_lblLandValueMarketCertified']");
foreach ($results as $index => $links) {
$Var['landV'] = $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^0-9.]/');
}
/************BUILDING VALUE************/
//echo PHP_EOL.' Extrayendo BUILDING VALUE'.date("H:i:s");
$results = $Parseo->queryDom($contentTable, "//span[@id='ctl00_cphBody_lblBuildingValueCertified']");
foreach ($results as $index => $links) {
$Var['buildingV'] = $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^0-9.]/');
}
/************ASSESSED VALUE************/
//echo PHP_EOL.' Extrayendo ASSESSED VALUE'.date("H:i:s");
$results = $Parseo->queryDom($contentTable, "//span[@id='ctl00_cphBody_lblAssessedValueA10Certified']");
foreach ($results as $index => $links) {
$Var['assesedV'] = $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^0-9.]/');
}
/***********SDName********************/
$results = $Parseo->queryDom(
$contentTable,
"//th[@scope='row' and contains(.,'Subdivision')]/following-sibling::td"
);
foreach ($results as $index => $links) {
$aux=explode(' ', preg_replace('/[^a-zA-Z0-9\s\/\-\#]/', '', trim($links->nodeValue)));
array_shift($aux);
$Var['SDName'] = implode(' ', $aux);
}
/************TAXABLE VALUE************/
//echo PHP_EOL.' Extrayendo TAXABLE VALUE'.date("H:i:s");
$results = $Parseo->queryDom($contentTable, "//span[@id='ctl00_cphBody_lblTaxableValueCertified']");
foreach ($results as $index => $links) {
$Var['taxableV'] = $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^0-9.]/');
}
/************BUILDING DATA************/
//echo PHP_EOL.' Extrayendo TAXABLE VALUE'.date("H:i:s");
$results = $Parseo->queryDom($contentTable, "//span[@id='ctl00_cphBody_lblNumberOfBuildings']");
foreach ($results as $index => $links) {
$Buildings = $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^0-9]/');
}
$x=1;
$tempYear=array();
//echo PHP_EOL.' Extrayendo Bildings'.date("H:i:s");
do {
$results = $Parseo->queryDom(
$contentTable,
"//table[@id='ctl00_cphBody_repeaterBuilding_ctl0".($x-1)."_gridBuildingArea']/tr[count(td)=4]"
);
if ($results->length>0) {
$temp=array();
foreach ($results as $index => $links) {
if ($index>0) {
$temp[] = explode('|', $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^a-zA-Z0-9.|\s]/'));
}
}
foreach ($temp as $index => $value) {
if (trim($value[0])=='Total') {
/************TOTAL GROSS AREA************/
$Var['lSqft'] += (int)$value[1];
/************TOTAL LIVING AREA************/
$Var['bHeated'] += (int)$value[2];
}
}
}
$results = $Parseo->queryDom(
$contentTable,
"//table[@id='ctl00_cphBody_repeaterBuilding_ctl0".($x-1)."_gridBuildingAttributes']/tr"
);
if ($results->length>0) {
$temp=array();
foreach ($results as $index => $links) {
if ($index>0) {
$temp[] = explode('|', $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^a-zA-Z0-9|.]/'));
}
}
foreach ($temp as $index => $value) {
/************BEDS************/
if ('Bedrooms'==trim($value[0])) {
$Var['beds'] += (int)$value[1];
}
/************BATHS************/
if ('Baths'==trim($value[0])) {
$Var['bath'] += (double)$value[1];
}
}
}
/************YEAR BUILT************/
$results = $Parseo->queryDom(
$contentTable,
"//span[@id='ctl00_cphBody_repeaterBuilding_ctl00_lblYearBuilt']"
);
foreach ($results as $index => $links) {
$tempYear[] = $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^0-9]/');
}
$x++;
} while ($x <= $Buildings);
//echo PHP_EOL.' Extrayendo Details'.date("H:i:s");
/*********CONDO BEDS BATHS*********/
$results = $Parseo->queryDom($contentTable, "//div[@id='CondoDetail_data']/table/tr");
if ($results->length>0) {
$temp=array();
foreach ($results as $index => $links) {
if ($index>0) {
$temp[] = explode('|', $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^a-zA-Z0-9|.]/'));
}
}
foreach ($temp as $index => $value) {
/************BEDS************/
if ('Bedrooms'==trim($value[0])) {
$Var['beds'] += (int)$value[1];
}
/************BATHS************/
if ('Baths'==trim($value[0])) {
$Var['bath'] += (double)$value[1];
}
}
}
//echo PHP_EOL.' Extrayendo Year VALUE'.date("H:i:s");
/************CONTINUE YEAR BUILT************/
if (count($tempYear)>0) {
sort($tempYear);
$Var['yearBuilt'] = array_shift($tempYear);
}
/************TOTAL SQFT************/
//echo PHP_EOL.' Extrayendo TOTAL SQFT'.date("H:i:s");
$results = $Parseo->queryDom($contentTable, "//span[@id='ctl00_cphBody_lblTotalArea1']");
foreach ($results as $index => $links) {
$Var['tSqft'] = $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^0-9.]/');
}
/************LEGAL DESCRIPTION************/
//echo PHP_EOL.' Extrayendo LEGAL DESCRIPTION'.date("H:i:s");
$temp=array();
$results = $Parseo->queryDom($contentTable, "//table[@id='ctl00_cphBody_gridLegal']/tr/td[2]");
foreach ($results as $index => $links) {
//echo PHP_EOL.str_replace('|','',$links->nodeValue);
array_push($temp, trim(str_replace('|', '', $links->nodeValue)));
//$temp[] = clearTrash(getHtmlDom($links),'/[^a-zA-Z0-9,-$\&\/\(\)#\s]/');
}
if (count($temp)>0) {
$Var['legal'] = implode(' ', $temp);
}
//echo $Var['legal'];
/************SALES HISTORY************/
//echo PHP_EOL.' Extrayendo SALES HISTORY'.date("H:i:s");
$results = $Parseo->queryDom($contentTable, "//table[@id='ctl00_cphBody_gridSalesHistory']/tr[count(td)=6]");
$allSales = array(
'saledate' => array(),
'saleprice' => array(),
'salebook' => array(),
'salepage' => array(),
'salecfn' => array()
);
foreach ($results as $index => $links) {
$salesInfo = array(
'saledate' => '',
'saleprice' => '',
'salebook' => '',
'salepage' => '',
'salecfn' => ''
);
/************SALE DATE***********/
$aux = explode('|', $Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^0-9.\|\/\s\-]/'));
$temp = explode('/', $aux[1]);
$salesInfo['saledate'] = trim($temp[2]).(strlen(trim($temp[0]))==1?"0".
trim($temp[0]):trim($temp[0])).(strlen(trim($temp[1]))==1?"0".trim($temp[1]):trim($temp[1]));
/************BOOK AND PAGE***********/
$temp = explode('-', $aux[0]);
$salesInfo['salebook'] = preg_replace('/[^a-zA-Z0-9\/]/', '', trim($temp[0]));
$salesInfo['salepage'] = preg_replace('/[^a-zA-Z0-9\/]/', '', trim($temp[1]));
/***************CFN*******************/
/*
echo PHP_EOL.$Var['parcelId'].' Ini 1 '.date('H:i:s');
$linkexterno1 = 'http://oncore.duvalclerk.com/details.aspx?BookType=OR&Book='.
(int)$salesInfo['salebook'].'&Page='.(int)$salesInfo['salepage'];
$Download->startSession(array(
'url'=>$linkexterno1,
'condado'=>$bd
));
$htmlOwner=$Download->getHtml(array(
'url'=>$linkexterno1,
'conMaster'=>$conMaster,
'condado'=>$bd
));
$Download->closeSession();
echo ' Fin 1 '.date('H:i:s');
/*
//$htmlOwner = customCurl(array(
// 'url'=>$ownerUrl,
// 'county'=>$bd
//));
*/
if (isset($htmlOwner)) {
$contentOwner = $Parseo->getXpathHtml($htmlOwner, false);
$resultscfn = $Parseo->queryDom($contentOwner, "//span[@id='lblCfn']/text()");
foreach ($resultscfn as $indexcfn => $linkscfn) {
$salesInfo['salecfn'] = $linkscfn->nodeValue;
}
}
/************SALE PRICE***********/
$salesInfo['saleprice'] = preg_replace('/[^0-9.]/', '', trim($aux[2]));
array_push($allSales['saledate'], $salesInfo['saledate']);
array_push($allSales['saleprice'], $salesInfo['saleprice']);
array_push($allSales['salebook'], $salesInfo['salebook']);
array_push($allSales['salepage'], $salesInfo['salepage']);
array_push($allSales['salecfn'], $salesInfo['salecfn']);
}
/************EXTRACT MOST RESENTLY SALE FOR THE PASPAS************/
if (count($allSales['saledate'])>0) {
if (count($allSales['saledate'][0])>0) {
$maxs = array_keys($allSales['saledate'], max($allSales['saledate']));
}
}
/************OWNER NAME************/
$results = $Parseo->queryDom($contentTable, "//table[@id='ctl00_cphBody_gridSalesHistory']/tr[2]/td[1]/a");
if ($results->length > 0) {
foreach ($results as $index => $links) {
$ownerUrl = $links->getAttribute('href');
}
$ownerUrl = 'http://oncore.duvalclerk.com/details.aspx?BookType=OR&Book='.
(int)$allSales['salebook'][$maxs[0]].'&Page='.(int)$allSales['salepage'][$maxs[0]];
$Download->startSession(array(
'url'=>$ownerUrl,
'condado'=>$bd
));
$htmlOwner=$Download->getHtml(array(
'url'=>$ownerUrl,
'conMaster'=>$conMaster,
'condado'=>$bd
));
$Download->closeSession();
$contentOwner = $Parseo->getXpathHtml($htmlOwner, false);
$resultsOwner = $Parseo->queryDom($contentOwner, "//span[@id='lblReverseName']");
foreach ($resultsOwner as $index => $links) {
$temp_dom = new DOMDocument();
$temp_dom->appendChild($temp_dom->importNode($links, true));
$Var['ownerName'] = trim(preg_replace(
'/[^a-zA-Z0-9\&\s\;]/',
'',
strip_tags(
str_replace(
array("<br>"),
" ; ",
str_replace(array("&"), "&", $temp_dom->saveHtml())
)
)
));
$Var['ownerName'] = rtrim($Var['ownerName'], '&;');
}
//CFN
$Var['ownerName'] = trim($Var['ownerName']);
$resultscfn = $Parseo->queryDom($contentOwner, "//span[@id='lblCfn']/text()");
foreach ($resultscfn as $indexcfn => $linkscfn) {
$allSales['salecfn'][$maxs[0]] = $linkscfn->nodeValue;
}
unset($htmlOwner);
unset($contentOwner);
}
/*
$comac = $c == 0 ? '' : ',';
$queryc .= $comac."
('{$Var['parcelId']}',NULL,'{$salesInfo['saledate']}',NULL,'{$salesInfo['saleprice']}',".
"'{$salesInfo['salebook']}','{$salesInfo['salepage']}','{$salesInfo['salecfn']}',NULL,NULL,NULL)";
$c++;
*/
foreach ($allSales['saledate'] as $key => $value) {
$comac = $c == 0 ? '' : ',';
$queryc .= $comac."
('{$Var['parcelId']}',NULL,'{$allSales['saledate'][$key]}',NULL,'{$allSales['saleprice'][$key]}',".
"'{$allSales['salebook'][$key]}','{$allSales['salepage'][$key]}','{$allSales['salecfn'][$key]}',
NULL,NULL,NULL)";
$c++;
}
$Var['saleDate'] = $allSales['saledate'][$maxs[0]];
$Var['salePrice'] = $allSales['saleprice'][$maxs[0]];
$Var['book'] = $allSales['salebook'][$maxs[0]];
$Var['page'] = $allSales['salepage'][$maxs[0]];
$Var['cfn'] = $allSales['salecfn'][$maxs[0]];
//echo PHP_EOL.'Fin Down Interno'.date("H:i:s");
if (empty($Var['ownerName'])) {
$results = $Parseo->queryDom(
$contentTable,
"//span[@id='ctl00_cphBody_repeaterOwnerInformation_ctl00_lblOwnerName']"
);
foreach ($results as $index => $links) {
$separador = ($index==0) ? '' : '; ';
$Var['ownerName'] = $separador.$Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^a-zA-Z0-9&\s\;]/');
}
}
/************TYPE OF PROPERTY************/
$results = $Parseo->queryDom($contentTable, "//span[@id='ctl00_cphBody_lblPropertyUse']");
foreach ($results as $index => $links) {
$aux = explode(' ', trim($Parseo->clearTrash($Parseo->getHtmlDom($links), '/[^a-zA-Z0-9-\s]/')));
$Var['CCode'] = $Var['Xcode'] = array_shift($aux);
$Var['CCodeD']= trim(implode(' ', $aux));
}
$Var['address'] = str_replace("'", '', $Var['address']);
/*$Var['ownerAddress'] = trim(str_replace("'",'',$Var['ownerAddress']));
$Var['ownerCity'] = preg_replace('/[^a-zA-Z0-9-\s]/','',$Var['ownerCity']);
$Var['city'] = preg_replace('/[^a-zA-Z0-9-\s]/','',$Var['city']);*/
//echo PHP_EOL.' Fin del Parseo '.date("H:i:s");
//print_r($Var);
//die();
foreach ($Var as $key => $value) {
$Var[$key] = $con->real_escape_string($value);
}
//print_r($Var);
$comad = $d == 0 ? '' : ',';
$queryd .= $comad."
(
'{$Var['parcelId']}',
'{$Var['Xcode']}',
'{$Var['CCode']}',
'{$Var['address']}',
'{$Var['assesedV']}',
'{$Var['bath']}',
'{$Var['beds']}',
'{$Var['bHeated']}',
'{$Var['book']}',
'{$Var['buildingV']}',
'{$Var['CCodeD']}',
'{$Var['city']}',
'{$Var['ffc']}',
'{$Var['parcelId']}',
'{$Var['landV']}',
'{$Var['legal']}',
'{$Var['lSqft']}',
'{$Var['ownerName']}',
'{$Var['ownerAddress']}',
'{$Var['ownerCity']}',
'{$Var['ownerCountry']}',
'{$Var['ownerState']}',
'{$Var['ownerZip']}',
'{$Var['page']}',
'{$Var['cfn']}',
'{$Var['saleDate']}',
'{$Var['salePrice']}',
'{$Var['SDName']}',
'{$Var['taxableV']}',
'{$Var['tSqft']}',
'{$Var['yearBuilt']}',
'{$Var['zip']}')
";
//verifyVariables($Var);die();
//print_r($Var);
$d++;
if ($d == $totalInsert) {
//Insert for PASPAS
if ($show==1) {
echo '<br> Inicio de Insert'.date('H:i:s a');
}
$queryd = "REPLACE INTO $bd.paopao (parcelid,xcode,ccode,address,assesedv,Bath,Beds,".
"bheated,book,buildingV,ccoded,city,ffc,folio,landv,legal,lsqft,owner,owner_a,owner_c,".
"owner_p,owner_s,owner_z,page,cfn,saledate,saleprice,SDName,taxablev,tsqft,yrbuilt,zip) ".
"VALUES ".$queryd;
do {
if (!$inserto=$con->query($queryd)) {
$queryd=handlerErrorMysql($con->error, $queryd);
}
} while (!$inserto);
$queryd = '';
$d=0;
if ($show==1) {
echo '<br> Fin de Insert'.date('H:i:s a');
}
if (!empty($queryc)) {
//Insert for PASSAL
if ($show==1) {
echo '<br> Inicio de Insert'.date('H:i:s a');
}
$queryc = "REPLACE INTO $bd.paosal VALUES ".$queryc;
$con->query($queryc) or die($queryc.$con->error);
$queryc = '';
$c=0;
if ($show==1) {
echo '<br> Fin de Insert'.date('H:i:s a');
}
}
}
} else {
echo PHP_EOL.'Parcel Id No Found '.$archivo.PHP_EOL;
if (is_readable($archivo)) {
echo PHP_EOL.PHP_EOL.$html.PHP_EOL.PHP_EOL;
$html = file_get_contents($archivo);
echo PHP_EOL.PHP_EOL.$html.PHP_EOL.PHP_EOL;
}else{
echo 'No es Legible: '.$archivo.PHP_EOL;
}
//die('Error al encontrar el parselId');
registerOnErrorOrNotFound(array(
'content'=>$contentTable,
'optionals'=>$optionals,
'line'=>__LINE__,
'file'=>__FILE__,
'archivo'=>$archivo,
'bd'=>$bd
));
}//End ParcelId Empty Validation
unset($results, $html, $contentTable);
}
}
#die('Yan');
if ($d != 0) {
//Insert for PASPAS
if ($show==1) {
echo '<br> Inicio de Insert'.date('H:i:s a');
}
$queryd = "REPLACE INTO $bd.paopao (parcelid,xcode,ccode,address,assesedv,Bath,Beds,".
"bheated,book,buildingV,ccoded,city,ffc,folio,landv,legal,lsqft,owner,owner_a,owner_c,".
"owner_p,owner_s,owner_z,page,cfn,saledate,saleprice,SDName,taxablev,tsqft,yrbuilt,zip) ".
"VALUES ".$queryd;
do {
if (!$inserto=$con->query($queryd)) {
$queryd=handlerErrorMysql($con->error, $queryd);
}
} while (!$inserto);
$queryd = '';
$d=0;
if ($show==1) {
echo '<br> Fin de Insert'.date('H:i:s a');
}
if (!empty($queryc)) {
//Insert for PASSAL
if ($show==1) {
echo '<br> Inicio de Insert'.date('H:i:s a');
}
$queryc = "REPLACE INTO $bd.paosal VALUES ".$queryc;
$con->query($queryc) or die($queryc.$con->error);
$queryc = '';
$c=0;
if ($show==1) {
echo '<br> Fin de Insert'.date('H:i:s a');
}
}
}
}
}