KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.41 (Ubuntu)
System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64
User : www-data ( 33)
PHP Version : 8.2.12
Disable Function : NONE
Directory :  /var/www/leadai/leadai.co.in/storage/framework/views/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/leadai/leadai.co.in/storage/framework/views/b5239f8c113d2ddcf0b75311d9f0ca10e5a015c4.php
<?php $__env->startSection('content'); ?>
    <!-- begin::main content -->
    <style>
  /* Styles for tabs */
  .tab {
    display: inline-block;
    padding: 12px 26px;
    cursor: pointer;

    background-color: #E6EAED;
    margin-right: -4px; /* Remove spacing between tabs */
  }

  /* Style for highlighted tab */
  .tab.active {
    background-color: white;
  }

  /* Content area style */
  .tab-content {

    padding: 20px;
    border-radius: 0 0 5px 5px;
    display: none; /* Hide all content areas by default */
  }

  /* Show active content area */
  .tab-content.active {
    display: block;
  }
  .form-group {
    margin-bottom: 1rem;
    margin-bottom: 30px !important;
}
.form-group input, .form-group select{
    height:42px;
    padding-top:10px 25px !important;
}
.form-group label, .tab{
    font-size:13px !important;
}
.company-save-btn{
    position:fixed;
    bottom:0;left:250px;
    background-color:white;
    border-top:1px solid #ccc;
}
.inner-border{
    border:-2px solid #ddd !important;
}
@media  only screen and (max-width: 768px) {
    .company-save-btn{
    position:fixed;
    bottom:0;left:0px;
    background-color:white;
    border-top:1px solid #ccc;
}
}
</style>

    <main class="main-content px-0">

        <div class="container">

            <!-- begin::page header -->
            <div class="page-header m-0 border-0">
                <h3> <?php echo e(__('message.create')); ?> Link </h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="<?php echo e(asset('dashboard')); ?>"><?php echo e(__('message.dashboard')); ?></a></li>
                        <li class="breadcrumb-item" aria-current="page"><a href="<?php echo e(asset('share-links')); ?>">Links</a></li>
                        <li class="breadcrumb-item active" aria-current="page"><?php echo e(__('message.add')); ?></li>
                    </ol>
                </nav>
            </div>
            <!-- end::page header -->

            <div class="row pb-5">
                <div class="col-md-12 py-5">

                    <?php if (isset($component)) { $__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\FlashMessage::class, []); ?>
<?php $component->withName('flashMessage'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74)): ?>
<?php $component = $__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74; ?>
<?php unset($__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74); ?>
<?php endif; ?>
                    <div class="card border-0 py-5">

                        <div class="card-body py-0">
                        <?php

                            $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";


                            $host = $_SERVER['HTTP_HOST'];


                            $uri = $_SERVER['REQUEST_URI'];

                            $name = $users->name;
                            $modified_name = "";
                            if (strpos($name, ' ') !== false)
                            {
                                $modified_name = str_replace(' ', '_', $name);
                            }
                            else
                            {

                                $modified_name = $name;
                            }


                        ?>
                                <span id="show_message"></span>
                            <form action="#" id="test_form" method="post">
                                <div class="row">
                                    <div class="col-md-6 py-3 pt-5">
                                        <?php echo csrf_field(); ?>
                                        <div class="form-group d-flex justify-content-between align-items-center ">
                                            <label for="name" class="col-md-4"> Link For</label>
                                            <div class="col-md-8 px-0">
                                                <input type="text" required class="form-control end_point" name="slug" id="slug" >
                                                <?php if($errors->has('slug')): ?>
                                                    <div class="error">
                                                        <?php echo e($errors->first('slug')); ?>

                                                    </div>
                                                <?php endif; ?>
                                            </div>


                                        </div>
                                        <div class="form-group d-flex justify-content-between align-items-center ">
                                            <label for="name" class="col-md-8">Link : <?php echo e("https://leadai.co.in/".$modified_name); ?></label>
                                            <div class="col-md-4 px-0">
                                                <input type="text" class="form-control url-input" name="url" id="url" >
                                                <?php if($errors->has('url')): ?>
                                                    <div class="error">
                                                        <?php echo e($errors->first('url')); ?>

                                                    </div>
                                                <?php endif; ?>
                                            </div>


                                        </div>
                                        <div class="form-group d-flex justify-content-between align-items-center ">
                                            <label for="name" class="col-md-4"> Select Branch</label>
                                            <div class="col-md-8 px-0">
                                                <select required class="form-control " name="branch_id" id="branch_id" >
                                                    <option selected disabled>--SELECT--</option>
                                                    <?php $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $branch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($branch->id); ?>"><?php echo e($branch->name); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                                <?php if($errors->has('branch_id')): ?>
                                                    <div class="error">
                                                        <?php echo e($errors->first('branch_id')); ?>

                                                    </div>
                                                <?php endif; ?>
                                            </div>


                                        </div>
                                        <input type="hidden" class="form-control" name="full_url" id="full_url" >

                                    </div>


                                </div>
                                <input class="mb-3"  type="checkbox"  id="products" value="1"> Products
                                <input  class="mb-3" type="checkbox" id="sources"  value="1"> Sources
                                <div class="col-md-6" id="input_wrapper"></div>
                                <button id="save_btn" class="btn btn-success">Save</button>
                                <button id="add_btn" class="btn btn-primary">Add Row</button>


                                    


                            </form>
                        </div>
                    </div>


                    



                </div>

            </div>

        </div>

    </main>
    <!-- end::main content -->
