Ejemplo n.º 1
0
    ?>
                        <div class='row'>
                            <div class='col-xs-12'>
                                <strong>Fully Depreciated: </strong>
                                
                                <?php 
    $dt1 = date_create(date('Y-m-d'));
    $dt2 = date_create(getDepriciationDate($asset['purchase_date'], $asset['depreciation_term']));
    $interval = date_diff($dt1, $dt2);
    echo $interval->y > 0 ? $interval->y . " year/s " : "";
    echo $interval->m > 0 ? $interval->m . " month/s " : "";
    echo $interval->d > 0 ? $interval->d . " days/s " : "";
    // var_dump($interval);
    ?>
                                <?php 
    echo htmlspecialchars("(" . getDepriciationDate(Date("Y-m-d"), $asset['depreciation_term']) . ")");
    ?>
                            </div>
                        </div>
                        <?php 
}
?>
                        <?php 
if ($asset['EOL'] != "0000-00-00" && $asset['EOL'] == "00/00/00") {
    ?>
                        <div class='row'>
                            <div class='col-xs-12'>
                                <strong>EOL: </strong>

                                <?php 
    echo htmlspecialchars($asset['EOL']);
Ejemplo n.º 2
0
                                                 <td>
                                                     <?php 
     if ($asset['check_out_date'] != "0000-00-00") {
         echo "Deployed (" . htmlspecialchars($asset['current_holder']) . ")";
     } else {
         echo htmlspecialchars($value);
     }
     ?>
                                                 </td>
                                         <?php 
 } elseif ($key == "depreciation_term") {
     ?>
                                                 <td>
                                                     <?php 
     if (!empty($value)) {
         echo date_format(new DateTime(getDepriciationDate($asset['purchase_date'], $value)), "Y-m-d");
     }
     ?>
                                                 </td>
                                         <?php 
 } elseif ($key == "asset_status" || $key == "current_holder" || $key == "id") {
     #skipped keys
 } else {
     ?>
                                             <td>
                                                 <?php 
     echo htmlspecialchars($value);
     ?>
                                             </td>
                                         <?php 
 }