redirect_to('../index.php');
}
if (isset($_GET['tid']) && !empty($_GET['tid'])) {
    $tenant_id = (int) $_GET['tid'];
    if (!is_int($tenant_id)) {
        $mesg = "Cheque payments from user could not be displayed. An invalid value was sent through the URL";
        $session->message($mesg);
        redirect_to('tenants.php');
    } else {
        $tenant = Tenant::findById($tenant_id);
        if (is_null($tenant)) {
            $mesg = "Tenant could not be found in the system";
            $session->message($mesg);
            redirect_to("tenants.php");
        }
        $cheques = Cheque::findByTenantId($tenant_id);
        if (empty($cheques)) {
            $mesg = "No corresponding cheque payments found";
            $session->message($mesg);
            redirect_to("tenant.php?tid={$tenant_id}");
        }
    }
}
include_layout_template('admin_header.php');
?>

	<div id="container">
    <h3>Actions</h3>
    <div id="side-bar">
	<?php 
$actions = array("tenants" => "Tenants", "tenant_search" => "Search Tenant", "tenants_old" => "Previous Tenants");