Search
 
SCRIPT & CODE EXAMPLE
 

PHP

expiry date alert in php

<?php
$r = mysql_query($q);
$output = '';
if(mysql_num_rows($r))
{

    while($d = mysql_fetch_assoc($r))
    {
        if($d['diff'] < 0)
        {
            $notes = "EXPIRED";
        }elseif($d['diff'] <= 14){
            $notes = "ALERT";
        }else{
            $notes = '';
        }

        $output .= "<tr><td>{$d['machine']}</td><td>{$d['received_date']}</td><td>{$d['expiry_date']}</td><td>{$d['consignee']}</td><td>$notes</td></tr>";
    }

}
?>

<table>
    <thead>
        <tr>
            <th>Machine</th>
            <th>Received Date</th>
            <th>Expiry Date</th>
            <th>Consignee</th>
            <th>Notes</th>
        </tr>
    </thead>
    <tbody>
        <?php echo $output;?>
    </tbody>
</table>
Comment

PREVIOUS NEXT
Code Example
Php :: retrievemultipleimage from database in laravel 
Php :: ob_start store variable in php 
Php :: 100 rows update php 
Php :: get git branch with php 
Php :: how to put cloth on 3d model using javascript and php 
Php :: WP Hero Img 
Php :: php csv to multirow array $_FILES 
Php :: inject multiple logger symfony 
Php :: array with key value pair php 
Php :: call stored procedure in laravel 
Php :: direct without public laravel 
Php :: $n = readline(); for($i = 0; $i < $n ; $i++) { $name = readline(); $names[$name] = (isset($names[$name]) ? $names[$name] + 1 : 1); } 
Php :: filter from taggable laravel 
Php :: laravel gigapay update invoice 
Php :: php-like-system-with-notification-using-ajax-jquery 
Php :: no cache on browser back php 
Php :: null coalesce operator in php (laravel) 
Php :: connecting to database and performing sql queries 
Php :: union type php does not work 
Php :: upsert request php-salesforce-rest-api 
Php :: how to use db more than 1 codeigiter 3 
Php :: view codeigniter 4 
Php :: presentar la respuesta del conteo de la tabla una tabla en php 
Php :: $request laravel undefined inside function query 
Php :: datatables compactible with bootstrap v4 
Php :: run php code online 
Php :: debugger not installed phpstorm 
Php :: test lockForUpdate laravel 
Php :: phpmailer valid cert 
Php :: Return the union of this RDD and another one 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =