<?php
session_start();
if(!isset($_SESSION["username"]) || $_SESSION["username"] == '' ){
header("Location: login.php");
exit();
}
else {

include('functions.php');


?>
<!DOCTYPE html>
<html>
<head>


  <style>
    @import url(http://weloveiconfonts.com/api/?family=iconicfill);[class*="iconicfill-"]::before{font-family:'IconicFill',sans-serif;font-size:1.2rem}
    *{box-sizing:border-box}
    html,body,.dashboard{margin:0;padding:0}
    ul,ul li{padding:0}
    html,body,input,textarea{font:300 1rem sans-serif}
    h1,h2{color:#333}
    h1{font:700 1.75rem sans-serif;border-bottom:.5rem solid #2c3e50;margin:0 0 2rem 0}
    h2{font:700 1.5rem sans-serif;margin:0 0 1rem 0}
    h3{font-weight:500}
    p{margin:0 0 1rem 0}
    .dashboard{font:300 1rem sans-serif;display:flex;flex-flow:row wrap;height:auto}
    aside{background:#2c3e50;flex:2 1 0%;order:1}
    aside li a,aside .search{display:block;color:#ecf0f1;text-decoration:none;padding:1rem;border-bottom:1px solid #34495e;transition:background 0.15s ease}
    aside li a:hover,aside li a:active,aside li a:focus,aside .search:hover,aside .search:active,aside .search:focus{background:#34495e}
    aside li a::before,aside .search::before{display:inline-block;width:1.5rem}
    aside .search input{width:80%}
    main{background:#ecf0f1;flex:6 1 0%;order:2;padding:1rem 0 1rem 1rem}
    main .overview{min-height:100vh}
    main .overview .widget-container{display:flex;flex-flow:row wrap}
    main .overview .widget-container .widget{background:#bdc3c7;flex:6 1 0%;margin:0 1rem 1rem 0;min-width:15rem}
    main .overview .widget-container .widget header{background:#2c3e50;color:#ecf0f1;padding:3px 0 3px 30px}
    main .overview .widget-container .widget header h3::before{display:inline-block;width:1.5rem}
    main .overview .widget-container .widget .content{padding:1rem}
    main .overview .widget-container .widget .content li{list-style-type:square;margin:0 0 0 1rem}
    main .overview .widget-container .widget .content .ok::before{content:'';display:inline-block;width:1rem;height:1rem;background:#27ae60;border-radius:50%;margin:0 1rem 0 0}
    main .overview .widget-container .widget .content .no::before{content:'';display:inline-block;width:1rem;height:1rem;background:red;border-radius:50%;margin:0 1rem 0 0}
    main footer p{text-align:right;font-size:.85rem}
    .col {width:50%;float:left;}
    .addbutton {text-decoration:none;color:green;margin-top:-45px;margin-right:10px;float:right;padding:5px 10px;background:#fff;border-radius:5px;}
    table.tg {width:100%}
    table th {padding:5px;background:#b4b8bb;border-bottom:1px solid #dbe1e4;}
    table td {padding:5px;border-bottom:1px solid #dbe1e4;}
    label {display:block;width:100%;}
    textarea, input {width:100%;background:#fff;border:none;border-radius:5px;margin:5px 0 10px;padding:5px;}
    .nicEdit-main {background:#fff;padding:15px;}
    input[type=submit] {background:green;padding:10px 0;color:white;border:1px solid #fff;}
  </style>


  <link href="https://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script>
  <script src="https://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script>
  <link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.11/summernote.css" rel="stylesheet">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.11/summernote.js"></script>


</head>
<body>


  <div class="dashboard">
    <main>
      <div class="overview">
        <h1>Add Post</h1>
        <div class="widget-container">

          <div class="widget">

            <header>
              <h3 class="iconicfill-document-alt-fill">Add New Post</h3>
            </header>

            <div class="content">

              <form action="go.php" method="post" name="addpost" enctype="multipart/form-data">

                <div class="form-group">
                  <label for="exampleInputEmail1">Post Heading (H1) - required</label>
                  <input name="title" type="text" class="form-control" id="exampleInputEmail1" placeholder="Title Here" required />
                </div>

                <div class="form-group">
                  <label for="exampleInputEmail1">Meta Title ( Not same H1 - But must contain keywords ) - required</label>
                  <input name="mtitle" type="text" class="form-control" id="exampleInputEmail1" placeholder="Meta Title Here" required />
                </div>

                <div class="form-group">
                  <label for="exampleInputEmail1">Post Description - required</label>
                  <textarea name="description" id="myArea2" class="form-control" rows="3" placeholder="Text Area" required></textarea>
                </div>


                <div class="form-group">
                  <label for="exampleInputPassword1">Post keywords (optional)</label>
                  <input name="keywords" type="text" class="form-control" id="exampleInputPassword1" placeholder="keyword, keywords, keywords" />
                </div>


                <div class="form-group">
                  <label for="exampleInputEmail1">Script - required</label>
                  <textarea name="script" id="summernote" class="form-control" rows="5"placeholder="Text Area" required></textarea>
                </div>


                <div class="form-group">
                  <label for="exampleInputFile">Post photo - required</label>
                  <input name="fileToUpload" type="file" id="exampleInputFile" required />
                </div>

                <div class="form-group">
                  <label for="exampleInputEmail1">image ALT - required</label>
                  <input name="imgalt" type="text" class="form-control" id="exampleInputEmail1" placeholder="Title Here" required />
                </div>

                <input name="addpost" type="submit" value="Add New Post" class="btn btn-info" />

              </form>

            </div>
          </div>



        </div>
      </div>
      <footer>
        <p>@sabry</p>
      </footer>
    </main>
    <aside>
      <ul>
        <li><a class="iconicfill-home" href="index.php">Overview</a></li>
        <li><a class="iconicfill-document-alt-fill" href="#">Images</a></li>
        <li><a class="iconicfill-user" href="logout.php?logout=1">Logout</a></li>
      </ul>
    </aside>
  </div>

<script>
  $(document).ready(function() {
    $('#summernote').summernote();
  });
</script>

</body>
</html>
<?php
}
?>
