D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
vitalityhealth
/
public_html
/
aa
/
invite
/
Filename :
edit-sukhmani-sahib-path-generator-2.php
back
Copy
<?php include 'cn.php'; $rand=$_GET["rand"]; $query = "SELECT * FROM sukhmaniinv2 WHERE random = $rand"; $result = $con->query($query); $row = $result->fetch_assoc(); //$eventTime = $row['eventtime']; $dateTimeObject = DateTime::createFromFormat('h:i:A', $row['eventtime']); if ($dateTimeObject !== false && !array_sum($dateTimeObject->getLastErrors())) { // Successfully created a DateTime object $formattedTime = $dateTimeObject->format('h:i A'); // return $dateTimeObject->format('h:i A'); // Return the formatted time } else { // Failed to create a DateTime object $formattedTime = $row['eventtime']; // return false; } if(isset($_POST['submit'])) { date_default_timezone_set('Asia/Kolkata'); $curdate= date('d-m-Y H:i'); $filename1 = $_FILES['file1']['name']; // Upload file move_uploaded_file($_FILES['file1']['tmp_name'],'category/'.$filename1); $rand = addslashes($_POST['rand']); $familyname = addslashes($_POST['familyname']); // print_r($_POST);exit; $weddingname = addslashes($_POST['weddingname']); $eventdate = addslashes($_POST['eventdate']); $eventmonth = addslashes($_POST['eventmonth']); $eventyear = addslashes($_POST['eventyear']); $eventtime = addslashes($_POST['eventtime']); $eventday = addslashes($_POST['eventday']); $number = addslashes($_POST['number']); $address = addslashes($_POST['address']); $rsvp = addslashes($_POST['rsvp']); $birthage = addslashes($_POST['birthage']); $dateTime = new DateTime($_POST['eventtime']); $formattedTime = $dateTime->format('h:i A'); $eventtime = addslashes($formattedTime); $sql = "UPDATE sukhmaniinv2 SET familyname = '$familyname', weddingname = '$weddingname', number = '$number', eventdate = '$eventdate', eventmonth = '$eventmonth', eventyear = '$eventyear', eventtime = '$eventtime', eventday = '$eventday', birthage = '$birthage', address = '$address', rsvp = '$rsvp' WHERE random = $rand"; $result = $con->query($sql); if($result){ echo "<script type='text/javascript'> location.href='sukhmani-sahib-path/temp2/index.php?rand=$rand'; </script>";} else { echo "<script type='text/javascript'>alert(\"Not Generated\") location.href='fail.php'; </script>"; } } ?> <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <title>Edit Sukhmani Sahib Path Card Generator</title> <meta name="description" content=""> <meta name="keywords" content=""> <meta name="author" content="FREE INVITATION GENERATOR"> <link rel="shortcut icon" href="images/favicon.ico"><!-- Favicon Icon --> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i"><!-- Google Fonts --> <link rel="stylesheet" href="css/plugins.css"><!-- plugins Css --> <link rel="stylesheet" href="css/fonts-icons.css"><!-- Font Icons Css --> <link rel="stylesheet" type="text/css" href="css/style.css"><!-- Custom Css --> <link rel="stylesheet" type="text/css" href="css/helper.css"><!-- Helper Css --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> </head> <body> <!-- Start PreLoader ================================================== --> <div id="pre-loader" class="pre-loader"> <div class="cube-wrapper"> <div class="cube-folding"> <span class="leaf1"></span> <span class="leaf2"></span> <span class="leaf3"></span> <span class="leaf4"></span> </div> <span class="loading" data-name="Loading">Loading</span> </div> <div class="pre-loader-logo"><span class="text-uppercase fw-2 text-white">FREE INVITATION GENERATOR</span></div> </div> <!-- End PreLoader ================================================== --> <!-- Start Header ================================================== --> <?php include("header.php");?> <!-- Start Get in touch today ================================================== --> <section id="contact" class="section bg-grey"> <div class="container"> <div class="row justify-content-center text-center mb-60"> <div class="col-lg-12"> <h2 class="text-black fw-3">Submit <strong class="fw-7">Your</strong> <span class="text-orange">Details</span></h2> </div> </div> <div class="row"> <div class="col-lg-12"> <form action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="rand" value="<?php echo $rand ?>"> <div class="row form-group pb-3"> <div class="col-lg-4"> <div class="form-group"> <div class="position-relative"> <label>Family Name</label> <input type="text" class="form-control" name="familyname" value="<?php echo $row['familyname']; ?>" required> </div> </div> </div> <div class="col-lg-4"> <div class="form-group"> <div class="position-relative"> <label>Brithday of</label> <input type="text" class="form-control" name="weddingname" value="<?php echo $row['weddingname']; ?>" required> </div> </div> </div> <input type="hidden" class="form-control" name="number" value="<?php echo $row['number']; ?>" required> <div class="col-lg-4"> <div class="form-group"> <div class="position-relative"> <label>Select Date</label> <select name="eventdate" class="form-control"> <option >Select Date</option> <?php for ($i = 1; $i <= 31; $i++) { $selected = ($i == $row['eventdate']) ? 'selected' : ''; echo "<option value=\"$i\" $selected>$i</option>"; } ?> </select> </div> </div> </div> <div class="col-lg-4"> <div class="form-group"> <div class="position-relative"> <label>Select Month</label> <select name="eventmonth" class="form-control"> <option >Select Month</option> <?php $months = ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']; foreach ($months as $month) { $selected = ($month === $row['eventmonth']) ? 'selected' : ''; echo "<option value=\"$month\" $selected>$month</option>"; } ?> </select> </div> </div> </div> <div class="col-lg-4"> <div class="form-group"> <div class="position-relative"> <label>Select Year</label> <select name="eventyear" class="form-control"> <option >Select Year</option> <?php for ($i = 2023; $i <= 2050; $i++) { $selected = ($i == $row['eventyear']) ? 'selected' : ''; echo "<option value=\"$i\" $selected>$i</option>"; } ?> </select> </div> </div> </div> <div class="col-lg-4"> <div class="form-group"> <div class="position-relative"> <label>Select Month</label> <select name="eventday" class="form-control"> <option value="<?php echo $row['eventday']; ?>"><?php echo $row['eventday']; ?></option> <option value="SUNDAY">SUNDAY</option> <option value="MONDAY">MONDAY</option> <option value="TUESDAY">TUESDAY</option> <option value="WEDNESDAY">WEDNESDAY</option> <option value="THURSDAY">THURSDAY</option> <option value="FRIDAY">FRIDAY</option> <option value="SATURDAY">SATURDAY</option> <option value="SUNDAY">SUNDAY</option> </select> </div> </div> </div> <div class="col-lg-4"> <div class="form-group"> <div class="position-relative"> <label >Time</label> <input type="text" class="form-control" name="eventtime" id="eventtime" value="<?php echo $formattedTime?$formattedTime:$row['eventtime']; ?>" required> </div> </div> </div> <div class="col-lg-4"> <div class="form-group"> <label>Birth Age</label> <div class="position-relative"> <input type="text" class="form-control" name="birthage" required maxlength="10" required value="<?php echo $row['birthage']; ?>"> </div> </div> </div> <div class="col-lg-4"> <div class="form-group"> <div class="position-relative"> <label >Address</label> <textarea id="myTextarea" rows="4" cols="50" oninput="limitTextarea()" placeholder="Type here..." class="form-control" name="address" ><?php echo $row['address']; ?></textarea> <p id="wordCount">Word count: 0</p> </div> </div> </div> <div class="col-lg-4"> <div class="form-group"> <div class="position-relative"> <label >RSVP</label> <textarea rows="4" cols="50" placeholder="Type here..." class="form-control" name="rsvp" ><?php echo $row['rsvp']; ?></textarea> </div> </div> </div> </div> <div class="row"> <div class="col-lg-12"> <center> <button type="submit" name="submit" class="btn btn-send btn-blue">Generate<i class="far fa-paper-plane pl-3"></i></button> </center> </div> </div> </form> </div> </div> </section> <!-- End Get in touch today ================================================== --> <!-- Start Footer ================================================== --> <?php include("footer.php");?> <!-- End Footer ================================================== --> <!-- Start Back to Top ================================================== --> <a href="#" class="back-to-top" id="back-to-top"><span class="ti-arrow-up"></span></a> <!-- End Back to Top ================================================== --> <script> function limitTextarea() { var textarea = document.getElementById("myTextarea"); var wordCount = document.getElementById("wordCount"); // Split the text by spaces to count words var words = textarea.value.split(/\s+/); // Set your desired word limit var wordLimit = 10; // Update word count wordCount.textContent = "Word count: " + words.length; // Check if the word limit is exceeded and trim the textarea value accordingly if (words.length > wordLimit) { textarea.value = words.slice(0, wordLimit).join(" "); wordCount.textContent = "Word count: " + wordLimit; } } </script> <script src="js/jquery.min.js"></script><!-- jquery JS --> <script src="js/plugins.js"></script><!-- Plugins JS --> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBhS88E7WGYgrr2chM0z94OLBWKNDXxESk"></script><!-- Google Map JS --> <script src="js/app.js"></script><!-- Custom JS --> <script> document.getElementById('eventtime').addEventListener('click', function() { // Create a new input element with type="time" var timeInput = document.createElement('input'); timeInput.type = 'time'; timeInput.className = 'form-control'; timeInput.name = 'eventtime'; timeInput.value = this.value; // Replace the text input with the time input this.parentNode.replaceChild(timeInput, this); // Focus on the new time input timeInput.focus(); }); </script> </body> </html>