本文整理汇总了PHP中Conexion::insertCausaHistoria方法的典型用法代码示例。如果您正苦于以下问题:PHP Conexion::insertCausaHistoria方法的具体用法?PHP Conexion::insertCausaHistoria怎么用?PHP Conexion::insertCausaHistoria使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conexion
的用法示例。
在下文中一共展示了Conexion::insertCausaHistoria方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setBusqueda
function setBusqueda($posts)
{
$client = $this->setClient();
$headers = $client->getRequest()->getHeaders();
$cookies = new Zend\Http\Cookies($headers);
$client->setMethod('GET');
$response = $client->send();
$uri = 'http://civil.poderjudicial.cl/CIVILPORWEB/AtPublicoViewAccion.do?tipoMenuATP=1';
$client->setUri($uri);
$cookies->addCookiesFromResponse($response, $client->getUri());
$response = $client->send();
foreach ($posts as $post) {
echo '<pre>';
print_r("Se estan consultado las causas para: " . $post['NOM_Consulta'] . " " . $post['APE_Paterno'] . " " . $post['APE_Materno']);
echo '</pre>';
$rut_buscado = array_pop($post);
$client->setUri('http://civil.poderjudicial.cl/CIVILPORWEB/AtPublicoDAction.do');
$cookies->addCookiesFromResponse($response, $client->getUri());
$client->setParameterPost($post);
$response = $client->setMethod('POST')->send();
if ($response->isOk()) {
$data = $response->getContent();
$dom = new Query($data);
$results = $dom->execute('#contentCellsAddTabla tr');
$informacionCausas = $this->getCausas($results);
echo '<pre> Se han encontrado: ' . count($informacionCausas) . ' causas';
if (count($informacionCausas) > 0) {
$postCausas = $this->setPostCausas($informacionCausas);
$client->setUri("http://civil.poderjudicial.cl/CIVILPORWEB/ConsultaDetalleAtPublicoAccion.do?");
$cookies->addCookiesFromResponse($response, $client->getUri());
foreach ($postCausas as $causa) {
$client->setParameterPost($causa);
$response = $client->setMethod('POST')->send();
if ($response->isOk()) {
$data = $response->getContent();
$dom = new Query($data);
$detalleCausa = $dom->execute('tr');
$rol = $causa['TIP_Causa'] . '-' . $causa['ROL_Causa'] . '-' . $causa['ERA_Causa'];
$arr_detalles = $this->infoCausas($detalleCausa, $rol, $rut_buscado);
$cuadernos = $dom->execute("#TablaCuadernos .comboBox option");
$cuadernos = $dom->execute("#TablaCuadernos .comboBox option");
$contador = 0;
foreach ($cuadernos as $cuaderno) {
$arr_cuadernos[$contador]['nombre'] = $cuaderno->textContent;
$arr_cuadernos[$contador]['id'] = $cuaderno->attributes->getNamedItem('value')->textContent;
$contador++;
}
$litigantes = $dom->execute("#Litigantes table tr");
$arr_litigantes = $this->getLitigantes($litigantes, $rol, $rut_buscado, $arr_cuadernos[0]['nombre']);
$tribunal = $arr_detalles['tribunal'];
$historias = $dom->execute("#Historia tr");
$arr_historias = $this->getHistorias($historias, $rol, $rut_buscado, $tribunal, $arr_cuadernos[0]['nombre']);
foreach ($arr_litigantes as $ar) {
if (strpos($ar['rut'], $rut_buscado)) {
echo "<pre> Entr igual: " . $arr_detalles['estado_proceso'] . "</pre>";
$connect = new Conexion();
$connect->insertCausa($arr_detalles, $rut_buscado);
$connect->insertCausaHistoria($arr_historias);
}
}
if (count($cuadernos) > 1) {
$documento = $dom->getDocument();
preg_match_all("/(TIP_Cuaderno.value.*')/", $documento, $tips);
preg_match_all("/(CRR_IdCuaderno.value.*)/", $documento, $crrids);
$arr_tips_cuadernos = $tips[0];
$arr_crr_cuadernos = $crrids[0];
$contador = 0;
for ($i = 1; $i < count($cuadernos); $i++) {
$postCuaderno[$contador]['tip'] = str_replace("TIP_Cuaderno.value = '", "", $arr_tips_cuadernos[$i]);
$postCuaderno[$contador]['tip'] = str_replace("'", "", $postCuaderno[$contador]['tip']);
$postCuaderno[$contador]['crr'] = str_replace("CRR_IdCuaderno.value = '", "", $arr_crr_cuadernos[$i]);
$postCuaderno[$contador]['crr'] = str_replace("';", "", $postCuaderno[$contador]['crr']);
$postCuaderno[$contador]['crr'] = trim(rtrim($postCuaderno[$contador]['crr'], " "));
$postCuaderno[$contador]['gls'] = $arr_cuadernos[$i]['nombre'];
$postCuaderno[$contador]['tip_causa'] = $causa['TIP_Causa'];
$postCuaderno[$contador]['rol_causa'] = $causa['ROL_Causa'];
$postCuaderno[$contador]['era_causa'] = $causa['ERA_Causa'];
$postCuaderno[$contador]['cod_tribunal'] = $causa['COD_Tribunal'];
$contador++;
}
foreach ($postCuaderno as $cuaderno) {
$post_parameters = array('TIP_Causa' => $cuaderno['tip_causa'], 'ROL_Causa' => $cuaderno['rol_causa'], 'ERA_Causa' => $cuaderno['era_causa'], 'COD_Tribunal' => $cuaderno['cod_tribunal'], 'TIP_Cuaderno' => $cuaderno['tip'], 'GLS_Cuaderno' => $cuaderno['gls'], 'CRR_IdCuaderno' => $cuaderno['crr'], 'TIP_Informe' => '1', 'FLG_Caratula' => '0', 'TIP_Cargo' => '2', 'COD_Corte' => '98', 'FLG_ImpresionTribunal' => '1', 'CRR_Cuaderno' => $cuaderno['crr'], 'irAccionAtPublico' => 'Ir a Cuaderno', 'FLG_Vuelta' => 'null');
$client->setUri("http://civil.poderjudicial.cl/CIVILPORWEB/AtPublicoDAction.do");
$cookies->addCookiesFromResponse($response, $client->getUri());
$client->setParameterPost($post_parameters);
$response = $client->setMethod('POST')->send();
$data = $response->getContent();
$dom = new Query($data);
$cuaderno = $cuaderno['gls'];
$tribunal = $arr_detalles['tribunal'];
$litigantes = $dom->execute("#Litigantes table tr");
$arr_litigantes = $this->getLitigantes($litigantes, $rol, $rut_buscado, $arr_cuadernos[0]['nombre']);
$historias = $dom->execute("#Historia tr");
$arr_historias = $this->getHistorias($historias, $rol, $rut_buscado, $tribunal, $cuaderno);
foreach ($arr_litigantes as $ar) {
if (strpos($ar['rut'], $rut_buscado) !== false) {
$connect = new Conexion();
$connect->insertCausaHistoria($arr_historias);
}
}
//.........这里部分代码省略.........
示例2: getHistorias
function getHistorias($historias, $rol, $rut, $tribunal, $nombreCuaderno)
{
$cabeceras = array('Folio', 'Doc.', 'Etapa', 'Trámite', 'Desc. Trámite', 'Fec.Tram', 'Foja', 'Participante', 'Rut', 'Persona', 'Nombre o Razón Social');
foreach ($historias as $historia) {
$columnas = 0;
foreach ($historia->getElementsByTagName('td') as $td) {
if (!in_array($td->textContent, $cabeceras)) {
if ($columnas == 0) {
$folios[] = trim($td->textContent);
}
if ($columnas == 1) {
$img = $td->getElementsByTagName('img')->item(0);
if ($img === null) {
$documentos[] = "No se ha encontrado documento asociado";
} else {
$documentos[] = trim($img->getAttribute('onclick'));
}
}
if ($columnas == 2) {
$etapas[] = trim($td->textContent);
}
if ($columnas == 3) {
$tramites[] = trim($td->textContent);
}
if ($columnas == 4) {
$desTramite[] = trim($td->textContent);
}
if ($columnas == 5) {
$fecTramite[] = trim($td->textContent);
}
if ($columnas == 6) {
$fojas[] = trim($td->textContent);
}
$columnas++;
}
}
}
for ($i = 0; $i < count($documentos); $i++) {
$documentos[$i] = str_replace("ShowPDFCabecera('/", "", $documentos[$i]);
$documentos[$i] = str_replace("ShowWord('", "", $documentos[$i]);
$documentos[$i] = str_replace("ShowImage('/", "", $documentos[$i]);
$documentos[$i] = str_replace("')", "", $documentos[$i]);
}
for ($i = 0; $i < count($folios); $i++) {
$causas[$i]['rut'] = $rut;
$causas[$i]['rol'] = $rol;
$causas[$i]['folio'] = $folios[$i];
if ($documentos[$i] === "alert('No existe documento asociado..") {
$causas[$i]['documento'] = "No existe documento asociado";
} else {
$causas[$i]['documento'] = "http://civil.poderjudicial.cl/" . $documentos[$i];
/*$rol_divido = explode("-", $rol);
$salida = "downloads/" . $rol_divido[0] . $rol_divido[2] . str_pad($rol, 5, '0', STR_PAD_LEFT) . "-" . $folios[$i];
file_put_contents($salida, fopen("http://ttp://civil.poderjudicial.cl/" . $documentos[$i], 'r'));*/
}
$causas[$i]['etapa'] = $etapas[$i];
$causas[$i]['tramite'] = $tramites[$i];
$causas[$i]['descTramite'] = $desTramite[$i];
$causas[$i]['fecTramite'] = $fecTramite[$i];
$causas[$i]['foja'] = $fojas[$i];
$causas[$i]['tribunal'] = $tribunal;
$causas[$i]['cuaderno'] = $nombreCuaderno;
}
$conexion = new Conexion();
$conexion->insertCausaHistoria($causas);
return $causas;
}