// End db_num > 0 } // End !empty $content .= "<br /><br />"; $content .= display_systemstatic("seatmap"); } elseif ($_GET['action'] == "takeseat") { $seatX = $_GET['seatX']; $seatY = $_GET['seatY']; $ticketID = $_GET['ticketID']; $eventID = $sessioninfo->eventID; $password = $_POST['password']; $newlog['ticketID'] = $ticketID; $newlog['seatX'] = $seatX; $newlog['seatY'] = $seatY; $newlog['password'] = $password; if (seating_rights($seatX, $seatY, $ticketID, $eventID, $password)) { // We have rights to seat that ticket. Update DB $qTicketInfo = db_query("SELECT * FROM " . $sql_prefix . "_tickets WHERE ticketID = '" . db_escape($ticketID) . "'"); $rTicketInfo = db_fetch($qTicketInfo); // Check if that ticket is already used $qCheckUsedTicket = db_query("SELECT * FROM " . $sql_prefix . "_seatReg_seatings WHERE ticketID = '" . db_escape($ticketID) . "'"); if (db_num($qCheckUsedTicket) == 0) { // Ticket has never been used. Insert it db_query("INSERT INTO " . $sql_prefix . "_seatReg_seatings SET\n\t\t\t eventID = '" . db_escape($eventID) . "',\n\t\t\t ticketID = '" . db_escape($ticketID) . "',\n\t\t seatX = '" . db_escape($seatX) . "',\n\t\t seatY = '" . db_escape($seatY) . "'"); db_query("UPDATE " . $sql_prefix . "_tickets SET status = 'used'\n\t\t WHERE ticketID = '" . db_escape($ticketID) . "'"); } else { db_query("UPDATE " . $sql_prefix . "_seatReg_seatings SET\n\t\t seatX = '" . db_escape($seatX) . "',\n\t\t seatY = '" . db_escape($seatY) . "'\n\t\t WHERE ticketID = '" . db_escape($ticketID) . "'"); } // End else log_add("seating", "takeseat", serialize($newlog)); } else {
$content .= lang("This seat is password-protected. If you know the password, you can take it", "seatmap_table"); $content .= "<form method=POST action=?module=seating&action=takeseat&&ticketID={$ticketID}&seatX={$place_seatX}&seatY={$place_seatY}{$suffixSeatingUrl}>"; $content .= "<input type=text name=password><input type=submit value='" . lang("Take seat", "seatmap_table") . "'>\n"; $content .= "</form>"; break; case "g": if (seating_rights($place_seatX, $place_seatY, $ticketID, $sessioninfo->eventID, $password)) { $content .= lang("This seat is protected by group. You are a member of a group with access.", "seatmap_table"); $content .= "<br /><a href=\"?module=seating&action=takeseat&ticketID={$ticketID}&seatX={$place_seatX}&seatY={$place_seatY}{$suffixSeatingUrl}\">"; $content .= lang("Take seat", "seatmap_table"); $content .= "</a>"; } else { $content .= lang("This seat is protected by group. You are not member of a group with access. Too bad!", "seatmap_table"); } // End else break; case "r": if (seating_rights($place_seatX, $place_seatY, $ticketID, $sessioninfo->eventID, $password)) { $content .= _("This seat is protected by a special right. You are a member of a group with access"); $content .= "<br /><a href=\"?module=seating&action=takeseat&ticketID={$ticketID}&seatX={$place_seatX}&seatY={$place_seatY}{$suffixSeatingUrl}\">"; $content .= _("Take seat"); $content .= "</a>"; } else { $content .= _("This seat is protected by a special right. You are not member of a group with access. Too bad!"); } break; } // End switch } // End if db_num() == 0 }