<?php $__env->startSection('content'); ?>
<style type="text/css">
.preview-canvas {    
    padding-bottom: 60%;
    padding-top: 30px; height: 0; overflow: hidden;
}
 
.preview-canvas iframe,
.preview-canvas object,
.preview-canvas embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
</style>

<section class="dispute_1_section">

    <div class="container ">

		<div id="divLayoutAlert" class="alert alert-success" role="alert" style="z-index: 5555;margin-top: 10px; display:none;">
	        
	        <span id="alertmessage"></span>
	        
	    </div>

        <div class="col-lg-12 col-md-12 col-sm-12 col-12 text-right">

			<a href="#" class="create_btn" data-toggle="modal" data-target="#myModal">Create New Dispute</a>

		</div>

    </div>

</section>

<section class="dispute_2section">

    <div class="container">

		<div id="accordion">

			<div class="accordion__item">

		        <header class="accordion__header collapsed" id="heading-Pending" data-toggle="collapse" href="#collapse-Pending" aria-controls="collapse-Pending" aria-expanded="false">

		            <span class="accordion__title" id="dispute-Pending-title">Pending</span>

		            <span class="accordion__badge"><?php echo e(count($pending)); ?></span>

		        </header>

    			<div class="accordion__body collapse show" id="collapse-Pending" data-parent="#accordion" aria-labelledby="dispute-Pending-title" style="">

        			<table class="table table-accordion table-status dispute-highlight" cellspacing="0">

            			<tbody>
            				<?php if(count($pending)>0): ?>
            				<?php $__currentLoopData = $pending; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            				<tr class="table-accordion__header active collapsed tr--Generated" id="card_<?php echo e($key); ?>">
            					<?php if($value->bureau==1){$label='Transunion';}else if($value->bureau==2){$label='Experian';}else{$label='Equifax';}?>
							    <th data-label="<?php echo e($label); ?>">
							        <span id="lblLetterLabel_<?php echo e($value->id); ?>">Round <?php echo e($value->round); ?></span>
							    </th>
							    <td data-label="Date" class="create_date<?php echo e($value->id); ?>"><?php echo e(date('m/d/Y',strtotime($value->created))); ?></td>
							    <td data-label="Status">
							    	<div class="text-danger">
					                    <span>Action Needed</span>
					                    <a class="btn-border btn btn-icon btn-xs ml-2" data-class="dynamic-class" data-content="Once you’ve mailed your dispute letter, make sure to mark your letter as SENT. " data-placement="top" data-toggle="popover" data-trigger="hover" href="javascript:;" title="" rel="popover" data-original-title="Action Needed"><i class="fa fa-info"></i></a>
					                </div>
							    </td>
							    <td>
							        <div class="table-accordion__icon collapsed" data-toggle="collapse" href="#collapse-Completed-<?php echo e($value->id); ?>" aria-controls="collapse-Completed-<?php echo e($value->id); ?>">
							            <i class="fa fa-plus"></i>
							            <i class="fa fa-minus"></i>
							        </div>
							    </td>
							</tr>
							<tr class="table-accordion__content" id="card-content_<?php echo e($value->id); ?>">
							    <td colspan="7">
							        <div class="collapse table-accordion__card" id="collapse-Completed-<?php echo e($value->id); ?>">
							            <div class="dispute-card__actions py-2">
							                <input id="CurrentDisputeEvent" name="CurrentDisputeEvent" type="hidden" value="Completed">
							                <button onclick="DownloadDispute('<?php echo e($value->id); ?>'); return false;" class="btn btn-outline-primary">Download/Print</button>
							                <button onclick="emailDispute('<?php echo e($value->id); ?>'); return false;" class="btn btn-outline-primary">Send To My Email</button>
							                <button onclick="openSentMail('<?php echo e($value->id); ?>'); return false;" class="btn btn-primary">Mark As Sent</button>
							                <button onclick="openPreview('<?php echo e($value->id); ?>','Round <?php echo e($value->round); ?>'); return false;" class="btn btn-outline-primary">Preview</button>
							                <button onclick="editTrans('<?php echo e($value->transaction_id); ?>')" class="btn btn-link ml-auto">Edit</button>
							                <a href="" onclick="deleteDisputeLatter('<?php echo e($value->id); ?>'); return false;" class=" btn btn-link" target="">Delete</a>
							            </div>
        							</div>
    							</td>
							</tr>
							<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
							<?php endif; ?>
            			</tbody>
        			</table>
    			</div>
			</div>

			<div class="accordion__item">
		        <header class="accordion__header collapsed" id="heading-Sent" data-toggle="collapse" href="#collapse-Sent" aria-controls="collapse-Sent" aria-expanded="false">
		            <span class="accordion__title" id="dispute-Sent-title">Sent</span>
		            <span class="accordion__badge"><?php echo e(count($send)); ?></span>
		        </header>
    			<div class="accordion__body collapse" id="collapse-Sent" data-parent="#accordion" aria-labelledby="dispute-Sent-title" style="">
					<table class="table table-accordion table-status dispute-highlight" cellspacing="0">
			            <tbody>
			            	<?php if(count($send)>0): ?>
			            	<?php $__currentLoopData = $send; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
			            		<tr class="table-accordion__header active collapsed tr--Generated" id="card_<?php echo e($value->id); ?>">
								    <th data-label="Equifax">
								        <span id="lblLetterLabel_<?php echo e($value->id); ?>">Round <?php echo e($value->round); ?></span>
								    </th>
							        <td data-label="Date"><?php echo e(date('m/d/Y',strtotime($value->sent_date))); ?></td>
							        <td data-label="Status">Sent</td>
							        <td>
							            <div class="table-accordion__icon collapsed" data-toggle="collapse" href="#collapse-Completed-<?php echo e($value->id); ?>" aria-controls="collapse-Completed-<?php echo e($value->id); ?>">
							                <i class="fa fa-plus"></i>
							                <i class="fa fa-minus"></i>
							            </div>
							        </td>
								</tr>
								<tr class="table-accordion__content" id="card-content_<?php echo e($value->id); ?>">
								    <td colspan="7">
								        <div class="collapse table-accordion__card" id="collapse-Completed-<?php echo e($value->id); ?>">
								            <div class="dispute-card__actions py-2">
								                <input id="CurrentDisputeEvent" name="CurrentDisputeEvent" type="hidden" value="Sent">
								                <button onclick="UndoEvent('<?php echo e($value->id); ?>'); return false;" class="btn btn-primary">Not sent Yet</button>
								                <button onclick="openPreview('<?php echo e($value->id); ?>','Round <?php echo e($value->round); ?>'); return false;" class="btn btn-outline-primary">Preview</button>
								            </div>
								        </div>
								    </td>
								</tr>
			            	<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
			            	<?php endif; ?>
			            </tbody>
			        </table>
    			</div>
			</div>

			<div class="accordion__item">
		        <header class="accordion__header" id="heading-Completed" data-toggle="collapse" href="#collapse-Completed" aria-controls="collapse-Completed" aria-expanded="true">
		            <span class="accordion__title" id="dispute-Completed-title">Completed</span>
		            <span class="accordion__badge"><?php echo e(count($complete)); ?></span>
		        </header>
    			<div class="accordion__body collapse" id="collapse-Completed" data-parent="#accordion" aria-labelledby="dispute-Completed-title" style="">

             		<div class="modal fade" tabindex="-1" id="popup_8676_retrieve" data-keyboard="false" data-backdrop="static">
					    <div class="modal-dialog" role="document">
					        <div class="modal-content">
					            <div class="modal-header">
					                <h6 class="modal-title">DONE</h6>
					                <button type="button" class="close" data-dismiss="modal" style="">
					                    <span aria-hidden="true">×</span>
					                </button>
					            </div>
					            <div class="modal-body "> 
									<div id="Div_ChooseAction">
					    				<div class="px-3 px-sm-5 pb-3 pb-sm-4">
					        				<div class="gap-y">
												<a class="btn btn-outline-primary w-100  " href="/Dispute/Summary">Manage Dispute Letters</a>
					            				<input type="button" class="btn  btn-primary w-100" onclick="MoveToNextCreateDispute()" value="Create Transunion Dispute" input="">
					            				<a class="btn btn-outline-primary w-100" href="/">Go to Dashboard</a>
					        				</div>
					    				</div>
									</div>
									<div id="Div_ExistingDispute" style="display: none;">
					    				<div class="col-12 pb-2">There is already an existing dispute for this bureau, would you like to edit it?</div>
				    					<div class="d-flex justify-content-end">
				        					<input type="button" onclick="changeAction();" value="No" class="btn btn-outline-primary">
				        					<input type="button" onclick="editNextDispute();" value="Yes" class="btn btn-primary ml-1">
				    					</div>
									</div>
					            </div>
					            <div class="modal-footer"></div>
					        </div>
					    </div>
					</div>

					<div class="modal fade" tabindex="-1" id="popup_8673_retrieve" data-keyboard="false" data-backdrop="static" style="display: none;" aria-hidden="true">
					    <div class="modal-dialog" role="document">
					        <div class="modal-content">
					            <div class="modal-header">
					                <h6 class="modal-title">DONE</h6>
					                <button type="button" class="close" data-dismiss="modal" style="display:">
					                    <span aria-hidden="true">×</span>
					                </button>
					            </div>
					            <div class="modal-body "> 
									<div id="Div_ChooseAction">
									    <div class="px-3 px-sm-5 pb-3 pb-sm-4">
									        <div class="gap-y">
										        <a class="btn btn-outline-primary w-100  " href="/Dispute/Summary">Manage Dispute Letters</a>
									            <input type="button" class="btn  btn-primary w-100" onclick="MoveToNextCreateDispute()" value="Create Equifax Dispute" input="">
									            <a class="btn btn-outline-primary w-100" href="/">Go to Dashboard</a>
									        </div>
									    </div>
									</div>
									<div id="Div_ExistingDispute" style="display: none;">
									    <div class="col-12 pb-2">There is already an existing dispute for this bureau, would you like to edit it?</div>
									    <div class="d-flex justify-content-end">
									        <input type="button" onclick="changeAction();" value="No" class="btn btn-outline-primary">
									        <input type="button" onclick="editNextDispute();" value="Yes" class="btn btn-primary ml-1">
									    </div>
									</div>
					            </div>
					            <div class="modal-footer"></div>
					        </div>
					    </div>
					</div>

					<div class="modal fade" tabindex="-1" id="popup_8674_retrieve" data-keyboard="false" data-backdrop="static" style="display: none;" aria-hidden="true">
					    <div class="modal-dialog" role="document">
					        <div class="modal-content">
					            <div class="modal-header">
					                <h6 class="modal-title">DONE</h6>
					                <button type="button" class="close" data-dismiss="modal" style="display:">
					                    <span aria-hidden="true">×</span>
					                </button>
					            </div>
					            <div class="modal-body "> 
									<div id="Div_ChooseAction">
									    <div class="px-3 px-sm-5 pb-3 pb-sm-4">
									        <div class="gap-y">
									            <a class="btn btn-outline-primary w-100  " href="/Dispute/Summary">Manage Dispute Letters</a>
									            <input type="button" class="btn  btn-primary w-100" onclick="MoveToNextCreateDispute()" value="Create Equifax Dispute" input="">
									            <a class="btn btn-outline-primary w-100" href="/">Go to Dashboard</a>
									        </div>
									    </div>
									</div>
									<div id="Div_ExistingDispute" style="display: none;">
									    <div class="col-12 pb-2">There is already an existing dispute for this bureau, would you like to edit it?</div>
									    <div class="d-flex justify-content-end">
									        <input type="button" onclick="changeAction();" value="No" class="btn btn-outline-primary">
									        <input type="button" onclick="editNextDispute();" value="Yes" class="btn btn-primary ml-1">
									    </div>
									</div>
					            </div>
					            <div class="modal-footer"></div>
					        </div>
					    </div>
					</div>

					<div class="modal fade" tabindex="-1" id="popup_8666_retrieve" data-keyboard="false" data-backdrop="static" style="display: none;" aria-hidden="true">
					    <div class="modal-dialog" role="document">
					        <div class="modal-content">
					            <div class="modal-header">
					                <h6 class="modal-title">DONE</h6>
					                <button type="button" class="close" data-dismiss="modal" style="display:">
					                    <span aria-hidden="true">×</span>
					                </button>
					            </div>
					            <div class="modal-body "> 
									<div id="Div_ChooseAction">
									    <div class="px-3 px-sm-5 pb-3 pb-sm-4">
									        <div class="gap-y">
									            <a class="btn btn-outline-primary w-100  " href="/Dispute/Summary">Manage Dispute Letters</a>
									            <input type="button" class="btn  btn-primary w-100" onclick="MoveToNextCreateDispute()" value="Create Experian Dispute" input="">
									            <a class="btn btn-outline-primary w-100" href="/">Go to Dashboard</a>
									        </div>
									    </div>
									</div>
									<div id="Div_ExistingDispute" style="display: none;">
									    <div class="col-12 pb-2">There is already an existing dispute for this bureau, would you like to edit it?</div>
									    <div class="d-flex justify-content-end">
									        <input type="button" onclick="changeAction();" value="No" class="btn btn-outline-primary">
									        <input type="button" onclick="editNextDispute();" value="Yes" class="btn btn-primary ml-1">
									    </div>
									</div>
					            </div>
					            <div class="modal-footer"></div>
					        </div>
					    </div>
					</div>

					<table class="table table-accordion table-status dispute-highlight " cellspacing="0">
					    <tbody>
					    	<?php if(count($complete)>0): ?>
			            	<?php $__currentLoopData = $complete; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
			            		<tr class="table-accordion__header active collapsed tr--Generated" id="card_<?php echo e($value->id); ?>">
								    <th data-label="Equifax">
								        <span id="lblLetterLabel_<?php echo e($value->id); ?>">Round <?php echo e($value->round); ?></span>
								    </th>
							        <td data-label="Date"><?php echo e(date('d/m/Y',strtotime($value->created))); ?></td>
							        <td data-label="Status">
										Completed        
									</td>
							        <td>
							            <div class="table-accordion__icon collapsed" data-toggle="collapse" href="#collapse-Completed-<?php echo e($value->id); ?>" aria-controls="collapse-Completed-<?php echo e($value->id); ?>">
							                <i class="fa fa-plus"></i>
							                <i class="fa fa-minus"></i>
							            </div>
							        </td>
								</tr>
								<tr class="table-accordion__content" id="card-content_<?php echo e($value->id); ?>">
								    <td colspan="7">
								        <div class="collapse table-accordion__card" id="collapse-Completed-<?php echo e($value->id); ?>">
								            <div class="dispute-card__actions py-2">
								                <input id="CurrentDisputeEvent" name="CurrentDisputeEvent" type="hidden" value="Completed">
								                <button onclick="openPreview('<?php echo e($value->id); ?>','Round <?php echo e($value->round); ?>'); return false;" class="btn btn-outline-primary">Preview</button>
								            </div>
								        </div>
								    </td>
								</tr>
			            	<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
			            	<?php endif; ?>
            			</tbody>
        			</table>

    			</div>

			</div>

		</div>

    </div>

