<a title="Save Letters" href="#" class="dropdown-toggle" data-toggle="dropdown" style="text-decoration:none;">
    <i class="fa fa-database"></i>
    <?php if ($total_save_letter > 0) { ?>
        <span id="bage-noti-count-affiliate" class="badge badge-light total-affiliate_message" style="background-color:#e94b35;position: absolute;">
            <?php
                echo $total_save_letter;
             ?>
        </span>
    <?php } ?>
</a>
<?php if ($total_save_letter > 0) { ?>
    <div class="dropdown-menu dropdown-content width-350" id="total_affiliate_message">
        <div class="dropdown-content-heading">Save Letters</div>
        <ul class="media-list dropdown-content-body">
            <?php if (!empty($pdf_letters)) {
                foreach ($pdf_letters as $pdf_letter) {
                    $file_path = 'pdfletters/' . EPIC_AND_SERTG_DROPDOWN[$pdf_letter->velocity_type] . "/" . $pdf_letter->member_id . "/" . $pdf_letter->client_id . "/" . $pdf_letter->velocity_id;
                    $file_path .= "/" . $pdf_letter->file_path;
                    if (!is_file($file_path)) {
                        continue;
                    }
                    ?>
                    <li class="media" id="noti-message-<?php echo $pdf_letter->id; ?>">
                        <!--<div class="media-left">
                            <img src="<?php /*echo $this->Url->build('/rtgv3/images/placeholder.jpg'); */?>" class="img-circle img-sm" alt="">
                            <span class="badge bg-danger-400 media-badge">4</span>
                        </div>-->
                        <div class="media-body">
                            <a href="<?php echo $this->Url->build(array('controller'=>'PdfLetters','action' => 'index', $pdf_letter->client_id)); ?>" class="media-heading" id="media-heading-new">
                                <?php echo $this->Common->splitString(strip_tags(explode("<br/>",$pdf_letter->personal_info)[0]),15) ?><br>
                                <span class="text-muted">
                                    <?php echo $this->Common->getConvertedDate($pdf_letter->created_at); ?>
                                </span>
                            </a>

                        </div>
                        <div class="media-right">
                            <p style="white-space: nowrap;" class="media-annotation"><?php $days = $this->Common->daysBetweenDate(date('Y-m-d'),$pdf_letter->file_remove_date); echo  $days > 0 ? $days." day till":""; ?></p>
                            <!--<img src="<?php /*echo $this->request->webroot; */?>rtgv3/images/client_user.png" class="img-circle img-sm" alt="">-->
                        </div>
                    </li>
                    <?php
                }
            } ?>
        </ul>


    </div>
<?php } ?>