D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ipuco
/
public_html
/
superadmin
/
Filename :
staff-edit.php
back
Copy
<?php ob_start(); session_start(); include('include/connection.php'); $emailid=$_SESSION['emailid']; $adminid=$_SESSION['id']; $per=mysqli_query($conn,"select * from admin where id='".$adminid."'"); $perq1=mysqli_fetch_array($per); if (!(isset($_SESSION['emailid']) && $_SESSION['emailid'] != '')) { header ("Location: index.php"); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,minimal-ui"> <title>Update </title> <meta content="Admin Dashboard" name="description"> <meta content="Themesbrand" name="author"> <link rel="shortcut icon" href="assets/images/favicon.ico"> <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css"> <link href="assets/css/metismenu.min.css" rel="stylesheet" type="text/css"> <link href="assets/css/icons.css" rel="stylesheet" type="text/css"> <link href="assets/css/style.css" rel="stylesheet" type="text/css"> <script src="https://cdn.ckeditor.com/4.16.0/standard/ckeditor.js"></script> </head> <body> <!-- Begin page --> <div id="wrapper"> <!-- Top Bar Start --> <?php include('include/top-header.php');?> <!-- Top Bar End --> <!-- ========== Left Sidebar Start ========== --> <div class="left side-menu"> <?php include('include/left-menu.php');?> <!-- Sidebar -left --> </div> <!-- Left Sidebar End --> <!-- ============================================================== --> <!-- Start right Content here --> <!-- ============================================================== --> <div class="content-page"> <!-- Start content --> <div class="content"> <div class="container-fluid"> <div class="page-title-box"> <div class="row align-items-center"> <div class="col-sm-10"> <h4 class="page-title">staff Data Management</h4> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li> <li class="breadcrumb-item active">Update staff Data</li> </ol> </div> <div class="col-sm-2"> </div> </div> </div> <!-- end row --> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-body"> <h4 class="mt-0 header-title"><i class="ti-agenda text-primary mr-2"></i>Edit staff Data </h4> <p class="text-muted m-b-30"></p> <p class="text-muted m-b-30"></p> <?php if(isset($_POST['submit'])) { date_default_timezone_set('Asia/Kolkata'); function string_limit_words($string, $word_limit) { $words = explode(' ', $string); return implode(' ', array_slice($words, 0, $word_limit)); } $staff_name = $_POST['staff_name']; $designation = $_POST['designation']; if($_FILES['file11']['name']=="") { $img11 = $_POST['file11']; } else{ $img11 = $_FILES['file11']['name']; $fullpath11 = "upload/"; $destination11 = $fullpath11.$img11; move_uploaded_file($_FILES['file11']['tmp_name'],$destination11); } if(mysqli_query($conn,"update tbl_staff set staff_name = '$staff_name',designation = '$designation',img1 = '$img11' where staff_id=".$_REQUEST['id'])) { ?><script type="text/javascript"> //alert("Data Inserted Successfully"); window.location='list-of-staff.php'; </script><?php } else { ?><script type="text/javascript"> alert("Error! Data Not Updated"); window.location='list-of-staff.php'; </script><?php echo mysql_error(); } } $fetch=mysqli_query($conn,"select * from tbl_staff where staff_id='".$_REQUEST['id']."'"); $fetch1=mysqli_fetch_array($fetch); ?> <div class="table-responsive"> <form action="" method="post" enctype="multipart/form-data" class="form-horizontal" > <div class="form-group"> <label>Name</label> <input type="text" name="staff_name" class="form-control" value="<?php echo $fetch1['staff_name'];?>" /> </div> <div class="form-group"> <label>Designation</label> <input type="text" name="designation" class="form-control" value="<?php echo $fetch1['designation'];?>" /> </div> <div class="form-group"> <label>Image</label> <input type="hidden" name="file11" value="<?php echo $fetch1['img1'];?>" /> <input type="file" name="file11" class="form-control" /> <br /> <img src="upload/<?php echo $fetch1['img1']; ?>" alt="" height="50" width="50"> </div> <div class="form-group"><label></label> <button type="submit" class="btn btn-success waves-effect waves-light" name="submit">Update</button></div> </form> </div> </div> </div> </div> <!-- end col --> </div> <!-- end row --> </div> <!-- container-fluid --> </div> <!-- content --> <?php include_once('include/admin-footer.php'); ?> </div> <!-- ============================================================== --> <!-- End Right content here --> <!-- ============================================================== --> </div> <!-- END wrapper --> <!-- jQuery --> <script src="assets/js/jquery.min.js"></script> <script src="assets/js/bootstrap.bundle.min.js"></script> <script src="assets/js/metisMenu.min.js"></script> <script src="assets/js/jquery.slimscroll.js"></script> <script src="assets/js/waves.min.js"></script> <!-- App js --> <script src="assets/js/app.js"></script> <script> CKEDITOR.replace( 'editor1' ); </script> </body> </html>