<commit_before><div class='helptip' id='helptip' style="display:none;">
	<a class='label label-primary'>E</a> Edit /
	<a class='label label-danger'>X</a> Delete /
</div>
<div class="col-md-12">
	<table class="table table-striped">
		<thead>
			<tr>
                <th>Train</th>
                <th>Type</th>
                <th>Departure</th>
                <th>Destination</th>
                <th>Start Time</th>
                <th>End Time</th>
                <th>Hours</th>
                <th>Seat Carriage (Capacity)</th>
                <th>Hard Sleeper Carriage (Capacity)</th>
                <th>Soft Sleeper Carriage (Capacity)</th>
                <th>
					Operation <a onclick="$('#helptip').toggle()" class="glyphicon glyphicon-question-sign icona"></a>
				</th>
              </tr>
        </thead>
		<tbody>
			<?php
				$sql_train = "SELECT t.id,t.name,ty.type,c1.city AS scity,c2.city AS ecity,gotime,DATE_FORMAT(timestampadd(hour,hours,gotime),'%T') AS endtime,hours FROM train AS t INNER JOIN train_type AS ty ON t.train_type_id=ty.id INNER JOIN city AS c1 ON start_city_id=c1.id INNER JOIN city AS c2 ON end_city_id=c2.id ORDER BY id";
				$res_train = $mysql->query($sql_train); 
				while($row_train = $mysql->fetch($res_train)){
					echo "<tr>
						<td>".$row_train['name']."</td>
						<td>".$row_train['type']."</td>
						<td>".$row_train['scity']."</td>
						<td>".$row_train['ecity']."</td>
						<td>".$row_train['gotime']."</td>
						<td>".$row_train['endtime']."</td>
						<td>".$row_train['hours']."</td>";
					$sql_carnums = "SELECT seats_level,COUNT(*) AS carnum,CONCAT(COUNT(*),'*',s.capacity,'=',COUNT(*)*s.capacity) AS cap FROM cariage AS c INNER JOIN seats_type AS s ON c.cariage_type_id = s.id WHERE train_id = '".$row_train['id']."' GROUP BY cariage_type_id ORDER BY s.id";
					$res_car = $mysql->query($sql_carnums);
					$carinfo = array('Seat'=>0,'Hard Sleeper'=>0,'Soft Sleeper'=>0);
					while($row_car = $mysql->fetch($res_car)){
						$carinfo[$row_car['seats_level']] = $row_car['carnum'].' ('.$row_car['cap'].')';
					}	
					echo "<td>".$carinfo['Seat']."</td>
						<td>".$carinfo['Hard Sleeper']."</td>
						<td>".$carinfo['Soft Sleeper']."</td>";
					echo"<td>
							<a class='label label-primary' href='index.php?page=train&action=new&edit=".$row_train['id']."'>E</a>						
							<a class='label label-danger' href='#modal-container-1' data-toggle='modal' onclick=$('[name=\"delid\"]').val(".$row_train['id'].")>X</a>	
						</td>
					</tr>";
				}	
			?>
        </tbody>
    </table>
</div>
<!-- Delete Train Form -->
			<div class="modal fade" id="modal-container-1" role="dialog" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
							<h1 class="modal-title text-center" id='popFormLabel'>
								Delete Train
							</h1>
						</div>
						<div class="modal-body">	
							<div class="alert alert-danger">
								This operation will delete the train and its all carriages and tickets!
							</div>
							<form method='post'>
								<div class="form-group">
									<label>Please Verify Your Password...</label><commit_msg>update train_all specific info<commit_after><div class='helptip' id='helptip' style="display:none;">
	<a class='label label-primary'>E</a> Edit /
	<a class='label label-danger'>X</a> Delete /
</div>
<div class="col-md-12">
	<table class="table table-striped">
		<thead>
			<tr>
                <th>Train</th>
                <th>Type</th>
                <th>Departure</th>
                <th>Destination</th>
                <th>Start Time</th>
                <th>End Time</th>
                <th>Hours</th>
                <th>Seat Carriage (Capacity)</th>
                <th>Hard Sleeper Carriage (Capacity)</th>
                <th>Soft Sleeper Carriage (Capacity)</th>
                <th>
					Operation <a onclick="$('#helptip').toggle()" class="glyphicon glyphicon-question-sign icona"></a>
				</th>
              </tr>
        </thead>
		<tbody>
			<?php
				$sql_train = "SELECT t.id,t.name,ty.type,c1.city AS scity,c2.city AS ecity,gotime,DATE_FORMAT(timestampadd(hour,hours,gotime),'%T') AS endtime,hours FROM train AS t INNER JOIN train_type AS ty ON t.train_type_id=ty.id INNER JOIN city AS c1 ON start_city_id=c1.id INNER JOIN city AS c2 ON end_city_id=c2.id ORDER BY id";
				$res_train = $mysql->query($sql_train); 
				while($row_train = $mysql->fetch($res_train)){
					echo "<tr>
						<td>".$row_train['name']."</td>
						<td>".$row_train['type']."</td>
						<td>".$row_train['scity']."</td>
						<td>".$row_train['ecity']."</td>
						<td>".$row_train['gotime']."</td>
						<td>".$row_train['endtime']."</td>
						<td>".$row_train['hours']."</td>";
					$sql_carnums = "SELECT seats_level,COUNT(*) AS carnum,CONCAT(COUNT(*),'*',s.capacity,'=',COUNT(*)*s.capacity) AS cap FROM cariage AS c INNER JOIN seats_type AS s ON c.cariage_type_id = s.id WHERE train_id = '".$row_train['id']."' GROUP BY cariage_type_id ORDER BY s.id";
					$res_car = $mysql->query($sql_carnums);
					$carinfo = array('Seat'=>0,'Hard Sleeper'=>0,'Soft Sleeper'=>0);
					while($row_car = $mysql->fetch($res_car)){
						$carinfo[$row_car['seats_level']] = $row_car['carnum'].' ('.$row_car['cap'].')';
					}	
					echo "<td>".$carinfo['Seat']."</td>
						<td>".$carinfo['Hard Sleeper']."</td>
						<td>".$carinfo['Soft Sleeper']."</td>";
					echo"<td>
							<a class='label label-primary' href='index.php?page=train&action=new&edit=".$row_train['id']."'>E</a>						
							<a class='label label-danger' href='#modal-container-1' data-toggle='modal' onclick=$('[name=\"delid\"]').val(".$row_train['id'].")>X</a>	
						</td>
					</tr>";
				}	
			?>
        </tbody>
    </table>
</div>
<!-- Delete Train Form -->
			<div class="modal fade" id="modal-container-1" role="dialog" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
							<h1 class="modal-title text-center" id='popFormLabel'>
								Delete the Train
							</h1>
						</div>
						<div class="modal-body">	
							<div class="alert alert-danger">
								This operation will delete the train and its all carriages and tickets!
							</div>
							<form method='post'>
								<div class="form-group">
									<label>Please Verify Your Password.....</label>
{'fraction_non_alphanumeric': 0.2058151925711676, 'fraction_numerical': 0.004566905160602832, 'mean_word_length': 2.8443534230544176, 'pattern_counts': {'":': 0, '<': 175, '<?xml version=': 0, '>': 189, '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': '1629662', 'n_tokens_mistral': 2817, 'n_tokens_neox': 2321, 'n_words': 437}