<?php include("includes/config.php"); ?>
<?php include("includes/sessioncheck.php"); ?>
<?php   


   $db->where("notification_id", $_REQUEST['id']);
   $notifications = $db->get("eduportal_notification_details");
 
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Add Notifications | EduPortal </title>

    <!-- Bootstrap -->
    <link href="../vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <!-- NProgress -->
    <link href="../vendors/nprogress/nprogress.css" rel="stylesheet">
    
    <!-- Custom Theme Style -->
    <link href="../build/css/custom.min.css" rel="stylesheet">

   </head>

  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
        <div class="col-md-3 left_col">
         
        <?php include('includes/sidebar.php');?>
        <?php include('includes/header.php');?>
  
        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
              <div class="title_left">
                <h3>Add New Notification</h3>
              </div>

             
            </div> <br>
            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                 
                  <div class="x_content">

                    <form action="<?php echo DOMAIN.AdminDirectory; ?>includes/InsertMe.php" method="post" enctype="multipart/form-data" class="form-horizontal form-label-left" novalidate>

<?php 

//print_r($db);
 if($_REQUEST['id']!=NULL){

?>                      

                      <input type="hidden" name="action" value="update_notification" />
                      <input type="hidden" name="id" value="<?php echo $_GET['id'];?>" />

<?php } else { ?>                      


                      <input type="hidden" name="action" value="add_notification" />

<?php } ?>                      
                      <div class="item form-group">
                        <h2 style="margin-left: 30px;">Title</h2>
                        <div class="col-md-12 col-sm-12 col-xs-12">
                          <input id="school_name" autocomplete="off" class="form-control col-md-7 col-xs-12" name="title" value="<?php echo $notifications[0]['notification_title']; ?>" placeholder="e.g Rise School" required="required" type="text">
                        </div>
                      </div>

                      <div class="item form-group" >
                        <h2 style="margin-left: 30px;">Image</h2>
                        
                        <div class="col-md-12 col-sm-12 col-xs-12">
                          <input type="file"  <?php if($_GET["id"]==NULL) ?> name="img_file" class="form-control col-md-7 col-xs-12" />

                          <input type="hidden" name="old_logo" value="<?php echo $notifications[0]['images']; ?>" />
                        </div>
               
                       <!--  <div class="col-md-3 col-sm-6 col-xs-12"> 

                      
                         <img src="<?php echo DOMAIN; ?>AgentPanel/img/upload.png" id="preview" height="170px" class="img-thumbnail" width="180px">

                        </div> -->

                       </div>

             
                    
                    <div class="item form-group">
                    <h2 style="margin-left: 30px;">Description</h2> 
                        <div class="col-md-12 col-sm-12 col-xs-12">
                          <textarea id="textarea" required="required" name="description" class="ckeditor"> <?php echo $notifications[0]['description']; ?></textarea>
                        </div>
                    </div>




                     
                      <div class="form-group">
                        <div class="col-md-6 col-md-offset-7">
                          
                          <button id="send" name="description" type="submit" class="btn btn-success">Submit</button>
                          <button type="submit" class="btn btn-primary">Cancel</button>

                        </div>
                      </div>


                     
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->

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


  </div>
    </div>

    <!-- jQuery -->
    <script src="../vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="../vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="../vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="../vendors/nprogress/nprogress.js"></script>
    <!-- validator -->
    <script src="../vendors/validator/validator.js"></script>

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

    <script src="https://cdn.ckeditor.com/4.12.1/standard/ckeditor.js"></script>
    
  
  </body>
</html>