if (!create_country($db)) { echo "<tr>\n\n\t\t\t\t<td>CREATE TABLE IF NOT EXISTS " . PRFX . "COUNTRY</td>\n\n\t\t\t\t<td><font color=\"red\"><b>Failed:</b></font> " . $db->ErrorMsg() . "</td>\n\n\t\t\t</tr>\n"; $error_flag = true; } else { echo "<tr>\n\n\t\t\t\t<td>CREATE TABLE IF NOT EXISTS " . PRFX . "COUNTRY</td>\n\n\t\t\t\t<td><font color=\"green\"><b>OK</b></font></td>\n\n\t\t\t</tr>\n"; } if (!create_gift($db)) { echo "<tr>\n\n\t\t\t\t<td>CREATE TABLE IF NOT EXISTS " . PRFX . "GIFT_CERT</td>\n\n\t\t\t\t<td><font color=\"red\"><b>Failed:</b></font> " . $db->ErrorMsg() . "</td>\n\n\t\t\t</tr>\n"; $error_flag = true; } else { echo "<tr>\n\n\t\t\t\t<td>CREATE TABLE IF NOT EXISTS " . PRFX . "GIFT_CERT</td>\n\n\t\t\t\t<td><font color=\"green\"><b>OK</b></font></td>\n\n\t\t\t</tr>\n"; } ################################## # create_TABLE_EXPENSE # ################################## if (!create_expense($db)) { echo "<tr>\n\n\t\t\t\t<td>CREATE TABLE IF NOT EXISTS " . PRFX . "TABLE_EXPENSE</td>\n\n\t\t\t\t<td><font color=\"red\"><b>Failed:</b></font> " . $db->ErrorMsg() . "</td>\n\n\t\t\t</tr>\n"; $error_flag = true; } else { echo "<tr>\n\n\t\t\t\t<td>CREATE TABLE IF NOT EXISTS " . PRFX . "TABLE_EXPENSE</td>\n\n\t\t\t\t<td><font color=\"green\"><b>OK</b></font></td>\n\n\t\t\t</tr>\n"; } ################################## # create_refund # ################################## if (!create_refund($db)) { echo "<tr>\n\n\t\t\t\t<td>CREATE TABLE IF NOT EXISTS " . PRFX . "TABLE_REFUND</td>\n\n\t\t\t\t<td><font color=\"red\"><b>Failed:</b></font> " . $db->ErrorMsg() . "</td>\n\n\t\t\t</tr>\n"; $error_flag = true; } else { echo "<tr>\n\n\t\t\t\t<td>CREATE TABLE IF NOT EXISTS " . PRFX . "TABLE_REFUND</td>\n\n\t\t\t\t<td><font color=\"green\"><b>OK</b></font></td>\n\n\t\t\t</tr>\n"; } ##################################
function new_expense() { create_expense($_POST['pot_id'], $_POST['amount'], $_POST['description']); my_exit("success", "expense created"); }