<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.4
 * @ Decoder version: 1.0.2
 * @ Release: 10/08/2022
 */

// Decoded file for php version 72.
$db = new SQLite3("./api/.smartsport.db");
$table_name = "sports";
$base_file = basename($_SERVER["SCRIPT_NAME"]);
$db->exec("CREATE TABLE IF NOT EXISTS " . $table_name . "(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, header_n TEXT, border_c TEXT, background_c TEXT, text_c TEXT, days TEXT, auto_s TEXT)");
$rows = $db->query("SELECT COUNT(*) as count FROM " . $table_name);
$row = $rows->fetchArray();
$numRows = $row["count"];
if($numRows == 0) {
    $db->exec("INSERT INTO " . $table_name . "(id, header_n, border_c, background_c, text_c, days, auto_s) VALUES('1', 'Event', '#000000', '#000000', '#ffffff', '7', '1')");
}
$resU = @$db->query("SELECT * FROM " . $table_name . " WHERE id='1'");
$rowU = @$resU->fetchArray();
if(isset($_POST["submit"])) {
    $db->exec("UPDATE " . $table_name . " SET header_n='" . $_POST["header_n"] . "',\n\t\t\t\t\t\t\t\t\t\tborder_c='" . $_POST["border_c"] . "', \n\t\t\t\t\t\t\t\t\t\tbackground_c='" . $_POST["background_c"] . "', \n\t\t\t\t\t\t\t\t\t\ttext_c='" . $_POST["text_c"] . "',\n\t\t\t\t\t\t\t\t\t\tauto_s='" . $_POST["auto_s"] . "'\n\t\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\tid='1'");
    $db->close();
    header("Location: " . $base_file);
}
include "includes/header.php";
echo "\n\n\n\t\t<div class=\"col-md-6 mx-auto\">\n\t\t\t<div class=\"modal fade\" id=\"how2\" tabindex=\"-1\" aria-labelledby=\"exampleModalLabel\" aria-hidden=\"true\">\n\t\t\t<div class=\"modal-dialog\">\n\t\t\t\t<div class=\"modal-content\">\n\t\t\t\t<div class=\"modal-header\">\n\t\t\t\t\t<h5 class=\"modal-title\" id=\"exampleModalLabel\">How to Get the API Key</h5>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"modal-body\">\n\t\t\t\t\t<p>Go to the website https://www.tvsportguide.com/page/widget/ , scroll to the bottom enter some BS info and it will give you url like below. The portion in red is what you need.\n\t\t\t\t\t<p><small>https://www.tvsportguide.com/widget/<em style=\"color:red;\">5cc316f797659</em>?filter_mode=all&filter_value</small></p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"modal-footer\">\n\t\t\t\t\t<button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>\n\t\t\t\t\t<a href=\"https://www.tvsportguide.com/page/widget/\"><button  type=\"button\" class=\"btn btn-primary\">Go to webpage</button></a>\n\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"card-body\">\n\t\t\t\t<div class=\"card bg-primary text-white\">\n\t\t\t\t\t<div class=\"card-header\">\n\t\t\t\t\t\t<center>\n\t\t\t\t\t\t\t<h2><i class=\"fa fa-wrench\"></i> Sports Events</h2>\n\t\t\t\t\t\t</center>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"card-body\">\n\t\t\t\t\t\t\t<form method=\"post\">\n\n\t\t\t\t\t\t\t\t<div class=\"form-group \">\n\t\t\t\t\t\t\t\t\t<div class=\"form-line\">\n\t\t\t\t\t\t\t\t\t  <label class=\"form-group form-float form-group-lg\">API Key</label><br>\n\t\t\t\t\t\t\t\t\t  <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"modal\" data-target=\"#how2\">How to get the API Key</button><br><br>\n\t\t\t\t\t\t\t\t\t  <input class=\"form-control\" name=\"auto_s\" value=\"";
echo $rowU["auto_s"];
echo "\" type=\"text\"/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\n\n\t\t\t\t\t\t\t\t<div class=\"form-group \">\n\t\t\t\t\t\t\t\t\t<div class=\"form-line\">\n\t\t\t\t\t\t\t\t\t\t<label class=\"form-group form-float form-group-lg\">Header Name</label>\n\t\t\t\t\t\t\t\t\t\t<input class=\"form-control\" name=\"header_n\" value=\"";
echo $rowU["header_n"];
echo "\" type=\"text\"/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<div class=\"form-group \">\n\t\t\t\t\t\t\t\t\t<div class=\"form-line\">\n\t\t\t\t\t\t\t\t\t\t<label class=\"form-group form-float form-group-lg\">Border</label>\n\t\t\t\t\t\t\t\t\t\t<input class=\"form-control\" name=\"border_c\" value=\"";
echo $rowU["border_c"];
echo "\" type=\"color\"/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<div class=\"form-group \">\n\t\t\t\t\t\t\t\t\t<div class=\"form-line\">\n\t\t\t\t\t\t\t\t\t\t<label class=\"form-group form-float form-group-lg\">Background Color</label>\n\t\t\t\t\t\t\t\t\t\t<input class=\"form-control\" name=\"background_c\" value=\"";
echo $rowU["background_c"];
echo "\" type=\"color\"/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<div class=\"form-group \">\n\t\t\t\t\t\t\t\t\t<div class=\"form-line\">\n\t\t\t\t\t\t\t\t\t\t<label class=\"form-group form-float form-group-lg\">Text Color</label>\n\t\t\t\t\t\t\t\t\t\t<input class=\"form-control\" name=\"text_c\" value=\"";
echo $rowU["text_c"];
echo "\" type=\"color\"/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<!--<div class=\"form-group \">\n\t\t\t\t\t\t\t\t\t<div class=\"form-line\">\n\t\t\t\t\t\t\t\t\t  <label class=\"form-group form-float form-group-lg\">Days</label>\n\t\t\t\t\t\t\t\t\t  <select class=\"form-control\" id=\"select\" name=\"days\">\n\t\t\t\t\t\t\t\t\t\t  <option value=\"1\" >1</option>\n\t\t\t\t\t\t\t\t\t\t  <option value=\"3\" >3</option>\n\t\t\t\t\t\t\t\t\t\t  <option value=\"7\" >7</option>\n\t\t\t\t\t\t\t\t\t  </select>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>-->\n\n\t\t\t\t\t\t\t\t<hr>\n\n\t\t\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t\t\t<center>\n\t\t\t\t\t\t\t\t\t\t<button class=\"btn btn-info\" name=\"submit\" type=\"submit\">\n\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-check\"></i> Update Status\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</center>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</form>\t \n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t</div>\n\n";
include "includes/footer.php";
?>
