11 lines
378 B
PHP
11 lines
378 B
PHP
<?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;
|
|
}
|
|
?>
|