<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(function()
{
$('#mydata .date').each(function()
{
var cell_date = Date.parse($(this).text().replace(/(\d{2})\/(\d{2})\/(\d{4})/, '$2/$1/$3'));
var myDate = new Date(new Date().getTime()+(5*24*60*60*1000));
if(cell_date < myDate )
{
$(this).parent('tr').addClass('past')
}
}
);
}
);
</script>
pano ko dadagdagan ng 5 days to? kasi po ang kailangan ko po kasing gawin ee dapat after 5 days + ee magrered po yung row ng table
gumagana po sya ang problema lang po yung current date nag rered na agad imbis na after 5 days sana po matulungan nyo ako.
eto po ...
<table cellpadding="0" cellspacing="0" border="0" class="table table-bordered table-hover" id="mydata" >
<?php include('modal_delete.php'); ?>
<thead>
<tr name = "table">
<th>ID</th>
<th>Unit</th>
<th>Filename</th>
<th>From</th>
<th>Date Received</th>
<th>Location</th>
<th>Date Released</th>
<th class="empty"></th>
<th class="empty"></th>
<th class="empty"></th>
</tr>
</thead>
<tbody>
<?php while($row = mysqli_fetch_array($search_result)):?>
<tr>
<td><?php $id = $row['user_id']?><?php echo $row['user_id']; ?></td>
<td><?php echo $row['unit']; ?></td>
<td><?php echo $row['filename']; ?></td>
<td><?php echo $row['from1']; ?></td>
<td><?php echo $row['datercv']; ?></td>
<td><?php echo $row['location']; ?></td>
<td class="date"><?php echo $row['daterls']; ?></td>
<td class="empty" width="30"><a href=transfered_files.php<?php echo '?id='.$id; ?>" class="btn btn-info"><i class="glyphicon glyphicon-ok-circle"></i></a></td>
</td>
</td>
<td class="empty" width="30">
<a data-placement="left" title="Click to Edit" id="edit<?php echo $id; ?>" data-toggle="modal" href="#<?php echo $id; ?>" class="btn btn-success"><i class="fa fa-pencil"></i></a>
<script type="text/javascript">
$(document).ready(function(){
$('#edit<?php echo $id; ?>').tooltip('show');
$('#edit<?php echo $id; ?>').tooltip('hide');
})
</script>
<?php include('modal_edit_transfer1.php') ?>
<td class="empty" width="30"><a href="delete_transfer1.php<?php echo '?id='.$id; ?>" class="btn btn-danger"><i class="fa fa-trash-o"></i></a></td>
</tr>
<?php endwhile;?>
</tbody>
</table>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript">
$(function()
{
$('#mydata .date').each(function()
{
var cell_date = Date.parse($(this).text().replace(/(\d{2})\/(\d{2})\/(\d{4})/, '$2/$1/$3'));
var duedate = cell_date.addDays(5);
if(cell_date <= duedate )
{
$(this).parent('tr').addClass('past')
}
}
);
}
);
</script>
Last edited: