<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<!DOCTYPE html>
<html>
  
  <head>
    <title>
      Admin &gt; Umpan Balik | <?php echo html_escape($this->system->set[ 'site_name']) . PHP_EOL; ?>
    </title>
    <?php include_once(VIEWPATH. 'includes/head.php'); ?>
  </head>
  
  <body>
    <?php include_once(VIEWPATH. 'admin/_navbar.php'); ?>
    <div class="container">
      <ul class="breadcrumb">
        <li><a href="<?php echo site_url();?>"><i class="fa fa-home"></i></a></li>
        <li><a href="<?php echo site_url('admin');?>">Admin Panel</a></li>
        <li><a href="<?php echo site_url('admin/feedback');?>">Umpan Balik</a></li>
        <li class="active"><span><?php echo html_escape($result->nama);?></span></li>
      </ul>
      <div class="row">
        <div class="col-sm-4 col-md-3">
          <?php
          $params = array(array(
            'title' => 'Umpan Balik',
            'icon' => 'fa fa-ticket',
            'links' => array(
                array('Semua', site_url('admin/feedback'), 'fa fa-comments-o', false,'<span class="badge">'.$count['total'].'</span>'),
                array('Belum Dibaca', site_url('admin/feedback/index/unread'), 'fa fa-commenting', false,'<span class="badge">'.$count['unread'].'</span>'),
                array('Sudah Dibaca', site_url('admin/feedback/index/read'), 'fa fa-commenting-o', false,'<span class="badge">'.$count['read'].'</span>'),
            )
          ));
          echo sidebar_menu($params);
          ?>
        </div>
        <div class="col-sm-8 col-md-9">
          <div class="panel panel-default">
            <div class="panel-heading">
              <h3>
                <a class="pull-right" href="<?php echo site_url('admin/feedback/delete/'.$result->id);?>" style="font-size: 18px;color:#333;cursor:pointer;" data-toggle="modal" data-target="#myModal" title="Hapus"><i class="fa fa-times"></i></a>
                <i class="fa fa-comments-o"></i> <?php echo html_escape($result->nama);?>
              </h3>
            </div>
            <div class="panel-body">
              <p>
                <?php if ($result->us_id):?>
                <a href="<?php echo site_url('admin/users/profil/'.$result->us_id);?>"><strong><i class="fa fa-user"></i> <?php echo html_escape($result->nama);?></strong></a>
                <?php else:?>
                <strong><i class="fa fa-user-secret"></i> <?php echo html_escape($result->nama);?></strong>
                <?php endif;?>
                &nbsp;<small>(<?php echo format_tanggal($result->tanggal) . ($result->inv_id ? ' / <a href="'.site_url('admin/transaksi/view/'.$result->inv_id).'">Trx #'.$result->inv_id.'</a>' : '');?>)</small>:
                &nbsp;<?php echo nl2br(auto_link(html_escape($result->pesan)));?>
              </p>
              <?php if ($result->us_id):?>
              <?php echo form_open();?>
                <div class="form-group">
                  <label>Kirim pemberitahuan ke <?php echo html_escape($result->nama);?></label>
                  <textarea class="form-control" name="pesan" rows="8"><?php echo $result->nama." (".format_tanggal($result->tanggal)."):\r\n".$result->pesan."\r\n--------------------\r\n";?></textarea>
                </div>
                <div class="row">
                  <div class="col-sm-8 col-md-10">
                    <div class="form-group">
                      <div class="input-group">
                        <span class="input-group-addon" style="padding: 0;overflow: hidden;">
                          <img src="<?php echo site_url('captcha');?>" style="height:30px" alt="Loading....">
                        </span>
                        <input type="text" class="form-control" name="captcha" id="v" maxlength="5" size="5" required="required">
                      </div>
                    </div>
                  </div>
                  <div class="col-sm-4 col-md-2">
                    <button type="submit" class="btn btn-primary btn-block" style="margin-bottom: 15px;"><i class="fa fa-paper-plane"></i> Kirim</button>
                  </div>
                </div>
                <input type="hidden" name="nama" value="Administrator">
                <input type="hidden" name="no_hp" id="no_hp" value="0818118061">
              <?php echo form_close();?>
              <?php endif;?>
            </div>
          </div>
        </div>
      </div>
    </div>
    <?php include_once(VIEWPATH.'includes/foot.php'); ?>
  </body>

</html>