<form action="reg_envio.php" method="post">
<input type="hidden" name="client_id" value="<?php echo $_SESSION['client_id'] ?>" class="form-control">
<input type="hidden" name="name_client" value="<?php echo $_SESSION['name_client'] ?>" class="form-control">
<div class="form-group row">
<span class="input-group-addon" id="basic-addon1">Domiciliario <img src="btn/usuario3.png" width="18px"> *</span>
<div class="col-sm-10">
<select name="domiciliary_id" class="form-control">
<option value="opt1">Seleccione</option>
<?php
include("../logica/conexion.php");//Contiene de conexion a la base de datos
$result = mysqli_query($conectar, "SELECT * FROM contratos where client_id=".$_SESSION['client_id']."");
while ($registro = mysqli_fetch_array($result)){
?>
<option value="<?php echo $registro['domiciliary_id'];?>"><?php echo $registro['codigo'];?></option>
<?php } ?>
</select>
</div>
</div>
<br/>
<div class="form-group row">
<span class="input-group-addon" id="basic-addon1">Confirmar Domiciliario <img src="btn/usuario3.png" width="18px"> *</span>
<div class="col-sm-9">
<select name="name_domiciliary" class="form-control">
<option value="opt1">Seleccione</option>
<?php
include("../logica/conexion.php");//Contiene de conexion a la base de datos
$result = mysqli_query($conectar, "SELECT * FROM contratos where client_id=".$_SESSION['client_id']."");
while ($registro = mysqli_fetch_array($result)){
?>
<option value="<?php echo $registro['codigo'];?>"><?php echo $registro['codigo'];?></option>
<?php } ?>
</select>
</div>
</div>
<br>
<div class="form-fields">
<label for="start_time">Entrada:</label>
<input type="datetime-local" name="start_time" value="<?php echo( date('Y-m-d', time()) . 'T' . date('H:i:s', time()) ); ?>"/>
</div>
<div class="form-fields">
<label for="end_time">Salida:</label>
<input type="datetime-local" name="end_time" value="<?php echo( date('Y-m-d', time()) . 'T' . date('H:i:s', time()) ); ?>"/>
</div>
<div class="form-buttons">
<input type="submit" value="Calcular y Guardar"/>
</div>
<div class="results">
Resultado:
<?php
include('../logica/conexion.php');//Contiene de conexion a la base de datos
$result = mysqli_query($conectar, 'SELECT * FROM planes_xeb where client_id='.$_SESSION['client_id'].' order by plan_id desc limit 1');
while ($registro = mysqli_fetch_array($result)){
$start_time = $_POST['start_time'];
$end_time = $_POST['end_time'];
$total_time = getTotalTime( array($start_time, $end_time) );
$rate = ($registro['valor_hora_dom']);
$rate2cliente = ($registro['valor_hora_cliente']);
echo( '<br/>');
echo( ' <input type="text" name="cant_horas_dom" value=" '.$total_time . '" /> total horas domiciliario');
echo( '<br/>');
echo( ' <input type="text" name="cant_horas_client" value=" '.$total_time . '" /> total horas cliente');
echo( '<br/>');
echo( '$ <input type="text" name="valor_hora_dom" value="'. $rate . '" /> valor por hora domiciliario');
echo( '<br/>');
echo( '$ <input type="text" name="valor_hora_cliente" value="'. $rate2cliente . '" /> valor por hora cliente');
echo( '<br/>');
echo( '$ <input type="text" name="totalxhoras_dom" value="'. $total_time * $rate . '" /> valor total domiciliario');
;
echo( '<br/>');
echo( '$ <input type="text" name="totalxhoras_client" value="'. $total_time * $rate2cliente . '" /> valor total Cliente');
}
?>
<input type="hidden" name="estado" value="3" class="form-control">
</div>
</div>
</div>
</form>