D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
vitalityhealth
/
public_html
/
aa
/
invite
/
Filename :
card-update.php
back
Copy
<?php ob_start(); include("cn.php"); session_start(); $selectRole = mysqli_query($con,"SELECT * FROM user WHERE userUid ='".$urlData[2]."' ORDER BY userID ASC"); $rowRole = mysqli_fetch_array($selectRole); $Arr1 = json_decode($rowRole['userDetails'], true); $selectRole11 = mysqli_query($con,"SELECT * FROM card WHERE cardID ='".$rowRole['userTid']."' ORDER BY cardID ASC"); $rowRole11 = mysqli_fetch_array($selectRole11); if($rowRole11['cardCategory'] == 1) { $cattype ='sukhmani-sahib-path'; }else if($rowRole11['cardCategory'] == 2){ $cattype ='griha-pravesh'; } else if($rowRole11['cardCategory'] == 3){ $cattype ='wedding-invitation'; } else if($rowRole11['cardCategory'] == 4){ $cattype ='happy-birthday'; } else if($rowRole11['cardCategory'] == 5){ $cattype ='happy-new-year'; } else if($rowRole11['cardCategory'] == 6){ $cattype ='baby-shower'; } else if($rowRole11['cardCategory'] == 7){ $cattype ='happy-diwali'; } $Arr = json_decode($rowRole11['cardDetails'], true); if(isset($_POST['save'])){ // print_r($_POST); $countData = count($_POST['title']); $myArr = array(); for($i=0; $i < $countData; $i++){ $myArr[] = array( "title"=>addslashes($_REQUEST['title'][$i]), "size"=>$_REQUEST['size'][$i], "color"=>addslashes($_REQUEST['color'][$i]) ); } // $myArr['userUid'] = $_REQUEST['tid']; // $myArr['userCatid'] = base64_decode($_REQUEST['cid']); // $myArr['userTid'] = base64_decode($_REQUEST['tid']); $insert1 ="UPDATE user set userDetails ='".addslashes(json_encode($myArr))."' WHERE userUid ='".$urlData[2]."'"; $result=mysqli_query($con,$insert1) or die(mysqli_error()); $lastid = mysqli_insert_id($con); //$url = $rowRole11['cardPage']."?cid=".$_REQUEST['cid']."&tid=".$_REQUEST['tid']."&uid=".$_REQUEST['uid']; //header("Location:".$url.""); $url = $siteurl.$cattype."/".trim($rowRole11['cardPage'])."/".$urlData[0]."/".$urlData[1]."/".$urlData[2]; echo "<script type='text/javascript'> document.location = '".$url."'; </script>"; exit; } ?> <!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>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="<?php echo $siteurl; ?>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="<?php echo $siteurl; ?>css/plugins.css"><!-- plugins Css --> <link rel="stylesheet" href="<?php echo $siteurl; ?>css/fonts-icons.css"><!-- Font Icons Css --> <link rel="stylesheet" type="text/css" href="<?php echo $siteurl; ?>css/style.css"><!-- Custom Css --> <link rel="stylesheet" type="text/css" href="<?php echo $siteurl; ?>css/helper.css"><!-- Helper Css --> <link rel="stylesheet" type="text/css" href="<?php echo $siteurl; ?>css/color-1.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <style type="text/css"> .myforms { background: #f3f7fe; padding: 10px; border: 2px solid #cfcfcf; border-radius: 10px; } .myfills { text-align: center; font-size: 18px; font-weight: 700; color: #e80000; padding-bottom: 15px; } </style> </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-3"></div> <div class="col-lg-6"> <img src="<?php echo $siteurl.$rowRole11['cardPic']; ?>" style="width:382px;height:465px;"> </div> <div class="col-lg-3"></div> </div> <div class="row"> <div class="col-lg-12"> <div class="myforms"><div class="myfills">Fill All Infomation for Best Invitation Card</div> <form action="" method="post" enctype="multipart/form-data"> <?php foreach ($Arr as $keyt => $vals) { ?> <?php foreach ($Arr1 as $keyv => $val1){ ?> <?php if($keyt == $keyv){ ?> <div class="mb-3 row mt-3"> <div class="col-lg-9"> <label class="col-sm-12 col-form-label"></label> <input type="text" name="title[<?php echo $keyt; ?>]" required value="<?php echo stripslashes($val1['title']); ?>" class="form-control"> </div> <div class="col-lg-2"> <label class="col-sm-12 col-form-label">Font Size</label> <input type="number"name="size[<?php echo $keyt; ?>]" minlength="10" maxlength="30" value="<?php echo $val1['size']; ?>" class="form-control"> </div> <div class="col-lg-1"> <label class="col-sm-12 col-form-label">Color</label> <input class="form-control-color" oninput="document.querySelector('#tcolor_<?php echo $keyt; ?>').value= this.value" type="color" placeholder="Title" id="title" value="<?php echo $val1['color']; ?>"> <input type="hidden" name="color[<?php echo $keyt; ?>]" value="<?php echo $val1['color']; ?>" class="form-control" id="tcolor_<?php echo $keyt; ?>" readonly=""> </div> </div> <?php } ?> <?php } ?> <?php } ?> <div class="row"> <div class="col-lg-12 mt-5"> <center> <button type="submit" name="save" class="btn btn-send btn-blue">Preview <i class="far fa-paper-plane pl-3"></i></button> </center> </div> </div> </div> </form> </div> </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 src="<?php echo $siteurl; ?>js/jquery.min.js"></script><!-- jquery JS --> <script src="<?php echo $siteurl; ?>js/plugins.js"></script><!-- Plugins JS --> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBhS88E7WGYgrr2chM0z94OLBWKNDXxESk"></script><!-- Google Map JS --> <script src="<?php echo $siteurl; ?>js/app.js"></script><!-- Custom JS --> </body> </html>