<?php
require_once("../layouts/members/head.php");
?>

<?php if(in_array($user_data['usertype'], ['Admin','White Label'])){ ?>

<?php
if(isset($_POST['noticeupdate']) && $user_data['user_id']>0){
$noticealert = $_POST['noticealert'];
if(!empty($noticealert)){

$insData = array();
$insData['noticealert'] = $noticealert;
if(db_update("sitedata", $insData, " user_id='".$user_data['user_id']."' ")){
awal_alert_msg("Notice Updated Successfully!",'success','');  
}else{
awal_alert_msg("No Any Changes!",'info');  
}

}else{
awal_alert_msg("Please Fill All Valid Details!",'error');
}

}
?>

<div class="row">
  <div class="col-md-12 mb-2">
    <div class="card text-danger">
      <div class="card-header bg-primary text-white py-2">
        <div class="d-flex align-items-center">
          <span class="mr-auto"><?=file_name()?></span>
        </div>
      </div>
      <div class="p-3">
      <form class="row text-dark" method="POST" action="">
        <div class="col-md-12 mb-3">
          <textarea class="form-control" placeholder="Enter Content" id="noticealert" name="noticealert" required><?=$site_data['noticealert']?></textarea>
        </div>
        <div class="col-md-4 mb-3">
          <button type="submit" class="btn btn-primary btn-block" name="noticeupdate">Submit</button>
        </div>
      </form>
     </div>
    </div>
  </div>
</div>
<?php 
}else{
require_once("404.php");
} 
?>

<?php
require_once("../layouts/members/foot.php");
summernote('#noticealert');
?>