<div class="container-fluid">
	<div class="container">
		<h1 class="text-center"> Mali-Mart Merchant Training Center </h1>
	</div>
	<br>
	<br>
</div>

<div class="row">
	<div class="col-lg-12">
		<div class="card">
			<div class="card-header">
				<h2> All Training Informations</h2>
			</div>

			<div class="card-body">
				<div class="table-responsive">
					<table class="table table-hover">
						<thead class="bg-warning">
							<tr style="border-radius: 5px!important;">
								<th>SL</th>
								<th>Topic</th>
								<th>Date</th>
								<th>Start Time</th>
								<th>Duration</th>
								<th>Meeting Description</th>
								<th>Start</th>
							</tr>
						</thead>

						<tbody>

							<?php

							$d = json_decode($meetings);

							if (isset($d->result) && $d->result == 0) {

								echo '
								<tr>
									<td colspan="7"> 
									<p> 
										প্রিয় গ্রাহক ,<br>
										 Mali-Mart কর্তৃক , সকল Active User -দের জন্য Free Training Session এর ব্যবস্থা করা হয়ছে । <br>
										 পরবর্তি Training Session এ যোগদান করতে  Training Button -এ চোখ রাখুন।
									</p>
									</td>
								</tr> 
							';
							} else {

								foreach (json_decode($meetings) as $key => $meeting) {
									echo '
									<tr>
										<td>' . ($key + 1) . '</td>
										<td>' . $meeting->topic . '</td>
										<td>' . $meeting->date . '</td>
										<td>' . $meeting->time . '</td>
										<td>40 Min.</td>
										<td>' . $meeting->description . '</td>
										<td> 
											<a href="' . base_url() . '/TrainingController/startMeeting?url=' . $meeting->join_url . '&password=' . $meeting->password . '&topic=' . $meeting->topic . '&description=' . $meeting->description . '&time=' . $meeting->time . '" 
											class="btn btn-warning" target="_blank">
											 Join Training.
											 </a>
										 </td>
									</tr>
								';
								}
							}

							?>

						</tbody>


					</table>
				</div>
			</div>

		</div>
	</div>
</div>

<style>
	table th:nth-child(1) {
		border-radius: 3px 0px 0px 3px;
	}

	table th:nth-last-child(1) {
		border-radius: 0px 3px 3px 0px;
	}
</style>