?
Path : /home/u949514618/domains/karmaasrconsultants.com/public_html/admin/ |
Current File : /home/u949514618/domains/karmaasrconsultants.com/public_html/admin/postscontent.php |
<div class="content-wrapper"> <form action="#" method="post"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Projects <small> All Project</small> </h1> <ol class="breadcrumb"> <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li> <li class="active">Projects</li> </ol> </section> <!-- Main content --> <section class="content"> <!-- Small boxes (Stat box) --> <div class="row"> <div class="col-xs-12"> <div class="box"> <?php if($_SESSION['role'] == 'admin'){ $query = "select * from posts order by id desc"; $run = mysqli_query($con, $query); } else if($_SESSION['role'] == 'author') { $query = "select * from posts where author = '$session_username' order by id desc"; $run = mysqli_query($con, $query); } if(mysqli_num_rows($run) > 0){ ?> <div class="box-header"> <h3 class="box-title">All Projects Detail Here</h3> <div class="clear"></div> <div class="col-md-6"> <select name="bulk-options" class="form-control" id="" width="50%"> <option value="delete">Delete</option> <option value="published">Published</option> <option value="draft">Draft</option> </select> </div> <div class="col-md-3"><input type="submit" value="Apply" class="btn btn-block btn-primary"></div> <div class="col-md-3"><a href="add-post.php" class="btn btn-block btn-primary">Add Post</a></div> </div> <!-- /.box-header --> <div class="box-body"> <?php if(isset($error)){ echo "<span style='color:red;' class='pull-right'>$error</span>"; } else if(isset($msg)){ echo "<span style='color:green;' class='pull-right'>$msg</span>"; } ?> <table id="example1" class="table table-bordered table-striped"> <thead> <tr> <th><input type="checkbox" id="selectallboxes" /></th> <th>Sr #</th> <th>Date</th> <th>Title</th> <th>Image</th> <th>Status</th> <th>Edit</th> <th>Del</th> </tr> </thead> <tbody> <?php while($row=mysqli_fetch_array($run)) { $id = $row['id']; $title = $row['title']; $image = $row['image']; $date = getdate($row['date']); $day = $date['mday']; $month = substr($date['month'],0,3); $year = $date['year']; $status = $row['status']; ?> <tr> <td><input type="checkbox" class="checkboxes" name="checkboxes[]" value="<?php echo $id; ?>" /></td> <td><?php echo $id; ?></td> <td><?php echo "$day $month $year"; ?></td> <td><?php echo $title; ?></td> <td><img src="../post/<?php echo $image; ?>" width="32px;"></td> <td><span style="color:<?php if($status == 'published'){ echo 'green'; } else if($status == 'draft'){ echo 'red';}?>;"><?php echo ucfirst($status);?></span></td> <td><a href="edit-post.php?edit=<?php echo $id; ?>"><i class="fa fa-pencil"></i></a></td> <td><input type="button" name="delete" value="Delete" onclick="deleteme(<?php echo $id; ?>)"></td> </tr> <script type="text/javascript"> function deleteme(delid) { if(confirm("Do You Wanna Delete!")) { window.location.href='posts.php?del=' +delid+''; return true; } } </script> <?php } ?> </tbody> <tfoot> <tr> <th><input type="checkbox" /></th> <th>Sr #</th> <th>Date</th> <th>Title</th> <th>Image</th> <th>Status</th> <th>Edit</th> <th>Del</th> </tr> </tfoot> </table> </div> <!-- /.box-body --> <?php } else { echo "<center><h3>No Press Post available now!!</h3></center>"; } ?> </div> <!-- /.box --> </div> </div> <!-- /.row --> <!-- Main row --> <!-- /.row (main row) --> </section> <!-- /.content --> </form> </div>