D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
skdesign
/
public_html
/
admin
/
Filename :
edit_blog.php
back
Copy
<?php include('header.php'); include('menu.php'); include('connect.php'); $id=$_GET['id']; if(isset($_POST['save'])){ extract($_POST); /*$a1="select * from banner where booking_date='$tdate' and customer_name='$cname' and phone_no='$phone' and manager_id=$manager_id and room_no='$room'"; $done=mysqli_query($conn,$a1); $count=mysqli_num_rows($done); if($count >= 1){ echo "Already Exist"; }else{ */ $target_path = "uploads/about/"; $target_path = $target_path . basename( $_FILES['file']['name']); if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) { $a="update blog set blog_title='$abt_title',blog_detail='$abt_detail', blog_picture='$target_path' where blog_id=$blog_id"; $done=mysqli_query($conn,$a); }else{ $a="update blog set blog_title='$abt_title',blog_detail='$abt_detail' where blog_id=$blog_id"; $done=mysqli_query($conn,$a); } } ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h1>Blogs</h1> </div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a href="#">Home</a></li> <li class="breadcrumb-item active">Blog</li> </ol> </div> </div> </div><!-- /.container-fluid --> </section> <!-- Main content --> <section class="content"> <div class="container-fluid"> <div class="row"> <div class="col-6"> <div class="card"> <div class="card-header"> <h3 class="card-title">Display Blogs</h3> </div> <!-- /.card-header --> <div class="card-body"> <table id="example1" class="table table-bordered table-striped"> <thead> <tr> <th>Title</th> <th>Detail</th> <th>Picture</th> </tr> </thead> <tbody> <?php $done="select * from blog"; $done1=mysqli_query($conn,$done); while($row=mysqli_fetch_array($done1)){ ?> <tr> <td><a href="edit_blog.php?id=<?php echo $row['blog_id'];?>"><?php echo $row['blog_title'];?></td> <td><?php echo $row['blog_detail'];?> </td> <td><img src="<?php echo $row['blog_picture'];?>" width="100px" height="100px"></td> </tr> <?php }?> </tfoot> </table> </div> <!-- /.card-body --> </div> <!-- /.card --> </div> <!-- /.col --> <div class="col-6"> <form method="post" action="" enctype="multipart/form-data"> <div class="card"> <div class="card-header"> <h3 class="card-title">Display Blogs</h3> </div> <?php $done0="select * from blog where blog_id=$id"; $done10=mysqli_query($conn,$done0); $row11=mysqli_fetch_array($done10); ?> <!-- /.card-header --> <div class="card-body"> <table id="example1" class="table table-bordered table-striped"> <thead> <input type="hidden" value="<?php echo $row11['blog_id'];?>" name="blog_id" class="form-control"> <tr> <td>Title</td><td> <input type="text" value="<?php echo $row11['blog_title'];?>" name="abt_title" class="form-control"></td> </tr> <tr> <td>about Detail</td><td><input type="text" value="<?php echo $row11['blog_detail'];?>" name="abt_detail" class="form-control"></td> </tr> <tr> <td>Picture</td><td><input type="file" value="<?php echo $row11['blog_picture'];?>" name="file" class="form-control"></td> </tr> <tr><td>Pic</td><td><img src="<?php echo $row11['blog_picture'];?>" width="100px" height="100px"></td></tr> <tr> <td colspan="2" align="center"><input type="submit" name="save" value="Save Record" class="btn btn-success"> <input type="reset" name="reset" value="Clear Record" class="btn btn-danger"></td></tr> </thead> <tbody> </tbody> </table> </form> </div> </div> </div> <!-- /.row --> </div> <!-- /.container-fluid --> </section> <!-- /.content --> </div> <!-- /.content-wrapper --> <?php include('footer.php'); ?>