<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>RealEstate - Landing</title>
    <link rel="icon" href="<?php echo asset('img/logo.png'); ?>"/>
    <!-- Custom fonts for this template -->
    <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
    <link
        href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
        rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="css/sb-admin-2.min.css" rel="stylesheet">

    <!-- Custom styles for this page -->
    <link href="vendor/datatables/dataTables.bootstrap4.min.css" rel="stylesheet">

    <script>
        function hideMessages() {
            document.getElementById('successMessage').style.display = 'none';
            document.getElementById('errorMessages').style.display = 'none';
        }
    </script>

</head>

<body id="page-top">

    <!-- Page Wrapper -->
    <div id="wrapper">

        <!-- Sidebar -->
        

        <!-- Content Wrapper -->
        <div id="content-wrapper" class="d-flex flex-column">

            <!-- Main Content -->
            <div id="content">

                <!-- Topbar -->
                <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">

                <div  style="background: url('<?php echo e(asset('/img/logo.png')); ?>');background-position: center; background-size: cover; width: 90px; height: 80px; margin-top: -10px"></div>
                           
                    <!-- Page Heading -->
                    <h1 class="h3 mb-2 text-gray-800">Melsoft RealEstate</h1>
                    

                    <!-- Topbar Navbar -->
                    <ul class="navbar-nav ml-auto">

               

                        <!-- Nav Item - Alerts -->
                        <li class="nav-item dropdown no-arrow mx-1">
                            <a class="nav-link dropdown-toggle"  id="alertsDropdown" role="button"
                                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                <i class="fas fa-bell fa-fw"></i>
                                <!-- Counter - Alerts -->
                                <span class="badge badge-danger badge-counter">0</span>
                            </a>
                            
                        </li>

                        <!-- Nav Item - Messages -->
                        <li class="nav-item dropdown no-arrow mx-1">
                            <a class="nav-link dropdown-toggle"  id="messagesDropdown" role="button"
                                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                <i class="fas fa-envelope fa-fw"></i>
                                <!-- Counter - Messages -->
                                <span class="badge badge-danger badge-counter">0</span>
                            </a>
                            
                        </li>

                        <div class="topbar-divider d-none d-sm-block"></div>

                        <!-- Nav Item - User Information -->
                        <li class="nav-item dropdown no-arrow">
                            <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button"
                                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                <span class="mr-2 d-none d-lg-inline text-gray-600 small"><?php echo e(Session::get('Name')); ?></span>
                                <img class="img-profile rounded-circle"
                                    src="img/undraw_profile.svg">
                            </a>
                            <!-- Dropdown - User Information -->
                            <div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"
                                aria-labelledby="userDropdown">
                               
                              
                                <a class="dropdown-item"  data-toggle="modal" data-target="#logoutModal">
                                    <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
                                    Logout
                                </a>
                            </div>
                        </li>

                    </ul>

                </nav>
                <!-- End of Topbar -->

                <!-- Begin Page Content -->
                <div class="container-fluid">

                    <!-- Page Heading -->
                    <h1 class="h3 mb-2 text-gray-800">Properties</h1>

