I have a table that contains a column of dates that can be changed through the datepicker .
<td>
<div class="input-group date" data-provide="datepicker">
<input type="text" class="form-control" name="dataPrevisao" id="dataPrevisao" rel="<?php echo odbc_result($resultado,"stamp");?>" value="<?php echo odbc_result($resultado,"dvalor");?>" />
<div class="input-group-addon">
<span class="glyphicon glyphicon-calendar small"></span>
</div>
</div>
What i want to do, is after the change of date, the register is automatically updated in the table. For that, i have a php file - changePrevisao.php:
<?php include("includes/odbc.ini");
$iniciais=str_replace(' ', '', $_SESSION['iniciais']);
$stamp=$_POST['stamp'];
$dataP=$_POST['dataP'];
$query = " update od set marcada=1, data='$dataP', usrdata=convert(varchar(10),getdate(),112),
usrhora=right(convert(varchar(19),getdate(),121),8), usrinis='$iniciais' where od.odstamp='$stamp'";
odbc_exec($sqlconnect,$query);
?>
I have problems in building the user function to ajax that allows pass the data to the php file , does anyone can help me ?