if ($comp_id == '') { if (!CheckProductionExist($local_id, $prod_id)) { AddProduction($local_id, $prod_id, $quantity); } else { $error = '"' . $prod_name . '" უკვე არის სიაში!'; } } else { SaveProduction($comp_id, $prod_id, $quantity); } } else { $error = 'არასაკმარისი პროდუქტი მარაგში!'; } break; case 'disable': $prod_id = $_REQUEST['id']; DeleteProduction($prod_id); break; default: $error = 'Action is Null'; } $data['error'] = $error; echo json_encode($data); /* ****************************** * Recipie Production List Functions * ****************************** */ function AddProduction($local_id, $prod_id, $quantity) { mysql_query("INSERT INTO `transfer_detail`\r\n\t\t\t\t\t(`transfer_id`, `production_id`, `quantity`) \r\n\t\t\t\t VALUES\r\n\t\t\t\t\t({$local_id}, {$prod_id}, {$quantity})"); } function SaveProduction($comp_id, $prod_id, $quantity)
$ingredient_id = GetProductID($ing_name); if ($comp_id == '') { if (!CheckProductionExist($local_id, $ingredient_id)) { AddProduction($local_id, $user_id, $ingredient_id, $amount, $quantity, $price, $checked); global $log; $log->setInsertLog('recipie'); } else { $error = ' უკვე არის სიაში!'; } } else { SaveProduction($comp_id, $user_id, $ingredient_id, $amount, $quantity, $price, $checked); } break; case 'disable': $ingr_id = $_REQUEST['id']; DeleteProduction($ingr_id); break; default: $error = 'Action is Null'; } $data['error'] = $error; echo json_encode($data); /* ****************************** * Recipie Production List Functions * ****************************** */ function getProdId($ingredient_name) { mysql_query("SELECT `production`.`id`\r\n\t\t\t\tFROM `production`\r\n\t\t\t\tWHERE `production`.`name` = '{$ingredient_name}'"); } function AddProduction($recipie_id, $user_id, $ingredient_id, $amount, $quantity, $price, $checked)