<br>
<br>


                    

                    <!-- DataTales Example -->
                    <div class="card shadow mb-4">
                        <div class="card-header py-3">
                            <h6 class="m-0 font-weight-bold text-primary"   id="formHeader">Create Properties</h6>
                        </div>
                        <?php if(session('success')): ?>
                            <div class="alert alert-success" id="successMessage"  style="margin: 20px;">
                                <?php echo e(session('success')); ?>

                            </div>
                        <?php endif; ?>
                      
                        <?php if($errors->any()): ?>

                                    <div class="form-group"  id="successMessage"  style="margin: 20px;">
                                        <div class="card bg-warning text-white shadow">
                                            <div class="card-body">
                                        
                                                <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <div style="color: red; "><?php echo e($error); ?></div>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        
                                            </div>
                                        </div>
                                    </div>
                                    <?php endif; ?>
                            <form class="card-body" action="<?php echo e(route('createProperty')); ?>" method="post"  id="accountTypeForm">
                            <?php echo csrf_field(); ?>
                            <input type="hidden" id="accountId" name="id" value="">
                                <div class="form-group row">
                                   <div class="col-sm-4 mb-3 mb-sm-0">
                                        <input type="text" class="form-control form-control-user" id="pcode" placeholder="Property Code" name="pcode"  value="<?php echo e(old('pcode')); ?>" required>
                                    </div>
                                    <div class="col-sm-4 mb-3 mb-sm-0">
                                        <input type="text" class="form-control form-control-user" id="name" placeholder="Name" name="name" value="<?php echo e(old('name')); ?>" required>
                                    </div>
                                    <div class="col-sm-4">
                                        <input type="text" class="form-control form-control-user" id="address" placeholder="Address" name="address"  value="<?php echo e(old('address')); ?>" required>
                                    </div>
                                </div>
                               
                                <div class="form-group row">
                                <div class="col-sm-4 mb-3 mb-sm-0">
                                        <input type="text" class="form-control form-control-user" id="type" placeholder="Type" name="type"  value="<?php echo e(old('type')); ?>" required>
                                    </div>
                                    <div class="col-sm-4 mb-3 mb-sm-0">
                                        <input type="text" class="form-control form-control-user" id="floors" placeholder="Floors" name="floors"  value="<?php echo e(old('floors')); ?>" required>
                                    </div>
                                    <div class="col-sm-4">
                                        <input type="text" class="form-control form-control-user" id="area" placeholder="Area" name="area"  value="<?php echo e(old('area')); ?>" required>
                                    </div>
                                </div>
                               
                                <div class="form-group row">
                                    <div class="col-sm-4 mb-3 mb-sm-0">
                                    <select class="form-control form-control-user" id="group" name="group"  value="<?php echo e(old('group')); ?>"  required>
                                        <option value="" disabled selected>Select Group</option>
                                        <option value="Commercial">Commercial</option>
                                        <option value="Industrial">Industrial</option>
                                        <option value="Residential">Residential</option>
                                    </select>
                                    </div>
                                    <div class="col-sm-4 mb-3 mb-sm-0">
                                        <input type="text" class="form-control form-control-user" id="rooms" placeholder="Rooms" name="rooms"  value="<?php echo e(old('rooms')); ?>" required>
                                    </div>
                                    <div class="col-sm-4">
                                        <input type="text" class="form-control form-control-user" id="space" placeholder="Space Occupied" name="space"  value="<?php echo e(old('space')); ?>" required>
                                    </div>
                                </div>


                               <div style="display: flex;">
                               <input type="submit" style="width: 100px;height: 40px; margin-right: 10px; margin-top: 6px" value="Create" class="btn btn-primary btn-user btn-block" id="submitButton"/>

                                <input style="width: 100px;" onclick="refreshAccountType('', '', '', '',   '', '', '',  '', '', '')"  type="reset" value="Refresh" class="btn btn-secondary btn-user btn-block"  onclick="hideMessages()"/>
                                    
                               </div>
                                
                                <hr>
                             </form>
                   
                        
                        
                        <div class="card-body">
                            <div class="table-responsive">
                                <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
                                    <thead>
                                        <tr>
                                            <th>Code</th>
                                            <th>Name</th>
                                            <th>Address</th>
                                            <th>Type</th>
                                            <th>Area</th>
                                            <th>Action</th>
                                        </tr>
                                    </thead>
                                    <tfoot>
                                        <tr>
                                        
                                            <th>Code</th>
                                            <th>Name</th>
                                            <th>Address</th>
                                            <th>Type</th>
                                            <th>Area</th>
                                            <th>Action</th>

                                        </tr>
                                    </tfoot>
                                    <tbody>
                                       
                                        <?php $__currentLoopData = $properties; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $property): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr>
                                        
                                                <td><?php echo e($property->Code); ?></td>
                                                <td><?php echo e($property->Name); ?></td>
                                                <td><?php echo e($property->Address); ?></td>
                                                <td><?php echo e($property->Type); ?></td> 
                                                <td><?php echo e($property->Area); ?></td>

                                                <td style="justify-content: center; align-items: center;">
                                                    <a href="<?php echo e(route('property.details', ['code' => $property->Code, 'name' => $property->Name])); ?>" class="btn btn-success btn-circle">
                                                        <i class="fas fa-check"></i>
                                                    </a>
                                                    <a href=""  class="btn btn-primary btn-circle" onclick="editAccountType(event,'<?php echo e($property->ID); ?>', '<?php echo e($property->Code); ?>', '<?php echo e($property->Name); ?>', '<?php echo e($property->Address); ?>',   '<?php echo e($property->Type); ?>', '<?php echo e($property->Floors); ?>', '<?php echo e($property->Area); ?>',  '<?php echo e($property->Groups); ?>', '<?php echo e($property->Rooms); ?>', '<?php echo e($property->Space); ?>')">
                                                    <i class="fas fa-edit"></i>
                                                    </a>
                                                    <a href="<?php echo e(route('property.delete', ['code' => $property->Code, 'name' => $property->Name])); ?>" class="btn btn-danger btn-circle" onclick="return confirmDelete('<?php echo e($property->Name); ?>');">
                                                        <i class="fas fa-trash"></i>
                                                    </a>
                                                </td>
                                                
                                            </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                           
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>

                </div>
                <!-- /.container-fluid -->

            </div>
            <!-- End of Main Content -->

            <!-- Footer -->
            <footer class="sticky-footer bg-white">
                <div class="container my-auto">
                    <div class="copyright text-center my-auto">
                        <span>Copyright &copy; Melsoft Solutions (PVT) LTD</span>
                    </div>
                </div>
            </footer>
            <!-- End of Footer -->

        </div>
        <!-- End of Content Wrapper -->

    </div>
    <!-- End of Page Wrapper -->

    <!-- Scroll to Top Button-->
    <a class="scroll-to-top rounded" href="#page-top">
        <i class="fas fa-angle-up"></i>
    </a>

    <!-- Logout Modal-->
    <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
        aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
                    <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                </div>
                <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
                <div class="modal-footer">
                    <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
                    <a class="btn btn-primary" href="<?php echo e(url('logout')); ?>">Logout</a>
                </div>
            </div>
        </div>
    </div>
    </div>

    <!-- Bootstrap core JavaScript-->
    <script src="vendor/jquery/jquery.min.js"></script>
    <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

    <!-- Core plugin JavaScript-->
    <script src="vendor/jquery-easing/jquery.easing.min.js"></script>

    <!-- Custom scripts for all pages-->
    <script src="js/sb-admin-2.min.js"></script>

    <!-- Page level plugins -->
    <script src="vendor/datatables/jquery.dataTables.min.js"></script>
    <script src="vendor/datatables/dataTables.bootstrap4.min.js"></script>

    <!-- Page level custom scripts -->
    <script src="js/demo/datatables-demo.js">
        
    </script>

    <script>
                             function editAccountType(event,id,pcode,name,address,type,floors,area,group,rooms,space) 
                             {
                                event.preventDefault();
                                
                                document.getElementById('accountId').value = id;
                                document.getElementById('pcode').value = pcode;
                                document.getElementById('name').value = name;
                                document.getElementById('address').value = address;
                                document.getElementById('type').value = type;
                                document.getElementById('floors').value = floors;
                                document.getElementById('area').value = area;
                                document.getElementById('group').value = group;
                                document.getElementById('rooms').value = rooms;
                                document.getElementById('space').value = space;
                                document.getElementById('formHeader').innerText = 'Edit Property';
                                document.getElementById('submitButton').value = 'Update';
                                document.getElementById('accountTypeForm').action = '<?php echo e(route("editProperty")); ?>';
                            }
                
                            function refreshAccountType(id,pcode,name,address,type,floors,area,group,rooms,space) 
                             {
                                
                                document.getElementById('accountId').value = id;
                                document.getElementById('pcode').value = pcode;
                                document.getElementById('name').value = name;
                                document.getElementById('address').value = address;
                                document.getElementById('type').value = type;
                                document.getElementById('floors').value = floors;
                                document.getElementById('area').value = area;
                                document.getElementById('group').value = group;
                                document.getElementById('rooms').value = rooms;
                                document.getElementById('space').value = space;
                                document.getElementById('formHeader').innerText = 'Create Property';
                                document.getElementById('submitButton').value = 'Create';
                                document.getElementById('accountTypeForm').action = '<?php echo e(route("createProperty")); ?>';
                                hideMessages();
                            
                            }

                            function confirmDelete(propertyName) {
                                return confirm("Are you sure you want to delete the property: " + propertyName + "?");
                            }


                
                </script>

</body>

</html><?php /**PATH /home/pinetopsco/public_html/re.pro/resources/views//Landing.blade.php ENDPATH**/ ?>