<?php

global $db;

ob_start();
?>                  
  <div class="form-group ">
      <label class="col-lg-4 control-label text-right">Email:</label>
      <div class="col-lg-8">
          <p><?= $this -> email['email'];?></p>
      </div>
  </div>
  <div class="form-group ">
      <label class="col-lg-4 control-label text-right">Numer telefonu:</label>
      <div class="col-lg-8">
          <p> <?= $this -> email['phone'];?></p>
      </div>
  </div>
 <div class="form-group ">
      <label class="col-lg-4 control-label text-right">Temat:</label>
      <div class="col-lg-8">
          <p> <?= $this -> email['title'];?></p>
      </div>
  </div>
<div class="form-group ">
      <label class="col-lg-4 control-label text-right">Wiadomość:</label>
      <div class="col-lg-8">
          <p> <?= nl2br($this -> email['mail']);?></p>
      </div>
  </div>
<div class="form-group ">
      <label class="col-lg-4 control-label text-right">Data wysłania:</label>
      <div class="col-lg-8">
          <p> <?=date( "Y-m-d H:i", strtotime( $this -> email[add_date] ) )?></p>
      </div>
  </div>
<?
$out = ob_get_clean();

$grid = new \gridEdit();
$grid -> id               = 'email-detali';
$grid -> gdb_opt          = $gdb;
$grid -> title            = 'Szczegóły Wiadomości';
$grid -> external_code    = $out;
$grid -> actions          = [ 
                              'save' => [ ''  => '/admin/emails/view_list/', 'back_url' => '/admin/emails/view_list/'], 
                              'cancel' => [ 'url' => '/admin/emails/view_list/' ] 
                            ];
$grid -> form             = false;
echo $grid -> draw();
?>
<style>
    #g-edit-save{
        display: none;
    }
</style>    