<commit_before><!-- Modal add department-->
<?php echo $this->element('Request/edit') ?>
<?php echo $this->element('Request/comment') ?>
<?php echo $this->element('Request/change_status') ?>
<!-- End div .md-modal .md-fade-in-scale-up -->

<!-- Page Heading Start -->
<div class="page-heading">
    <h1><i class='fa fa-table'></i> <?=__('request').' '.__('list')?></h1>
</div>
<!-- Page Heading End-->
<!-- Your awesome content goes here -->
<div class="row">
    <div class="col-md-12">
        <div class="widget">
            <div class="widget-content">

                <div class="data-table-toolbar">

                    <div class="row">

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

                            <form role="form">
                                <input type="text" class="form-control" placeholder="<?=__('search')?>...">
                            </form>
                        </div>
                        <div class="col-md-8">
                            <div class="toolbar-btn-action">
                                <div class="btn-group">
                                    <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
                                        <i class="fa fa-cog"></i> <?=__('action')?> <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu primary" role="menu">
                                        <li><a  data-modal="md-edit-request" class="md-trigger actionRequest" data-mode="add"   ><?=__('add_new')?></a></li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <?php  if(count($requests) && !empty($requests[0]->id)):?>
                <div class="table-responsive">
                    <table data-sortable class="table table-hover table-striped" id="listRequests">
                        <thead>
                        <tr>
                            <th><?=__('no')?></th>
                            <th><?=__('user')?></th>
                            <th><?=__('department')?></th>
                            <th><?=__('request_cate')?></th>
                            <th><?=__('title')?></th>
                            <th><?=__('request_approve_date')?></th>
                            <th><?=__('request_approve_by')?></th>
                            <th><?=__('status')?></th>
                            <th><?=__('create_date')?></th>
                            <th width="116px;" data-sortable="false"><?=__('action')?></th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach ($requests as $key => $request): ?>
                            <?php
                                $request->appr_date = $this->Time->i18nFormat($request->appr_date,'MM/dd/yyyy');
                                $request->payment_date = $this->Time->i18nFormat($request->payment_date,'MM/dd/yyyy');
                                $status = ['class'=>'label-danger','value'=>'Rejected','status' => false, 'rowclass'=> (round( ( strtotime( $request->appr_date ) - time() ) / 86400 ) <= 1) ? 'highlight-out-pending' : 'highlight-pending'];
                                if($request->role_name === 'top' || ((int)$request->department_id === 1 && $request->role_name === 'manager') || $request->status === 'approved'){
                                    $status = ['class'=>'label-success','value'=>'Approved','status' => false, 'rowclass'=>'highlight-success'];
                                }elseif ($request->status === 'rejected'){
                                    $status = ['class'=>'label-danger','value'=>'Rejected','status' => false, 'rowclass'=>'highlight-reject'];
                                }elseif ($request->status === 'returned'){
                                    $status = ['class'=>'label-return','value'=>'Returned','status' => false, 'rowclass'=>'highlight-return'];
                                }
                                else{
                                    $status = ['class' => 'label-warning', 'value' => 'Pending', 'status' => true, 'rowclass'=>$status['rowclass']];
                                }
                            ?>
                            <tr class="<?=$status['rowclass'];?>">
                                <td><?php echo $key+1;?></td>
                                <td><strong><?php echo $request->alias_name;?></strong></td>
                                <td><strong><?php echo $request->department_name;?></strong></td>
                                <td><strong><?php echo $request->categories_name;?></strong></td>
                                <td><strong><?php echo $request->title;?></strong></td>
                                <td><strong><?= $request->appr_date;?></strong></td>
                                <td>
                                    <?php if((int)$request->top_status === 1 || (int)$request->top_status === 2 || $request->role_name === 'top' ){?>
                                        <strong  title="<?= ($request->role_name === 'top' ? __('created_by_top') : ( (int)$request->top_status === 2 ? __('rejected_by_top') : __('approved_by_top')))?>"><i class="icon-person"></i></strong>
                                    <?php } if((int)$request->manager_status === 1 || (int)$request->manager_status === 2 ||  $request->role_name === 'manager'){ ?>
                                        <strong  title="<?= ($request->role_name === 'manager' ? __('created_by_manager') : ( (int)$request->manager_status === 2 ? __('rejected_by_manager') : __('rejected_by_manager'))) ?>"><i class="icon-adult"></i></strong>
                                    <?php } if((int)$request->sub_manager_status === 1 || (int)$request->sub_manager_status === 2 ||  $request->role_name === 'sub-manager'){ ?>
                                        <strong  title="<?= ($request->role_name === 'sub-manager' ? __('created_by_sub') : ( (int)$request->sub_manager_status === 2 ? __('rejected_by_sub') : __('rejected_by_sub'))) ?>"><i class="icon-child"></i></strong>
                                    <?php } if($request->role_name === 'staff'){?>
                                        <strong  title="<?= __('created_by_staff')?>"><i class="icon-user-1"></i></strong>
                                    <?php } ?>
                                </td>
                                <td> <span class="requestStatus label <?= $status['class'] ?>"><?= $status['value'] ?></span></td>
                                <td><strong><?=  $this->Time->i18nFormat($request->created,'MM/dd/yyyy');?></strong></td><commit_msg>no message<commit_after><!-- Modal add department-->
<?php echo $this->element('Request/edit') ?>
<?php echo $this->element('Request/comment') ?>
<?php echo $this->element('Request/change_status') ?>
<!-- End div .md-modal .md-fade-in-scale-up -->

