<?php include("../Header/Session.php"); ?>
<?php include("../Header/Connection.php"); ?>

<!DOCTYPE html>
<html lang="en">
<?php include ("../Header/head.php"); ?>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.js"></script>
<body class="skin-default fixed-layout">

<!-- Main wrapper - style you can find in pages.scss -->
<div id="main-wrapper">    
<?php include ("../Header/header.php"); ?>
<?php include ("../Header/left_menu.php"); ?>
<?php include ("../Header/right_sidebar.php"); ?>
        
<!-- Page wrapper  -->
<div class="page-wrapper">
<!-- Container fluid  -->
<div class="container-fluid">
<!-- Bread crumb and right sidebar toggle -->
<!--?php include ("../Header/breadcumb.php"); ?-->
<br><br>
<!-- End Bread crumb and right sidebar toggle -->
    
<!-- Start Page Content -->
<!-- ============================================================== -->



    <?php
    $q = "SELECT *
    FROM announcement
    Where status='1'
    order by id Desc";
    $result = $mysqli->query($q);
    if ($result->num_rows > 0)
    {
        $i=1;
        
        while($record = $result -> fetch_assoc())
        {  
            $summernote_id = "summernote".$i;
            $id = $record['id'];
            $announcement_title = $record['announcement_title'];
            $announcement_image = $record['announcement_image'];  
            $announcement_content = $record['announcement_content'];
    ?>
    <div class="row">
        <div class="col-12">
        <div class="card">
        <div class="card-body">
            <div class="table-responsive m-t-40">            
            <h2><?php echo $announcement_title; ?></h1><br>
            <?php if ($announcement_image != "")
            {
            ?>
            
            <img src="../Controller/uploads/<?php echo $announcement_image; ?>" width="30%"><br>
            <?php
			}
            ?>
            <br>
            <textarea class="form-control"  id="<?php echo $summernote_id; ?>" name="announcement_content"  rows="10"><?php echo $announcement_content; ?></textarea>  
                                            
            </div>
        </div>
        </div>                      
        </div>  
    </div>
    <?php 
    $i++ ;
    }
    }
    ?>                             

<!-- ============================================================== -->
<!-- End PAge Content -->

</div>
<!-- End Container fluid  -->
</div>
<!-- End Page wrapper  -->

<script type="text/javascript">
$(document).ready(function() {
	$('#summernote1').summernote({airMode: true});
    $('#summernote1').summernote('disable'); 

    $('#summernote2').summernote({airMode: true});
    $('#summernote2').summernote('disable'); 

    $('#summernote3').summernote({airMode: true});
    $('#summernote3').summernote('disable'); 

    $('#summernote4').summernote({airMode: true});
    $('#summernote4').summernote('disable'); 

    $('#summernote5').summernote({airMode: true});
    $('#summernote5').summernote('disable'); 

    $('#summernote6').summernote({airMode: true});
    $('#summernote6').summernote('disable'); 

    $('#summernote7').summernote({airMode: true});
    $('#summernote7').summernote('disable'); 

    $('#summernote8').summernote({airMode: true});
    $('#summernote8').summernote('disable'); 

    $('#summernote9').summernote({airMode: true});
    $('#summernote9').summernote('disable'); 

    $('#summernote10').summernote({airMode: true});
    $('#summernote10').summernote('disable'); 
});
</script>


<!-- Footer Start-->
<?php include ("../Footer/footer.php"); ?>
<!-- Footer End-->

</div>
<!-- End Wrapper -->
<!-- All Jquery -->
    

<!-- All Jquery Start-->
<?php include ("../Header/all_jquery.php"); ?>
<!-- All Jquery End-->

</body>

</html>