D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
skdesign
/
public_html
/
admin
/
Filename :
edit_interior.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/interiors/"; $target_path = $target_path . basename( $_FILES['file']['name']); if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) { $a="update interior set interior_title='$p_name',interior_detail='$p_detail', interior_picture='$target_path' where interior_id=$p_id"; $done=mysqli_query($conn,$a); }else{ $a="update interior set interior_title='$p_name',interior_detail='$p_detail' where interior_id=$p_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>Interiors</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">Interiors</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 Interiors</h3> </div> <!-- /.card-header --> <div class="card-body"> <table id="example1" class="table table-bordered table-striped"> <thead> <tr> <th>Name</th> <th>Picture</th> <th>Detail</th> <th>Edit</th> </tr> </thead> <tbody> <?php $done="select * from interior"; $done1=mysqli_query($conn,$done); while($row=mysqli_fetch_array($done1)){ ?> <tr> <td><?php echo $row['interior_title'];?></td> <td><img src="<?php echo $row['interior_picture'];?>" width="100px" height="100px"> </td> <td><?php echo $row['interior_detail'];?></td> <td><a href="edit_interior.php?id=<?php echo $row['interior_id']?>"> <button type="button" class="btn btn-danger">Edit</button> </a></td> </tr> <?php }?> </tfoot> </table> </div> <!-- /.card-body --> </div> <!-- /.card --> </div> <!-- /.col --> <div class="col-6"> <?php $donee="select * from interior where interior_id=$id"; $doneee=mysqli_query($conn,$donee); $rowe=mysqli_fetch_array($doneee); ?> <form method="post" action="" enctype="multipart/form-data"> <div class="card"> <div class="card-header"> <h3 class="card-title">Display Interiors</h3> </div> <!-- /.card-header --> <div class="card-body"> <input readonly type="hidden" name="p_id" class="form-control" value="<?php echo $rowe['interior_id'];?>"> <table id="example1" class="table table-bordered table-striped"> <thead> <tr> <td>Name</td><td> <input readonly type="text" name="p_name" class="form-control" value="<?php echo $rowe['interior_title'];?>"></td> </tr> <tr> <td>Detail</td><td><input type="text" name="p_detail" class="form-control" value="<?php echo $rowe['interior_detail'];?>"></td> </tr> <tr> <td>Picture</td><td><input type="file" name="file" class="form-control" value="<?php echo $rowe['interior_picture'];?>"> <img src="<?php echo $rowe['interior_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'); ?>