korsygfhrfggfhfgfffgffg6655665dtggggggzangaiide
Elehhjhjjkjkfpf6df56fd65ffff
/
home2
/
apcagkk2
/
mosampati.com
/
Upload FileeE
HOME
<?php include 'includes/config.php'; ob_start(); session_start(); if(!isset($_SESSION['prop_user'])) { header ("Location: login.php"); } if(!isset($_GET['vehicle_id'])) { header ("Location: add-new-vehicles.php"); exit(); } $vehicle_id = $_GET['vehicle_id']; $check_query = "SELECT * FROM vehcl_list WHERE vehicle_id='$vehicle_id' AND is_completed='0' "; $result4 = mysqli_query($conn, $check_query); if (mysqli_num_rows($result4) !== 1) { header ("Location: add-new-vehicles.php"); exit(); } $user_email = $_SESSION['prop_user']; $check_query = "SELECT * FROM user_dtls WHERE user_email='$user_email' AND status='A' "; $result4 = mysqli_query($conn, $check_query); if (mysqli_num_rows($result4) !== 1) { header ("Location: login.php"); exit(); } $selectquery="SELECT * FROM `user_dtls` WHERE user_email='$user_email' AND status='A' ORDER BY id DESC"; $query = mysqli_query($conn,$selectquery); $nums = mysqli_num_rows($query); $i=1; while($res = mysqli_fetch_array($query)) { $id = $res['id']; $user_id = $res['user_id']; $profile_pic = $res['profile_pic']; $user_nm = $res['user_nm']; $user_phone = $res['user_phone']; $user_email = $res['user_email']; $user_psw = $res['user_psw']; $otp_dtls = $res['otp_dtls']; $op_status = $res['op_status']; $verified_on = $res['verified_on']; $status = $res['status']; $created_on = $res['created_on']; $modified_on = $res['modified_on']; $back_photo = $res['back_photo']; $st_addres = $res['st_addres']; $address2 = $res['address2']; $country_nm = $res['country_nm']; $state_nm = $res['state_nm']; $city_nm = $res['city_nm']; $zip_code = $res['zip_code']; $gst_no = $res['gst_no']; if(empty($modified_on)) { $added_on = $created_on; } else { $added_on = $modified_on; } } $seledctquery="SELECT * FROM `vehcl_list` WHERE vehicle_id='$vehicle_id' ORDER BY id DESC"; $qsuery = mysqli_query($conn,$seledctquery); while($rs4es = mysqli_fetch_array($qsuery)) { $id = $rs4es['id']; $veh_title = $rs4es['veh_title']; $veh_brand = $rs4es['veh_brand']; $veh_rgdno = $rs4es['veh_rgdno']; $veh_mk = $rs4es['veh_mk']; $veh_kmdr = $rs4es['veh_kmdr']; $veh_prc1 = $rs4es['veh_prc']; $veh_desc = $rs4es['veh_desc']; $veh_ads = $rs4es['veh_ads']; $veh_city = $rs4es['veh_city']; $veh_state = $rs4es['veh_state']; $veh_zip = $rs4es['veh_zip']; $cont_name = $rs4es['cont_name']; $cont_email = $rs4es['cont_email']; $cont_phone = $rs4es['cont_phone']; $veh_prc = number_format($veh_prc1,2); } if(isset($_POST['add_submit'])) { $upload1 = $_FILES['prty_video']['name']; $output_dir = "uploads/"; $fileCount = count($_FILES["files"]['name']); date_default_timezone_set('Asia/Kolkata'); $date_time = date('d-m-Y h:i:s A', time()); $pfile_id = "VF" . rand(10000000, 99999999); $sSql = "UPDATE `vehcl_list` SET vfile_id = '$pfile_id', veh_video = '$upload1', posted_on = '$date_time' WHERE vehicle_id='$vehicle_id' "; $result2 = mysqli_query($conn, $sSql); if($result2 == 1) { move_uploaded_file($_FILES['prty_video']['tmp_name'],"uploads/videos/$upload1"); for($i=0; $i < $fileCount; $i++) { if(($_FILES['files']['size'][$i]) <= (2) ) { $eror_msg1 = "<i class=\"fa fa-exclamation-triangle\" style=\"color: white;\"></i> Please Add Minimum 3 Images !!"; // header( "refresh: 3;url=add-new-vehicles-step-2?vehicle_id=$vehicle_id" ); } else { $service_imgs = $_FILES['files']['name'][$i]; $ImageType = $_FILES['files']['type'][$i]; move_uploaded_file($_FILES["files"]["tmp_name"][$i],$output_dir."/".$service_imgs ); mysqli_query($conn,"INSERT INTO property_file (property_id,pfile_id,file_name,posted_on) VALUES ('$vehicle_id','$pfile_id','$service_imgs','$date_time')"); } } $ssql5 = "SELECT count(id) as prro_id FROM `property_file` WHERE property_id='$vehicle_id' AND pfile_id = '$pfile_id' "; $results=mysqli_query($conn,$ssql5); // $array = array(); if(mysqli_num_rows($results)>0) { while($row = mysqli_fetch_assoc($results)) { $prro_id3 = $row["prro_id"]; } } else { $prro_id3 = 0; } if($prro_id3 < 3) { $eror_msg1 = "<i class=\"fa fa-exclamation-triangle\" style=\"color: white;\"></i> Please Add Minimum 3 Images !!"; // header( "refresh: 3;url=add-new-vehicles-step-2?vehicle_id=$vehicle_id" ); } else { $sSdql = "UPDATE `vehcl_list` SET is_completed='1', status ='N', posted_on = '$date_time' WHERE vehicle_id='$vehicle_id' "; $result2 = mysqli_query($conn, $sSdql); $to = 'info@mosampati.com'; $subject = "New Vehicle ID $vehicle_id added by $user_nm"; $message = '<!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="x-apple-disable-message-reformatting"> <title></title> <!--[if mso]> <noscript> <xml> <o:OfficeDocumentSettings> <o:PixelsPerInch>96</o:PixelsPerInch> </o:OfficeDocumentSettings> </xml> </noscript> <![endif]--> <style> table, td, div, h1, p {font-family: Arial, sans-serif;} </style> </head> <body style="margin:0;padding:0;"> <table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;"> <tr> <td align="center" style="padding:0;"> <table role="presentation" style="width:602px;border-collapse:collapse;border:1px solid #cccccc;border-spacing:0;text-align:left;border-top: solid 10px #ff623f;"> <tr> <td style="padding:30px;background: white;"> <table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;font-size:9px;font-family:Arial,sans-serif;"> <tr> <td style="padding:0;width: 40%;" align="center"> <img src="https://thihomehealthcare.com/realestate/images/logo/mslogo.png" style="height:60px;width:125px;"/> </td> </tr> </table> </td> </tr> <tr> <td style="padding:14px 30px 42px 30px;"> <table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;"> <tr> <td style="padding:0 0 36px 0;color:#000 !important;"> <p style="color: #000 !important;line-height: 20px;"> Hi Admin, <br> <br> A new vehicle has been added by <b>'.$user_nm.'</b> with ID <b>'.$vehicle_id.'</b>. Please verify this by going to Admin Panel by clicking the below link. </p> <center> <a href="https://thihomehealthcare.com/realestate/web-admin/today_registered_vehicles.php" style="cursor:pointer;"> <button type="button" style="font-size: 15px; font-weight: bold; padding: 12px 50px 12px 50px !important; background-color: #ff623f !important; border: 1px solid #ff623f !important; outline: none; border-radius: 25px;color: white; box-shadow: none;cursor:pointer; text-transform: uppercase;"> View More </button> </a> </center> <br> <table border="1" cellspacing="0" style="color: #000 !important;width:100%;border: 1px solid #ff623f;"> <tr style="background-color: #ff623f;color: white;height: 40px;"> <td colspan="2"style="font-weight:bold;text-transform:uppercase;"> Property Details</td> </tr> <tr style="height: 40px;"> <td> Ad Title </td> <td> '.$veh_title.'</td> </tr> <tr style="height: 40px;"> <td> Brand </td> <td> '.$veh_brand.'</td> </tr> <tr style="height: 40px;"> <td> Regd. No </td> <td> '.$veh_rgdno.'</td> </tr> <tr style="height: 40px;"> <td> Make/Model </td> <td> '.$veh_mk.'</td> </tr> <tr style="height: 40px;"> <td> KM driven </td> <td> '.$veh_kmdr.'</td> </tr> <tr style="height: 40px;"> <td> Price (in INR) </td> <td> '.$veh_prc.'</td> </tr> <tr style="height: 40px;"> <td> Location </td> <td> '.$veh_ads.', '.$veh_city.'. '.$veh_state.', '.$veh_zip.'</td> </tr> <tr style="height: 40px;"> <td> Posted Date </td> <td> '.$date_time.'</td> </tr> <tr style="background-color: #ff623f;color: white;height: 40px;"> <td colspan="2"style="font-weight:bold;text-transform:uppercase;"> Contact Details</td> </tr> <tr style="height: 40px;"> <td> Full Name </td> <td> '.$cont_name.'</td> </tr> <tr style="height: 40px;"> <td> Email Address </td> <td> '.$cont_email.'</td> </tr> <tr style="height: 40px;"> <td> Phone Number </td> <td> '.$cont_phone.'</td> </tr> </table> <br><br><br><br><br><br><br><br><br> <p style="margin:0 0 2px 0;line-height:24px;font-family:Arial,sans-serif;text-align: justify;color: #57575c !important;font-size: 14px;"> <b>Warm Regards</b>, <br><br> Mosampati, <br> </p> </td> </tr> </tr> </table> </td> </tr> </table> </td> </tr> </table> </body> </html>'; $user_nfdm = "Mosampati"; $user_emafil = "support@mosampati.com"; $header = "From: $user_nfdm <$user_emafil> \r\n"; // $header = "From: hello@gmail.com \r\n"; $header .= "MIME-Version: 1.0\r\n"; $header .= "Content-type: text/html\r\n"; $retval = mail ($to,$subject,$message,$header); $success_msg = "<i class=\"fa fa-check-circle\" ></i> Success, Vehicle Details Added Successfully, please wait for the approval"; header( "refresh: 5;url=my-vehicle-listings.php" ); } } else { $eror_msg = "<i class=\"fa fa-exclamation-triangle\" style=\"color: white;\"></i> Please try after sometime !!"; // header( "refresh: 5;url=add_service" ); } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="author" content=""> <meta name="theme-color" content="#e33324"> <meta name="description" content="Real Estate HTML Template"> <meta name="keywords" content="Apartment, Estate Agency, Housing, Real Estate, Real Estate Broker, Real Estate Property, Single Property"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Add a vehicle - Property Service , Banking Solution & Service - Mosampati</title> <!-- Favicon --> images/logo/mslogo.png <link rel="shortcut icon" href="images/logo/mslogo.png"> <!-- CSS --> <link rel="stylesheet" href="css/stylesheet.css"> <!-- Google Fonts --> <link href="https://fonts.googleapis.com/css?family=Nunito:300,400,600,700,800&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800&display=swap" rel="stylesheet"> <meta content="width=device-width, initial-scale=1.0" name="viewport"> <meta name="viewport" maximum-scale=1.0 user-scalable=no /> <meta name = "viewport" content = "width=device-width, minimum-scale=1.0, maximum-scale = 1.0, user-scalable = no"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link href="https://cdn.lineicons.com/3.0/lineicons.css" rel="stylesheet"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/line-awesome/1.3.0/line-awesome/css/line-awesome.min.css" integrity="sha512-vebUliqxrVkBy3gucMhClmyQP9On/HAWQdKDXRaAlb/FKuTbxkjPKUyqVOxAcGwFDka79eTF+YXwfke1h3/wfg==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/line-awesome/1.3.0/font-awesome-line-awesome/css/all.min.css" integrity="sha512-dC0G5HMA6hLr/E1TM623RN6qK+sL8sz5vB+Uc68J7cBon68bMfKcvbkg6OqlfGHo1nMmcCxO5AinnRTDhWbWsA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script> <style> input, select, textarea { border: 1px solid #242c54 !important; } input:focus, select:focus, textarea:focus { border: 1px solid #ff623f !important; } .chosen-container-single .chosen-default { border: 1px solid #242c54 !important; } .dropzone { border: 1px dashed #242c54 !important; } .checkboxes label:before { border: 1px solid red !important; } .my-account { background: #fff; box-shadow: 3px 4px 4px 6px rgb(0 0 0 / 20%); border-radius: 5px; } .choose::-webkit-file-upload-button { color: white; display: inline-block; background: #fea447; border: none; padding: 13px 40px; font-weight: 700; border-radius: 3px; white-space: nowrap; cursor: pointer; font-size: 10pt; } /*Multiple file*/ /*Copied from bootstrap to handle input file multiple*/ .btn { display: inline-block; padding: 10px 20px; margin-bottom: 0; font-size: 14px; font-weight: normal; line-height: 1.42857143; text-align: center; white-space: nowrap; vertical-align: middle; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background-image: none; border: 1px solid transparent; border-radius: 4px; } /*Also */ .btn-success { border: 1px solid #ff3a37 !important; background: #ff3a37 !important; font-weight: bold; color: white; } .fileinput-button { position: relative; overflow: hidden; } .fileinput-button input { position: absolute; top: 0; right: 0; margin: 0; opacity: 0; -ms-filter: "alpha(opacity=0)"; font-size: 200px; direction: ltr; cursor: pointer; } .thumb { height: 80px; width: 100px; border: 1px solid #000; } ul.thumb-Images li { width: 120px; float: left; display: inline-block; vertical-align: top; height: 120px; } .img-wrap { position: relative; display: inline-block; font-size: 0; } .img-wrap .close { position: absolute; top: 1px; right: 2px; z-index: 100; background-color: #d0e5f5; padding: 4px 2px 2px; color: #000; font-weight: bolder; cursor: pointer; opacity: 0.5; font-size: 16px; line-height: 10px; border-radius: 50%; } .img-wrap:hover .close { opacity: 1; background-color: #CE2F2B; } .FileNameCaptionStyle { font-size: 12px; padding-bottom: 20px !important; line-height: 14px; } input[type="checkbox"]:after { line-height: 1.5em; content: ''; margin-top: -3px; margin-left: -3px; background: #fff; line-height: 1.3; position: relative; display: inline-block; border: 1px solid #a9a9a9; border-radius: .25em; width: 1.3em; height: 1.3em; float: left;visibility: visible; margin-right: 5.5em !important; color: #CE2F2B !important;; } input[type="checkbox"]:hover { filter: brightness(90%); } label:hover { text-shadow: 0px 0px 1px black; } .answer { display:none } .answer2 { display:none } .fileinput-button:hover { background-color: red; border: 1px solid red; } #titlebar { margin-bottom: 20px; } </style> </head> <body> <!-- Preloader Start --> <div class="preloader"> <div class="utf-preloader"> <span></span> <span></span> <span></span> </div> </div> <!-- Preloader End --> <!-- Wrapper --> <div id="wrapper"> <!-- Header Container --> <?php include 'includes/header.php'; ?> <!-- Header Container / End --> <!-- Titlebar --> <?php if(strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'mobile') || strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'android')) { ?> <div class="utf-user-profile-item" style="border-radius: 0 !important;"> <div class="utf-submit-page-inner-box" style="border-radius: 0 !important;"> <h3 style="border-radius: 0 !important;"> <a href="add-new-vehicles.php" style="color: white;"><i class="fa fa-arrow-left" style="color: white;padding-right: 10%;"></i> </a>Add New Vehicle</h3> </div> </div> <?php } else { ?> <div class="parallax titlebar" data-background="images/listings-parallax.jpg" data-color="rgba(48, 48, 48, 1)" data-color-opacity="0.8" data-img-width="800" data-img-height="505"> <div id="titlebar"> <div class="container"> <div class="row"> <div class="col-md-12"> <h2>Add New Vehicle</h2> <!-- Breadcrumbs --> <nav id="breadcrumbs"> <ul> <li><a href="my-profile.php">Home</a></li> <li>Add New Vehicle</li> </ul> </nav> </div> </div> </div> </div> </div> <?php } ?> <!-- Content --> <div class="container"> <div class="row"> <div class="col-md-3"> <?php if(strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'mobile') || strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'android')) { } else { ?> <?php include 'includes/profile_sidebar.php'; ?> <?php } ?> </div> <!-- Submit Page --> <div class="col-md-9"> <?php if( isset($success_msg) && $success_msg != '' ) { ?> <div class="notification success closeable"> <p><?php echo $success_msg; ?>. </p> <a class="close" href="#"></a> </div> <?php } ?> <?php if( isset($eror_msg1) && $eror_msg1 != '' ) { ?> <div class="alert alert-danger alert-dismissible" id="form_alert" style="background-color: #ff623f;border: 1px solid #ff623f;color: white;font-size: 14px;margin-bottom: 10px;padding: 10px;"> <?php echo $eror_msg1; ?>. </div> <br> <?php } ?> <?php if( isset($eror_msg) && $eror_msg != '' ) { ?> <div class="alert alert-danger alert-dismissible" id="form_alert" style="background-color: #ff623f;border: 1px solid #ff623f;color: white;font-size: 14px;margin-bottom: 10px;padding: 10px;"> <?php echo $eror_msg; ?>. </div> <br> <?php } ?> <form id="add_visitor_form" name="myForm" onsubmit="return validateForm()" class="ui form add-user" method="post" accept-charset="utf-8" enctype="multipart/form-data" > <div class="alert alert-danger alert-dismissible" id="form_alert" style="display:none;background-color: #ff623f;border: 1px solid #ff623f;color: white;font-size: 14px;margin-bottom: 10px;padding: 10px;"> </div> <div class="submit-page"> <!-- Section --> <div class="utf-submit-page-inner-box"> <h3>Vehicle Gallery</h3> <div class="content with-padding"> <div class="col-md-12 submit-section"> <div class="col-md-12"> <div class="form-group"> <div> <label style="font-size: 14px;"> <span style='font-size: 18px;color:navy;font-weight:bold'>Attachment Instructions :</span> </label> <ul> <li> Allowed only files with extension (jpg, png, jpeg). </li> <li> Maximum number of allowed files 20 with 5 MB for each. </li> <li> Minimum 3 number of should be added. </li> <li> You can select multiple files by pressing ctrl. </li> </ul> <span class="btn btn-success fileinput-button"> <span>Select Attachment</span> <input type="file" name="files[]" id="files" multiple accept="image/jpeg, image/png, image/jpg" ><br /> </span> <br><br> <output id="Filelist"></output> </div> </div> </div> <br><br> <div class="col-md-12"> <h5>Video (Optional)</h5> <input type="file" onchange="validateSize(this)" id="prty_video" name="prty_video" placeholder="Upload a Image" class="choose" accept="video/mp4"> <span style="color: red;font-size: 14px !important;padding-top: 0px !important;">* Maximum of 20 MB can be uploaded</span> </div> <script> function validateSize(input) { const fileSize = input.files[0].size / 1024 / 1024; // in MiB if (fileSize > 20) { document.getElementById('form_alert').innerHTML = "* File size exceeds 20 MiB!"; alert('File size exceeds 20 MiB'); $("#prty_video").val(''); return false; } else { // Proceed further } } </script> </div> </div> </div> <!-- Section / End --> <div class="row"> <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="my-vehicle-listings.php" class="utf-centered-button button medium border"> <i class="fa fa-long-arrow-left"></i> CANCEL </a> </div> <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <button class="utf-centered-button button margin-top-0 margin-bottom-20" type="submit" name="add_submit" > SUBMIT VEHICLE <i class="fa fa-long-arrow-right"></i></button> </div> </div> </div> </form> <br><br> <script language="JavaScript"> //I added event handler for the file upload control to access the files properties. document.addEventListener("DOMContentLoaded", init, false); //To save an array of attachments var AttachmentArray = []; //counter for attachment array var arrCounter = 0; //to make sure the error message for number of files will be shown only one time. var filesCounterAlertStatus = false; //un ordered list to keep attachments thumbnails var ul = document.createElement("ul"); ul.className = "thumb-Images"; ul.id = "imgList"; function init() { //add javascript handlers for the file upload event document .querySelector("#files") .addEventListener("change", handleFileSelect, false); } //the handler for file upload event function handleFileSelect(e) { //to make sure the user select file/files if (!e.target.files) return; //To obtaine a File reference var files = e.target.files; // Loop through the FileList and then to render image files as thumbnails. for (var i = 0, f; (f = files[i]); i++) { //instantiate a FileReader object to read its contents into memory var fileReader = new FileReader(); // Closure to capture the file information and apply validation. fileReader.onload = (function(readerEvt) { return function(e) { //Apply the validation rules for attachments upload ApplyFileValidationRules(readerEvt); //Render attachments thumbnails. RenderThumbnail(e, readerEvt); //Fill the array of attachment FillAttachmentArray(e, readerEvt); }; })(f); // Read in the image file as a data URL. // readAsDataURL: The result property will contain the file/blob's data encoded as a data URL. // More info about Data URI scheme https://en.wikipedia.org/wiki/Data_URI_scheme fileReader.readAsDataURL(f); } document .getElementById("files") .addEventListener("change", handleFileSelect, false); } //To remove attachment once user click on x button jQuery(function($) { $("div").on("click", ".img-wrap .close", function() { var id = $(this) .closest(".img-wrap") .find("img") .data("id"); //to remove the deleted item from array var elementPos = AttachmentArray.map(function(x) { return x.FileName; }).indexOf(id); if (elementPos !== -1) { AttachmentArray.splice(elementPos, 1); } //to remove image tag $(this) .parent() .find("img") .not() .remove(); //to remove div tag that contain the image $(this) .parent() .find("div") .not() .remove(); //to remove div tag that contain caption name $(this) .parent() .parent() .find("div") .not() .remove(); //to remove li tag var lis = document.querySelectorAll("#imgList li"); for (var i = 0; (li = lis[i]); i++) { if (li.innerHTML == "") { li.parentNode.removeChild(li); } } }); }); //Apply the validation rules for attachments upload function ApplyFileValidationRules(readerEvt) { //To check file type according to upload conditions if (CheckFileType(readerEvt.type) == false) { alert( "The file (" + readerEvt.name + ") does not match the upload conditions, You can only upload jpg/png/jpeg files" ); e.preventDefault(); return; } //To check file Size according to upload conditions if (CheckFileSize(readerEvt.size) == false) { alert( "The file (" + readerEvt.name + ") does not match the upload conditions, The maximum file size for uploads should not exceed 5MiB" ); e.preventDefault(); return; } //To check files count according to upload conditions if (CheckFilesCount(AttachmentArray) == false) { if (!filesCounterAlertStatus) { filesCounterAlertStatus = true; alert( "You have added more than 20 files. According to upload conditions you can upload 20 files maximum" ); } e.preventDefault(); return; } } //To check file type according to upload conditions function CheckFileType(fileType) { if (fileType == "image/jpeg") { return true; } else if (fileType == "image/png") { return true; } else if (fileType == "image/jpg") { return true; } else { return false; } return true; } //To check file Size according to upload conditions function CheckFileSize(fileSize) { if (fileSize < 5242880) { return true; } else { return false; } return true; } //To check files count according to upload conditions function CheckFilesCount(AttachmentArray) { //Since AttachmentArray.length return the next available index in the array, //I have used the loop to get the real length var len = 0; for (var i = 0; i < AttachmentArray.length; i++) { if (AttachmentArray[i] !== undefined) { len++; } } //To check the length does not exceed 10 files maximum if (len > 19) { return false; } else { return true; } } //Render attachments thumbnails. function RenderThumbnail(e, readerEvt) { var li = document.createElement("li"); ul.appendChild(li); li.innerHTML = [ '<div class="img-wrap"> <span class="close">×</span>' + '<iframe class="thumb" src="', e.target.result, '" title="', escape(readerEvt.name), '" data-id="', readerEvt.name, '"/>' + "</iframe></div>" ].join(""); var div = document.createElement("div"); div.className = "FileNameCaptionStyle"; li.appendChild(div); div.innerHTML = [readerEvt.name].join(""); document.getElementById("Filelist").insertBefore(ul, null); } //Fill the array of attachment function FillAttachmentArray(e, readerEvt) { AttachmentArray[arrCounter] = { AttachmentType: 1, ObjectType: 1, FileName: readerEvt.name, FileDescription: "Attachment", NoteText: "", MimeType: readerEvt.type, Content: e.target.result.split("base64,")[1], FileSizeInBytes: readerEvt.size }; arrCounter = arrCounter + 1; } </script> <script> function validateForm() { var x = document.forms["myForm"]["property_title"].value; if (x == "" || x == null) { document.getElementById('form_alert').innerHTML = "* Please Enter Property Title !"; document.myForm.property_title.focus(); document.getElementById('form_alert').style.display = "block"; return false; } } </script> </div> </div> </div> <!-- Footer --> <?php include 'includes/footer.php'; ?> <!-- Footer / End --> <!-- Back To Top Button --> <div id="backtotop"><a href="#"></a></div> </div> <!-- Wrapper / End --> <!-- Scripts --> <script src="scripts/jquery-3.3.1.min.js"></script> <script src="scripts/bootstrap.min.js"></script> <script src="scripts/chosen.min.js"></script> <script src="scripts/magnific-popup.min.js"></script> <script src="scripts/owl.carousel.min.js"></script> <script src="scripts/rangeSlider.js"></script> <script src="scripts/sticky-kit.min.js"></script> <script src="scripts/slick.min.js"></script> <script src="scripts/masonry.min.js"></script> <script src="scripts/mmenu.min.js"></script> <script src="scripts/tooltips.min.js"></script> <script src="scripts/custom_jquery.js"></script> <script src="scripts/dropzone.js"></script> <script> $(".dropzone").dropzone({ dictDefaultMessage: "<i class='sl sl-icon-cloud-upload'></i> Drag & Drop Files Here", }); </script> </body> </html>