D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ipuco
/
public_html
/
superadmin
/
Filename :
trav-package-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 Package </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.14.0/standard/ckeditor.js"></script> <link rel="stylesheet" href="https://cdn.datatables.net/1.10.23/css/dataTables.bootstrap.min.css"> <style> .dataTables_length, .dataTables_paginate, .dataTables_info { display: block !important; } .blink_me { animation: blinker 1s linear infinite; } @keyframes blinker { 50% { opacity: 0; } } </style> </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">Package Management</h4> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li> <li class="breadcrumb-item active">Update Package Category</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 Package Category </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)); } if($_FILES['file10']['name']=="") { $img10 = $_POST['file10']; } else{ $img10 = $_FILES['file10']['name']; $fullpath10 = "upload/"; $destination10 = $fullpath10.$img10; move_uploaded_file($_FILES['file10']['tmp_name'],$destination10); } 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); } $travcategory_id = $_POST['travcategory_id']; $subcategory_name = $_POST['subcategory_name']; $duration = $_POST['duration']; $packprice = $_POST['packprice']; $coveredplaces = $_POST['coveredplaces']; $traveltime = $_POST['traveltime']; $ms_travel_operate = $_POST['ms_travel_operate']; $editor1=addslashes($_POST['editor1']); $newtitle=string_limit_words($subcategory_name, 6); $urltitle=preg_replace('/[^a-z0-9]/i',' ', $newtitle); $newurltitle=str_replace(" ","-",$newtitle); $newurltitle1=str_replace("&","and",$newurltitle); $newurltitle2=str_replace(".","dot",$newurltitle1); $newurltitle3=str_replace("/","dot",$newurltitle2); $url= strtolower($newurltitle3); if(mysqli_query($conn,"update trav_package set img = '$img10',img2 = '$img11',travcategory_id = '$travcategory_id',subcategory_name = '$subcategory_name',duration = '$duration',packprice = '$packprice',coveredplaces = '$coveredplaces',traveltime = '$traveltime',ms_travel_operate = '$ms_travel_operate',description = '$editor1',url = '$url' where travpackage_id=".$_REQUEST['id'])) { ?><script type="text/javascript"> //alert("Data Inserted Successfully"); window.location='trav-package.php'; </script><?php } else { ?><script type="text/javascript"> alert("Error! Data Not Updated"); window.location='trav-package.php'; </script><?php echo mysql_error(); } } $fetch=mysqli_query($conn,"select * from trav_package where travpackage_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>Update Package Category Name</label> <select name="travcategory_id" class="form-control" /> <?php $travcategory_id=$fetch1['travcategory_id']; $client=mysqli_query($conn,"SELECT * FROM travcategory where travcategory_id='$travcategory_id'"); $client1=mysqli_fetch_array($client); $category_name=$client1['category_name']; $travcategory_id=$client1['travcategory_id']; ?> <option value="<?php echo $travcategory_id; ?>"><?php echo $category_name;?></option> <?php $sel=mysqli_query($conn,"SELECT * FROM travcategory order by travcategory_id desc"); while($result=mysqli_fetch_array($sel)){ ?> <option value="<?php echo $result['travcategory_id']; ?>"><?php echo $result['category_name'];?></option> <?php } ?> </select> </div> <div class="form-group"> <label>Update Package Name</label> <input type="text" name="subcategory_name" class="form-control" value="<?php echo $fetch1['subcategory_name'];?>" /> </div> <div class="form-group"> <label>Update Package Duration</label> <input type="text" name="duration" class="form-control" value="<?php echo $fetch1['duration'];?>" /> </div> <div class="form-group"> <label>Update Package Price</label> <input type="text" name="packprice" class="form-control" value="<?php echo $fetch1['packprice'];?>" /> </div> <div class="form-group"> <label>Update Package Covered places</label> <input type="text" name="coveredplaces" class="form-control" value="<?php echo $fetch1['coveredplaces'];?>" /> </div> <div class="form-group"> <label>Update Package Travel Time</label> <input type="text" name="traveltime" class="form-control" value="<?php echo $fetch1['traveltime'];?>" /> </div> <div class="form-group"> <label>Update Package ms_travel_operate</label> <input type="text" name="ms_travel_operate" class="form-control" value="<?php echo $fetch1['ms_travel_operate'];?>" /> </div> <div class="form-group"><label> Description </label> <textarea name="editor1" class="form-control" placeholder="Description" rows="3"><?php echo $fetch1['description'];?></textarea> </div> <div class="form-group"> <label>Update Img</label> <input type="hidden" name="file10" value="<?php echo $fetch1['img'];?>" /> <input type="file" name="file10" class="form-control" /> <br /> <img src="upload/<?php echo $fetch1['img']; ?>" alt="" height="50" width="50"> </div> <div class="form-group"> <label>Update Img2</label> <input type="hidden" name="file11" value="<?php echo $fetch1['img2'];?>" /> <input type="file" name="file11" class="form-control" /> <br /> <img src="upload/<?php echo $fetch1['img2']; ?>" 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> <script src="https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js"></script> <script src="https://cdn.datatables.net/1.10.23/js/dataTables.bootstrap.min.js"></script> <script> $(document).ready(function() { $('#example').DataTable(); } ); </script> </body> </html>