</section>

<script src="<?php echo e(url('/')); ?>/accets/frontend/js/dispute.js"></script>

<div class="modal" id="myModal">

    <div class="modal-dialog">

      	<div class="modal-content">

	        <div class="modal-header">

	          	<h5 class="modal-title">Create Dispute Letter</h5>

	          	<button type="button" class="close" data-dismiss="modal">&times;</button>

	        </div>

	        <div class="modal-body text-center">

	         	<p class=" pb-2">

	            	Create a dispute letter for each bureau.

	            	<br>Select a credit bureau to begin:

	        	</p>

	        	<a class=" btn MT10 btn-primary w-100" href="javascript:;" onclick="showCreditDispute('1')">Transunion</a>

	        	<a class=" btn MT10 btn-primary w-100" href="javascript:;" onclick="showCreditDispute('2')">Experian</a>

	        	<a class=" btn MT10 btn-primary w-100" href="javascript:;" onclick="showCreditDispute('3')">Equifax</a>

	        </div>

	        <div class="modal-footer"></div> 

      	</div>

    </div>

</div>

<div class="modal fade" tabindex="-1" id="popup" data-keyboard="false" data-backdrop="static" style="display: none;" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h6 class="modal-title">Mark as Sent</h6>
                <button type="button" class="close" data-dismiss="modal" style="display:">
                    <span aria-hidden="true">×</span>
                </button>
            </div>
            <div class="modal-body "> 
				<form id="sendLetterForm" class="justify-content-left">
				    <input name="__token" type="hidden" value="<?php echo e(csrf_token()); ?>">
				    <div class="form-group">
				        <label class="label-faded">Method </label>
				        <div class="dropdown" id="select-reason">
				            <select class="form-control" aria-labelledby="select-sent-method" id="drpMethod">
				                <option value="">Select Method</option>
				                <option value="fax">Fax</option>
				                <option value="us_mail">US Mail</option>
				                <option value="certified_mail">Certified Mail</option>
				            </select>
				        </div>
				    </div>
				    <div class="form-group">
				        <label class="label-faded">Date Sent </label>
				        <input type="text" class="form-control date" name="sentDate" id="txtSendDate"  max="" min="">
				    </div>
				    <div class="form-group">
				        <button type="button" class="btn btn-link" onclick="$('#divFileUpload').show();return false;">Attach Confirmation (optional)</button>
				        <div id="divFileUpload" style="display:none;">
							<input type="hidden" id="hidSubmitButtonId">
							<input class="input-file d-none" id="file-upload_upload-file" type="file" name="fileUpload" onchange="readURL(this)">
							<label class="border_dash" for="file-upload_upload-file" id="file-drag_upload-file">
				    		<div>
				        		<span class="d-none d-sm-block drop" id="txtdragDrop">
				        			<span>Drag your file here </span><br>or<br>
				        		</span>
				        		<span class="btn btn-primary" id="file-upload-btn">Browse</span>
				    		</div>
							</label>
							<output for="file-upload_upload-file" id="upload-file"></output>
				        </div>
				    </div>
				</form>            
			</div>
            <div class="modal-footer">
				<button onclick="markSent(); return false;" class="btn btn-primary">Mark as Sent</button>                
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="mdlPreview" role="dialog" tabindex="-1">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h6 class="modal-title" id="lblDisputeName"></h6>
                <button class="close" data-dismiss="modal" type="button" aria-label="Close"> <span aria-hidden="true">×</span></button>
            </div>
            <div class="modal-body">
                <div id="pdf-canvas-list" class="preview-canvas"></div>

            </div>
            <div class="modal-footer">
                <button class="btn btn-outline-primary btn--wide" data-dismiss="modal" type="button" aria-label="Close">Close Preview</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" tabindex="-1" id="popup_closepopup" data-keyboard="false" data-backdrop="static">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h6 class="modal-title"></h6>
                <button type="button" class="close" data-dismiss="modal" style="display:">
                    <span aria-hidden="true">×</span>
                </button>
            </div>
            <div class="modal-body">Are you sure you want to delete this letter?</div>
            <div class="modal-footer justify-content-between">
            	<input type="hidden" name="disputeId" id="disputeId">
				<button onclick="$('#popup_closepopup').modal('hide'); return false;" class="btn btn-default">Cancel</button>     
           		<button onclick="deleteDispute(); return false;" class="btn btn-primary">Delete</button>
        	</div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('frontend.frontMaster', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>