define('USERPWD', 'echidna\jconesa:jconesa');
$empresa = '1 TPS-N_LAB';
$baseURL = 'http://128.20.1.1:7047/DynamicsNAV/WS/';
$pageURL = $baseURL.rawurlencode($empresa).'/Page/WTADistribucionesPorAutoriz';
$NumCliente = '101222'; // deixar en blanc perque pregunti
//-------------------------------------------------------------------------------------------------
include("NTLMStream.php");
include("NTLMSoapClient.php");
// we unregister the current HTTP wrapper
stream_wrapper_unregister('http');
// we register the new HTTP wrapper
stream_wrapper_register('http', 'NTLMStream') or die("Fallo al registrar protocolo");
// Initialize Page Soap Client
$page = new NTLMSoapClient($pageURL);
//-------------------------------------------------------------------------------------------------
/* if ($NumCliente == ''){
echo 'NumCliente? ';
$NumCliente = fgets(STDIN);
}
echo "NumCliente: " . $NumCliente . PHP_EOL; */
echo $cliente;
$timeIni = time();
$params = array('filter' => array(
array('Field' => 'Cliente',
'Criteria' => $cliente)
),
'setSize' => 0);
$result = $page->ReadMultiple($params);
$distribuciones = $result->ReadMultiple_Result->WTADistribucionesPorAutoriz ;
/* echo 'Num_distribucion | Num_contrato | Cdad_disponible '; */
//echo '| Cdad_existente'
echo PHP_EOL;
if (is_array($distribuciones)) {
foreach($distribuciones as $distrib) {
/* echo $distrib->Num_distribucion . ' | ';
echo $distrib->Num_contrato . ' | ';
echo $distrib->Cdad_disponible ;
echo $distrib->Cdad_existente */
echo PHP_EOL;
}
}
/* else {
echo $distribuciones->Num_distribución . PHP_EOL;
} */
$ndistri = $distrib->Num_autorizacion;
$clientes = $distrib->Cliente;
$matriculat = $distrib->Matricula_tractora;
$matricular = $distrib->Matricula_remolque;
$dni = $distrib->DNI_conductor;
$namedriver = $distrib->Nombre_conductor;
$fecha = $distrib->Fecha;
$hora = $distrib->Hora;
$estado = $distrib->Estado;
$contrato = $distrib->Contrato;
/* echo $ndistri. ' | ';
echo $cliente. ' | ';
echo $matriculat. ' | ';
echo $matricular. ' | ';
echo $dni. ' | ';
echo $namedriver. ' | ';
echo $fecha. ' | ';
echo $hora. ' | ';
echo $estado. ' | '; */
//sleep(3);
echo 'Respuesta en ';
echo time() - $timeIni . ' segundos' ;
?>
<table class="table table-bordered table-striped datatable" id="table-2">
<thead>
<tr>
<th>
<div class="checkbox checkbox-replace">
<input type="checkbox" id="chk-1">
</div>
</th>
<th>Contrato</th>
<th>Cliente</th>
<th>Matricula Tractora</th>
<th>DNI PASAPORTE</th>
<th>Matricula Remolque</th>
<th>Nombre</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div class="checkbox checkbox-replace">
<input type="checkbox" id="chk-1">
</div>
</td>
<td><?php echo $contrato;?></td> <------------------------
<td><?php echo $clientes;?></td> <-----------------------
<td><?php echo $matriculat;?></td> <----------------------
<td><?php echo $dni;?></td> <-------------------------------
<td><?php echo $matricular;?></td><-----------------------
<td><?php echo $namedriver;?></td><----------------------
<td>
<a href="#" class="btn btn-default btn-sm btn-icon icon-left">
<i class="entypo-pencil"></i>
Edit
</a>
<a href="#" class="btn btn-danger btn-sm btn-icon icon-left">
<i class="entypo-cancel"></i>
Delete
</a>
<a href="#" class="btn btn-info btn-sm btn-icon icon-left">
<i class="entypo-info"></i>
Profile
</a>
</td>
</tr>