<commit_before><?php require __DIR__ . '/bootstrap.php'; ?>
<?php
	$data = new CashMoney\Data\Data();

	$tripID = isset($_GET['id']) ? $_GET['id'] : null;

	$trip = $data->getTrip($tripID);

	$expenses = $trip->getExpenses();
	$payments = $trip->getPayments();

?>
<?php require 'header.php'; ?>

<div class="row equal">
	<div id="trip-expense-matrix-container" class="col-md-6"></div>
	<div id="trip-repayment-container" class="col-md-6"></div>
</div>
<div class="row">
	<div id="trip-expenses-container" class="col-md-6"></div>
	<div id="atm-map" class="col-md-6"></div>
</div>

<?= '<script type="handlerbars-template" id="trip-expense-template">' ?>
	<div class="panel panel-default">
		<div class="panel-heading"><h2>Total Expenses</h2></div>

		<div class="panel-body">
			<table class="table table-striped table-hover expenses">
				<tr>
					<th>Expense</th>
					<th>Amount</th>
					<th>Paid By</th>
				</tr>

				{{#each expenses}}
					<tr>
						<td><b>{{name}} </b></td>

						<td>{{formattedAmount}}</td>

						<td>{{paidBy.name}}</td>
					</tr>
				{{/each}}

				<tr>
					<th>Total</th>
					<th>{{formattedTotal}}</th>
					<th></th>
				</tr>
			</table>
		</div>
	</div>
<?= '</script>' ?>

<?= '<script type="handlerbars-template" id="trip-payment-template">' ?>
	<div class="panel panel-default payments-panel" style="width:100%;">
		<div class="panel-heading">
			<h2>
				Pay Me Back

				<span class="pull-right">
					{{#if isAllPaid}}
						<button class="btn btn-default" disabled>
							<img src="img/mastercard.ico">
							All Paid
						</button>
					{{else}}
						<button class="btn btn-default do-all-payments">
							<img src="img/mastercard.ico">
							<span class="do-payment-text">Settle Trip</span>
						</button>
					{{/if}}
				</span>
			</h2>
		</div>

		<div class="panel-body">
			<p>Payments that need to be made to reconcile all debts for the trip.</p>

			<ul class="list-group payments">
				{{#each payments}}
					<li class="list-group-item clearfix">
						<b>{{debtor.name}}</b> owes <b>{{formattedAmount}}</b> to <b>{{lender.name}}</b>

						<span class="pull-right">
							{{#if isPaid}}
								<button class="btn btn-default" disabled>
									<img src="img/mastercard.ico">
									Paid
								</button>
							{{else}}
								<button class="btn btn-default do-payment" data-debtor-id="{{debtor.id}}" data-lender-id="{{lender.id}}">
									<img src="img/mastercard.ico">
									<span class="do-payment-text">Pay {{lender.name}}</span>
								</button>
							{{/if}}
						</span>
					</li>
				{{/each}}
			</ul>
		</div>
	</div>
<?= '</script>' ?>

<?= '<script type="handlerbars-template" id="trip-expense-by-user-template">' ?>
	<div class="panel panel-default">
		<div class="panel-heading"><h2>Expense Participation Matrix</h2></div>

		<div class="panel-body">
			<p>Check marks in this table represent participation in the expense</p>

			<table class="table table-bordered table-hover expenses">
				<tr>
					<th></th>
					{{#each users}}
						<th width="150" class="text-center">
							{{name}}<br>
							<a href="#" data-toggle="modal" data-target="#user-modal-{{id}}">
								<img src="img/{{name}}.png" class="img-circle" height="32" width="24" />
							</a>
						</th>
					{{/each}}
				</tr>
<commit_msg>Avatars on top of names in trip.php<commit_after><?php require __DIR__ . '/bootstrap.php'; ?>
<?php
	$data = new CashMoney\Data\Data();

	$tripID = isset($_GET['id']) ? $_GET['id'] : null;

	$trip = $data->getTrip($tripID);

	$expenses = $trip->getExpenses();
	$payments = $trip->getPayments();

?>
<?php require 'header.php'; ?>

<div class="row equal">
	<div id="trip-expense-matrix-container" class="col-md-6"></div>
	<div id="trip-repayment-container" class="col-md-6"></div>
</div>
<div class="row">
	<div id="trip-expenses-container" class="col-md-6"></div>
	<div id="atm-map" class="col-md-6"></div>
</div>

<?= '<script type="handlerbars-template" id="trip-expense-template">' ?>
	<div class="panel panel-default">
		<div class="panel-heading"><h2>Total Expenses</h2></div>

		<div class="panel-body">
			<table class="table table-striped table-hover expenses">
				<tr>
					<th>Expense</th>
					<th>Amount</th>
					<th>Paid By</th>
				</tr>

				{{#each expenses}}
					<tr>
						<td><b>{{name}} </b></td>

						<td>{{formattedAmount}}</td>

						<td>{{paidBy.name}}</td>
					</tr>
				{{/each}}

				<tr>
					<th>Total</th>
					<th>{{formattedTotal}}</th>
					<th></th>
				</tr>
			</table>
		</div>
	</div>
<?= '</script>' ?>

<?= '<script type="handlerbars-template" id="trip-payment-template">' ?>
	<div class="panel panel-default payments-panel" style="width:100%;">
		<div class="panel-heading">
			<h2>
				Pay Me Back

				<span class="pull-right">
					{{#if isAllPaid}}
						<button class="btn btn-default" disabled>
							<img src="img/mastercard.ico">
							All Paid
						</button>
					{{else}}
						<button class="btn btn-default do-all-payments">
							<img src="img/mastercard.ico">
							<span class="do-payment-text">Settle Trip</span>
						</button>
					{{/if}}
				</span>
			</h2>
		</div>

		<div class="panel-body">
			<p>Payments that need to be made to reconcile all debts for the trip.</p>

			<ul class="list-group payments">
				{{#each payments}}
					<li class="list-group-item clearfix">
						<b>{{debtor.name}}</b> owes <b>{{formattedAmount}}</b> to <b>{{lender.name}}</b>

						<span class="pull-right">
							{{#if isPaid}}
								<button class="btn btn-default" disabled>
									<img src="img/mastercard.ico">
									Paid
								</button>
							{{else}}
								<button class="btn btn-default do-payment" data-debtor-id="{{debtor.id}}" data-lender-id="{{lender.id}}">
									<img src="img/mastercard.ico">
									<span class="do-payment-text">Pay {{lender.name}}</span>
								</button>
							{{/if}}
						</span>
					</li>
				{{/each}}
			</ul>
		</div>
	</div>
<?= '</script>' ?>

<?= '<script type="handlerbars-template" id="trip-expense-by-user-template">' ?>
	<div class="panel panel-default">
		<div class="panel-heading"><h2>Expense Participation Matrix</h2></div>

		<div class="panel-body">
			<p>Check marks in this table represent participation in the expense</p>

			<table class="table table-bordered table-hover expenses">
				<tr>
					<th></th>
					{{#each users}}
						<th width="150" class="text-center">
							<a href="#" data-toggle="modal" data-target="#user-modal-{{id}}">
								<img src="img/{{name}}.png" class="img-circle" height="32" width="24" />
							</a><br>
							{{name}}
						</th>
					{{/each}}
				</tr>

{'fraction_non_alphanumeric': 0.22387834989461006, 'fraction_numerical': 0.006022282445046673, 'mean_word_length': 2.9778443113772455, 'pattern_counts': {'":': 0, '<': 243, '<?xml version=': 0, '>': 249, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1229874', 'n_tokens_mistral': 3098, 'n_tokens_neox': 2365, 'n_words': 468}