D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
skdesign
/
public_html
/
admin
/
Filename :
add_projects_picture.php
back
Copy
<?php include('header.php'); include('menu.php'); include('connect.php'); $pid=$_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 = "projects/"; $target_path = $target_path . basename( $_FILES['file']['name']); if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) { $a="insert into project_detail set project_detail_pic='$target_path',project_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>Projects</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">Projects Pictures</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 Projects Pictures</h3> </div> <!-- /.card-header --> <div class="card-body"> <table id="example1" class="table table-bordered table-striped"> <thead> <tr> <th>Project Name</th> <th>Project Picture</th> <th>Edit</th> </tr> </thead> <tbody> <?php $done="select * from project_detail as pd,project as p where pd.project_id=p.project_id"; $done1=mysqli_query($conn,$done); while($row=mysqli_fetch_array($done1)){ ?> <tr> <td><?php echo $row['project_name'];?></td> <td><img src="<?php echo $row['project_detail_pic'];?>" width="100px" height="100px"> </td> <td><a href="edit_projects.php?id=<?php echo $row['project_detail_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 $done11="select * from project where project_id=$pid "; $done111=mysqli_query($conn,$done11); $row111=mysqli_fetch_array($done111); ?> <form method="post" action="" enctype="multipart/form-data"> <div class="card"> <div class="card-header"> <h3 class="card-title">Add New Picture</h3> </div> <!-- /.card-header --> <div class="card-body"> <table id="example1" class="table table-bordered table-striped"> <input type="hidden" value="<?php echo $row111['project_id'];?>" name="p_id" class="form-control"> <thead> <tr> <td>Project Name</td><td> <input type="text" readonly value="<?php echo $row111['project_name'];?>" name="p_name" class="form-control"></td> </tr> <tr> <td>Project Picture</td><td><input type="file" value="" name="file" class="form-control"> </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'); ?>