D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ipuco
/
public_html
/
superadmin
/
Filename :
adpostdata_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>IPU - Update Ad Post Data </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> function showsubcategory123(str) { //alert('str'); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } if (xmlhttp!=''){ document.getElementById("showsubcatdiv123").innerHTML='<img src="images/loader.gif">'; } var url="show_subcategory.php"; url=url+"?category_id="+str; xmlhttp.open("GET",url,true); xmlhttp.send(); //alert(url); //alert(url); xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4) { document.getElementById("showsubcatdiv123").innerHTML=xmlhttp.responseText; } } } </script> <script> function showcategory(str) { //alert('str'); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } if (xmlhttp!=''){ document.getElementById("showcatdiv").innerHTML='<img src="images/loader.gif">'; } var url="subcity123.php"; url=url+"?state_id="+str; xmlhttp.open("GET",url,true); xmlhttp.send(); //alert(url); //alert(url); xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4) { document.getElementById("showcatdiv").innerHTML=xmlhttp.responseText; } } } </script> <script> function showcategory123(str) { //alert('str'); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } if (xmlhttp!=''){ document.getElementById("showcatdiv123").innerHTML='<img src="images/loader.gif">'; } var url="subtosubcity123.php"; url=url+"?city_id="+str; xmlhttp.open("GET",url,true); xmlhttp.send(); //alert(url); //alert(url); xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4) { document.getElementById("showcatdiv123").innerHTML=xmlhttp.responseText; } } } </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">Update Ad Post Data Management</h4> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li> <li class="breadcrumb-item active">Update Ad Post 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 Ad Post Data </h4> <p class="text-muted m-b-30"></p> <p class="text-muted m-b-30"></p> <?php if(isset($_POST['register'])) { function string_limit_words($string, $word_limit) { $words = explode(' ', $string); return implode(' ', array_slice($words, 0, $word_limit)); } $blog=''; $company_name=addslashes($_POST['company_name']); $company_owner_name=addslashes($_POST['company_owner_name']); $company_registration_date=addslashes($_POST['company_registration_date']); $company_website=addslashes($_POST['company_website']); $country_name=addslashes($_POST['country_name']); $state_name = $_POST['state_id']; $city_name = $_POST['city_id']; $subcity_name = $_POST['subcity_id']; $company_address=addslashes($_POST['company_address']); $area_pin_code=addslashes($_POST['area_pin_code']); $company_emailid=addslashes($_POST['company_emailid']); $company_phoneno=addslashes($_POST['company_phoneno']); $company_gstno=addslashes($_POST['company_gstno']); $company_panno=addslashes($_POST['company_panno']); $company_listing_title=addslashes($_POST['company_listing_title']); $company_listing_meta_description=addslashes($_POST['company_listing_meta_description']); $company_listing_meta_keywords=addslashes($_POST['company_listing_meta_keywords']); $about_company=addslashes($_POST['about_company']); $category_id = $_POST['category_id']; $subcategory_id = $_POST['subcategory_id']; $newtitle=string_limit_words($company_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); $company_name_url= strtolower($newurltitle3); $status=$_POST['status']; $date=date("d/m/Y"); $time=date("h:i:sa"); if($_FILES['image5']['name']=="") { $new_file_name5 = $_POST['image5']; } else { $file_name5 = $_FILES['image5']['name']; $random_digit5 = rand(0000,9999); $new_file_name5 = $random_digit5.$file_name5; $path5 = "../upload/".$new_file_name5; copy($_FILES['image5']['tmp_name'], $path5); } $posr_free_add_id=$_POST['posr_free_add_id']; $ins=mysqli_query($conn,"Update posr_free_add set company_name='".$company_name."',company_owner_name='".$company_owner_name."',company_registration_date='".$company_registration_date."',company_website='".$company_website."',country_name='".$country_name."',state_name='".$state_name."',city_name='".$city_name."',subcity_name='".$subcity_name."',company_address='".$company_address."',area_pin_code='".$area_pin_code."',company_emailid='".$company_emailid."',company_phoneno='".$company_phoneno."',company_gstno='".$company_gstno."',company_panno='".$company_panno."',company_listing_title='".$company_listing_title."',company_listing_meta_description='".$company_listing_meta_description."',company_listing_meta_keywords='".$company_listing_meta_keywords."',about_company='".$about_company."',category_id='".$category_id."',subcategory_id='".$subcategory_id."',image='".$new_file_name5."',status='".$status."',company_name_url='".$company_name_url."' where posr_free_add_id='".$posr_free_add_id."'"); if($ins) { //echo '<div class="alert alert-success">Detail Updated Successfully </div>'; ?> <script type="application/javascript"> //alert("Company Listing Already Exist"); window.location="list-of-adpostdata.php"; </script> <?php } else { ?> <script type="application/javascript"> //alert("Company Listing Already Exist"); window.location="list-of-adpostdata.php"; </script> <?php } } ?> <?php $vuser=mysqli_query($conn,"select * from posr_free_add where posr_free_add_id='".$_GET['id']."'"); $rowuser=mysqli_fetch_array($vuser); ?> <div class="col-12"> <div class="card"> <div class="card-body"> <form action="#" method="post" name="registration" enctype="multipart/form-data"> <input class="form-control" type="hidden" name="posr_free_add_id" value="<?php echo $rowuser['posr_free_add_id']; ?>" > <div class="row"> <div class="col-md-12"> <h6>Personal Details</h6> <hr> </div> <div class="col-md-4 form-group"> <label> Company Name </label> <input class="form-control" type="text" value="<?php echo $rowuser['company_name']; ?>" name="company_name" > </div> <div class="col-md-4 form-group"> <label> Name of Owner </label> <input class="form-control" type="text" value="<?php echo $rowuser['company_owner_name']; ?>" name="company_owner_name" > </div> <div class="col-md-4 form-group"> <label> Company Registration Date </label> <input class="form-control" type="date" value="<?php echo $rowuser['company_registration_date']; ?>" name="company_registration_date" > </div> <div class="col-md-4 form-group"> <label> Company Website </label> <input class="form-control" type="text" value="<?php echo $rowuser['company_website']; ?>" name="company_website" > </div> <div class="col-md-4 form-group"> <label> Country </label> <input class="form-control" type="text" value="India" name="country_name" readonly> </div> <div class="col-md-4 form-group"> <label> Select State </label> <?php $state_name=$rowuser['state_name']; $state=mysqli_query($conn,"SELECT * FROM state where state_id='$state_name'"); $state1=mysqli_fetch_array($state); $state_name=$state1['state_name']; ?> <select name="state_id" class="form-control" onChange="showcategory(this.value)"> <option value="<?php echo $state1['state_id']; ?>"><?php echo $state1['state_name']; ?></option> <?php $sel=mysqli_query($conn,"SELECT * FROM state order BY state_id ASC"); while($result=mysqli_fetch_array($sel)){ ?> <option value="<?php echo $result['state_id']; ?>"><?php echo $result['state_name'];?></option> <?php } ?> </select> </div> <div class="col-md-4 form-group"> <label> Select City </label> <?php $city_name=$rowuser['city_name']; $city=mysqli_query($conn,"SELECT * FROM city where city_id='$city_name'"); $city1=mysqli_fetch_array($city); $city_name=$city1['city_name']; ?> <div id="showcatdiv"> <select name="city_id" class="form-control"> <option value="<?php echo $city1['city_id']; ?>"><?php echo $city1['city_name']; ?></option> </select> </div> </div> <div class="col-md-4 form-group"> <label> Select Sub City </label> <?php $subcity_name=$rowuser['subcity_name']; $subcity=mysqli_query($conn,"SELECT * FROM subcity where subcity_id='$subcity_name'"); $subcity1=mysqli_fetch_array($subcity); $subcity_name=$subcity1['subcity_name']; ?> <div id="showcatdiv123"> <select name="subcity_id" class="form-control"> <option value="<?php echo $subcity1['subcity_id']; ?>"><?php echo $subcity1['subcity_name']; ?></option> </select> </div> </div> <div class="col-md-4 form-group"> <label> Company Address </label> <input class="form-control" type="text" value="<?php echo $rowuser['company_address']; ?>" name="company_address" > </div> <div class="col-md-4 form-group"> <label> Area Pin Codes </label> <input class="form-control" type="text" value="<?php echo $rowuser['area_pin_code']; ?>" name="area_pin_code" > </div> <div class="col-md-4 form-group"> <label> Company Email Id </label> <input class="form-control" type="text" value="<?php echo $rowuser['company_emailid']; ?>" name="company_emailid" > </div> <div class="col-md-4 form-group"> <label> Company Phone No. </label> <input class="form-control" type="text" value="<?php echo $rowuser['company_phoneno']; ?>" name="company_phoneno" > </div> <div class="col-md-4 form-group"> <label> GST No. </label> <input class="form-control" type="text" value="<?php echo $rowuser['company_gstno']; ?>" name="company_gstno" > </div> <div class="col-md-4 form-group"> <label> PAN No. </label> <input class="form-control" type="text" value="<?php echo $rowuser['company_panno']; ?>" name="company_panno" > </div> <div class="col-md-4 form-group"> <label> Title </label> <input class="form-control" type="text" value="<?php echo $rowuser['company_listing_title']; ?>" name="company_listing_title" > </div> <div class="col-md-4 form-group"> <label> Meta Description </label> <input class="form-control" type="text" value="<?php echo $rowuser['company_listing_meta_description']; ?>" name="company_listing_meta_description" > </div> <div class="col-md-4 form-group"> <label> Meta Keywords </label> <input class="form-control" type="text" value="<?php echo $rowuser['company_listing_meta_keywords']; ?>" name="company_listing_meta_keywords" > </div> <div class="col-md-12 form-group"> <label> About Company </label> <textarea placeholder="Type your message here" name="about_company" class="form-control"><?php echo $rowuser['about_company']; ?></textarea> </div> <div class="col-md-12"> <h6>Services</h6> <hr> </div> <div class="col-md-4 form-group"> <label> Select Category </label> <select name="category_id" class="form-control" id="category_id" onChange="showsubcategory123(this.value)"> <?php $category_id=$rowuser['category_id']; $client=mysqli_query($conn,"SELECT * FROM category where category_id='$category_id'"); $client1=mysqli_fetch_array($client); $category_name=$client1['category_name']; $category_id=$client1['category_id']; ?> <option value="<?php echo $category_id; ?>"><?php echo $category_name;?></option> <?php $sel=mysqli_query($conn,"SELECT * FROM category order by category_id asc"); while($result=mysqli_fetch_array($sel)){ ?> <option value="<?php echo $result['category_id']; ?>"><?php echo $result['category_name'];?></option> <?php } ?> </select> </div> <div class="col-md-4 form-group"> <label> Sub Category </label> <div class="form-group"> <div class="controls" id="showsubcatdiv123"> <select class="form-control" name="subcategory_id" id="subcategory_id"> <?php $subcategory_id=$rowuser['subcategory_id']; $subclient=mysqli_query($conn,"SELECT * FROM subcategory where subcategory_id='$subcategory_id'"); $subclient1=mysqli_fetch_array($subclient); $subcategory_name=$subclient1['subcategory_name']; $subcategory_id=$subclient1['subcategory_id']; ?> <option value="<?php echo $subcategory_id; ?>"><?php echo $subcategory_name;?></option> </select> </div> </div> </div> <div class="col-md-12"> <h6>Business Photo</h6> <hr> </div> <div class="col-md-6 form-group"> <label> </label> <input type="hidden" name="image5" value="<?php echo $rowuser['image'];?>" /> <input type="file" name="image5" class="form-control" /> <br /> <p class="help-block">Dimension: 5600X350</p> <img src="../upload/<?php echo $rowuser['image']; ?>" height="350" width="700" /> </div> <div class="col-md-12"> <h6>Status</h6> <hr> </div> <div class="col-sm-10"> <select class="form-control select2" name="status"> <?php $status=$rowuser['status']; if($status !='0') { ?> <option value="1">Approved</option> <?php } else { ?> <option value="0">Not Approved</option> <?php } ?> <option value="1">Approved</option> <option value="0">Not Approved</option> </select> </div> </div> <div class="col-md-12 form-group mr-auto"> <button type="submit" name="register" class="btn btn-danger mt-2">Update</button> </div> </div> </form> </div> </div> </div> </form> </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> </body> </html>