<?php $__env->startSection('content'); ?>
<div class="container-fluid parallax-six modul-bt-one" data-speed="5" data-type="background">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="big-title">
                    <h1>View Variables</h1>
                    <div class="category_menu">
	                    <a href="<?php echo e(url('admin/variables')); ?>">All</a> | 
	                    <a href="<?php echo e(url('admin/variables/general')); ?>">General</a> | 
	                    <a href="<?php echo e(url('admin/variables/price')); ?>">Price</a> | 
	                    <a href="<?php echo e(url('admin/variables/company')); ?>">Company</a> | 
	                    <a href="<?php echo e(url('admin/variables/media')); ?>">Media</a> | 
	                    <a href="<?php echo e(url('admin/variables/add')); ?>">Add Variable</a> | 
	                    <a href="<?php echo e(url('admin/variables/media/add')); ?>">Add Media Variable</a>
	                </div>
                </div>
            </div>
        </div>
	</div>
</div>


<div class="container-fluid">
<div class="container modul-space-twoX">
	<div class="row">
		<div class="col-md-10 col-md-offset-1">
					<?php if(session('status')): ?>
						<div class="alert alert-success">
							<?php echo e(session('status')); ?>

						</div>
					<?php endif; ?>
		
					<?php if(count($errors) > 0): ?>
						<div class="alert alert-danger">
							<strong>Whoops!</strong> There were some problems with your input.<br><br>
							<ul>
								<?php foreach($errors->all() as $error): ?>
									<li><?php echo e($error); ?></li>
								<?php endforeach; ?>
							</ul>
						</div>
					<?php endif; ?>
			<div class="shop-checkout">
				<div class="row checkout-table hidden-xs hidden-sm">
					<div class="col-md-2">
						<div class="checkout-product">
							<h6><a style="color: black;" href='<?php echo e(url("admin/variables/{$self}/id")); ?>'>ID:</a></h6>
						</div>
					</div>
					<div class="col-md-4">
						<div class="checkout-product">
							<h6><a style="color: black;" href='<?php echo e(url("admin/variables/{$self}/name")); ?>'>Name:</a></h6>
						</div>
					</div>
					<div class="col-md-4">
						<div class="checkout-product">
							<h6><a style="color: black;" href='<?php echo e(url("admin/variables/{$self}/updated_at")); ?>'>Timestamp:</a></h6>
						</div>
					</div>
					<div class="col-md-2">
						<div class="checkout-product">
							<h6>Action:</h6>
						</div>
					</div>
				</div>
				<?php $countV = 0; ?>
				<?php foreach($variables as $variable): ?>
				<?php $countV++; ?>
				<div class="row checkout-product">
					<div class="col-md-2">
						<div class="checkout-product">
							<h6><?php echo e($variable->id); ?></h6>
						</div>
					</div>
					<div class="col-md-4">
						<div class="checkout-product">
							<h6><?php echo e($variable->name); ?></h6>
							<small>
							<div id="selectable<?php echo e($countV); ?>" onclick="selectText('selectable<?php echo e($countV); ?>')">
							<p style="font-size: 10px;">
								<?php 
								if($variable->type == 'media')
								{
									echo '&lt?php echo'.' $variable->getMedia('."'".$variable->name."'".'); ?>';
								}
								else 
								{
									echo '&lt?php echo'.' $variable->get('."'".$variable->name."'".'); ?>';
								}
								?>
							</p>
							</div>
							</small>
						</div>
					</div>
					<div class="col-md-4">
						<div class="checkout-product">
							<h6> </h6>
							<p>
								Created: <?php echo e($variable->created_at); ?><br>
								Last Edit: <?php echo e($variable->updated_at); ?>

							</p>
						</div>
					</div>
					<div class="col-md-2">
						<div class="checkout-product">
							<h6> </h6>
							<?php if($variable->type != 'media'): ?>
							<button type="button" style="border: none; background-color: lightgray;">
									<p>
									<a href='<?php echo e(url("admin/variables/edit/{$variable->id}")); ?>'>EDIT</a>
									</p>
							</button>
							<?php else: ?>
							<button type="button" style="border: none; background-color: lightgray;">
								<p class="text-warning">								
									<a target="blank" href="<?php echo e($variable_object->getMedia($variable->name)); ?>">VIEW</a>
								</p>
							</button>
							<?php endif; ?>
							<form class="form-horizontal" role="form" method="POST" action="<?php echo e(url('admin/variables/delete')); ?>" 
									onsubmit="return confirm('Are you sure you want to delete variable (<?php echo e($variable->name); ?>)?')">
								<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
								<input type="hidden" name="variableID" value="<?php echo e($variable->id); ?>">
								<button type="submit" style="border: none; background-color: white; padding: 0;">
									<p class="text-warning">DELETE</p>
								</button>
							</form>

						</div>
					</div>
				</div>
				<?php endforeach; ?>
				
			</div>
		</div>
	</div>
</div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('extras'); ?>

	<style>
		a {
			color: white;
		}
		a:hover {
			color: darkgray;
			text-decoration: none;
		}
		a:visted {
			color: white;
		}
		.category_menu {
			color: darkgray;
		}
	</style>
	<script type="text/javascript">
    function selectText(containerid) {
        if (document.selection) 
        {
            var range = document.body.createTextRange();
            range.moveToElementText(document.getElementById(containerid));
            range.select();
        } 
        else if (window.getSelection) 
            {
            var range = document.createRange();
            range.selectNode(document.getElementById(containerid));
            window.getSelection().addRange(range);
        }
    }
</script>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('residential.templates.adminT', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>