<!DOCTYPE html>
<html>
  <head>
    <!-- Credits to https://bootstrapious.com/p/bootstrap-4-dashboard -->
    <meta charset="utf-8">
    <title>CheckServer - Installer</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/css/panel.css" id="theme-stylesheet">
    <link rel="stylesheet" href="assets/css/patchpanel.css" id="theme-stylesheet">
    <link rel="stylesheet" href="assets/fonts/roboto/stylesheet.css">
     <!-- Fonts CSS-->
    <link rel="stylesheet" href="assets/fonts/styles.css">

  </head>
  <body>
    <div class="page forms-page" style="width:100%;">
      <!-- navbar-->
      <header class="header">
        <nav class="navbar">
          <div class="container-fluid">
            <div class="navbar-holder d-flex align-items-center justify-content-between">
              <div class="navbar-header">
                  <div class="brand-text hidden-sm-down"><span style="color:white;">CheckServer</span></div></div>
            </div>
          </div>
        </nav>
      </header>


<section class="forms">
  <div class="container-fluid">
    <header>
      <h1 class="h3 display">CheckServer installer</h1>
    </header>

    {% if part != 2 %}
      <div class="row">
        <div class="col-lg-12">
          <div class="card">
            <div class="card-block">
                <div class="form-group row">
                  <div class="col-sm-12">
                    <p>Welcome to the "one-minute" installer of CheckServer. We only need the lang and admin data to configure the site and take the control to you</p>
                  </div>
                </div>
              <form class="form-horizontal" method="POST"  action="?page=install">
                
                <div class="form-group row">
                  <label class="col-sm-2">Language</label>
                  <div class="col-sm-10">
                    <select name="lang">
                      <option value="es">Spanish</option>
                      <option value="en">English</option>
                    </select>
                  </div>
                </div>

                <div class="form-group row">
                  <label class="col-sm-2">Site name</label>
                  <div class="col-sm-10">
                    <input name="websiteName" type="text" placeholder="Nombre del sitio." value="CheckServer" class="form-control form-control-success"><small class="form-text">For "naming" CheckServer</small>
                  </div>
                </div>
                <div class="form-group row">
                  <label class="col-sm-2">Admin username</label>
                  <div class="col-sm-10">
                    <input name="username" type="text" placeholder="Nombre de usuario" value="" class="form-control form-control-success"><small class="form-text">Your username</small>
                  </div>
                </div>
                <div class="form-group row">
                  <label class="col-sm-2">Password</label>
                  <div class="col-sm-10">
                    <input name="passw1" type="password" placeholder="" value="" class="form-control form-control-success"><small class="form-text">Your password</small>
                  </div>
                </div>
                <div class="form-group row">
                  <label class="col-sm-2">Repeat password</label>
                  <div class="col-sm-10">
                    <input name="passw2" type="password" placeholder="" value="" class="form-control form-control-success"><small class="form-text">Your password, again.</small>
                  </div>
                </div>

                <div class="form-group row">       
                  <div class="col-sm-10 offset-sm-2">
                    <button type="submit" class="btn btn-primary">Install</button>
                  </div>
                </div>
              </form>
            </div>
          </div>
        </div>
      </div>
    {%else%}
      <div class="row">
        <div class="col-lg-12">
          <div class="card">
            <div class="card-block">
                <div class="form-group row">
                  <div class="col-sm-12">
                    <p>Installed!<br/>Well, not all, there is one manual step left to you. You have to
                    configure your cron service (If using cpanel is in cron jobs, in standard linux see distro cron).
                    </p>
                    <p>You have to create a cron that executes using php the file cronchk.php that is here.<br/>
                    Example using cron of Linux:</p>
                    <pre>
                      */5 * * * *  root  cd /srv/http/checkserver/ &amp;&amp; /usr/bin/php -f cronchk.php >/dev/null 2>&amp;1
                    </pre>
                    <p>In this example, cron runs every 5 mins, you can adjust it, but I do not recommend less than 3 mins if you have somewhat much checks, it can slow server.</p>
                    <p>Go to <a href="index.php">home</a> to start using CheckServer! Welcome</p>
                  </div>
                </div>
            </div>
          </div>
        </div>
      </div>

    {%endif%}
  </div>
</section>
</body>