Add php files
This commit is contained in:
11
modules/EcmProducts/ProductsToOrder.php
Executable file
11
modules/EcmProducts/ProductsToOrder.php
Executable file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
function ProductToOrder($focus, $field, $value, $view) {
|
||||
$db = $focus->db;
|
||||
$query = "SELECT q3, ems_qty_in_stock from ecmproducts WHERE id='".$focus->id."';";
|
||||
$result = $db->query($query);
|
||||
$row = $db->fetchByAssoc($result);
|
||||
$q3 = $row['q3'];
|
||||
$stock = $row['ems_qty_in_stock'];
|
||||
if ( intval($stock) < 3 * intval($q3)) return 1; else return 0;
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user