?> Welcome here</h2> <?php /*echo "Do you want to exit??? " . $_SESSION["user_name"]*/ ?> <a href="login/logout.php">Logout</a> echo --><?php } include_once 'dbClass.php'; if (isset($_POST['submit']) && !empty($_POST['category_name'])) { $category_name = $_POST['category_name']; $created_at = date("Y-m-d H:i:s"); //echo $article_title,$category_id,$article_created_at; $blog = new blogClass(); $insertCategory = $blog->insertCategory($category_name, $created_at); } ?> <!DOCTYPE html> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="style.css"/> <link rel="stylesheet" type="text/css" href="Bootstrap/bootstrap.min.css"/> </head> <body> <div class="container"> <div class="row"> <div class="col-md-12" style="border:10px solid #BF8F94 ">
</div> <div class="row"> <div class="col-md-12" style="border:10px solid #BF8F94;"> <div><h2>List a new Category</h2></div> <table class="table"> <thead> <tr> <th>Category Name</th> <th>Created At</th> <th>Edit</th> <th>Delete</th> </tr> </thead> <tbody> <?php $blog = new blogClass(); $allCategory = $blog->selectCategory(); while ($category = $allCategory->fetch_assoc()) { ?> <tr class="success"> <td><?php echo $category["category_name"]; ?> </td> <td><?php echo $category["created_at"]; ?> </td> <td><a href="editCategory.php?id=<?php echo $category["category_id"]; ?>
<?php include_once 'common/headerMenu.php'; ?> <!-- /.navbar-collapse --> </div> <!-- /.container --> </nav> <!-- Page Header --> <!-- Set your background image for this header on the line below. --> <?php if (isset($_GET['id']) && !empty($_GET['id'])) { $article_id = $_GET['id']; //$sql="SELECT article_id, article_title, article_subtitle, category_id, article_sequence, article_brief, article_details, user_id, article_deleted, article_deleted_at, article_created_at FROM article WHERE article_deleted = 1 AND article_id = $article_id ORDER BY article_id DESC"; $blog = new blogClass(); $data = $blog->selectOneArticle($article_id); $article = $data->fetch_assoc(); } ?> <header class="intro-header" style="background-image: url('<?php echo $article['article_img']; ?> ')"> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> <div class="post-heading"> <h1><?php echo $article['article_title']; ?>
?> "> </div> <div class="form-group"> <label for="input_2"> Article Subtitle:</label> <input type="text" class="form-control" id="article_subtitle" name="article_subtitle" value="<?php echo $article['article_subtitle']; ?> "> </div> <div class="form-group"> <label for="category_id"> Category Name</label> <select name="category_id" class="form-control"> <?php $blog1 = new blogClass(); $allCat = $blog1->selectCategory(); //print_r($allCat); while ($Cat = $allCat->fetch_assoc()) { ?> <option value="<?php echo $Cat['category_id']; ?> " <?php if ($Cat["category_id"] == $article['category_id']) { echo "selected='selected'"; } ?> > <?php echo $Cat['category_name']; ?>
<div class="col-md-12" style="border:10px solid #BF8F94;"> <div><h2>Edit a new category</h2></div> <?php if (isset($insertCategory)) { ?> <div class="alert alert-success"> Category Update <strong>Success!</strong> </div> <?php } ?> <form action="" method="post" class="form-class"> <div class="form-group"> <label for="category_name"> Category Name:</label> <?php $catecory = new blogClass(); $data = $catecory->selectOneCategory($_GET['id']); $cat = $data->fetch_assoc(); ?> <input type="text" class="form-control" id="category_name" name="category_name" value="<?php echo $cat['category_name']; ?> "> <input type="hidden" class="form-control" id="category_id" name="category_id" value="<?php echo $cat['category_id']; ?> "> </div> <input type="reset" value="Cancel" class="btn btn-default"> <input type="submit" value="Submit" class="btn btn-success" name="submit">
?> <div><h2>List a new blog</h2></div> <table class="table"> <thead> <tr> <th>Title</th> <th>Article Brief</th> <th>Created At</th> <th>Edit</th> <th>Delete</th> </tr> </thead> <tbody> <?php $blog = new blogClass(); $allArticle = $blog->selectArticle($_SESSION["user_id"]); while ($article = $allArticle->fetch_assoc()) { ?> <tr class="success"> <td><?php echo $article["article_title"]; ?> </td> <td><?php echo $article["article_brief"]; ?> </td> <td><?php echo $article["article_created_at"]; ?>
<div class="col-md-12" style="border:10px solid #BF8F94;"> <div><h2>List of Author</h2></div> <table class="table"> <thead> <tr> <th>Title</th> <th>Author Name</th> <th>Cheated At</th> <th>Edit</th> <th>Delete</th> </tr> </thead> <tbody> <?php $blog = new blogClass(); $allArticle = $blog->selectArticle(); while ($article = $allArticle->fetch_assoc()) { ?> <tr class="success"> <td><?php echo $article["article_title"]; ?> </td> <td><?php echo $article["article_brief"]; ?> </td> <td><?php echo $article["article_created_at"]; ?>