<?php include('include/auth.php');?>
<!doctype html>
<html class="fixed dark">
<?php 
	$pagerole="user";
	 $fid=$_GET['id'];

	include('include/head.php');
	$sql1 = $db2->query("SELECT * FROM api_ext_seasons WHERE api_ext_seasons.api_ext_season_id='$fid' ") or die(mysql_error());
$row = mysqli_fetch_array( $sql1 );
    
		?>

<body>
<?php

///check whether data with the name usename has been submitted
   if (isset($_POST['api_ext_season_diff_am'])) {
  //variables to hold our submitted data with post

  $api_ext_season_diff_mod = $_POST['api_ext_season_diff_mod'];
 $api_ext_season_diff_am = $_POST['api_ext_season_diff_am'];

       $api_ext_season_diff_mod =$db2->real_escape_string($api_ext_season_diff_mod);		
       
//our sql statement that we will execute
$sql = "INSERT INTO `api_ext_season_diff` (`api_ext_season_diff_id`, `api_ext_season_diff_exid`, `api_ext_season_diff_mod`, `api_ext_season_diff_am`) VALUES (NULL, '{$fid}', '{$api_ext_season_diff_mod}', '{$api_ext_season_diff_am}');";
        
if ($db2->query($sql) === TRUE) {
echo "<div class='alert alert-success'>Record Updated Succesfully</div><script>"; echo "window.history.go(-2);";
echo "</script>";;
exit;}
else {
echo "<div class='alert alert-danger'>Error updating record: </div>" . $db->error;
}

$db2->close();
    
}?>
    <section class="body">

        <!-- start: header -->
        <header class="header">
            <div class="logo-container">
                <a href="index.php" class="logo">
                    <img src="img/logo-light.png" width="75" height="35" alt="Web Voyage" />
                </a>
                <div class="d-md-none toggle-sidebar-left" data-toggle-class="sidebar-left-opened" data-target="html"
                    data-fire-event="sidebar-left-opened">
                    <i class="fas fa-bars" aria-label="Toggle sidebar"></i>
                </div>
            </div>

            <!-- start: search & user box -->
            <div class="header-right">
                <?php include('include/search.php');?>


                <span class="separator"></span>
                <?php include('include/notifications.php');?>


                <span class="separator"></span>
                <?php include('include/userbox.php');?>

            </div>
            <!-- end: search & user box -->
        </header>
        <!-- end: header -->

        <div class="inner-wrapper">
            <!-- start: sidebar -->
            <?php include('include/nav.php');?>
            <!-- end: sidebar -->

            <section role="main" class="content-body">
                <header class="page-header">
                    <h2>EDIT API Extended Season </h2>

                    <div class="right-wrapper text-right">
                        <ol class="breadcrumbs">
                            <li>
                                <a href="index.php">
                                    <i class="fas fa-home"></i>
                                </a>
                            </li>
                            <li><span>WV Admin</span></li>
                            <li><span>EDIT API Extended Season</span></li>
                        </ol>

                        <a class="sidebar-right-toggle" data-open="sidebar-right"><i
                                class="fas fa-chevron-left"></i></a>
                    </div>
                </header>

                               <!-- start: page -->
                <form class="order-details action-buttons-fixed" action="editapextseasondiff.php?id=<?php echo $fid;?>"
                    method="post" name="form1">

                    <div class="row">
                        <div class="col-xl-4 mb-4 ">
                            <div class="card card ">
                                <div class="card-header">
                                    <h2 class="card-title">Season Difference</h2>
                                </div>
                                <div class="card-body">


                                    <div class="form-row">
                                        <div class="form-group col-xl-6 mb-3">
                                            <label>+/-</label>
                                            <select data-plugin-selectTwo class="form-control populate"
                                                        id="api_ext_season_diff_mod" name="api_ext_season_diff_mod">
                                                        
                                                        <option value="+"> + </option>
                                                            <option value="-" >  - </option>
                                                    
                                                            
                                                    </select>
                                        </div>
                                    </div>
                                    <div class="form-row">
                                        <div class="form-group col-xl-6 mb-3">
                                            <label>Difference</label>
                                            <input type="text" class="form-control form-control" name="api_ext_season_diff_am"
                                                value="" />
                                        </div>

                                    </div>



                                   
                                </div>
                            </div>

                        </div>
                     
                        <div class="col-xl-4 mb-4 ">
                            <div class="card card ">
                                <div class="card-header">
                                    <h2 class="card-title">Season Info</h2>
                                </div>
                                <div class="card-body">
                                <p>Season Name: <?php echo$row["api_ext_seasons_name"]; ?></p> 
                                <p>Start: <?php echo date('d/m/Y H:i', $row["api_ext_season_start"]); ?></p> 
                                    <p>End: <?php echo date('d/m/Y H:i', $row["api_ext_season_end"]); ?></p> 
                                  
                                   
                                 


                                   

                                   
                                </div>
                            </div>

                        </div>
                    </div>
                    <div class="row action-buttons">

                        <div class="col-12 col-md-auto">
                            <button type="submit"
                                class="submit-button btn btn-primary btn-px-4 py-3 d-flex align-items-center font-weight-semibold line-height-1"
                                data-loading-text="Loading...">
                                <i class="bx bx-save text-4 mr-2"></i> Save
                            </button>
                        </div>

                        <div class="col-12 col-md-auto px-md-0 mt-3 mt-md-0">
                            <a href="apipartner.php"
                                class="cancel-button btn btn-light btn-px-4 py-3 d-flex align-items-center font-weight-semibold line-height-1">Return</a>
                        </div>

                    </div>

                </form>
                <!-- end: page -->
            </section>
        </div>

        <?php include('include/aside.php');?>

    </section>


    <!-- Vendor -->
    <script src="vendor/jquery/jquery.js"></script>
    <script src="vendor/jquery-browser-mobile/jquery.browser.mobile.js"></script>
    <script src="vendor/popper/umd/popper.min.js"></script>
    <script src="vendor/bootstrap/js/bootstrap.js"></script>
    <script src="vendor/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
    <script src="vendor/common/common.js"></script>
    <script src="vendor/nanoscroller/nanoscroller.js"></script>
    <script src="vendor/magnific-popup/jquery.magnific-popup.js"></script>
    <script src="vendor/jquery-placeholder/jquery.placeholder.js"></script>

    <!-- Specific Page Vendor -->
    <script src="vendor/select2/js/select2.js"></script>
    <script src="vendor/pnotify/pnotify.custom.js"></script>

    <!--(remove-empty-lines-end)-->

    <!-- Theme Base, Components and Settings -->
    <script src="js/theme.js"></script>

    <!-- Theme Custom -->
    <script src="js/custom.js"></script>

    <!-- Theme Initialization Files -->
    <script src="js/theme.init.js"></script>

    <!-- Examples -->
    <script src="js/examples/examples.header.menu.js"></script>
    <script src="js/examples/examples.ecommerce.orders.detail.js"></script>


</body>

</html>
<?php include('include/footer.php');?>