Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html class="no-js" lang="en" dir="ltr">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="x-ua-compatible" content="ie=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>GONIT - Edit</title>
- <link rel="icon" href="../../id/images/icon.ico">
- <link rel="stylesheet" href="../../id/css/foundation.css">
- <link rel="stylesheet" href="../../id/css/app.css">
- <script src="../../id/js/ckeditor/ckeditor.js"></script>
- </head>
- <body>
- <div class="grid-y medium-grid-frame">
- <?php include '../../id/element/admin/menu-admin-header.php';?>
- <div class="cell medium-auto medium-cell-block-container">
- <div class="grid-x">
- <div class="body-background-dashboard2 medium-cell-block-y">
- <div class="grid-y grid-padding-y">
- <div class="large-12 medium-12 small-12 cell">
- <div class="grid-x grid-padding-x grid-padding-y">
- <div class="large-12 medium-12 small-12 title-text-dashboard2 cell">
- <h5>
- <?php
- include '../../id/text/menu.php';
- $hasil= strtoupper($posting4);
- echo $hasil;
- ?>
- </h5>
- <div class="line4"></div>
- <div id="clockbox2"></div>
- <script src="../../id/js/clock2.js"></script>
- </div>
- </div>
- <?php
- include "../../connection.php";
- if(!isset($_GET['blog_id'])){
- die("Error: blog_id Tidak Dimasukkan");
- }
- if(isset($_POST['submit'])){
- // $user_id = htmlentities($_SESSION['user_id']);
- // $blog_username = htmlentities($_SESSION['user_username']);
- $blog_id = htmlentities($_GET['blog_id']);
- $blog_cat_id = htmlentities($_POST['blog_cat_id']);
- $blog_images = htmlentities($_POST['blog_images']);
- // $blog_date = htmlentities(date('Y-m-d'));
- $blog_title = htmlentities($_POST['blog_title']);
- $blog_body = htmlentities($_POST['blog_body']);
- // $blog_link = htmlentities($_POST['blog_link']);
- $tw_blog = $db->prepare("UPDATE tw_blog SET blog_title = :blog_title, blog_cat_id = :blog_cat_id, blog_images = :blog_images, blog_body = :blog_body WHERE blog_id = :blog_id");
- // $tw_blog->BindParam(':user_id', $user_id);
- $tw_blog->BindParam(':blog_id', $blog_id);
- // $tw_blog->BindParam(':blog_username', $blog_username);
- $tw_blog->BindParam(':blog_cat_id',$blog_cat_id);
- $tw_blog->BindParam(':blog_images', $blog_images);
- // $tw_blog->BindParam(':blog_date', $blog_date);
- $tw_blog->BindParam(':blog_title', $blog_title);
- $tw_blog->BindParam(':blog_body', $blog_body);
- // $tw_blog->BindParam(':blog_link', $blog_link);
- $tw_blog->execute();
- }
- $query = $db->prepare("SELECT * FROM tw_blog WHERE blog_id = :blog_id");
- $query->bindParam(":blog_id", $_GET['blog_id']);
- $query->execute();
- if($query->rowCount() == 0){
- die("Error: blog_id Tidak Ditemukan");
- }else{
- $data = $query->fetch();
- }
- ?>
- <div class="grid-x grid-padding-x grid-padding-y">
- <div class="large-12 medium-12 small-12 text-right cell">
- <form method="post" name=form action="">
- <input type="hidden" name="blog_link" value="">
- <span>Author by: <?php echo $_SESSION['user_username']; ?></span>
- <span><button class="posting" type="submit" name="submit" value="data"><img src="https://img.icons8.com/office/20/000000/submit-resume.png"> Publikasikan </button></span>
- <span><a href="../../id/admin/blog"><img src="https://img.icons8.com/office/20/000000/close-window--v2.png"> Tutup</a></span>
- </div>
- <div class="large-12 medium-12 small-12 cell">
- <label><h5>Judul</h5></label>
- <input type="text" placeholder="Judul" name="blog_title" value="<?php echo $data['blog_title']; ?>" />
- <div class="grid-x grid-padding-x grid-padding-y">
- <div class="large-2 medium-4 small-12 cell">
- <label><h5>Category</h5></label>
- <select name="blog_cat_id">
- <?php
- require_once("../../connection.php");
- $tw_category = $db->prepare("SELECT * FROM tw_category");
- $tw_category->execute();
- while($d = $tw_category->fetch(PDO::FETCH_ASSOC)){
- ?>
- <option value="<?=$d['blog_cat_id'];?>" <?php echo ($d['blog_cat_id'] == $data['blog_cat_id']) ? ' selected="selected"' : '';?> > <?=$d['cat_name'];?> </option>
- <?php } ?>
- </select>
- </div>
- </div>
- <label for="exampleFileUpload" class="button">Upload Gambar</label>
- <input type="file" name="blog_images" id="exampleFileUpload" class="show-for-sr">
- <div class="callout-height">
- <link href="../../id/css/quill.snow.css" rel="stylesheet">
- <label><h5>Isi</h5></label>
- <textarea name="blog_body" id="editor1" rows="10" cols="500"><?php echo $data['blog_body']; ?>
- </textarea>
- <script>
- CKEDITOR.replace( 'editor1' );
- </script>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script src="../../id/js/vendor/jquery.js"></script>
- <script src="../../id/js/vendor/what-input.js"></script>
- <script src="../../id/js/vendor/foundation.js"></script>
- <script src="../../id/js/app.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement