%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /mnt/tnb2/los/backend/
Upload File :
Create Path :
Current File : //mnt/tnb2/los/backend/novy.php

<!DOCTYPE html>
<html lang="cs">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta name="apple-mobile-web-app-title" content="Správa závodů LOS" />
  <meta name="application-name" content="Správa závodů LOS" />
  <meta name="msapplication-TileColor" content="#da532c" />
  <meta name="theme-color" content="#ffffff" />
  <meta name="color-scheme" content="dark light" />
  <title>Správa závodů LOS</title>  
  <link rel="canonical" href="https://loslex.cz/backend/" />
  <link rel="apple-touch-icon" sizes="180x180" href="../apple-touch-icon.png" />
  <link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png" />
  <link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png" />
  <link rel="manifest" href="../site.webmanifest" />

  <!-- css -->
  <link rel="stylesheet" href="css/bootstrap.min.css" />
  <link rel="stylesheet" href="css/table-style.css" />
  <link rel="stylesheet" href="css/dashboard.css" />
</head>

<body>

<?php 
ini_set( "session.gc_maxlifetime", 86400 );
session_start();
$admin=$_SESSION["admin"];
$poradatel_id=$_SESSION["poradatel_id"];
$poradatel=$_SESSION["poradatel"];
include('../sql.php');
$db=mysqli_connect(pc,user,pass,data) or die('Není spojení s databází!');
$mysqli = new mysqli(pc,user,pass,data);
$dotaz="select * from poradatele where id_poradatele=".$poradatel_id;
$vychozi=mysqli_fetch_assoc($mysqli->query($dotaz));
?>
<header>
    <nav class="navbar navbar-expand-md fixed-top bg-light border-bottom">
      <div class="container-fluid">
        <span class="navbar-brand fw-bold fs-6">SK LOS SEVER z. s.</span>
        <button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#loslex"><span class="fas fa-bars"></span></button>
        <div class="collapse navbar-collapse" id="loslex">
          <div class="navbar-nav mx-auto">
            <ul class="navbar-nav mb-2 mb-lg-0">
              <li class="nav-item"><a class="nav-link" href="main.php">Přehled závodů</a></li>
              <li class="nav-item"><a class="nav-link active" href="novy.php">Nový závod</a></li>
			  <li class="nav-item"><a class="nav-link" href="poradatel_nastaveni.php">Nastavení pořadatele</a></li>
			  <?php if ($admin==1) {
						echo '<li class="nav-item"><a class="nav-link" href="zavodnici.php">Správa uživatelů</a></li>';
						echo '<li class="nav-item"><a class="nav-link" href="soutez_nastaveni.php">Nastavení soutěže</a></li>';
						}
						echo '</ul>';
						echo '</div>';
					if (isset($_SESSION["poradatel"])) {
						echo '<div class="navbar-nav ms-auto">';
						echo '<li class="nav-item dropdown">';
						echo '<a class="nav-link dropdown-toggle" href="login.php" role="button" data-bs-toggle="dropdown" aria-expanded="false">Pořadatel: '.$_SESSION["poradatel"].'</a>';
						echo '<ul class="dropdown-menu rounded-0">';
						echo '<li class="nav-item"><a class="nav-link dropdown-item" href="logout.php">Odhlásit</a></li>';
						echo '</ul>';
						echo '</li>';
						echo '</div>';
						}
					//else {echo '<li class="nav-item ms-auto"><a class="nav-link" href="index.php">Přihlásit</a></li>';}	
			  ?>
          </div>
        </div>
      </nav>
    </header>

  <!-- create table match *https://codepen.io/AllThingsSmitty/pen/MyqmdM* & *https://css-tricks.com/responsive-data-tables/* -->
  <div class="container">
    <div class="row">
      <div class="col-lg-12 offset-lg-0">
        <h4 class="text-center mt-3 mt-lg-0 mb-3">Založení nového závodu</h4>
        <ul class="nav nav-pills justify-content-center">
          <li class="nav-item">
            <a class="nav-link active" data-bs-toggle="tab" href="#step-1">Nastavení závodu</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" data-bs-toggle="tab" href="#step-2">Nastavení skupin</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" data-bs-toggle="tab" href="#step-3">Propozice</a>
          </li>
          <!--<li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#reg-in">Nic</a>
