function printHistory($history) { echo "<table class ='pure-table pure-table-bordered'>"; echo "<thead><tr><th>Reservation Id</th><th>Date of Departure (GMT)</th><th>Depart City</th>" . "<th>Depart Country</th><th>Arrival City</th><th>Arrival Country</th>" . "<th>Class</th><th>Number of tickets</th><th>Credit card #</th>" . "<th>COST (CAD)</th></thead>"; $it = 0; while ($tuple = OCI_Fetch_Array($history, OCI_ASSOC)) { $numFlights = 1; if (array_key_exists("FID3", $tuple)) { $numFlights = 3; } else { if (array_key_exists("FID2", $tuple) && array_key_exists("FID3", $tuple) != TRUE) { $numFlights = 2; } } $details = getDetails($tuple, $numFlights); echo "<tr><td>" . $tuple['RESID'] . "</td><td>" . $details['DEPARTDATE'] . "</td><td>" . $details['DEPARTCITY'] . "</td><td>" . $details['DEPARTCOUNTRY'] . "</td><td>" . $details['ARRIVALCITY'] . "</td><td>" . $details['ARRIVALCOUNTRY'] . "</td><td>" . parseClass($tuple['PCLASS']) . "</td><td>" . $tuple['TICKET_NUM'] . "</td><td>" . parseCard($tuple['CREDITCARD']) . "</td><td>" . $tuple['TOTAL_COST'] . "</td></tr>"; echo "<tr><td>"; $flight = array("FIRSTID" => $tuple['FID1']); if ($numFlights >= 2) { $flight["SECONDID"] = $tuple['FID2']; } if ($numFlights == 3) { $flight["THIRDID"] = $tuple['FID3']; } printDetails($flight, $it, 1); echo "</td></tr>"; $it++; } echo "</table>"; }
function printClassUseTable($result) { echo "<table class=\"mytable\">"; echo "<tr>\n\t\t\t\t<th>Activity ID</th>\n\t\t\t\t<th>Name</th>\n\t\t\t\t<th>Start Date</th><th></th><th></th>\n\t\t\t\t<th>Start Time</th><th></th><th></th>\n\t\t\t\t<th>End Time</th><th></th>\n\t\t\t\t<th>Sessions</th>\n\t\t\t\t<th>Repeats On</th><th></th>\n\t\t\t\t<th>Room</th>\n\t\t\t\t<th>Instructor Name</th>\n\t\t\t</tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<tr><td>" . $row["ACTIVITY_ID"] . "</td><td>" . $row["NAME"] . "</td><td>" . $row["DAY"] . "</td><td>" . "</td><td>" . "</td><td>" . $row["START_TIME"] . "</td><td>" . "</td><td>" . "</td><td>" . $row["END_TIME"] . "</td><td>" . "</td><td>" . $row["NUMOFSESSIONS"] . "</td><td>" . $row["REPEATEDON"] . "</td><td>" . "</td><td>" . $row["ROOMNUM"] . "</td><td>" . $row["INSTRUCTORNAME"] . "</td></tr>"; } echo "</table>"; }
function printActivityUseTable($result) { echo "<table class=\"myTable\">"; echo "<tr>\n\t\t\t\t<th>Activity ID</th>\n\t\t\t\t<th>Name</th>\n\t\t\t\t<th>Day</th><th></th><th></th>\n\t\t\t\t<th>Start Time</th><th></th><th></th>\n\t\t\t\t<th>End Time</th><th></th>\n\t\t\t\t<th>Room</th>\n\t\t\t</tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<tr><td>" . $row["ACTIVITY_ID"] . "</td><td>" . $row["NAME"] . "</td><td>" . $row["DAY"] . "</td><td>" . "</td><td>" . "</td><td>" . $row["START_TIME"] . "</td><td>" . "</td><td>" . "</td><td>" . $row["END_TIME"] . "</td><td>" . "</td><td>" . $row["ROOMNUM"] . "</td></tr>"; } echo "</table>"; }
function printRentals($result) { echo "<h2>Available Equipment</h2>"; echo "<table class=\"myTable\">"; echo "<tr><th>Equipment Type</th><th>Quantity Available</th><tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<tr><td>" . $row["TYPE"] . "</td><td>" . $row["COUNT"] . "</td></tr>"; } echo "</table>"; }
function printItem($result) { echo "<div class='Pokeguide'>"; echo "<table>"; echo "<tr><td>IID</td><td>Type</td><td>Description</td></tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<tr><td>" . $row[0] . "</td><td>" . $row[1] . "</td><td>" . $row[2] . "</td></tr>"; } echo "</table>"; echo "</div>"; }
function printPoke($result) { while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<tr>"; echo "<td><font size='5px'>Pokedex Number<br>{$row[0]}</font></td>"; echo "<td><font size='5px'>Name<br><a href = profile.php?name={$row[1]}>{$row[1]}</a></font></td>"; echo "</tr>"; echo "<tr>"; echo "<td><img src='{$row[2]}' alt='picture'></td>"; } }
function printLocation($result) { echo "<div class='Pokeguide'>"; echo '<table>'; echo '<tr><td>Location</td><td>Description</td></tr>'; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { if (strpos($row[0], 'Evolve') === false and strpos($row[0], 'LName') === false) { echo '<tr>'; echo '<td>' . $row[0] . '</td>'; echo '<td>' . $row[1] . '</td>'; echo '</tr>'; } } echo "</table>"; echo "</div>"; }
function printResult1($result) { //prints results from a select statement if ($_POST["query"] == "maxMemClass") { // print results from "class with most members" echo "<table class=\"mytable\">"; echo "<tr><th> Member_Count </th><th> Activity_ID </th></tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<tr><td>" . $row["COUNT"] . "</td><td>" . $row["AID"] . "</td></tr>"; } echo "</table>"; } elseif ($_POST["query"] == "teachingClass") { echo "<table class=\"mytable\">"; echo "<tr><th> Teaching_Count </th><th> Instructor </th></tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<tr><td>" . $row["COUNT"] . "</td><td>" . $row["NAME"] . "</td></tr>"; } echo "</table>"; } elseif ($_POST["query"] == "maxRentalItem") { echo "<table class=\"mytable\">"; echo "<tr><th>Rental_Count</th><th>EquipID</th></tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<tr><td>" . $row["COUNT"] . "</td><td>" . $row["EID"] . "</td></tr>"; } echo "</table>"; } elseif ($_POST["query"] == "avgClassRep") { echo "<table class=\"mytable\">"; echo "<tr><th>Avg Number of Sessions </th><th> StartDate </th></tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<tr><td>" . $row["AVG"] . "</td><td>" . $row["DAY"] . "</td></tr>"; } echo "</table>"; } elseif ($_POST["query"] == "classPrice") { echo "<table class=\"mytable\">"; echo "<tr><th>Class Name</th><th>Price</th></tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<tr><td>" . $row["N"] . "</td><td>" . $row["P"] . "</td></tr>"; } echo "</table>"; } }
function printResult($result) { //prints results from a select statement echo "<br>Got data from table:<br>"; echo "<div class=" . "pure-table pure-table-bordered pure-table-striped" . "><table>"; echo "<tr><th>cid</th>" . "<th>email</th>" . "<th>password</th>" . "<th>cname</th>" . "<th>passport_country</th>" . "<th>passport_num</th>" . "<th>phone#</th>" . "<th>address</th></tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { /* echo "<tr><td>" . $row["CID"] . "</td><td>" . $row["EMAIL"] . "</td><td>" . $row["PASSWORD"] . "</td><td>" . $row["CNAME"] . "</td><td>" . $row["PASSPORT_COUNTRY"] . "</td><td>" . $row["PASSPORT_NUM"] . "</td><td>" . $row["PHONE#"] . "</td><td>" . $row["ADDRESS"] . "</td></tr>"; //or just use "echo $row[0]" */ echo "<tr><td>" . $row[0] . "</td><td>" . $row[1] . "</td><td>" . $row[2] . "</td><td>" . $row[3] . "</td><td>" . $row[4] . "</td><td>" . $row[5] . "</td><td>" . $row[6] . "</td><td>" . $row[7] . "</td></tr>"; //or just use "echo $row[0]" } echo "</table></div>"; }
function printTable($attributes, $data) { echo "<div class=" . "pure-table pure-table-bordered pure-table-striped" . "><table>"; // print the top row (attribute labels) $label = "<tr>"; foreach ($attributes as $value) { $label = $label . "<th>" . $value . "</th>"; } echo $label . "</tr>"; // print the data rows (tuples) while ($tuple = OCI_Fetch_Array($data, OCI_NUM)) { $output = "<tr>"; foreach ($tuple as $value) { $output = $output . "<td>" . $value . "</td>"; } echo $output . "</tr>"; } echo "</table></div>"; }
function printFlights($flights, $locations) { echo "<p><br>Search Results: <br></p>"; echo "<form method='POST' action='reservation.php'>"; echo '<table class = "pure-table pure-table-bordered">'; // print the top row (attribute labels) echo '<thead>'; echo "<tr><th>Departure Airport</th><th>City</th><th>Country</th>" . "<th>Arrival Airport</th><th>City</th><th>Country</th><th>Departure Time (GMT)</th>" . "<th>Total Flight Time</th><th>COST (CAD)</th><th>Choose Flight</th></tr>"; echo '</thead>'; // print the data rows (tuples) $it = 0; while ($flight = OCI_Fetch_Array($flights, OCI_ASSOC)) { $printout = "<tr>"; foreach ($locations as $value) { $printout = $printout . "<td>{$value}</td>"; } $departtime = parseDate($flight['DT1'], 1); $flighttime = parseDate($flight['TOTALTIME'], 2); $cost = $flight['TOTALPRICE']; $fclassint = 0; // Variable costs depends on class if (strcmp($_COOKIE['flightclass'], "economy") == 0) { $cost *= 1; $fclassint = 1; } else { if (strcmp($_COOKIE['flightclass'], "business") == 0) { $cost *= 3; $fclassint = 3; } else { if (strcmp($_COOKIE['flightclass'], "first") == 0) { $cost *= 5; $fclassint = 5; } } } // update the cost if the class is changed $flight['TOTALPRICE'] = $cost; // Add class and num tickets to the post array $flight['CLASS'] = $_COOKIE['flightclass']; $flight['CLASSINT'] = $fclassint; $flight['NUMTICKETS'] = $_COOKIE['numtickets']; $flight_string = serialize($flight); echo $printout . "<td>{$departtime}</td><td>{$flighttime}</td><td>{$cost}</td>"; echo "<td><input type='radio' name='flightchoice' value='{$flight_string}' required></td></tr>"; echo "<tr><td>"; printDetails($flight, $it, 1); echo "</td></tr>"; $it++; } echo "</table>"; echo "<input type='submit' value='Book my flight'></form>"; }
function printResult($result) { //prints results from a select statement echo "<div class='content-customer-area'>"; echo "<br>Got data from table:<br>"; echo "<div class=" . "pure-table pure-table-bordered pure-table-striped" . "><table>"; echo "<tr><th>cid</th>" . "<th>email</th>" . "<th>password</th>" . "<th>cname</th>" . "<th>passport_country</th>" . "<th>passport_num</th>" . "<th>phone#</th>" . "<th>address</th></tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<tr><td>" . $row[0] . "</td><td>" . $row[1] . "</td><td>" . $row[2] . "</td><td>" . $row[3] . "</td><td>" . $row[4] . "</td><td>" . $row[5] . "</td><td>" . $row[6] . "</td><td>" . $row[7] . "</td></tr>"; //or just use "echo $row[0]" } echo "</table></div></div>"; }
function printTable($result) { echo "<div class='Pokeguide'>"; echo "<table>"; echo "<tr>"; echo "<td>Trainer Name</td>"; echo "</tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { for ($i = 0; $i < 15; $i++) { if ($row[$i] != null) { echo "<tr><td>" . $row[$i] . "</td></tr>"; } //or just use "echo $row[0]" } } echo "</table>"; echo "</div>"; }
function printResult($result) { //prints results from a select statement echo "<br>Got data from table customers:<br>"; echo "<table>"; echo "<tr><th>User</th>" . " " . "<th>Address </th>" . " " . "<th>Password </th>" . " " . "<th>Phone </th></tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<tr><td>" . " " . $row["USERNAME"] . " </td><td>" . " " . $row["ADDRESS"] . " </td><td>" . " " . $row["PASSWORD"] . "</td><td>" . " " . $row["PHONE"] . "</td></tr>"; //or just use "echo $row[0]" } echo "</table>"; }
//EXTRACT DATA FROM TYPES TABLE $Type_is = executePlainSQL("SELECT * from type_is"); echo "<table>"; echo "<tr><td>Attack\\Defense</td>"; //=============FIRST ROW FOR THE TABLES while ($row = OCI_Fetch_Array($Type_is, OCI_BOTH)) { if ($row[0] != 'Nothing') { echo "<td>{$row['0']}</td>"; } } //========================= echo "</tr>"; //=============REST OF ROWS $RestType = executePlainSQL("SELECT * from type_is"); //REST OF THE TABLE while ($row = OCI_Fetch_Array($RestType, OCI_BOTH)) { if ($row[0] != 'Nothing') { echo "<tr>"; for ($x = 0; $x < 16; $x++) { if ($row[$x] == 2) { echo "<td bgcolor='#00CC00'>{$row[$x]}</td>"; } else { if ($row[$x] == 0.5) { echo "<td bgcolor='#FF0000'>{$row[$x]}</td>"; } else { if ($row[$x] == 0) { echo "<td bgcolor='#C2C2A3'>{$row[$x]}</td>"; } else { echo "<td>{$row[$x]}</td>"; } }
function dropDownFromQuery($attr_name, $table, $target) { echo "<form method=\"POST\" action=\"" . $target . "\"><select name =\"activityName\">"; echo "<option value=\"\">Select...</option>"; $string = "select " . $attr_name . " from " . $table; $result = executePlainSQL($string); while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<option value=\"" . $row[0] . "\">" . $row[0] . "</option>"; } echo "</select><br><input class=\"pure-button\" type=\"submit\" value=\"Select\" name=\"select\"></form>"; }
function printDivide($result) { echo "<div class=container>"; echo "<table class='table table-striped'>"; echo "<h3>Displaying employees not assigned to a vehicle</h3>"; echo "<tr><th>sin</th><th>name</th><th>phone</th></tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<tr><td>" . $row["SIN"] . "</td><td>" . $row["NAME"] . "</td><td>" . $row["PHONE"] . "</td></tr>"; } echo "</table>"; echo "</div>"; }
<?php require 'template.php'; global $db_conn; ini_set('session.save_path', '/home/i/i5a8/'); session_start(); $PID = executePlainSQL("SELECT party FROM party WHERE partyid = '{$_SESSION["username"]}'"); $row = OCI_Fetch_Array($PID, OCI_BOTH); $updatedParty = explode(",", $row[0]); $stringParty; //Substitute number $pokeNum = $_GET['submit']; //================= //var_dump($pokeNum); //DELETE FROM ARRAY PARTY $num = array_search("{$pokeNum}", $updatedParty); unset($updatedParty[$num]); //INSERT INTO STRING $stringParty = implode(",", $updatedParty); //INSERT INTO DATABASE var_dump($stringParty); echo "<br><br>"; executePlainSQL("UPDATE party SET party='{$stringParty}' WHERE partyid = '{$_SESSION["username"]}'"); OCICommit($db_conn); OCILogoff($db_conn); header("Location: user.php");
Password: <br><input type="password" name="password"><br> <input type="submit" value="login"> </form> <button onclick="location.href = 'register.php';">Register Here</button> <?php global $db_conn; //IF FORM IS SUBMITTED ALREADY if (isset($_POST['username']) and isset($_POST['password'])) { $username = $_POST['username']; $password = $_POST['password']; //CHECK IF VALUES ARE IN THE DATABASE $results = executePlainSQL("select * from users where userid='{$username}' and password='******'"); OCICommit($db_conn); $arrayResults = OCI_Fetch_Array($results, OCI_BOTH); OCILogoff($db_conn); if ($arrayResults[0] != null) { $_SESSION["username"] = $_POST["username"]; $_SESSION["login"] = true; header("Location: user.php"); } else { echo "<br>Wrong password or username<br>"; } } ?> </div> </div> </div>
function printResult($result) { //prints results from a select statement echo "<br>Employee Info<br>"; echo "<table class='table table-striped'>"; echo "<tr><th>Username</th>" . " " . "<th>Wage</th>" . " " . "<th>Job Type</th>" . " " . "<th>Work Schedule</th></tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<tr><td>" . $row["USERNAME"] . " </td><td>" . $row["WAGE"] . " </td><td>" . $row["JOBT"] . "</td><td>" . " " . $row["WORKS"] . "</td></tr>"; //or just use "echo $row[0]" } echo "</table>"; }
function printTable($result) { echo "<div class='Pokeguide'>"; echo "<table>"; echo "<tr>"; echo "<td>Name</td>"; echo "<td>Type</td>"; echo "<td>PP</td>"; echo "<td>Description</td>"; echo "</tr>"; echo "<tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { for ($x = 0; $x < 4; $x++) { echo "<td>{$row[$x]}</td>"; } echo "</tr>"; } echo "</table>"; echo "</div>"; }
function printResult($result) { //prints results from a select statement echo "<br>Got data from table tab1:<br>"; echo "<table>"; echo "<tr><th>ID</th><th>Name</th></tr>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { echo "<tr><td>" . $row["NID"] . "</td><td>" . $row["NAME"] . "</td></tr>"; //or just use "echo $row[0]" } echo "</table>"; }
} } else { echo "<br>input invalid value.<br>"; } // Select data... $cmdstr = "select * from tab1"; $parsed = OCIParse($db_conn, $cmdstr); if (!$parsed) { $e = OCIError($db_conn); echo htmlentities($e['message']); exit; } $r = OCIExecute($parsed, OCI_DEFAULT); if (!$r) { $e = oci_error($parsed); echo htmlentities($e['message']); exit; } echo "<br>Got data from table tab1:<br>"; while ($row = OCI_Fetch_Array($parsed, OCI_BOTH)) { echo $row["COL1"]; echo "\n"; echo $row["COL2"]; echo "<br>"; } OCICommit($db_conn); OCILogoff($db_conn); } else { $e = OCIError(); echo htmlentities($e['message']); }
$sqlquery = "SELECT Store,Register,SKU,SUM(AMT) AS TotalAmount,substr(SALEDATE, 4,6)\n\tFROM TRNSACT \n\tWHERE substr(SALEDATE, 8,2) = substr(" . $Year . ", 3,2) \n\tAND Store = " . $store . " \n\tGROUP BY Register,SKU,Store,SALEDATE \n\tORDER BY TotalAmount DESC,Register,SKU,Store"; } elseif ($store == null && $quarter != "None") { $sqlquery = "SELECT Store,Register,SKU,SUM(AMT) AS TotalAmount,substr(SALEDATE, 4,6)\n\tFROM TRNSACT \n\tWHERE substr(SALEDATE, 8,2) = substr(" . $Year . ", 3,2)\n\tAND substr(SALEDATE, 4,3) IN('" . $month1 . "','" . $month2 . "','" . $month3 . "') \n\tGROUP BY Register,SKU,Store,SALEDATE \n\tORDER BY TotalAmount DESC,Register,SKU,Store"; } else { $sqlquery = "SELECT Store,Register,SKU,SUM(AMT) AS TotalAmount,substr(SALEDATE, 4,6)\n\tFROM TRNSACT \n\tWHERE substr(SALEDATE, 8,2) = substr(" . $Year . ", 3,2) \n\tGROUP BY Register,SKU,Store,SALEDATE \n\tORDER BY TotalAmount DESC,Register,SKU,Store"; } $sql_id = ociparse($connection, $sqlquery); if (!$sql_id) { $e = oci_error($connection); print htmlentities($e['message']); exit; } ociexecute($sql_id, OCI_DEFAULT); $result = array(); $numrows = oci_fetch_all($sql_id, $result, null, null, OCI_FETCHSTATEMENT_BY_ROW); if ($numrows == 0) { echo '<font color="' . red . '">There is no information available for the selected criteria. Please enter a valid combination of Category, Year and StoreID</font>'; } else { echo "<h3>Report - Register And SKU Summary</h3>"; echo "<table border=1>"; echo "<tr><td>" . Store . "</td><td></td><td>" . Register . "</td><td></td><td>" . SKU . "</td><td></td><td>" . TotalAmount . "</td><td></td><td>" . MonthYear . "</td><td></td><td></td></tr>"; ociexecute($sql_id, OCI_DEFAULT); while ($row = OCI_Fetch_Array($sql_id, OCI_NUM)) { echo "<tr><td>" . $row[0] . "</td><td></td><td>" . $row[1] . "</td><td></td><td>" . $row[2] . "</td><td></td><td>\n\t\t" . $row[3] . "</td><td></td><td>" . $row[4] . "</td><td></td><td></td></tr>"; } echo "</table>"; } } ocilogoff($connection); ?> </body>
$update_pw_q = "UPDATE Customer SET password = '******'new_pw'] . "' WHERE cid = " . $cid; executePlainSQL($update_pw_q); OCICommit($db_conn); ?> <script type="text/javascript"> alert("Password successfully updated!"); location: "profile.php"; </script> <?php } } } // Fetch the customer profile based on the cid from cookies $q = "select * from Customer where cid = '" . $cid . "'"; $result = executePlainSQL($q); $row = OCI_Fetch_Array($result, OCI_BOTH); $cname = $row['CNAME']; $email = $row['EMAIL']; $addr = $row['ADDRESS']; $phone = $row['PHONE']; $passport_country = $row['PASSPORT_COUNTRY']; $passport_num = $row['PASSPORT_NUM']; OCILogoff($db_conn); } ?> <div class="content-customer-area"> <p>Edit your profile:</p> <form class="pure-form pure-form-aligned" method="POST" action="profile.php"> <fieldset> <div class="pure-control-group">
function printPoke($result) { //========== COUNTS THE NUMBER OF POKEMON IN PARTY $PID = executePlainSQL("SELECT party FROM party WHERE partyid = '{$_SESSION["username"]}'"); $row = OCI_Fetch_Array($PID, OCI_BOTH); $updatedParty = explode(",", $row[0]); $numofPoke = count($updatedParty); //============================== echo "<div class='Pokeguide'>"; echo "<table>"; echo "<tr>"; echo "<td><font size='5px'>Pokedex Number</font></td>"; echo "<td><font size='5px'>Name</font></td>"; echo "<td><font size='5px'>Location</font></td>"; echo "</tr>"; echo "</table>"; while ($row = OCI_Fetch_Array($result, OCI_BOTH)) { if (strpos($row[1], 'Zero') === false) { $locQuery = executePlainSQL("select lname from poke_found where pid={$row[0]}"); $loc = OCI_Fetch_Array($locQuery, OCI_BOTH); echo "<table>"; echo "<tr>"; echo "<td><font size='5px'>{$row[0]}</font></td>"; echo "<td><font size='5px'><a href = profile.php?name={$row[1]}>{$row[1]}</a></font></td>"; echo "<td><font size='5px'>{$loc[0]}</font></td>"; echo "</tr>"; echo "<tr>"; if (isset($_SESSION["username"]) && $numofPoke < 6) { echo "<td colspan='2'><img src='{$row[2]}' alt='picture'></td>"; echo "<td>"; echo "<form action='addPokemon.php' method='get'>"; echo "<button name='submit' value='{$row[0]}'>Add Pokemon</button></form>"; echo "</td>"; } else { echo "<td colspan='3'><img src='{$row[2]}' alt='picture'></td>"; } echo "</tr>"; } } echo '</table>'; echo '</div>'; }