<!-- Page Heading Start -->
<div class="page-heading">
    <h1><i class='fa fa-table'></i> <?=__('request').' '.__('list')?></h1>
</div>
<!-- Page Heading End-->
<!-- Your awesome content goes here -->
<div class="row">
    <div class="col-md-12">
        <div class="widget">
            <div class="widget-content">

                <div class="data-table-toolbar">

                    <div class="row">

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

                            <form role="form">
                                <input type="text" class="form-control" placeholder="<?=__('search')?>...">
                            </form>
                        </div>
                        <div class="col-md-8">
                            <div class="toolbar-btn-action">
                                <div class="btn-group">
                                    <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
                                        <i class="fa fa-cog"></i> <?=__('action')?> <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu primary" role="menu">
                                        <li><a  data-modal="md-edit-request" class="md-trigger actionRequest" data-mode="add"   ><?=__('add_new')?></a></li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <?php  if(count($requests) && !empty($requests[0]->id)):?>
                <div class="table-responsive">
                    <table data-sortable class="table table-hover table-striped" id="listRequests">
                        <thead>
                        <tr>
                            <th><?=__('no')?></th>
                            <th><?=__('user')?></th>
                            <th><?=__('department')?></th>
                            <th><?=__('request_cate')?></th>
                            <th><?=__('title')?></th>
                            <th><?=__('request_approve_date')?></th>
                            <th><?=__('request_approve_by')?></th>
                            <th><?=__('status')?></th>
                            <th><?=__('create_date')?></th>
                            <th width="116px;" data-sortable="false"><?=__('action')?></th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach ($requests as $key => $request): ?>
                            <?php
                                $request->appr_date = $this->Time->i18nFormat($request->appr_date,'MM/dd/yyyy');
                                $request->payment_date = $this->Time->i18nFormat($request->payment_date,'MM/dd/yyyy');
                                $status = ['class'=>'label-danger','value'=>'Rejected','status' => false, 'rowclass'=> (round( ( strtotime( $request->appr_date ) - time() ) / 86400 ) <= 1) ? 'highlight-out-pending' : 'highlight-pending'];
                                if($request->role_name === 'top' || ((int)$request->department_id === 1 && $request->role_name === 'manager') || $request->status === 'approved'){
                                    $status = ['class'=>'label-success','value'=>'Approved','status' => false, 'rowclass'=>'highlight-success'];
                                }elseif ($request->status === 'rejected'){
                                    $status = ['class'=>'label-danger','value'=>'Rejected','status' => false, 'rowclass'=>'highlight-reject'];
                                }elseif ($request->status === 'returned'){
                                    $status = ['class'=>'label-return','value'=>'Returned','status' => false, 'rowclass'=>'highlight-return'];
                                }
                                else{
                                    $status = ['class' => 'label-warning', 'value' => 'Pending', 'status' => true, 'rowclass'=>$status['rowclass']];
                                }
                            ?>
                            <tr class="<?=$status['rowclass'];?>">
                                <td><?php echo $key+1;?></td>
                                <td><strong><?php echo $request->alias_name;?></strong></td>
                                <td><strong><?php echo $request->department_name;?></strong></td>
                                <td><strong><?php echo $request->categories_name;?></strong></td>
                                <td><strong><?php echo $request->title;?></strong></td>
                                <td><strong><?= $request->appr_date;?></strong></td>
                                <td>
                                    <?php if((int)$request->top_status === 1 || (int)$request->top_status === 2 || $request->role_name === 'top' ){?>
                                        <strong  title="<?= ($request->role_name === 'top' ? __('created_by_top') : ( (int)$request->top_status === 2 ? __('rejected_by_top') : __('approved_by_top')))?>"><i class="icon-person"></i></strong>
                                    <?php } if((int)$request->manager_status === 1 || (int)$request->manager_status === 2 ||  $request->role_name === 'manager'){ ?>
                                        <strong  title="<?= ($request->role_name === 'manager' ? __('created_by_manager') : ( (int)$request->manager_status === 2 ? __('rejected_by_manager') : __('approved_by_manager'))) ?>"><i class="icon-adult"></i></strong>
                                    <?php } if((int)$request->sub_manager_status === 1 || (int)$request->sub_manager_status === 2 ||  $request->role_name === 'sub-manager'){ ?>
                                        <strong  title="<?= ($request->role_name === 'sub-manager' ? __('created_by_sub') : ( (int)$request->sub_manager_status === 2 ? __('rejected_by_sub') : __('approved_by_sub'))) ?>"><i class="icon-child"></i></strong>
                                    <?php } if($request->role_name === 'staff'){?>
                                        <strong  title="<?= __('created_by_staff')?>"><i class="icon-user-1"></i></strong>
                                    <?php } ?>
                                </td>
                                <td> <span class="requestStatus label <?= $status['class'] ?>"><?= $status['value'] ?></span></td>
                                <td><strong><?=  $this->Time->i18nFormat($request->created,'MM/dd/yyyy');?></strong></td>
{'fraction_non_alphanumeric': 0.19671652681503102, 'fraction_numerical': 0.004961692812842028, 'mean_word_length': 1.4070951879171056, 'pattern_counts': {'":': 0, '<': 319, '<?xml version=': 0, '>': 445, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 40, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2489153', 'n_tokens_mistral': 3645, 'n_tokens_neox': 3524, 'n_words': 540}