<?php $__env->stopSection(); ?>
<?php $__env->startPush('footer-script'); ?>
    <!-- begin::select2 -->
    <link rel="stylesheet" href="<?php echo e(asset('public/admin/vendors/select2/css/select2.min.css')); ?>" type="text/css">
    <script src="<?php echo e(asset('public/admin/vendors/select2/js/select2.min.js')); ?>"></script>
    <!-- end::select2 -->
    <script>

        $(document).ready(function() {
            $('#js-example-basic-roles').select2({});
            $('select').select2({});

            $(".end_point").on("input",function(){
                var end_point = $(this).val();
                $(".url-input").val("/"+end_point);

                var full_url = "<?php echo e(asset('/').$modified_name); ?>";
                var full_url = full_url+"/"+end_point;
                $("#full_url").val(full_url);
            });

        });



        // add form


        $(document).ready(function() {
	var x = 0;
	$('#save_btn').show();

	$('#add_btn').click(function(e) {
  	e.preventDefault();
    appendRow(); // appen dnew element to form
    x++; // increment counter for form
    $('#save_btn').show(); // show save button for form
  });

	$('#input_wrapper').on('click', '.deleteBtn', function(e) {
  	e.preventDefault();
    var id = e.currentTarget.id; // set the id based on the event 'e'
    $('div[id='+id+']').remove(); //find div based on id and remove
    x--; // decrement the counter for form.

    if (x === 0) {
    	$('#save_btn').hide(); // hides the save button if counter is equal to zero
    }
  });

  $('#save_btn').click(function(e) {
  	e.preventDefault();

    var full_url = $('#full_url').val();
    var slug = $('#slug').val();
    var branch_id = $('#branch_id').val();

    const isCheckedProducts = $("#products").is(":checked");
    const isCheckedSources = $("#sources").is(":checked");


    var formData = $('#test_form').serializeObject(); // serialize the form
    var obj; //obj can be use to send to ajax call
    if(Array.isArray(formData.fn)) {
    	for(var i = 0; i < formData.fn.length; i++) {
      	obj = {};
        // set the obj for submittion
        obj.firstName = formData.fn[i];
        obj.lastName = formData.ln[i];
        // This object could be push into an array
        // console.log('object from form array ', obj);
      };
    } else {
    	obj = {};
      obj.firstName = formData.fn;
      obj.lastName = formData.ln;
    //   console.log('single obj from form ', obj);
    }


    $.ajax({

        type: "post",
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        },
        data: {
            "formData": formData,
            "full_url":full_url,
            "isCheckedProducts":isCheckedProducts,
            "isCheckedSources":isCheckedSources,
            "slug":slug,
            "branch_id":branch_id
        },
        url: "<?php echo e(asset('add-share-links')); ?>",
        dataType: "html",
        success: function(result)
        {
            console.log(result);

            var allData = JSON.parse(result);
            if(allData.message=="success")
            {
                $('#show_message').html(allData.data)
                setTimeout(function () {

                    location.reload();
                 }, 2500);


            }
            else
            {
                console.log("failed");
            }
        },
        error:function(xhr,error,status)
        {
            console.log(xhr);
        }

    });

    // console.log('object from form formData ', formData);
  });

  function appendRow() {
    $('#input_wrapper').append(
        '<div id="'+x+'" class="form-group" style="display:flex;">' +
          '<div>' +
            '<input type="text" id="'+x+'" class="form-control" name="fn" placeholder="Label"/>' +
          '</div>' +
          '<div>'+
          '<select class="form-control" id="'+x+'" name="ln"><option value="text">Textbox</option><option value="textarea">Textarea</option></select> &nbsp;&nbsp;'+
          '</div>' +
          '<div>'+
            '<button id="'+x+'" class="btn btn-danger pt-3  pb-2 deleteBtn"><i class="fa fa-trash fa-lg pb-1"></i></button>' +
          '</div>' +
      	'</div>');
  }

});

$.fn.serializeObject = function(asString) {
   var o = {};
   var a = this.serializeArray();
   $.each(a, function() {

       if($('#' + this.name).hasClass('date')) {
           this.value = new Date(this.value).setHours(12);
       }

       if (o[this.name] !== undefined) {
           if (!o[this.name].push) {
               o[this.name] = [o[this.name]];
           }
           o[this.name].push(this.value || '');
       } else {
           o[this.name] = this.value || '';
       }
   });
   if (asString) {
       return JSON.stringify(o);
   }
   return o;
};




    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/leadai/admin.leadai.co.in/resources/views/links/add.blade.php ENDPATH**/ ?>

Anon7 - 2021