D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
skdesign
/
public_html
/
admin
/
Filename :
project_one.php
back
Copy
<?php include('header.php'); include('menu.php'); include('connect.php'); 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_master set project_master_name='$p_name',project_master_detail='$p_detail',project_master_picture='$target_path'"; $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</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</h3> </div> <!-- /.card-header --> <div class="card-body"> <table id="example1" class="table table-bordered table-striped"> <thead> <tr> <th>Project Name</th> <th>Pictures</th> <th>Project Detail</th> <th>Edit</th> <th>Delete</th> </tr> </thead> <tbody> <?php $done="SELECT * FROM project_master"; $done1=mysqli_query($conn,$done); while($row=mysqli_fetch_array($done1)){ ?> <tr> <td><?php echo $row['project_master_name'];?></td> <td><img src="<?php echo $row['project_master_picture'];?>" width="100px" height="100px"> </td> <td><?php echo $row['project_master_detail'];?></td> <td><a href="edit_project_one.php?id=<?php echo $row['project_master_id']?>"> <button type="button" class="btn btn-primary">Edit</button> </a></td> <td><a href="delete.php?id=<?php echo $row['project_master_id']?>&tab=<?php echo "project_master";?>&cname=<?php echo "project_master_id";?>"> <button type="button" class="btn btn-danger">Delete</button> </a></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">Add New Project</h3> </div> <!-- /.card-header --> <div class="card-body"> <table id="example1" class="table table-bordered table-striped"> <thead> <tr> <td>Project Name</td> <td><input type="text" name="p_name" class="form-control"></td> </tr> <tr> <td>Project Detail</td> <td><input type="text" name="p_detail" class="form-control"></td> </tr> <tr> <td>Project Picture</td> <td><input type="file" 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'); ?>