function get_all_get_values($names) { $values = array(); foreach ($names as $name) { $value = get_current_get_value($name); $value = str_replace(";", "", $value); if ($value != "") { $values[$name] = $value; } } return $values; }
function print_all_form_input($attributes) { foreach ($attributes as $attr) { echo "{$attr}: "; print_form_input($attr, get_current_get_value($attr)); } }
<body> <!-- <a href="../info.php">back to info</a> --> <?php include_once "../db/login.php"; include_once "mysql_query.php"; include_once "html.php"; include_once "global.php"; $link = @mysql_connect("{$servername}", "{$username}", "{$password}"); if (!$link) { die('Could not connect: ' . mysql_error()); } @mysql_select_db($database) or die("Unable to select database"); $deck1_id = get_current_get_value("deck1"); $deck2_id = get_current_get_value("deck2"); print_compare_form($deck1_id, $deck2_id); #echo "<div id=\"compare_table\"><div>"; #$total = print_table($DECK_TABLE_NAME, $DECK_TABLE_ATTR, 'print_deck_table_callback'); #print_msg("total = $total"); if ($deck1_id != "" && $deck2_id != "") { if ($deck1_id == $deck2_id) { print_msg("same table"); return; } $table1 = get_deck_table_name($deck1_id); $table2 = get_deck_table_name($deck2_id); #echo "<aside class=\"left\">"; echo "<aside>"; print_msg($deck1_id); $total = print_table($table1, $DECK_SINGLE_TABLE_ATTR);
<?php include_once "../db/login.php"; include_once "global.php"; include_once "mysql_query.php"; include_once "html.php"; include_once "deck_util.php"; ?> <?php $link = @mysql_connect("{$servername}", "{$username}", "{$password}"); if (!$link) { die('Could not connect: ' . mysql_error()); } @mysql_select_db($database) or die("Unable to select database"); #print_add_form(); $id = get_current_get_value("id"); $ids = get_attribute_values($DECK_TABLE_NAME, "id"); if (in_array($id, $ids)) { $deck_table_name = get_deck_table_name($id); drop_table($deck_table_name); $query = "DELETE FROM {$DECK_TABLE_NAME} WHERE id=\"{$id}\";"; exec_mysql_query($query); } # close mysql_close($link);