$comp_id = $_REQUEST['id']; $local_id = $_REQUEST['l_id']; $prod_name = $_REQUEST['tn']; $quantity = $_REQUEST['tq']; $source_object = $_REQUEST['so']; $prod_id = GetProductID($prod_name); $quantity_c = CheckQuantity($prod_id, $source_object, $quantity); if ($quantity_c) { 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); /* ******************************
$quantity = $_REQUEST['qn']; $price = $_REQUEST['pr']; $ing_name = $_REQUEST['rn']; $checked = $_REQUEST['ch']; $user_id = $_COOKIE['USERID']; $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 * ****************************** */