<?php $__env->startSection('morecss'); ?>
<style>
.form-control-file{border-bottom:1px solid #ddd;padding-bottom:0.5em;margin-bottom:0.5em}
</style>
<?php $__env->stopSection(); ?>
<?php if(config('app.debug')): ?>
    <?php $__env->startSection('morejs'); ?>
    <script>
    var tab=["Nulla a ante cursus, pellentesque ex quis, congue nisl. Aenean non nulla efficitur, lacinia tortor sit amet, fringilla odio. Pellentesque et lorem et magna ullamcorper condimentum.\nOrci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris id gravida leo. Phasellus suscipit facilisis mi ut consequat.",
    "Donec venenatis elit ipsum, quis dignissim ipsum blandit vitae. Curabitur quam odio, egestas quis semper nec, scelerisque id nisl. Fusce non condimentum urna. Mauris eget elit pellentesque, consequat diam in, fermentum purus. Phasellus eget mi pretium, porta lacus at, varius libero. Nulla a ante cursus, pellentesque ex quis, congue nisl. Aenean non nulla efficitur, lacinia tortor sit amet, fringilla odio. Pellentesque et lorem et magna ullamcorper condimentum.",
    "Pellentesque et lorem et magna ullamcorper condimentum.\nOrci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris id gravida leo. Phasellus suscipit facilisis mi ut consequat. In ullamcorper eros ut tristique vehicula. In diam erat, condimentum a fringilla eget, tristique et mi. In et diam id diam mollis bibendum non blandit diam.\n\n Aliquam volutpat felis eu risus porttitor, vel bibendum orci feugiat. In id enim vitae erat hendrerit euismod. Aenean feugiat, nunc quis lobortis tincidunt, nisi libero ultricies magna, eu efficitur tellus tortor quis massa. Vivamus sagittis eleifend interdum.",
    "Aliquam ultricies dui leo, sit amet blandit nisi cursus a. Phasellus imperdiet id nulla nec egestas. Vestibulum rutrum efficitur velit. Pellentesque tristique condimentum vulputate. Suspendisse ac lectus fringilla, tempus tellus sit amet, commodo turpis. Nam porttitor odio neque, eget tempor metus viverra at. Quisque vel dolor at augue finibus pharetra sit amet sit amet purus. Fusce et luctus nulla.",
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget eros in ex lobortis dictum ut vel nisl. Nullam lobortis lorem at leo maximus rhoncus. Aliquam vestibulum auctor tellus non tristique. Integer varius ac velit tempus lacinia. Sed luctus iaculis massa, id accumsan ante venenatis at. ",
    "Donec elit justo, gravida vitae sagittis ut, dignissim id lacus. Curabitur cursus pharetra nulla quis pellentesque. In arcu lorem, tincidunt eu ante nec, accumsan tincidunt elit.\n\nVivamus erat sapien, pellentesque in nisi non, fermentum ullamcorper est. Pellentesque ornare dui sed consequat vestibulum. Pellentesque in odio ante."];
    function getRandomInt(max) {
    	  return Math.floor(Math.random() * Math.floor(max));
    	}
    
    i = getRandomInt(6);
    // 
    tx = tab[i];
    document.getElementById("message").innerHTML = tx;
    l =getRandomInt(6);
    tx= tab[l];
    document.getElementById("libelle").value=tx.substring(0,20 + getRandomInt(40));
    </script>
    <?php $__env->stopSection(); ?>
<?php endif; ?>
<?php $__env->startSection('content'); ?>
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header"><h1>Ma demande</h1></div>
 				<?php if(session('status')): ?>
                        <div class="alert alert-success" role="alert">
                            <?php echo e(session('status')); ?>

                        </div>
                    <?php endif; ?>
                    <?php if($errors->any()): ?>
        				<ul class="alert alert-warning">
        					<?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        					<li><?php echo e($error); ?></li> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        				</ul>
        				<?php endif; ?> 
        				<?php if(session()->has('message')): ?>
        				<div class="alert alertToolsBar alert-info alert-dismissible fade show }}"> 
                        <?php echo session('message'); ?>

                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                          </button>
                        </div>
    			<?php endif; ?>
					
                <div class="card-body">
                   	<form method="POST" class="" enctype="multipart/form-data"
						action="<?php echo e(route('demandes.store')); ?>">
						<?php echo csrf_field(); ?>
						<!-- <div class="col-12">
							<div class="input-group input-group-lg mb-3">
								<div class="input-group-prepend">
									<label for="date_depart" class="input-group-text"><i
										class="fas fa-arrow-right"></i></label>
								</div>
								<input type="date" min="2019-08-28"
									value="2019-08-28" id="date_test" name="date_test"
									placeholder="Date de départ*" class="form-control"/>
								<input type="time" class="form-control"/>
							</div>
						</div> -->
						
						<fieldset>
							<legend><i class="fas fa-home"></i> <?php if(!$adresses): ?>
						&Eacute;tape 1 :
						<?php endif; ?> Adresse intervention</legend>
							<div class="form-group">
								<?php if(count($adresses) > 0): ?>
								<label class="col-form-label col-form-label-lg"
									for="adresse_id">Adresse</label>
								<select id="adresse_id" name="adresse_id"
									class="form-control"> <?php $__currentLoopData = $adresses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $adresse): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
									<option value="<?php echo e($adresse->id); ?>"
										<?php if($adresse->id==old('adresse_id') || $adresse->id==session('new_adresse_id')): ?> selected
										<?php endif; ?>><?php echo e($adresse->libelle); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
								</select>
								<?php endif; ?>
								<a href="<?php echo e(route('adresses.create','from=demande')); ?>">Créer une nouvelle adresse</a>
							</div>
							
						</fieldset>
						<?php if($adresses): ?>
						<fieldset>
							<legend>
								<i class="fas fa-tag"></i> Libellé demande
							</legend>
							<div class="form-group">
								<label class="" for="libelle">Libellé</label> <input id="libelle" name="libelle"
									class="form-control form-control-lg" type="text"
									placeholder="ex: réparation porte couloir" value="<?php if($errors->any()): ?><?php echo e(old('libelle')); ?> <?php endif; ?>" />
							</div>
						</fieldset>
						<fieldset>
							<legend>
								<i class="fas fa-tag"></i> Description
							</legend>
							<div class="form-group">
								<label class="" for="message">Indiquer en détail votre demande</label> 
								<textarea id="message" rows="10" style="width:100%" name="message"><?php echo e(old('message')); ?></textarea>
							</div>
							<div class="form-group">
                            <label for="document">Ajouter des fichiers (photo, document PDF...)</label>
                                <input type="file" class="form-control-file" name="documents[]">
                                <input type="file" class="form-control-file" name="documents[]">
                                <input type="file" class="form-control-file" name="documents[]">
                            </div>
							
						</fieldset>
						<div class="col-12">
							<div class="form-group row">
								<div class="col">
									<a data-toggle="confirmation" data-title="Confirmer?"
										href="<?php echo e(route('demandes.index')); ?>"
										class="btn btn-info pull-right form-group"><?php echo e(__('Cancel')); ?></a>
								</div>
								<div class="col">
									<button type="submit" class="btn btn-primary"><?php echo e(__('Create')); ?></button>
								</div>
							</div>
						</div>
						<?php endif; ?>
					</form>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/hellodjo/resources/views/demandes/create.blade.php ENDPATH**/ ?>