<?php
include_once('../header_ten.php');
if(!check_login()){
	header("Location: ".WEB_URL."logout.php");
	die();
}
include_once(ROOT_PATH.'language/'.$lang_code_global.'/lang_rented_unit_details.php');
include_once(ROOT_PATH.'language/'.$lang_code_global.'/lang_common.php');
?>
<!-- Content Header (Page header) -->

<section class="content-header">
  <h1> <?= $_data['text_1'];?> </h1>
  <ol class="breadcrumb">
    <li><a href="<?= WEB_URL?>o_dashboard.php"><i class="fa fa-dashboard"></i> <?= $_data['home_breadcam'];?></a></li>
    <li class="active"><?= $_data['text_1'];?></li>
  </ol>
</section>
<!-- Main content -->
<section class="content">
<!-- Full Width boxes (Stat box) -->
<div class="row">
  <div class="col-xs-12">
    <div align="right" style="margin-bottom:1%;"></div>
    <div class="box box-success">
      <!-- /.box-header -->
      <div class="box-body">
        <?php
		$result = mysqli_query($link,"Select f.b_name,u.unit_no,u.uid,r.r_name,r.r_email,r.r_contact,r.r_address,r.r_nid,r.r_floor_no,r.r_unit_no,r.r_advance,r.r_rent_pm,r.r_date,r.image as r_image from units u inner join blocks f on f.bid = u.b_name inner join tenants r on r.r_unit_no = u.uid where r.tid = '". (int)$_SESSION['objLogin']['tid'] . "' order by u.uid desc");
				if($row = mysqli_fetch_array($result)){
					$image = WEB_URL . 'img/no_image.jpg';	
		if(file_exists(ROOT_PATH . '/img/upload/' . $row['r_image']) && $row['r_image'] != ''){
			$image = WEB_URL . 'img/upload/' . $row['r_image'];
		}
					
					 ?>
        <div class="modal-content">
          <div class="modal-header green_header">
            <h3 class="modal-title"><?= $_data['text_1'];?></h3>
          </div>
          <div class="modal-body model_view" align="center">&nbsp;
            <div><img class="photo_img_round" style="width:100px;height:100px;" src="<?= $image;  ?>" /></div>
            <div class="model_title"><?= $row['r_name']; ?></div>
          </div>
          <div class="modal-body">
            <h3 style="text-decoration:underline;"><?= $_data['details_information'];?></h3>
            <div class="row">
              <div class="col-xs-6"> <b><?= $_data['text_5'];?> :</b> <?= $row['r_name']; ?><br/>
                <b><?= $_data['text_6'];?> :</b> <?= $row['r_email']; ?><br/>
                <b><?= $_data['text_7'];?> :</b> <?= $row['r_contact']; ?><br/>
                <b><?= $_data['text_8'];?> :</b> <?= $row['r_address']; ?><br/>
                <b><?= $_data['text_14'];?> :</b> <?= $row['r_nid']; ?><br/>
              </div>
              <div class="col-xs-6"> <b><?= $_data['text_9'];?> :</b> <?= $row['b_name']; ?><br/>
                <b><?= $_data['text_10'];?> :</b> <?= $row['unit_no']; ?><br/>
				<b><?= $_data['text_11'];?> :</b> <?= $ams_helper->currency($localization, $row['r_advance']); ?><br/>
				<b><?= $_data['text_12'];?> :</b> <?= $ams_helper->currency($localization, $row['r_rent_pm']); ?><br/>
                <b><?= $_data['text_13'];?> :</b> <?= $row['r_date']; ?><br/>
              </div>
            </div>
          </div>
        </div>
        <!-- /.modal-content -->
        <?php } mysqli_close($link);$link = NULL; ?>
      </div>
      <!-- /.box-body -->
    </div>
    <!-- /.box -->
  </div>
  <!-- /.col -->
</div>
<!-- /.row -->
<?php include_once('../footer.php'); ?>
