<!-- Form for Adding New Transactions (First Row) -->
<form action="{{route('api.transactions.store')}}" method="post">
@csrf
<tr>
<td>
<button id="createTransactionButton" class="btn btn-primary" type="submit">Add</button>
</td>
<td><input type="text" class="form-control" name="type" placeholder="Type"></td>
<td><input type="number" class="form-control" name="indebted" placeholder="Indebted"></td>
<td><input type="number" class="form-control" name="creditor" placeholder="" disabled></td>
<td>
<label class="btn btn-primary btn-sm">
Upload <input type="file" name="file" style="display: none;">
</label>
</td>
<td>
<select id="treeviewSelect" class="form-select text-end" name="account_to">
@foreach($categories as $category)
<optgroup label="{{ $category->name_ar }}">
@foreach($category->children as $subcategory)
<optgroup label="{{ $subcategory->name_ar }}">
@foreach($subcategory->accounts as $account)
<option value="{{ $account->id }}">{{ $account->name_ar }}</option>
@endforeach
</optgroup>
@endforeach
@foreach($category->accounts as $account)
<option value="{{ $account->id }}">{{ $account->name_ar }}</option>
@endforeach
</optgroup>
@endforeach
</select>
</td>
<td><input type="text" class="form-control" name="notes" placeholder="Notes"></td>
<td><input type="text" class="form-control" name="added_by" placeholder="" disabled></td>
<td><input type="text" class="form-control" disabled></td>
<input type="hidden" class="form-control" id="accountFrom" name="account_from">
</tr>
</form>