function writePurchase($purchase_id, $club_id) { $mutable = true; $result = mysql_query("SELECT status, instance_id FROM purchase_order WHERE id = '{$purchase_id}'"); if ($row = mysql_fetch_array($result)) { if ($row[0] != 0) { $mutable = false; } $instance_id = $row[1]; } else { return -2; } //use custom to display the fields customDisplay($instance_id, "purchase_process.php?id={$purchase_id}&club_id={$club_id}&submit=submit", $mutable, 'I\'m done. Submit.'); }
function writeRecommendation($recommend_id, $user_id, $auth) { //determine whether recommendation should be mutable, and get instance id at the same time $mutable = true; $result = mysql_query("SELECT status, instance_id FROM recommendations WHERE id = '{$recommend_id}'"); $instance_id = 0; if ($row = mysql_fetch_array($result)) { if ($row[0] != 0) { $mutable = false; } $instance_id = $row[1]; } else { return -2; } //use custom to display the fields customDisplay($instance_id, "recommend.php?id={$recommend_id}&user_id={$user_id}&auth={$auth}&submit=submit", $mutable, 'I\'m done. Submit.'); }