<?php
$menu_modules = unserialize($this->request->session()->read('modules'));

?>
<div class="row">
    <div class="col-md-12">
        <div class="box box-primary">
            <div class="box-body">
                <div class="row" style="text-align:left;" >
                    <div class="col-md-6 col-xs-6 tile">
                        <div class="icon-frame col-md-2" id="light">
                            <i class="fa fa-folder-open-o" style="color:white"></i>
                        </div>
                        <h3 class="box-title no-margin" style="line-height: 3;float: left;"><?php echo __('&nbspView Report Format Generation History'); ?></h3>
                    </div>

                    <div class="col-md-6">

                        <div class="row">

                            <div class="col-md-12 text-right" style="line-height: 5;">
                                <?php
                                if (array_key_exists("add", $module_pages)):
                                    $page_id = $module_pages["index"];
                                    foreach ($user_permission as $permission):
                                        if ($permission['page_id'] == $page_id):
                                            ?>

                                            <a href="<?php echo $this->Url->build('/report-format-generation-history'); ?>"  class="btn btn-success btn-flat btn-grid">
                                                <i class="fa fa-list"></i>
                                                <?php echo __('LIST'); ?>
                                            </a>

                                            <?php
                                            break;
                                        endif;
                                    endforeach;
                                endif;
                                ?>

                            </div>
                        </div>


                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="box box-primary">
    <!-- /.box-header -->
    <div class="box-body">
        <div class="row">
            <div class="col-md-12  main-view-section">

                <div id="basic_info_div">
                    <div class="col-md-6 view-section">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th> <span><?= __('Report Format') ?></span> </th>
                                <th> <?= h($report_format->name)?> </th>

                            </tr>
                            <tr>
                                <th> <span><?= __('Name') ?></span> </th>
                                <th> <?= h($report_format_generation_history->name)?> </th>

                            </tr>

                            <tr>
                                <th> <span><?= __('Receiver Emails') ?></span></th>
                                <th>
                                    <?= $report_format_generation_history->receiver_emails ?>
                                </th>
                            </tr>

                            <tr>
                                <th> <span><?= __('Status') ?></span></th>
                                <th>
                                    <?= h(json_decode(MEMBER_STATUS)[$report_format_generation_history->status])?>
                                </th>
                            </tr>
                            <tr>
                                <th> <span><?= __('Created On') ?></span></th>
                                <th>   <span><?= h($report_format_generation_history->created_at)?></span></th>
                            </tr>
                            </thead>

                        </table>

                    </div>
                    <div class="col-md-6 col-sm-12 col-xs-12">
                        <div class="form-group row">
                            <?= $this->Form->textarea('content', ['placeholder' => __('Content'),'label'=>false,'style'=>'height:300px','class' => 'form-control editable required', 'type' => 'text','id'=>'content', 'value' => $report_format->content , 'required' => false,'name' => 'content' ,'readonly' => true]); ?>
                        </div>
                    </div>

                    <div class="col-md-12 col-offset-12 back-btn-section">
                        <a href="<?php echo $this->Url->build('/report-format-generation-history'); ?>"  class="btn btn-success btn-flat btn-orange-color" id="back-btn">
                            <i class="fa fa-arrow-left"></i>
                            <?php echo __('Back'); ?>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<?php echo $this->element('tinymce_js'); ?>