 
<?php $__env->startSection('content'); ?>
	<div class="row">
    	<div class="col-lg-12">
    		<h4 class="page-header">Project: <?php echo e($project->company_name); ?></h4>
    		<span class="hidden-xs hidden-sm accordion-ts" ><a href="<?php echo e(url('uadmin/projects/report/'.$project->id)); ?>" target="_blank"><i class="fa fa-file-pdf-o"></i></a>&nbsp;&nbsp; Project completed @ <?php echo e(date('g:i:s A - F j, Y', strtotime($project->done))); ?></span>
    	</div>
    </div>
            <div class="row">
                <div class="col-lg-12">
                	<?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>
</div>     
<div class="row">
	<div class="panel-group col-md-12" id="accordion" role="tablist" aria-multiselectable="true">
	

			
	<div class="panel panel-default">
		Please refer to the report for more infomation on this archived project: <a href="<?php echo e(url('uadmin/projects/report/'.$project->id)); ?>" target="_blank"><i class="fa fa-file-pdf-o"></i></a>
	</div>
		  

		<hr>
		  <div class="panel panel-default">
		    <div class="panel-heading" role="tab" id="heading9" style="">
		      <h4 class="panel-title">
		        <div id="group_section9" class="accordian-item"  style="color: #317aba; "
		        role="button" data-toggle="collapse" data-parent="#accordion" 
		        href="#collapse9" aria-expanded="false" 
		        aria-controls="collapse9" onclick="chevron(9)" ondblclick="chevron(9)">
		          <i id="chevron9" class="fa fa-chevron-circle-right"></i> &nbsp;All Notes & Attachments
		        </div>
		      </h4>
		    </div>
		    <div id="collapse9" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading9">
		      <div class="panel-body">
		      
					<?php foreach($notes as $note): ?>
							
							<?php $note['isNote'] = array_key_exists('note', $note) ? true : false; ?>
							<br>
							<div class="form-group">
								<div class="panel panel-default">
									<div class="panel-heading" style="background-color: <?php echo e($note['isNote'] ? '#d6e7f5' : '#d5ddf6'); ?>;">
										<h4 class="panel-title">
											<?php echo e($note['user']); ?> @ <?php echo e(date('g:i:s A - F j, Y', strtotime($note['created_at']))); ?><i class="hidden-xs hidden-sm" style="float: right;"><?php echo e($team_object->find($note['team'])->name); ?></i>
										</h4>
									</div>
									<div class="panel-body" style="background-color: <?php echo e($note['isNote'] ? '#eaf3fa' : '#eaeefb'); ?>;">
										<div class="xcol-md-12">
											<?php if($note['isNote']): ?>
											<?php echo e($note['note']); ?>

											<?php else: ?>
											<a href="/uadmin/projects/attachment/<?php echo e($note['id']); ?>" target="_blank"><?php echo e($note['file']); ?></a>
											<?php endif; ?>
										</div>
									</div>
								</div>
							</div>
							
							<?php endforeach; ?>
		      </div>
		    </div>
		  </div>
		  <br>
	
</div>
		
<?php $__env->stopSection(); ?>

