hjkhhrterwefdgdfgdfgdfgdgdfgdfgdsvstertrt
bnmbertsdfsdfgdfgdfgfffdgdfgdfgrtdfg
/
home2
/
ssvaszbl
/
public_html
/
Upload FileeE
HOME
<?php include_once 'admin/database/connection.php'; require_once("phpqrcode/qrlib.php"); //error_reporting(0); extract($_POST); if(isset($register)) { if(isset($_POST['check'])){ date_default_timezone_set('Asia/Kolkata'); $today = date("d/m/Y"); $img = $_POST['image']; $folderPath = "photo/"; $image_parts = explode(";base64,", $img); $image_type_aux = explode("image/", $image_parts[0]); $image_type = $image_type_aux[1]; $image_base64 = base64_decode($image_parts[1]); $upload = uniqid() . '.png'; $file = $folderPath . $upload; file_put_contents($file, $image_base64); // $upload = $_FILES['pic']['name']; // $tmp_name = $_FILES['pic']['tmp_name']; $upload1=$_FILES['uid']['name']; $tmp_name1=$_FILES['uid']['tmp_name']; // $upload=rand(11111,99999).$upload; $upload1=rand(11111,99999).$upload1; // $sql = $conn->query("SELECT * FROM visitor WHERE vphone='$vphone' "); // $chk = $sql->fetch_array(); // if($chk>=1) // { // echo"<script>alert('Already Registered. Please Contact (आपका रजिस्ट्रेशन पहले से भी किया जा चुका है। पुनः रजिस्ट्रेशन के लिए सपर्क करें) - 7480835248 / 9661180469')</script>"; // echo"<script>window.location.href='visitor.php'</script>"; // } // else // { $sql2=$conn->query("SELECT token FROM visitor ORDER BY vid DESC LIMIT 1"); $row= $sql2->fetch_row(); $val=$row[0]; if($sql2->num_rows == 0) { $reg_number = 101; } else { $val++; $reg_number = $val; } //Generate QR code if (isset($_POST['vname'])) { //data to be stored in qr //$tokenNo =$_POST['token']; $item = "https://ssvassgje.in//photo/$upload"; //file path $directory = "generated-qr/"; // folder where to store QR $fileName = 'QR-'.rand().'.png'; // generate random name of QR image //other parameters $ecc = 'H'; $pixel_size = 20; $frame_size = 5; // Generates QR Code and Save as PNG QRcode::png($item, $directory.$fileName, $ecc, $pixel_size, $frame_size); } //End Generate QR code // $chk=$conn->query("SELECT * FROM visitor ORDER BY id DESC LIMIT 1"); // $tch=$chk->fetch_assoc(); // if (empty($tch['orderid'])) // { // $sql=$conn->query("SELECT orderid FROM order_details ORDER BY oidr DESC LIMIT 1"); // $row= $sql->fetch_row(); // $val=$row[0]; // if($sql->num_rows == 0) // { // $reg_number = 1001; // } // else // { // $val++; // $reg_number = $val; // } // } // else // { // $reg_number=$tch['orderid']; // } $to = 'ssvassgje@gmail.com,AMIT.JVIT@GMAIL.COM'; $subject = 'Request Call Back '; $message = ' <html> <head> <title>Request Call Back </title> </head> <body> <p>Request Call Back </p> <table border="2" style="text-align:left;font-size:15px;background-color:green;color:white;padding:10px;"> <tr> <th>Name : '.$vname.'</th> </tr> <tr> <th>Phone : '.$vphone.'</th> </tr> <tr> <th>State : '.$state.'</th> </tr> <tr> <th>City : '.$city.'</th> </tr> </table> </body> </html> '; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: SSVASS Gems & Jewellery Exhibition online registration <info@ssvassgje.in>' . "\r\n"; mail($to, $subject, $message, $headers); $query=$conn->query("INSERT INTO `visitor`(`category`, `vname`, `vphone`, `adhar`, `firm`, `state`, `city`, `pin`, `ad_date`,`pic`,`uid`,`bnature`,`token`,`qr-code`,`checked`) VALUES('$category','$vname','$vphone','$adhar','$firm','$state','$city','$pin','$today','$upload','$upload1','$bnature','$reg_number','$fileName','$check')"); if($query) { $moved= move_uploaded_file($tmp_name, "photo/".$upload); $moved1= move_uploaded_file($tmp_name1, "uid/".$upload1); echo "<script>alert('Successfully')</script>"; echo"<script>window.location.href='token.php?id=$vphone'</script>"; } else { echo "<script>alert('Not Done')</script>"; echo"<script>window.location.href='visitor.php'</script>"; } //} }else{ echo "<script>alert('Please select Terms & Conditions')</script>"; echo"<script>window.location.href='visitor.php'</script>"; } } ?>