Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. <?php
  2. // present inventory and further calculation is done here...
  3. foreach($products_info as $product_info) {
  4.     $result = mysql_query("SELECT product, current_quantity FROM Quantities WHERE product=$product_info['product_id'] AND      
  5.                             current_quantity=$product_info['minimum_quantity'];");
  6.     if ($result) {
  7.         $row = mysql_fetch_assoc($result);
  8.         $msg = "Current stock for product $row['product'] is less than minimum stock of $product_info['minimum_quantity']. $current_quantity items are remaining in the stock.";
  9.         mail($recipient, "Stock renewal needed, ", $msg);
  10.     }
  11. }
  12. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement