Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <?php
- require 'connect.php';
- require 'core.php';
- require 'navigation.php';
- if(loggedin()) {
- //header('Location: index.php');
- } else {
- header('Location: login.php');
- }
- ?>
- <html>
- <head>
- <meta charset='utf-8'>
- <title>Upstrey - Shared Tickets</title>
- <style>
- #banner {
- float: left;
- margin: 6px;
- }
- li.SuccShared {
- position:fixed;
- opacity: 1;
- padding: 7px;
- background-color: lightgreen;
- color: black;
- top: 0%;
- margin-left: 40%;
- -moz-border-radius:30px 30px 5px 5px;
- -webkit-border-bottom-left-radius: 10px;
- -webkit-border-bottom-right-radius: 10px;
- -khtml-border-top-left-radius: 10px;
- -khtml-border-top-right-radius: 10px;
- }
- li.AlreadyShared {
- position:fixed;
- opacity: 1;
- padding: 7px;
- background-color: red;
- color: white;
- top: 0%;
- margin-left: 40%;
- -moz-border-radius:30px 30px 5px 5px;
- -webkit-border-bottom-left-radius: 10px;
- -webkit-border-bottom-right-radius: 10px;
- -khtml-border-top-left-radius: 10px;
- -khtml-border-top-right-radius: 10px;
- }
- </style>
- </head>
- <body>
- <?php
- $responseText = '';
- $user = getUserData('users', 'Username');
- $sql = "SELECT `Uplata`, `Dobivka`, `Date`, `match1`, `match2`, `match3`, `match4`, `match5`, `match6`, `match7`, `match8`, `match9`, `match10`, `match11`, `match12`, `match13`, `match14`, `match15`, `match16`, `Odds`, `tip1`, `tip2`, `tip3`, `tip4`, `tip5`, `tip6`, `tip7`, `tip8`, `tip9`, `tip10`, `tip11`, `tip12`, `tip13`, `tip14`, `tip15`, `tip16`, `isActive`, `ticket_id`, `isShared`, `Username`, `Liked` FROM `kladilnica`";
- $result = $conn->query($sql);
- $count = 0;
- $count1 = 0;
- $uplata_total = 0;
- if($result === false) {
- echo "<b>Could not connect to database.</b>";
- trigger_error('Wrong SQL: ' . $sql . ' Error: ' . $conn->error, E_USER_ERROR);
- } else {
- if($result->num_rows == 0) {
- echo "<b>No more shared tickets.</b>";
- } else if($result->num_rows >= 1) {
- $count = $count + 1;
- $count1 = $count1 + 1;
- while($row = $result->fetch_assoc()) {
- if($result->num_rows != empty($row['match1'])) {
- $date = $row["Date"];
- $uplata_total = $row["Uplata"];
- $dobivka_total = $row["Dobivka"];
- $is_active = $row["isActive"];
- $is_shared = $row["isShared"];
- $odd = $row["Odds"];
- $publisher = $row["Username"];
- $ticket_id = $row["ticket_id"];
- $likedCount = $row["Liked"];
- if($is_active == 1 && $is_shared == 1) {
- ?>
- <form action='shared.php' method='POST'>
- <table id='t01' style='margin-bottom: 10px; padding: 15px;'>
- <thead>
- <tr>
- <th colspan='2'>
- <a style='position: relative; padding-left: 5px; float: left;'>Publisher: <?= $publisher ?></a>
- </th>
- </tr>
- <tr>
- <th colspan='2'>
- <button name="like" style="position: relative; cursor: pointer; margin-right: 5px; float: right;" class="share_button" value="<?= $ticket_id ?>" type="submit" id="likeBtn" onclick="change()">Like <?php echo "($likedCount)" ?></button>
- <a style="position: relative; cursor: pointer; margin-left: 5px; float: left;">Date: <?php echo $date ?></a>
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><?= $row["match1"] ?></td>
- <td><?= $row["tip1"] ?></td>
- </tr>
- <tr>
- <td><?= $row["match2"] ?></td>
- <td><?= $row["tip2"] ?></td>
- </tr>
- <tr>
- <td><?= $row["match3"] ?></td>
- <td><?= $row["tip3"] ?></td>
- </tr>
- <tr>
- <td><?= $row["match4"] ?></td>
- <td><?= $row["tip4"] ?></td>
- </tr>
- <tr>
- <td><?= $row["match5"] ?></td>
- <td><?= $row["tip5"] ?></td>
- </tr>
- <tr>
- <td><?= $row["match6"] ?></td>
- <td><?= $row["tip6"] ?></td>
- </tr>
- <tr>
- <td><?= $row["match7"] ?></td>
- <td><?= $row["tip7"] ?></td>
- </tr>
- <tr>
- <td><?= $row["match8"] ?></td>
- <td><?= $row["tip8"] ?></td>
- </tr>
- <tr>
- <td><?= $row["match9"] ?></td>
- <td><?= $row["tip9"] ?></td>
- </tr>
- <tr>
- <td><?= $row["match10"] ?></td>
- <td><?= $row["tip10"] ?></td>
- </tr>
- <tr>
- <td><?= $row["match11"] ?></td>
- <td><?= $row["tip11"] ?></td>
- </tr>
- <tr>
- <td><?= $row["match12"] ?></td>
- <td><?= $row["tip12"] ?></td>
- </tr>
- <tr>
- <td><?= $row["match13"] ?></td>
- <td><?= $row["tip13"] ?></td>
- </tr>
- <tr>
- <td><?= $row["match14"] ?></td>
- <td><?= $row["tip14"] ?></td>
- </tr>
- <tr>
- <td><?= $row["match15"] ?></td>
- <td><?= $row["tip15"] ?></td>
- </tr>
- <tr>
- <td><?= $row["match16"] ?></td>
- <td><?= $row["tip16"] ?></td>
- </tr>
- <tr>
- <th colspan='2'>Total Bet: <?= $uplata_total ?></th>
- </tr>
- <tr>
- <th colspan='2'>Total Win: <?= $dobivka_total ?></th>
- </tr>
- </tbody>
- </table>
- </form>
- <?php
- $count++;
- }
- if($count % 10 == 0) {
- ?>
- <div id="banner">
- <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
- <!-- ticketAds -->
- <ins class="adsbygoogle"
- style="display:inline-block;width:300px;height:250px"
- data-ad-client="ca-pub-5699416235054188"
- data-ad-slot="8461367752"></ins>
- <script>
- (adsbygoogle = window.adsbygoogle || []).push({});
- </script>
- </div>
- <?php
- if(isset($_POST['like'])) {
- $like = (int) $_POST['like'];
- $sql = "UPDATE `kladilnica` SET Liked = Liked+1 WHERE ticket_id = '".$like."' AND Username = '".$user."'";
- $return = $conn->query($sql);
- $responseText = ($conn->affected_rows)
- ? "<li class='SuccShared' id='activator'>You have successfully shared the ticket $ticket_id</li>"
- : "<li class='AlreadyShared' id='activator'>The ticket ($ticket_id) was shared already</li>";
- }
- }
- }
- }
- }
- }
- $conn->close();
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement