<commit_before><?php
defined('BASEPATH') or exit('No direct script access allowed');

// list.php <NAME> Dec 14, 2013 3:18:33 PM <EMAIL>
if (! $for_tourist) {
    $buttons[] = array(
            "text" => "Create Tour",
            "type" => "span",
            "class" => "button new create-tour",
            "id" => "tour"
    );
    print create_button_bar($buttons);
}
?>
<table class="list">
	<thead>
		<tr>
			<th>Tour</th>
			<th>Start</th>
			<th>End</th>
			<th>Payment Due</th>
			<? if($for_tourist):?>
			<th>Amt Paid</th>
			<? endif;?>
			<!-- <th>Full Price</th>
			<th>Banquet Price</th>
			<th>Early Bird</th>
			<th>Regular</th>
			<th>Single Rate</th>
			<th>Triple Rate</th>
			<th>Quad Rate</th> -->
			<th></th>
			<th></th>
		</tr>
	</thead>
	<tbody>
<?
$row_class = "odd";

foreach ($tours as $tour) {
    ?>
<tr class="<?=$row_class;?>">
			<td>

		<a href="<?=site_url("tour/view/$tour->id");?>">
<?=$tour->tour_name;?>
</a>
</td>
			<td>
<?=format_date($tour->start_date);?>
</td>
			<td>
<?=format_date($tour->end_date);?>
</td>
			<td>
<?=format_date($tour->due_date);?>
</td>
			<!-- <td>
<?=format_money($tour->full_price);?>
</td>
			<td>
<?=format_money($tour->banquet_price);?>
</td>
			<td>
<?=format_money($tour->early_price);?>
</td>
			<td>
<?=format_money($tour->regular_price);?>
</td>
			<td>
<?=format_money($tour->single_rate);?>
</td>
			<td>
<?=format_money($tour->triple_rate);?>
</td>
			<td>
<?=format_money($tour->quad_rate);?>
</td> -->
<? if($for_tourist): ?>
<td>
<?=format_money($tour->amt_paid);?>
</td>
<td>
<?=create_button(array("text"=>"Payment Details", "type"=>"span","class"=>"button edit edit-payer", "id"=>sprintf("edit-payer_%s_%s",$tour->payer_id, $tour->tour_id)));?>

</td>
<td><a class="button show-toursits mini"
				href="<?=site_url("/tourist/show_all/$tour->id");?>">Tourists</a></td>
<? else: ?>
			<td><a
				class="button show-hotels mini"
				href="<?=site_url("/hotel/view_all/$tour->id");?>">Hotels</a></td>
			<td><a
				class="button show-toursits mini"
				href="<?=site_url("/tourist/show_all/$tour->id");?>">Tourists</a></td>
		</tr>
<?
endif;
    if ($row_class == "odd") {
        $row_class = "even";
    } else {
        $row_class = "odd";
    }
}

?>
</tbody>
</table><commit_msg>refactoring "show" functions with "view"<commit_after><?php
defined('BASEPATH') or exit('No direct script access allowed');

// list.php <NAME> Dec 14, 2013 3:18:33 PM <EMAIL>
if (! $for_tourist) {
    $buttons[] = array(
            "text" => "Create Tour",
            "type" => "span",
            "class" => "button new create-tour",
            "id" => "tour"
    );
    print create_button_bar($buttons);
}
?>
<table class="list">
	<thead>
		<tr>
			<th>Tour</th>
			<th>Start</th>
			<th>End</th>
			<th>Payment Due</th>
			<? if($for_tourist):?>
			<th>Amt Paid</th>
			<? endif;?>
			<!-- <th>Full Price</th>
			<th>Banquet Price</th>
			<th>Early Bird</th>
			<th>Regular</th>
			<th>Single Rate</th>
			<th>Triple Rate</th>
			<th>Quad Rate</th> -->
			<th></th>
			<th></th>
		</tr>
	</thead>
	<tbody>
<?
$row_class = "odd";

foreach ($tours as $tour) {
    ?>
<tr class="<?=$row_class;?>">
			<td>

		<a href="<?=site_url("tour/view/$tour->id");?>">
<?=$tour->tour_name;?>
</a>
</td>
			<td>
<?=format_date($tour->start_date);?>
</td>
			<td>
<?=format_date($tour->end_date);?>
</td>
			<td>
<?=format_date($tour->due_date);?>
</td>
			<!-- <td>
<?=format_money($tour->full_price);?>
</td>
			<td>
<?=format_money($tour->banquet_price);?>
</td>
			<td>
<?=format_money($tour->early_price);?>
</td>
			<td>
<?=format_money($tour->regular_price);?>
</td>
			<td>
<?=format_money($tour->single_rate);?>
</td>
			<td>
<?=format_money($tour->triple_rate);?>
</td>
			<td>
<?=format_money($tour->quad_rate);?>
</td> -->
<? if($for_tourist): ?>
<td>
<?=format_money($tour->amt_paid);?>
</td>
<td>
<?=create_button(array("text"=>"Payment Details", "type"=>"span","class"=>"button edit edit-payer", "id"=>sprintf("edit-payer_%s_%s",$tour->payer_id, $tour->tour_id)));?>

</td>
<td><a class="button show-toursits mini"
				href="<?=site_url("/tourist/view_all/$tour->id");?>">Tourists</a></td>
<? else: ?>
			<td><a
				class="button show-hotels mini"
				href="<?=site_url("/hotel/view_all/$tour->id");?>">Hotels</a></td>
			<td><a
				class="button show-toursits mini"
				href="<?=site_url("/tourist/view_all/$tour->id");?>">Tourists</a></td>
		</tr>
<?
endif;
    if ($row_class == "odd") {
        $row_class = "even";
    } else {
        $row_class = "odd";
    }
}

?>
</tbody>
</table>
{'fraction_non_alphanumeric': 0.27589227063717975, 'fraction_numerical': 0.00481716663017298, 'mean_word_length': 3.70442842430484, 'pattern_counts': {'":': 0, '<': 217, '<?xml version=': 0, '>': 269, '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': '6062652', 'n_tokens_mistral': 2154, 'n_tokens_neox': 1901, 'n_words': 301}