</li>-->
        </ul>

        <div class="tab-content">
          <!-- krok 1 -->
          <div class="tab-pane active" id="step-1">
            <div class="row py-2">
              <div class="col-lg-12 col-md-6 mb-3 mt-lg-0 mt-3">
                <form action="" method="post">
                  <div class="row">
                    <!-- Parametry -->
                    <div class="col-md-6 px-0 px-lg-3">
                      <fieldset class="border bg-white px-3 px-lg-4 pb-3 mb-3">
                        <legend class="float-none w-auto px-2 fs-6 fw-bold">Nastavení závodu:</legend>
                        <div class="row">
                          <div class="col-md-12 mb-3">
                            <label for="matchname" class="form-label small fw-semibold mb-1">Název závodu:</label>
                            <input type="text" class="form-control form-control-sm" name="matchname" id="matchname" value="<?php echo $vychozi["nazev"];?>" required />
                          </div>

                          <div class="col-md-6">
                            <div class="form-group mb-3">
                              <label for="matchdate" class="form-label small fw-semibold mb-1">Datum konání:</label>
                              <input type="date" class="form-control form-control-sm" name="matchdate" id="matchdate" required />
                            </div>
                          </div>

                          <div class="col-md-6 mb-3">
                            <div class="form-group">
                              <label for="years" class="form-label small fw-semibold mb-1">Ročník:</label>
                              <select id="rocnik" name="rocnik" class="form-select form-select-sm">
								<option value="" disabled selected hidden>Vyberte rok</option>
								<?php 
								$dotaz=mysqli_query($db,"select rok from rocniky_zavodu where aktivni=true order by rok");
								while($row = mysqli_fetch_row($dotaz)) {
								if ($row[0]==$vychozi["rocnik"]) {$vybrana='selected';} else {$vybrana='';}
								echo '<option '.$vybrana.' value="'.$row[0].'">'.$row[0].'</option>';
								}
								?>
							  </select>
                            </div>
                          </div>

                          <div class="col-md-6 mb-3">
                            <div class="form-group">
                              <label for="category" class="form-label small fw-semibold mb-1">Kategorie závodu:</label>
                              <select id="kategorie" name="kategorie" class="form-select form-select-sm">
              <option value="" disabled selected hidden>Vyberte variantu</option>
			  <?php 
				$dotaz=mysqli_query($db,"select nazev from kategorie_zavodu where aktivni=true");
				while($row = mysqli_fetch_row($dotaz)) {
					if ($row[0]==$vychozi["kategorie_zavodu"]) {$vybrana='selected';} else {$vybrana='';}
					echo '<option '.$vybrana.' value="'.$row[0].'">'.$row[0].'</option>';
				}
			?>
            </select>
                            </div>
                          </div>

                          <div class="col-md-6 mb-3">
                            <div class="form-group">
                              <label for="level" class="form-label small fw-semibold mb-1">Úroveň závodu:</label>
                              <select id="level" name="level" class="form-select form-select-sm">
                                <option value="" disabled selected hidden>Vyberte variantu</option>
              <?php 
				$dotaz=mysqli_query($db,"select nazev from uroven_zavodu where aktivni=true");
				while($row = mysqli_fetch_row($dotaz)) {
					if ($row[0]==$vychozi["uroven_zavodu"]) {$vybrana='selected';} else {$vybrana='';}
					echo '<option '.$vybrana.' value="'.$row[0].'">'.$row[0].'</option>';
				}
			?>
                              </select>
                            </div>
                          </div>

                          <div class="col-md-6">
		    <div class="form-check">
			  <label for="pohar" class="form-label small fw-semibold">Lokální pohár:</label>
			  <input class="form-check-input" type="checkbox" id="pohar" name="pohar" <?php if ($vychozi["lokalni_pohar"]==1) echo "checked";?>>
			</div>
          </div>

                          <div class="col-md-6 mb-3">
                            <div class="form-group">
                              <label for="inputCity" class="form-label small fw-semibold mb-1">Kalibrační zbraň:</label>
                              <input type="text" class="form-control form-control-sm" id="inputCity" value="<?php if (empty($vychozi["kalibracni_zbran"])) {echo "nestanovena";} else {echo $vychozi["kalibracni_zbran"];} ?>" />
                            </div>
                          </div>
                        </div>
                      </fieldset>
                    </div>
                    <!-- Parametry -->

                    <!-- Rozložení -->
                    <div class="col-md-6 px-0 px-lg-3">
                      <fieldset class="border bg-white px-3 px-lg-4 pb-3 mb-3">
                        <legend class="float-none w-auto px-2 fs-6 fw-bold">Rozložení závodu:</legend>
                        <div class="row">
                          <div class="col-md-6 mb-3">
                            <div class="form-group">
                              <label for="numstage" class="form-label small fw-semibold mb-1">Počet situací:</label>
                              <input type="number" class="form-control form-control-sm" name="numstage" id="numstage" value="<?php echo $vychozi["pocet_situaci"];?>"/>
                            </div>
                          </div>

                          <div class="col-md-6 mb-3">
                            <div class="form-group">
                              <label for="numsquad" class="form-label small fw-semibold mb-1">Počet skupin:</label>
                              <input type="number" class="form-control form-control-sm" name="numsquad" id="numsquad" value="<?php echo $vychozi["pocet_skupin"];?>"/>
                            </div>
                          </div>

                          <div class="col-md-6 mb-3">
                            <div class="form-group">
                              <label for="inputCity" class="form-label small fw-semibold mb-1">Začátek závodu:</label>
                              <input type="time" class="form-control form-control-sm" id="inputCity" value="<?php echo substr($vychozi["zacatek"],0,5);?>" />
                            </div>
                          </div>

                          <div class="col-md-6 mb-3">
                            <div class="form-group">
                              <label for="inputCity" class="form-label small fw-semibold mb-1">Konec závodu:</label>
                              <input type="time" class="form-control form-control-sm" id="inputCity" value="<?php echo substr($vychozi["konec"],0,5);?>" />
                            </div>
                          </div>

                          <div class="col-md-6 mb-3">
                            <div class="form-group">
                              <label for="local" class="form-label small fw-semibold mb-1">Registrace:</label>
                              <select id="local" name="local" class="form-select form-select-sm">
                                <?php 
				$dotaz=mysqli_query($db,"select nazev from zpusobregistrace_zavodu where aktivni=true");
				while($row = mysqli_fetch_row($dotaz)) {
					if ($row[0]==$vychozi["zpusob_registrace"]) {$vybrana='selected';} else {$vybrana='';}
					echo '<option '.$vybrana.' value="'.$row[0].'">'.$row[0].'</option>';
				}
			?>
                              </select>
                            </div>
                          </div>

                          <div class="col-md-6 mb-3">
                            <div class="form-group">
                              <label for="local" class="form-label small fw-semibold mb-1">Prezence:</label>
                              <select id="local" name="local" class="form-select form-select-sm">
                                <?php 
				$dotaz=mysqli_query($db,"select nazev from prezence_zavodu where aktivni=true");
				while($row = mysqli_fetch_row($dotaz)) {
					if ($row[0]==$vychozi["prezence"]) {$vybrana='selected';} else {$vybrana='';}
					echo '<option '.$vybrana.' value="'.$row[0].'">'.$row[0].'</option>';
				}
			?>
                              </select>
                            </div>
                          </div>

                          <div class="col-md-6 mb-3">
                            <label for="inputCity" class="form-label small fw-semibold mb-1">Startovné plné:</label>
                            <div class="input-group input-group-sm">
                              <input type="number" class="form-control form-control-sm" id="inputCity" value="<?php echo $vychozi["startovne_plne"];?>"/>
                              <span class="input-group-text">Kč</span>
                            </div>
                          </div>

                          <div class="col-md-6 mb-3">
                            <label for="inputCity" class="form-label small fw-semibold mb-1">Startovné sleva:</label>
                            <div class="input-group input-group-sm">
                              <input type="number" class="form-control form-control-sm" id="inputCity" value="<?php echo $vychozi["startovne_sleva"];?>"/>
                              <span class="input-group-text">Kč</span>
                            </div>
                          </div>
                        </div>
                      </fieldset>
                    </div>
                    <!-- Rozložení -->
                  </div>
                  <div class="col-12 text-center pt-3">
                    <button type="submit" class="btn btn-sm btn-success">Uložit nový závod</button>
                  </div>
                </form>
              </div>
            </div>
          </div>
          <!-- krok 1 -->

          <!-- krok 2 -->
          <div class="tab-pane" id="step-2">
            <div class="row py-4">
              <div class="col-lg-12 col-md-6 mb-3 mt-lg-0 mt-3">
                <form action="" method="post">
                  <div class="row">
                    <!-- Závodníci -->
					<?php 
						$kolikrat=(int)$vychozi["pocet_skupin"];
						for ($x=1; $x<=$kolikrat;$x++) {
							$skupina++;
							echo '
                    <div class="col-md-6 px-0 px-lg-3">
                      <fieldset class="border bg-white px-3 px-lg-4 pb-3 pb-lg-1 mb-3">
                        <legend class="float-none w-auto px-2 fs-6 fw-bold">Skupina č. '.$skupina.':</legend>
                        <div class="row">
                          <div class="col-md-6">
                            <div class="form-group mb-3">
                              <label for="matchdate" class="form-label small fw-semibold mb-1">Počet závodníků:</label>
                              <input type="number" class="form-control form-control-sm" name="matchdate" id="matchdate" />
                            </div>
                          </div>

                          <div class="col-md-6">
                            <div class="form-group mb-3">
                              <label for="matchdate" class="form-label small fw-semibold mb-1">Čas startu:</label>
                              <input type="time" class="form-control form-control-sm" name="matchdate" id="matchdate" />
                            </div>
                          </div>
                        </div>
                      </fieldset>
                    </div>';
						}
					?>
                   

                    <!-- Závodníci -->

                    <!-- Rozhodčí -->
                    <div class="col-md-6 px-0 px-lg-3">
                      <fieldset class="border bg-white px-3 px-lg-4 pb-3 pb-lg-1 mb-3">
                        <legend class="float-none w-auto px-2 fs-6 fw-bold">Skupina R:</legend>
                        <div class="row">
                          <div class="col-md-6 mb-3">
                            <div class="form-group">
                              <label for="numstage" class="form-label small fw-semibold mb-1">Počet závodníků:</label>
                              <input type="number" class="form-control form-control-sm" name="numstage" id="numstage" />
                            </div>
                          </div>

                          <div class="col-md-6 mb-3">
                            <div class="form-group">
                              <label for="numstage" class="form-label small fw-semibold mb-1">Čas startu:</label>
                              <input type="time" class="form-control form-control-sm" name="numstage" id="numstage" />
                            </div>
                          </div>
                        </div>
                      </fieldset>
                    </div>
                    <!-- Rozhodčí -->
                  </div>
                  <div class="col-12 text-center pt-3">
                    <button type="submit" class="btn btn-sm btn-success">Uložit nastavení skupin</button>
                  </div>
                </form>
              </div>
            </div>
          </div>
          <!-- krok 2 -->

          <!-- krok 3 -->
          <div class="tab-pane" id="step-3">
            <div class="row py-2">
              <div class="col-12 mb-3 mt-lg-0 mt-3">
                <form action="" method="post">
                  <div class="row">
                    <!-- Propozice -->
                    <div class="col-md-12 px-0 px-lg-3">
                      <fieldset class="border bg-white px-3 px-lg-4 pb-3 mb-3">
                        <legend class="float-none w-auto px-2 fs-6 fw-bold">Propozice závodu:</legend>
                        <div class="row">
                          <div class="col-md-6 mb-3">
                            <label for="exampleFormControlTextarea1" class="form-label small fw-semibold">Kapacita:</label>
                            <textarea class="form-control" id="exampleFormControlTextarea1" rows="5"></textarea>
                          </div>

                          <div class="col-md-6">
                            <div class="form-group mb-3">
                              <label for="exampleFormControlTextarea1" class="form-label small fw-semibold">Situace:</label>
                              <textarea class="form-control" id="exampleFormControlTextarea1" rows="5"></textarea>
                            </div>
                          </div>

                          <div class="col-md-6 mb-3">
                            <div class="mb-3">
                              <label for="exampleFormControlTextarea1" class="form-label small fw-semibold">Průběh závodu:</label>
                              <textarea class="form-control" id="exampleFormControlTextarea1" rows="5"></textarea>
                            </div>
                          </div>

                          <div class="col-md-6 mb-3">
                            <div class="mb-3">
                              <label for="exampleFormControlTextarea1" class="form-label small fw-semibold">Ceny:</label>
                              <textarea class="form-control" id="exampleFormControlTextarea1" rows="5"></textarea>
                            </div>
                          </div>
                        </div>
                      </fieldset>
                    </div>
                    <!-- /Propozice -->

                    <div class="col-12 text-center pt-3">
                      <button type="submit" class="btn btn-sm btn-success">Uložit nastavení propozic</button>
                    </div>
                  </div>
                </form>
              </div>
            </div>
            <!-- /krok 3 -->
          </div>
        </div>
      </div>
    </div>
  </div>

  <!-- footer -->
  <footer class="footer mt-auto py-3">
    <div class="container">
      <p class="text-center copyright">2023 | mickey & strasidlo | created for defens shooting</p>
    </div>
  </footer>

  <!-- scripts -->
  <script src="js/bootstrap.bundle.min.js"></script>
  <script src="js/jquery.min.js"></script>
  <script src="js/main.js"></script>

</body>
</html>

Zerion Mini Shell 1.0