@extends('frontend.frontMaster')
@section('content')
<form method="post" class="create_dispute" id="msform">
	<ul id="progressbar">
		<li class="active">Select Items</li>
		<li>Add Dispute Reason </li>
		<li>Confirmation </li>
	</ul>
	<div class="notification_box">
		<p>Select the items that you want to include in this dispute letter.</p>
	</div>
	<fieldset>
		<div class="container text-right">
        	<a href="{{url('/')}}/account_summary" class="btn btn-link">Back</a>
            <button class="btn btn-primary Disputenext" type="button" id="btnDispute" data-step='first'>Create @if(Session::get('disputeSource')==1)Transunion @elseIf(Session::get('disputeSource')==2)Experian @else Equifax @endif Dispute</button>
        </div>
		<div class="wrap pt-3">
			<form action="/Account/Summary" id="AccountForm" method="get" novalidate="novalidate">  
			  	<div class="wrap">
			        <div class="container">
			            <div class="page-header">
			                <div class="page-header__tabs">
			                    <ul class="nav nav-bar bureauTabs" role="tablist">
		                       	<!--<li class="nav-item">
		                        		<a class="nav-link active" href="javascript:;" id="ctTransunion" aria-selected="false" >@if(Session::get('disputeSource')==1)Transunion @elseIf(Session::get('disputeSource')==2)Experian @else Equifax @endif Dispute</a>
		                        	</li> -->
		                       	<!--<li class="nav-item">
		                        		<a class="nav-link" href="javascript:;" id="ctExperian" aria-selected="false" onclick="BureauChange('2',this); refreshAccounts();">Experian</a>
		                        	</li>
		                        	<li class="nav-item">
		                        		<a class="nav-link" href="javascript:;" id="ctEquifax" aria-selected="false" onclick="BureauChange('3',this); refreshAccounts();">Equifax</a>
		                        	</li> -->
		                    	</ul>
	                		</div>
	            		</div>
	        		</div>
			        <div class="container">
			            <div class="row">
			                <div class="col-lg-2  filters-state filter-state--mobile-pills">
								<div class="filters">
								    <div class="d-none d-lg-inline-block filter-label">Filters
								     	<i class="fa fa-sliders-h"></i>
								 	</div>
								    <div class="filters__options">
								        <input data-val="true" data-val-required="The Bureau field is required." id="Search_Bureau" name="Search.Bureau" type="hidden" value="{{Session::get('disputeSource')}}"> 
								        <div class="filters__group">
								            <h6 class="filters__title">Account Status 
								            	<span class=" d-lg-none">Filter</span>
								            </h6>
								            <div class="filters__list">
												<div class="custom-control custom-checkbox ">
												    <input id="PositiveStatus_ID" name="PositiveStatus.ID" type="hidden" value="Positive">
										    		<input labelvalue="Positive" class="custom-control-input AccountStatus" data-val="true" data-val-required="The IsChecked field is required." id="PositiveStatus_IsChecked" name="PositiveStatus.IsChecked" onclick=" FilterUpdateSelected('AccountStatus','Positive' ); refreshAccounts();" type="checkbox" value="Positive">
										    		<input name="PositiveStatus.IsChecked" type="hidden" value="false"> 
										    		<label id="checkbox-label-AccountStatus-Positive" class="custom-control-label " for="PositiveStatus_IsChecked">Positive</label>
												</div>
												<div class="custom-control custom-checkbox ">
												    <input id="NegativeStatus_ID" name="NegativeStatus.ID" type="hidden" value="Negative">
												    <input labelvalue="Negative" class="custom-control-input AccountStatus" data-val="true" data-val-required="The IsChecked field is required." id="NegativeStatus_IsChecked" name="NegativeStatus.IsChecked" onclick="FilterUpdateSelected('AccountStatus','Negative' ); refreshAccounts();" type="checkbox" value="Negative">
												    <input name="NegativeStatus.IsChecked" type="hidden" value="false"> 
												    <label id="checkbox-label-AccountStatus-Negative" class="custom-control-label " for="NegativeStatus_IsChecked">Negative</label>
												</div>
												<div class="custom-control custom-checkbox ">
												    <input id="DeletedStatus_ID" name="DeletedStatus.ID" type="hidden" value="Deleted">
												    <input labelvalue="Deleted" class="custom-control-input AccountStatus" data-val="true" data-val-required="The IsChecked field is required." id="DeletedStatus_IsChecked" name="DeletedStatus.IsChecked" onclick="FilterUpdateSelected('AccountStatus','Deleted' ); refreshAccounts();" type="checkbox" value="Deleted">
												    <input name="DeletedStatus.IsChecked" type="hidden" value="false"> 
												    <label id="checkbox-label-AccountStatus-Deleted" class="custom-control-label " for="DeletedStatus_IsChecked">Deleted</label>
												</div>
												<div class="custom-control custom-checkbox ">
												    <input id="RepairedStatus_ID" name="RepairedStatus.ID" type="hidden" value="Repaired">
												    <input labelvalue="Repaired" class="custom-control-input AccountStatus" data-val="true" data-val-required="The IsChecked field is required." id="RepairedStatus_IsChecked" name="RepairedStatus.IsChecked" onclick="FilterUpdateSelected('AccountStatus','Repaired' ); refreshAccounts();" type="checkbox" value="Repaired">
												    <input name="RepairedStatus.IsChecked" type="hidden" value="false"> 
												    <label id="checkbox-label-AccountStatus-Repaired" class="custom-control-label " for="RepairedStatus_IsChecked">Repaired</label>
												</div>
		                						<div class="d-none d-lg-block"> 
													<div class="custom-control custom-checkbox ">
													    <input id="AllAccounts_ID" name="AllAccounts.ID" type="hidden" value="All">
													    <input labelvalue="All" class="custom-control-input AccountStatus" data-val="true" data-val-required="The IsChecked field is required." id="AllAccounts_IsChecked" name="AllAccounts.IsChecked" onclick="FilterUpdateSelected('AccountStatus','All' ); refreshAccounts();" type="checkbox" value="All"><input name="AllAccounts.IsChecked" type="hidden" value="false"> 
													    <label id="checkbox-label-AccountStatus-All" class="custom-control-label " for="AllAccounts_IsChecked">All</label>
													</div>
												</div>
		            						</div>
		        						</div>
								        <div class="filters__group">
								            <h6 class="filters__title">Dispute Status 
								            	<span class=" d-lg-none">Filter</span>
								            </h6>
								            <div class="filters__list">
		                						<div class="custom-control custom-checkbox ">
												    <input id="NADispute_ID" name="NADispute.ID" type="hidden" value="N/A">
												    <input labelvalue="N/A" class="custom-control-input DisputeStatus" data-val="true" data-val-required="The IsChecked field is required." id="NADispute_IsChecked" name="NADispute.IsChecked" onclick="FilterUpdateSelected('DisputeStatus','N/A' ); refreshAccounts();" type="checkbox" value="true">
												    <input name="NADispute.IsChecked" type="hidden" value="false">
												    <label id="checkbox-label-DisputeStatus-N/A" class="custom-control-label " for="NADispute_IsChecked">N/A</label>
												</div>
												<div class="custom-control custom-checkbox ">
												    <input id="PendingDispute_ID" name="PendingDispute.ID" type="hidden" value="Pending">
												    <input labelvalue="Pending" class="custom-control-input DisputeStatus" data-val="true" data-val-required="The IsChecked field is required." id="PendingDispute_IsChecked" name="PendingDispute.IsChecked" onclick="FilterUpdateSelected('DisputeStatus','Pending' ); refreshAccounts();" type="checkbox" value="1">
												    <input name="PendingDispute.IsChecked" type="hidden" value="false"> 
												    <label id="checkbox-label-DisputeStatus-Pending" class="custom-control-label " for="PendingDispute_IsChecked">Pending</label>
												</div>
												<div class="custom-control custom-checkbox ">
												    <input id="SentDispute_ID" name="SentDispute.ID" type="hidden" value="Sent">
												    <input labelvalue="Sent" class="custom-control-input DisputeStatus" data-val="true" data-val-required="The IsChecked field is required." id="SentDispute_IsChecked" name="SentDispute.IsChecked" onclick="FilterUpdateSelected('DisputeStatus','Sent' ); refreshAccounts();" type="checkbox" value="2">
												    <input name="SentDispute.IsChecked" type="hidden" value="false"> 
												    <label id="checkbox-label-DisputeStatus-Sent" class="custom-control-label " for="SentDispute_IsChecked">Sent</label>
												</div>
												<div class="custom-control custom-checkbox ">
												    <input id="CompletedDispute_ID" name="CompletedDispute.ID" type="hidden" value="Completed">
												    <input labelvalue="Completed" class="custom-control-input DisputeStatus" data-val="true" data-val-required="The IsChecked field is required." id="CompletedDispute_IsChecked" name="CompletedDispute.IsChecked" onclick="FilterUpdateSelected('DisputeStatus','Completed' ); refreshAccounts();" type="checkbox" value="3">
												    <input name="CompletedDispute.IsChecked" type="hidden" value="false"> 
												    <label id="checkbox-label-DisputeStatus-Completed" class="custom-control-label " for="CompletedDispute_IsChecked">Completed</label>
												</div>
		                						<div class="d-none d-lg-block">
													<div class="custom-control custom-checkbox ">
													    <input id="AllDisputes_ID" name="AllDisputes.ID" type="hidden" value="All">
													    <input labelvalue="All" checked="checked" class="custom-control-input DisputeStatus" data-val="true" data-val-required="The IsChecked field is required." id="AllDisputes_IsChecked" name="AllDisputes.IsChecked" onclick="FilterUpdateSelected('DisputeStatus','All' ); refreshAccounts();" type="checkbox" value="true"><input name="AllDisputes.IsChecked" type="hidden" value="false"> 
													    <label id="checkbox-label-DisputeStatus-All" class="custom-control-label " for="AllDisputes_IsChecked">All</label>
													</div>
												</div>
								            </div>
								        </div>
								    </div>
								</div>
		                	</div>
		                	<div id="divAccounts" class="col-lg-10 credit-item--table">
								<div id="accordion" class="accordion">
									<input type="hidden" id="disputeId" value="{{$transId}}">
									<input type="hidden" id="dispute_type" value="">    
									<div class="accordion__item"> 
									    <header class="accordion__header collapsed" data-target="#collapse-Accounts" data-toggle="collapse" role="button" aria-controls="collapse-Accounts" aria-expanded="true">
									        <span class="accordion__title" id="Accounts-title">Accounts</span>
									        <span class="accordion__badge tranCount">{{count($data)}}</span>
									    </header>
									    <div class="accordion__body collapse show" id="collapse-Accounts" data-parent="#accordion" aria-labelledby="Accounts-title">
									        <table class="table table-accordion table-status table-modify-border " cellspacing="0">
									            <tbody id="actb">
									            	@foreach($data as $key=>$value)
									            	<?php $accunt_status = '';$class = '';
									            		if($value->AccountCondition_abbreviation=='Open' && $value->AccountCondition_symbol=='O'){$accunt_status = 'Positive';$class='success';}else if($value->AccountCondition_abbreviation=='Derog' && $value->AccountCondition_symbol=='F'){$accunt_status = 'Negative';$class='danger';}?>
													<tr class="table-accordion__header tr--{{$class}} ">
														<td class="td-checkbox">
						                                    <div class="custom-control custom-checkbox Dispute-Checkbox">
						                                        <input class="custom-control-input"  type="checkbox" value="{{$value->trans_id}}" name="transDispute[]">
						                                        <label class="custom-control-label" ></label>
						                                    </div>
						                                </td>
														<td data-label="Credit Card " class="text-uppercase label--">{{$value->creditorName}}</td>
														<td data-label="BALANCE">${{$value->currentBalance}}</td>
														<td data-label="ACCOUNT STATUS" class="text-uppercase">{{$accunt_status}}</td>
						                            	<td class="d-none  btnDisputeReason">
						                                    <button type="button" class="btn btn-link p-0 btn-font--wider" onclick="openDisputeReasonPopUp('{{$value->trans_id}}','{{$value->bureau}}', '', 0,'edit'); ">
						                                        Add Dispute Reason
						                                        <i class="btn-warning fa fa-exclamation-circle" aria-hidden="true"></i>
						                                    </button>
						                            	</td>
							                            <td class="d-none  btnRemoveFromDispute">
							                                <button class="btn btn-link btn-gray btn-icon" onclick="RemoveAccountFromDispute('{{$value->bureau}}', '{{$value->trans_id}}', '')" type="button"><i class="fa fa-trash" aria-hidden="true"></i></button>
							                            </td>
							                            <td data-label="DISPUTE STATUS" class="">
							                                N/A
							                            </td>
							                            <td>
						                                    <div class="table-accordion__icon collapsed" data-toggle="collapse" href="#collapse-Accounts-{{$key}}" aria-controls="#collapse-Accounts-{{$key}}">
						                                        <i class="fa fa-plus"></i>
						                                        <i class="fa fa-minus"></i>
						                                    </div>
						                            	</td>
							                        </tr>
							                        <tr class="table-accordion__content">
							                            <td colspan="7">
							                                <label class="checkbox-on" for="check-Accounts-0"> </label>
							                                <div name="DIV_171632" class="collapse table-accordion__card table-accordion__card--{{$class}}" id="collapse-Accounts-{{$key}}">
							                                	<?php $master = new \App\Master;$dispute = $master->customequery('select dispute_letters.*,dispute_reasons.custom as reason,dispute_master_reasons.subject from dispute_letters
																	left join dispute_reasons on dispute_letters.id = dispute_reasons.dispute_id
																	left join dispute_master_reasons on dispute_reasons.dispute_reason_id = dispute_master_reasons.id
																	where dispute_letters.user_id = '.$value->user_id.' and dispute_letters.transaction_id = '.$value->trans_id.' and dispute_letters.bureau = '.$value->bureau);?>
							                                	@if($value->AccountCondition_abbreviation=='Open' && $value->AccountCondition_symbol=='O')
																<div class="row table-data">
															    	<div class="col-md-6">
															        	<table class="table-sm table-striped table-data__content">
															            	<tbody>
																            	<tr>
																                	<th>Account #</th>
																                	<td>{{str_pad(substr($value->accountNumber, 0, -4), strlen($value->accountNumber), '*', STR_PAD_RIGHT)}}</td>
																            	</tr>
																            	<tr>
																                	<th>Status</th>
																                	<td>{{$value->AccountCondition_abbreviation}}</td>
																            	</tr>
																            	<tr>
																                	<th>Credit Limit</th>
																                	<td> ${{$value->GrantedTrade_CreditLimit}}  </td>
																            	</tr>
																            	<tr>
																                	<th>High Balance</th>
																                	<td>${{$value->highBalance}}</td>
																            	</tr>
																            	<tr>
																                	<th>Payment Amount</th>
																                	<td> $40</td> 
																            	</tr>
																            	<tr>
																                	<th>Last Payment</th>
																                	<td>6/26/2020  </td>
																            	</tr>
																              	<tr>
																                	<th>Term</th>
																                	<td>{{$value->GrantedTrade_termMonths}}</td>
																            	</tr>
																            	<tr>
														                			<th>Description</th>
												                					<td>{{$value->AccountDesignator_description}}</td>
												            					</tr>  
												        					</tbody>
												        				</table>
												    				</div>
																    <div class="col-md-6 table-data__table">
																        <table class="table-sm table-striped table-data__content">
																           <tbody>
																	           	<tr>
																	                <th> Open Date</th>
																	                <td>{{date('d/m/Y',strtotime($value->dateOpened))}}</td>
																	            </tr>
																	            <tr>
																	                <th> Closed Date</th>
																	                <td>   </td>
																	            </tr>
																	            <tr>
																	                <th>Last Reported</th>
																	                <td>7/2/2020   </td>
																	            </tr> 
																	            <tr>
																	                <th>Days Late</th>
																	                <td> 30: <span class=""> {{$value->GrantedTrade_late90Count}} </span>
																	                	| 60: <span class=" "> {{$value->GrantedTrade_late60Count}} </span> 
																	                	| 90: <span class=" "> {{$value->GrantedTrade_late30Count}} </span> 
																	                </td>
																	            </tr>
																	            <tr>
																	                <th>Payment Status</th>
																	                <td class=" ">{{$value->PayStatus_abbreviation}}</td>
																	            </tr>
																	            <tr>
																	                <th>Past Due</th>
																	                <td class=" "> ${{$value->GrantedTrade_amountPastDue}}</td>
																	            </tr>
																	          	<tr>
																	                <th>Worst Rating</th>
																	                <td class=" "> </td>
																	            </tr>
																	            <tr>
																	                <th>Remarks</th>
																	                <td class=" ">  </td>
																	           	</tr>           
											        						</tbody>
											        					</table>
											    					</div>
																</div>
																@elseif($value->AccountCondition_abbreviation=='Derog' && $value->AccountCondition_symbol=='F')
																<div class="row table-data">
																    <div class="col-md-6">
																        <table class="table-sm table-striped table-data__content">
																            <tbody>
																            	<tr> 
																            		<th>Account #</th>
																            		<td>{{str_pad(substr($value->accountNumber, 0, -4), strlen($value->accountNumber), '*', STR_PAD_RIGHT)}}</td> 
																            	</tr>
																            	<tr> 
																            		<th>Status</th>
																            		<td>{{$value->AccountCondition_abbreviation}}</td> 
																            	</tr>
																            	<tr> 
																            		<th>Original Creditor</th>
																            		<td>CONWAY HOSPITAL</td> 
																            	</tr>
																            	<tr>  
																            		<th>Creditor Type</th>
																            		<td>Collection Services</td> 
																            	</tr>
																        	</tbody>
																    	</table>
																    </div>
																    <div class="col-md-6 table-data__table">
																        <table class="table-sm table-striped table-data__content">
																            <tbody>
																            	<tr> 
																            		<th>High Balance</th>
																            		<td>${{$value->highBalance}}</td> 
																            	</tr>
																            	<tr> 
																            		<th>Open Date</th>
																            		<td>{{date('d/m/Y',strtotime($value->dateOpened))}}</td> 
																            	</tr>
																            	<tr> 
																            		<th>Last Reported</th>
																            		<td>6/24/2018  </td> 
																            	</tr>
																            	<tr> 
																            		<th>Remarks</th>
																            		<td>Paid collection</td> 
																            	</tr>
																	        </tbody>
																	    </table>
																    </div>
																</div>
																<table class="table-accordion__footer" width="100%">
														            <tbody>
														            	@foreach($dispute as $val)
														            	<tr>
														                	<td data-label="Dispute" style="width:10%;"> Round {{$val->round}}</td>
														                	<?php if($val->status==1){$status='Pending';$content='Disputes letters created but not marked as sent yet.';}else if($val->status==2){$status='Sent';$content='Dispute letters sent to credit bureaus but still awaiting results.';}else if($val->status==3){$status='Completed';$content='Dispute letters sent to credit bureaus and results have been received.';}?>
														                	<td data-label="{{$status}}" style="width:20%;">
															                    <div class="d-flex align-items-center wrapper2">
															                        <span>
																						{{date('m/d/Y',strtotime($val->created))}}
															                        </span>
															                       <!--  <a class="btn-border btn btn-icon btn-xs ml-2 my-tip2" data-class="dynamic-class" data-content="{{$content}}" data-placement="top" data-toggle="popover" data-trigger="hover" href="javascript:;" title="" rel="popover" data-original-title="{{$status}}"><i class="fa fa-info"></i></a> -->
															                        <a type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="top" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."><i class="fa fa-info"></i></a>
		
															                    </div>
															                </td>
														                	<td data-label="Reason" style="width:20%;"><span>{{$val->subject}}</span></td>
														                	<td class="font-weight-normal"> 
														                		<span>{{$val->reason}}</span>
														                	</td>
														            	</tr>
														            	@endforeach
														        	</tbody>
														        </table>
																@endif
							                                </div>
							                            </td>
							                        </tr>
							                        @endforeach
		           								</tbody>
		        							</table>
		    							</div>
									</div>   
									<div class="accordion__item">
									    <header class="accordion__header collapsed" data-target="#collapse-PublicRecords" data-toggle="collapse" role="button" aria-controls="collapse-PublicRecords" aria-expanded="true">
									        <span class="accordion__title" id="PublicRecords-title">Public Records</span>
									        <span class="accordion__badge">0</span>
									    </header>
									    <div class="accordion__body collapse " id="collapse-PublicRecords" data-parent="#accordion" aria-labelledby="PublicRecords-title">
							        		<table class="table table-accordion table-status table-modify-border " cellspacing="0">
							            		<tbody>
													<form action="/Account/summary" id="AddDisputeReasonForm" method="post"></form>    
												</tbody>
							        		</table>
							    		</div>
									</div>   
									<div class="accordion__item">
									    <header class="accordion__header collapsed" data-target="#collapse-Inquiries" data-toggle="collapse" role="button" aria-controls="collapse-Inquiries" aria-expanded="true">
									        <span class="accordion__title" id="Inquiries-title">Inquiries</span>
									        <span class="accordion__badge">0</span>
									    </header>
									    <!-- <div class="accordion__body collapse " id="collapse-Inquiries" data-parent="#accordion" aria-labelledby="Inquiries-title">

									        <table class="table table-accordion table-status table-modify-border " cellspacing="0">

									            <tbody>

													<form action="/Account/summary" id="AddDisputeReasonForm" method="post"></form>     

													<tr class="table-accordion__header tr--grey     ">

														<td data-label="Name" class="text-uppercase">CAP ONE</td>

														<td data-label="Date">5/30/2018</td>

														<td data-label="ACCOUNT STATUS" class="text-uppercase">DELETED</td>

							                            <td class="d-none  btnDisputeReason">

							                                <button type="button" class="btn btn-link p-0 btn-font--wider" onclick="openDisputeReasonPopUp('171652','TRU', '', 0,'edit'); ">

							                                    Add Dispute Reason

							                                    <i class="btn-warning fa fa-exclamation-circle" aria-hidden="true"></i>

							                                </button>

							                            </td>

							                            <td class="d-none  btnRemoveFromDispute">

							                                <button class="btn btn-link btn-gray btn-icon" onclick="RemoveAccountFromDispute('TRU', 171652, '')" type="button"><i class="fa fa-trash" aria-hidden="true"></i></button>

							                            </td>

							                            <td data-label="DISPUTE STATUS" class="  ">

							                                N/A

							                            </td>

							                            <td></td>

							                        </tr>

							                        <tr class="table-accordion__content">

							                            <td colspan="7">

							                                <label class="checkbox-on" for="check-Inquiries-0"> </label>

							                                <div name="DIV_171652" class="collapse table-accordion__card table-accordion__card--grey" id="collapse-Inquiries-0">

							                                </div>

							                            </td>

							                        </tr>

							                        <tr class="table-accordion__header tr--danger     ">

														<td data-label="Name" class="text-uppercase">SYNCB/AMAZON</td>

														<td data-label="Date">12/16/2019</td>

														<td data-label="ACCOUNT STATUS" class="text-uppercase">Negative</td>

							                            <td class="d-none  btnDisputeReason">

							                                <button type="button" class="btn btn-link p-0 btn-font--wider" onclick="openDisputeReasonPopUp('171653','TRU', '', 0,'edit'); ">

							                                    Add Dispute Reason

							                                    <i class="btn-warning fa fa-exclamation-circle" aria-hidden="true"></i>

							                                </button>

							                            </td>

							                            <td class="d-none  btnRemoveFromDispute">

							                                <button class="btn btn-link btn-gray btn-icon" onclick="RemoveAccountFromDispute('TRU', 171653, '')" type="button"><i class="fa fa-trash" aria-hidden="true"></i></button>

							                            </td>

							                            <td data-label="DISPUTE STATUS" class="  ">

							                                N/A

							                            </td>

							                            <td></td>

							                        </tr>

							                        <tr class="table-accordion__content">

							                            <td colspan="7">

							                                <label class="checkbox-on" for="check-Inquiries-1"> </label>

							                                <div name="DIV_171653" class="collapse table-accordion__card table-accordion__card--danger" id="collapse-Inquiries-1">

							                                </div>

							                            </td>

							                        </tr>

							                        <tr class="table-accordion__header tr--danger     ">

														<td data-label="Name" class="text-uppercase">ONEMAIN</td>

														<td data-label="Date">12/16/2019</td>

														<td data-label="ACCOUNT STATUS" class="text-uppercase">Negative</td>

							                            <td class="d-none  btnDisputeReason">

							                                <button type="button" class="btn btn-link p-0 btn-font--wider" onclick="openDisputeReasonPopUp('171654','TRU', '', 0,'edit'); ">

							                                    Add Dispute Reason

							                                    <i class="btn-warning fa fa-exclamation-circle" aria-hidden="true"></i>

							                                </button>

							                            </td>

							                            <td class="d-none  btnRemoveFromDispute">

							                                <button class="btn btn-link btn-gray btn-icon" onclick="RemoveAccountFromDispute('TRU', 171654, '')" type="button"><i class="fa fa-trash" aria-hidden="true"></i></button>

							                            </td>

							                            <td data-label="DISPUTE STATUS" class="  ">

							                                N/A

							                            </td>

							                            <td>

							                            </td>

							                        </tr>

							                        <tr class="table-accordion__content">

							                        	.

							                        	

							                            <td colspan="7">

							                                <label class="checkbox-on" for="check-Inquiries-2"> </label>

							                                <div name="DIV_171654" class="collapse table-accordion__card table-accordion__card--danger" id="collapse-Inquiries-2">

							                                </div>

							                            </td>

							                        </tr>

							                        <tr class="table-accordion__header tr--danger     ">

														<td data-label="Name" class="text-uppercase">CAPITAL ONE</td>

														<td data-label="Date">11/1/2019</td>

														<td data-label="ACCOUNT STATUS" class="text-uppercase">Negative</td>

							                    		<td class="d-none  btnDisputeReason">

							                                <button type="button" class="btn btn-link p-0 btn-font--wider" onclick="openDisputeReasonPopUp('171655','TRU', '', 0,'edit'); ">

							                                    Add Dispute Reason

							                                    <i class="btn-warning fa fa-exclamation-circle" aria-hidden="true"></i>

							                                </button>

										                </td>

							                            <td class="d-none  btnRemoveFromDispute">

							                                <button class="btn btn-link btn-gray btn-icon" onclick="RemoveAccountFromDispute('TRU', 171655, '')" type="button"><i class="fa fa-trash" aria-hidden="true"></i></button>

							                            </td>

							                            <td data-label="DISPUTE STATUS" class="  ">

							                                N/A

							                            </td>

							                            <td></td>

							                        </tr>

							                        <tr class="table-accordion__content">

							                            <td colspan="7">

							                                <label class="checkbox-on" for="check-Inquiries-3"> </label>

							                                <div name="DIV_171655" class="collapse table-accordion__card table-accordion__card--danger" id="collapse-Inquiries-3">    

							                                </div>

							                            </td>

							                        </tr>

							    					<tr class="table-accordion__header tr--danger     ">

														<td data-label="Name" class="text-uppercase">SYNCB</td>

														<td data-label="Date">10/16/2019</td>

														<td data-label="ACCOUNT STATUS" class="text-uppercase">Negative</td>

									                    <td class="d-none  btnDisputeReason">

							                                <button type="button" class="btn btn-link p-0 btn-font--wider" onclick="openDisputeReasonPopUp('171656','TRU', '', 0,'edit'); ">

							                                    Add Dispute Reason

							                                    <i class="btn-warning fa fa-exclamation-circle" aria-hidden="true"></i>

							                                </button>

									                    </td>

							                            <td class="d-none  btnRemoveFromDispute">

							                                <button class="btn btn-link btn-gray btn-icon" onclick="RemoveAccountFromDispute('TRU', 171656, '')" type="button"><i class="fa fa-trash" aria-hidden="true"></i></button>

							                            </td>

							                            <td data-label="DISPUTE STATUS" class="  ">

							                                N/A

							                            </td>

							                            <td></td>

									                </tr>

							                        <tr class="table-accordion__content">

							                            <td colspan="7">

							                                <label class="checkbox-on" for="check-Inquiries-4"> </label>

							                                <div name="DIV_171656" class="collapse table-accordion__card table-accordion__card--danger" id="collapse-Inquiries-4">

							                                </div>

							                            </td>

							                        </tr>

									            </tbody>

									        </table>

									    </div> -->
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</form>
		</div>
	</fieldset>
	<fieldset>
		<div class="container text-right">
			<input type="button" name="previous" class="previous action-button " value="Back" />
			<input type="button" name="next" class=" action-button Disputenext" value="Finish" data-step='finish' />
		</div>
		<section class="create_dispute_top">
			<div class="container">
    			<div id="divAccounts" class="col-sm-12">
					<div id="accordion" class="accordion">  
						<div class="accordion__item"> 
						    <header class="accordion__header collapsed" data-target="#collapse-Accounts" data-toggle="collapse" role="button" aria-controls="collapse-Accounts" aria-expanded="false">
						        <span class="accordion__title" id="Accounts-title">Accounts</span>
						        <span class="accordion__badge" id="acc_count">1</span>
						    </header>
						    <div class="accordion__body collapse show" id="collapse-Accounts" data-parent="#accordion" aria-labelledby="Accounts-title" style="">
						        <table class="table table-accordion table-status table-modify-border     table-reason  " cellspacing="0">
            						<tbody id="credis">
										<form action="/Account/CreateDispute_AddReasons" id="AddDisputeReasonForm" method="post"></form>                     
										<tr class="table-accordion__header tr--danger     ">
											<td class="label--text-danger text-uppercase" data-label="Collection">MERCHANTS AD</td>
											<td data-label="BALANCE">$500</td>
											<td data-label="ACCOUNT STATUS" class="text-uppercase">Negative</td>
			                            	<td class="btnDisputeReason">
			                                    <button type="button" class="btn btn-link p-0 btn-font--wider" onclick="openDisputeReasonPopUp('171659','TRU', '171659', 0,'edit'); ">
			                                        Add Dispute Reason
			                                        <i class="btn-warning fa fa-exclamation-circle" aria-hidden="true"></i>
			                                    </button>
			                            	</td>
				                            <td class="  btnRemoveFromDispute">
				                                <button class="btn btn-link btn-gray btn-icon" onclick="RemoveAccountFromDispute('TRU', 171659, '171659')" type="button"><i class="fa fa-trash" aria-hidden="true"></i></button>
				                            </td>
				                            <td data-label="DISPUTE STATUS" class="d-none  ">
				                                Round 2 Pending
				                            </td>
				                            <td>
			                                    <div class="table-accordion__icon collapsed" data-toggle="collapse" href="#collapse-Accounts-0" aria-controls="#collapse-Accounts-0">
			                                        <i class="fa fa-plus"></i>
			                                        <i class="fa fa-minus"></i>
			                                    </div>
                           					</td>
				                        </tr>
				                        <tr class="table-accordion__content">
				                            <td colspan="7">
				                                <label class="checkbox-on" for="check-Accounts-0"> </label>
				                                <div name="DIV_171659" class="collapse table-accordion__card table-accordion__card--danger" id="collapse-Accounts-0">
													<div class="row table-data">
													    <div class="col-md-6">
													        <table class="table-sm table-striped table-data__content">
													            <tbody>
														            <tr> <th>Account #</th><td>1238****</td> </tr>
														            <tr> <th>Status</th><td>Open</td> </tr>
														            <tr> <th>Original Creditor</th><td>CAROLINA RADIOLOGY ASSOC BD</td> </tr>
														            <tr>  <th>Creditor Type</th><td>Collection Services</td> </tr>
													        	</tbody>
													        </table>
													    </div>
													    <div class="col-md-6 table-data__table">
													        <table class="table-sm table-striped table-data__content">
													            <tbody>
													            	<tr> <th>High Balance</th><td>$500 </td> </tr>
														            <tr> <th>Open Date</th><td>2/18/2019</td> </tr>
														            <tr> <th>Last Reported</th><td>7/1/2020  </td> </tr>
														            <tr> <th>Remarks</th><td>Placed for collection</td> </tr>
														        </tbody>
														    </table>
													    </div>
													</div>                               
											        <table class="table-accordion__footer">
											            <tbody>
											            	<tr>
												                <td data-label="Dispute" style="width:10%;"> Round 1</td>
												                <td data-label="Completed" style="width:20%;">
												                    <div class="d-flex align-items-center wrapper2">
												                        <span>5/16/2020</span>
												                        <a class="btn-border btn btn-icon btn-xs ml-2 my-tip2" data-class="dynamic-class" data-content="Dispute letters sent to credit bureaus and results have been received. " data-placement="top" data-toggle="popover" data-trigger="hover" href="javascript:;" title="" rel="popover" data-original-title="Completed"><i class="fas  fa-info"></i></a>
												                    </div>
												                </td>
												                <td data-label="Reason" style="width:20%;"><span>Custom Reason</span></td>
												                <td class="font-weight-normal"> <span>This account is not mine</span></td>
												            </tr>
												        </tbody></table>
												        <table class="table-accordion__footer">
												            <tbody>
												            	<tr>
												                <td data-label="Dispute" style="width:10%;"> Round 2</td>
												                <td data-label="Pending" style="width:20%;">
												                    <div class="d-flex align-items-center wrapper2">
												                        <span>
																			<span id="date-content">9/4/2020</span>
                        												</span>
                        												<a class="btn-border btn btn-icon btn-xs ml-2 my-tip2" data-class="dynamic-class" data-content="Disputes letters created but not marked as sent yet. " data-placement="top" data-toggle="popover" data-trigger="hover" href="javascript:;" title="" rel="popover" data-original-title="Pending"><i class="fa fa-info"></i></a>
												                    </div>
												                </td>
												                <td data-label="Reason" style="width:20%;"><span>I Previously Disputed This</span></td>
												                <td class="font-weight-normal"> <span>I previously disputed this account and it was never verified by the debt collector but it’s still on my credit report.</span></td>
												            </tr>
												        </tbody>
												    </table>
				                                </div>
				                            </td>
				                        </tr>
						            </tbody>
						        </table>
						    </div>
						</div>   
						<div class="accordion__item">
						    <header class="accordion__header collapsed" data-target="#collapse-PublicRecords" data-toggle="collapse" role="button" aria-controls="collapse-PublicRecords" aria-expanded="true">
						        <span class="accordion__title" id="PublicRecords-title">Public Records</span>
						        <span class="accordion__badge">0</span>
						    </header>
						    <div class="accordion__body collapse " id="collapse-PublicRecords" data-parent="#accordion" aria-labelledby="PublicRecords-title">
						        <table class="table table-accordion table-status table-modify-border     table-reason  " cellspacing="0">
						            <tbody>
										<form action="/Account/CreateDispute_AddReasons" id="AddDisputeReasonForm" method="post"></form>            
									</tbody>
						        </table>
						    </div>
						</div>   
						<div class="accordion__item">
						    <header class="accordion__header collapsed" data-target="#collapse-Inquiries" data-toggle="collapse" role="button" aria-controls="collapse-Inquiries" aria-expanded="true">
						        <span class="accordion__title" id="Inquiries-title">Inquiries</span>
						        <span class="accordion__badge">0</span>
						    </header>
						    <div class="accordion__body collapse " id="collapse-Inquiries" data-parent="#accordion" aria-labelledby="Inquiries-title">
						        <table class="table table-accordion table-status table-modify-border     table-reason  " cellspacing="0">
						            <tbody>
										<form action="/Account/CreateDispute_AddReasons" id="AddDisputeReasonForm" method="post"></form>           
									</tbody>
						        </table>
						    </div>
						</div>
					</div>
   			 	</div>
			</div>
		</section>
	</fieldset>
	<fieldset>
		<div class="container">
			<div class="col-lg-12 col-md-12 col-sm-12 col-12">
				<div class="great_box">
					<div class="box_greate">
						<h3>Great Job</h3>
						<p>
							<img src="{{url('/')}}/accets/frontend/img/fix_icon.png">
						</p>
						<p class="border_btm">Your <strong id="fintext">Transunion Round 4</strong> dispute letter has been emailed to <strong>{{Session::get('userLoginInfo')['email']}}</strong></p>
						<div class="btm_boxes">
				         	<p>What would you like to do  next?</p>
				        	<a class=" btn MT10 btn-primary w-100" href="{{url('/')}}/account_summary">Transunion</a>
				        	<a class=" btn MT10 btn-primary w-100" href="{{url('/')}}/account_summary">Experian</a>
				        	<a class=" btn MT10 btn-primary w-100" href="{{url('/')}}/account_summary">Equifax</a>
				        </div>
					</div>
			    </div>
			</div>
		</div>
	</fieldset>
</form>
<script src="{{url('/')}}/accets/frontend/js/credit_dispute.js"></script>
@if($dispute_letter!=null)
<div class="modal fade" tabindex="-1" id="myModal" data-keyboard="false" data-backdrop="static" aria-modal="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h6 class="modal-title">Duplicate Dispute Warning</h6>
                <button type="button" class="close" onclick="closePopup()" style="display:">
                    <span aria-hidden="true">×</span>
                </button>
            </div>
            <div class="modal-body "> 
            	<?php if($dispute_letter->bureau==1){$label='Transunion';}else if($dispute_letter->bureau==2){$label='Experian';}else{$label='Equifax';}?>
				A dispute letter has already been created for {{$label}} on {{date('m/d/Y',strtotime($dispute_letter->created))}}. Did you mail that letter to {{$label}} yet?            
			</div>
            <div class="modal-footer">
				<a class="btn btn-primary" href="javascript:;" onclick="closePopup();return false;">YES - create new letter</a>             
				<a class="btn btn-primary" href="javascript:;" onclick="editLetter('{{$dispute_letter->transaction_id}}')">NO - Edit existing letter</a>
            </div>
        </div>
    </div>
</div>
@endif
<!-- 2nd modal -->
<div class="modal fade " tabindex="-1" id="myModal1" data-keyboard="false" data-backdrop="static" aria-modal="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h6 class="modal-title">Add Dispute Reason</h6>
                <button type="button" class="close" data-dismiss="modal" >
                    <span aria-hidden="true">×</span>
                </button>
            </div>
            <div class="modal-body"> 
				<form id="DisputeReasonForm">
			    	<input name="trans_id" id="trans_id" type="hidden" value="">
			    	<input name="bureau" id="bureau" type="hidden" value="">
			    	<input name="disId" id="disId" type="hidden" value="">
					<div class="table-content pb-2">
					    <div class="table-content__box">
					        <label class="text-danger">Collection</label><span id="col_name">MERCHANTS AD</span>
					    </div>
					    <div class="table-content__box">
					        <label>BALANCE</label><span id="col_bal">$ 500</span>
					    </div>
					    <div class="table-content__box">
					        <label>ACC. STATUS</label><span id="col_status"> Negative</span>
					    </div>
					</div>
			    	<div class="modal-alert mb-3"> Select a dispute reason for this item. You can always edit the text to best describe your specific situation.</div>
			    	<div class="form-group">
			        	<label id="selected-label">Select Reason:</label>
			        	<select class="form-control" data-val="true" data-val-number="The field selectedValue must be a number." data-val-required="The selectedValue field is required." name="selectedValue" onchange="showReason(this)">
			        		<option selected="selected" value="0">Suggested Reason</option>
						</select>
						<span id="errreason" style="color: red;"></span>
					</div>
				    <div class="form-group mb-0">
				        <textarea id="txtDisputeText" class="form-control" cols="20" name="DisputeText" rows="2"></textarea>
				        <span id="errtext" style="color: red;"></span>
				    </div> 
				</form>            
			</div>
			<div class="modal-footer justify-content-between">
				<a href="javascript:;"  class=" btn btn-link" data-dismiss="modal">Close</a>                
				<input type="button" class="btn btn-primary btn--wide" onclick="saveReason()" value="Save">
			</div>
        </div>
    </div>
</div>
<script type="text/javascript">

$(".submit").click(function() {
  return false;
});
$(window).on('load', function () {
      // alert("Window Loaded");
	setTimeout(function(){
		// console.log('/');
    	$('#NegativeStatus_IsChecked').trigger('click');
	},800);
	var dis = localStorage.getItem('dispute_letter');
	if(dis!='edit'){
		$('#myModal').modal('show');
	}
 });


</script>
@endsection