<?php $__env->startSection('extras'); ?>
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('css/jquery.timepicker.css')); ?>" />
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('css/bootstrap-datepicker3.min.css')); ?>" />
	<style>
			input:focus+.label-text, input:not([value=""])+.label-text, select+.label-text
		    		{
		    font-weight: normal;
		    padding: 0;
		    padding-left: 20px;
		    -webkit-transform: translateY(-2rem) scale(.7);
		    transform: translateY(-2rem) scale(.7);
		}
		input+.label-text, select+.label-text, .hasValue{
		    font-size: 1.5rem;
		    font-weight: 400;
		    position: absolute;
		    top: 0;
		    left: 0;
		    display: block;

		    padding-left: 20px;
		    padding-top: 5px;
		    padding-bottom: 5px;
		    opacity: .8;
		    transition: all .3s ease-out,opacity 150ms ease .3s;
		    -webkit-transform: translateY(0) scale(1);
		    transform: translateY(0) scale(1);
		    -webkit-transform-origin: left top;
		    transform-origin: left top;
		}
		span {
		    font-size: 1rem;
		    font-weight: 600;
		    display: block;
		    padding-top: .25rem;
		    padding-bottom: .25rem;
		    margin-left: 1rem;
		    color: #317aba;
		}
		.hasValue
		{
		    font-weight: normal;
		    padding: 0;
		    padding-left: 20px;
		    -webkit-transform: translateY(-2rem) scale(.7);
		    transform: translateY(-2rem) scale(.7);    
		}
		
		.moveOver
		{
			padding-left: 9px;
			padding-bottom: 5px;
			padding-top: 5px;
			margin-bottom: 15px;
			font-weight: normal;
			border: none;
			border-radius: 10px;
			background-color: #eee;
			width: 100%;
		}
		

		@media (max-width: 959px)
		{
			.morePadding {
			    margin-top: 1.5em;
			}
		}

		@media (min-width: 960px)
		{
			.morePadding {
			    margin-top: 1em;
			}
		}
		
		.accordion-ts {float: right; color: #888; margin-top: -20px; font-weight: normal; font-size: 14px;}
		
	</style>

<?php $__env->stopSection(); ?>

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

	<script src="<?php echo e(asset('js/jquery.datepair.min.js')); ?>"></script>
	<script src="<?php echo e(asset('js/bootstrap-datepicker.min.js')); ?>"></script>
	<script src="<?php echo e(asset('js/jquery.timepicker.min.js')); ?>"></script>
	
	<script>
    $('#date_sold_container .date').datepicker({
        'format': 'yyyy-m-d',
        'autoclose': true
    });
    $('#desired_due_date_container .date').datepicker({
        'format': 'yyyy-m-d',
        'autoclose': true
    });
    $('#ready_to_bill_container .date').datepicker({
        'format': 'yyyy-m-d',
        'autoclose': true
    });
	</script>

<script>

	$('.form-control').each(function() {
	   var elem = $(this);

	   // Save current value of element
	   elem.data('oldVal', elem.val());

	   // Look for changes in the value
	   elem.bind("propertychange change click keyup input paste", function(event){
	      // If value has changed...
	      if (elem.data('oldVal') != elem.val()) {
	       // Updated stored value
	       elem.data('oldVal', elem.val());
	       var elem2 = $('#'+elem.attr('id')+"-label");
	       elem2.addClass('hasValue');
	       elem2.removeClass('label-text');
	       if(elem.val() == "")
	       {
		       
	    	   elem2.addClass('label-text');
		       elem2.removeClass('hasValue');
	       }
	     }
	   });
	 });

	function inputFocus(id)
	{
		document.getElementById(id).focus();
	}

	function enter911()
	{
		var checkbox = document.getElementById('checkbox_911_container');
		var address = document.getElementById('address_911_container');

		if(address.style.display == 'none')
		{
			address.style.display = '';
		}
		else
		{
			address.style.display = 'none';
			document.getElementById('address_911').value = '';
			document.getElementById('city_911').value = '';
			document.getElementById('state_911').value = '';
			document.getElementById('zip_911').value = '';
		}
	}
	function showConstruction()
	{
		var checkbox = document.getElementById('checkbox_construction_container');
		var address = document.getElementById('construction_container');

		if(address.style.display == 'none')
		{
			address.style.display = '';
		}
		else
		{
			address.style.display = 'none';
			document.getElementById('construction_location').value = '';
			document.getElementById('construction_build_estimate').value = '';
		}
	}
	function showNNI()
	{
		var checkbox = document.getElementById('checkbox_nni_container');
		var address = document.getElementById('nni_container');

		if(address.style.display == 'none')
		{
			address.style.display = '';
		}
		else
		{
			address.style.display = 'none';
			document.getElementById('a_loc_address').value = '';
			document.getElementById('a_loc_carrier').value = '';
			document.getElementById('z_loc_address').value = '';
			document.getElementById('z_loc_carrier').value = '';
		}
	}
	function addProduct2()
	{
		var next = 31;
		for(i = 30; i>=1; i--)
		{
			if(document.getElementById('product_group'+i).style.display != "none")
			{
				if(i != 30)
				{
					next = i + 1;
					document.getElementById('product_group'+next).style.display = '';
					return;
				}
				else
				{
					alert('Error: 2750724');
					return;
				}
				
			}
			
		}

		
	}
	function addProduct()
	{
		var product_group = document.getElementById('product_group');
		var plus_container = document.getElementById('plus_container');
		var theForm = document.getElementById('theForm');

		var string = 
			'<div class="form-group" id="product_group2">'+
				'<div class="col-sm-2 col-md-1 morePadding morePadding2" >'+
					'<div class="btn btn-primary" onclick="removeProduct(\'product_group2\')"><i class="fa fa-minus"></i></div>'+
				'</div>'+
				'<div class="col-sm-10 col-md-3 morePadding morePadding2" onclick="inputFocus(\'product2\')">'+
					'<input type="text" class="form-control" id="product2" name="product[2]" value="" title="Product 2">'+
					'<span id="product2-label" class="label-text">Product</span>'+
				'</div>'+
				'<div class="col-sm-12 col-md-2 morePadding morePadding2" onclick="inputFocus(\'quantity2\')">'+
					'<input type="text" class="form-control" id="quantity2" name="quantity[2]" value="" title="Quantity 2">'+
					'<span id="quantity2-label" class="label-text">Quantity</span>'+
				'</div>'+
				'<div class="col-sm-12 col-md-2 morePadding morePadding2" onclick="inputFocus(\'unit_price2\')">'+
					'<input type="text" class="form-control" id="unit_price2" name="unit_price[2]" value="" title="Unit Price 2">'+
					'<span id="unit_price2-label" class="label-text">Unit Price</span>'+
				'</div>'+
				'<div class="col-sm-12 col-md-2 morePadding morePadding2" onclick="inputFocus(\'product_mrc2\')">'+
					'<input type="text" class="form-control" id="product_mrc2" name="product_mrc[2]" value="" title="MRC 2">'+
					'<span id="product_mrc2-label" class="label-text">MRC</span>'+
				'</div>'+
				'<div class="col-sm-12 col-md-2 morePadding morePadding2" onclick="inputFocus(\'product_nrc2\')">'+
					'<input type="text" class="form-control" id="product_nrc2" name="product_nrc[2]" value="" title="NRC 2">'+
					'<span id="product_nrc2-label" class="label-text">NRC</span>'+
				'</div>'+
			'</div>';

		//alert(string);

		var div = document.createElement('div');
		div.innerHTML = string;
		
		

		
		theForm.insertBefore(div.firstChild, plus_container);
		
	}

	function removeProduct2(num)
	{
		document.getElementById('product_group'+num).style.display = 'none';
		document.getElementById('product'+num).value = '';
		document.getElementById('quantity'+num).value = '';
		document.getElementById('unit_price'+num).value = '';
		document.getElementById('product_mrc'+num).value = '';
		document.getElementById('product_nrc'+num).value = '';

		document.getElementById('product'+num+'-label').className = 'label-text';
		document.getElementById('quantity'+num+'-label').className = 'label-text';
		document.getElementById('unit_price'+num+'-label').className = 'label-text';
		document.getElementById('product_mrc'+num+'-label').className = 'label-text';
		document.getElementById('product_nrc'+num+'-label').className = 'label-text';

		calcMRC();
		calcNRC();
	}
	
	function removeProduct(id)
	{
		document.getElementById(id).remove();
	}

	function calcMRC()
	{
		var total = 0;
		for(i = 1; i<=30; i++)
		{
			if(document.getElementById('product_mrc'+i).value != "")
			{
				total += parseFloat(document.getElementById('product_mrc'+i).value);
			}
		}
		document.getElementById('mrc_total').innerHTML = '$' + total.toFixed(2);
	}
	
	function calcNRC()
	{
		var total = 0;
		for(i = 1; i<=30; i++)
		{
			if(document.getElementById('product_nrc'+i).value != "")
			{
				total += parseFloat(document.getElementById('product_nrc'+i).value);
			}
		}
		document.getElementById('nrc_total').innerHTML = '$' + total.toFixed(2);
	}

	calcMRC();
	calcNRC();

</script>

<script>	
	function chevron(group_id)
	{
		var chev = document.getElementById('chevron'+group_id);
		var state = chev.className.indexOf('right');
		
		
		for(i = 1; i <= 9; i++)
		{
			document.getElementById('chevron'+i).className = 'fa '+'fa-chevron-circle-right';
		}
			
		if(state > -1)
		{
			chev.className = '';
			chev.className = 'fa '+'fa-chevron-circle-down';
		}
		else
		{
			chev.className = '';
			chev.className = 'fa '+'fa-chevron-circle-right';
		}

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

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