<link rel="stylesheet" href="<?php echo base_url();?>assets/css/cust_paginition.css" type="text/css" />
<div class="layout-app">
    <div class="container"><div class="row row-app">
            <div class="col-md-12">
                <div class="col-separator col-separator-first col-unscrollable bg-none">
                    <div class="col-table">
                        <div class="row">
                            <div class="">
                                <div class="widget">
                                    <div class="widget-head">
                                        <h4 class="heading">Upcoming Renewals</h4>
                                        <div align="right"><h4 class="heading" align="right">Total Renewals: <?php echo $intTotal;?></h4></div>
                                    </div>
                                    <div class="widget-body">
                                        <form method="" action="" name="search_sub">
                                            <label>Search Renewal</label>
                                                <div>
                                                    <div style="float: left;margin-right: 10px">
                                                        <input class="form-control" type="text" style="background-color: #A9A9A9;color: white;width:250px !important;" placeholder="Enter Name / Email / Magazine Code" value="<?php echo $strSearchKey; ?>" name="search_value" size="45"/>
                                                        <input id="current_page" class="form-control" type="hidden" value="1">
                                                    </div>
                                                    <div style="">
                                                        <button class="btn btn-primary" type="submit">Search</button>
                                                    </div>
                                                </div>

                                        </form>
                                    <div class="innerAll inner-2x">
                                        <?php
                                        if (count($magazine_renewals) > 0) { ?>
                                        <table class="table table-white table-vertical-center margin-none table-striped footable">
                                            <thead>
                                            <tr>
                                                <th  data-class="highlight" class="text-center">Subscriber Name</th>
                                                <th data-hide="phone" class="text-center">Email</th>
                                                <th data-hide="phone" class="text-center">Phone</th>
                                                <th class="text-center">Magazine Code</th>
                                                <th class="text-center">Expiry On</th>
                                                <th class="text-center">Send Email</th>
                                                <th class="text-center">Renew</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <?php foreach($magazine_renewals as $magazineRenewals) {?>
                                                <tr>
                                                    <td class="text-justify" ><?php echo ucwords($magazineRenewals['first_name']." ".$magazineRenewals['last_name']);?></td>
                                                    <td class="text-justify" ><a href="#send_individual_mail" data-toggle="modal" onclick="return fnSendIndividualMails('<?php echo $magazineRenewals['email']; ?>')"><?php echo $magazineRenewals['email']; ?></a></td>
                                                    <td class="text-justify"><?php echo $magazineRenewals['phone']; ?></td>
                                                    <td class="text-center"><?php echo $magazineRenewals['magazine_code']; ?></td>
                                                    <td class="text-center"><?php echo date("d M Y", strtotime($magazineRenewals['subscription_end_on'])); ?></td>
                                                    <td class="text-center"><a href="#send_individual_mail" data-toggle="modal" onclick="return fnSendIndividualMails('<?php echo $magazineRenewals['email']; ?>')"><i class="fa fa-2x fa-envelope"></i></a></td>
                                                    <td class="text-center"><a href="<?php echo base_url();?>index.php/subscriber/preview/?user_id=<?php echo base64_encode($magazineRenewals['subscriber_id']); ?>" ><i class="fa fa-fw fa-refresh"></i></i></a></td>
                                                </tr>
                                            <?php } ?>
                                            </tbody>
                                        </table>
                                            <div class="text-center innerAll border-top pagination margin-none" align = "center">
                                                <?php echo $pagination; ?>
                                            </div>
                                        <?php } else {?>
                                            <div class="text-center innerAll border-top pagination margin-none" align = "center">
                                                Sorry, No renewals yet!!
                                            </div>
                                        <?php } ?>

                                        <div class="col-separator-h clearfix"></div>
                                    </div>
                                    <!-- // END TRENDS -->
                                </div>
                                <div class="col-separator-h"></div>
                            </div>
                        </div>
                        <div class="col-separator-h"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
    <div class="modal fade" id="send_individual_mail" data-backdrop="static">
        <div class="modal-dialog">
            <div class="modal-content" id="individual_mail">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <form action="<?php echo base_url();?>index.php/subscriber/fnSendIndividualMailAttachments" method="post" enctype="multipart/form-data" >
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                <h3 class="modal-title" align="left">Send Mail</h3>
                            </div>
                            <div class="modal-body">
                                <div class="innerAll">
                                    <div class="innerLR">
                                        <div class="form-group mmar">
                                            <label  class="col-sm-3 control-label text-left">To: </label>
                                            <div class="col-sm-7">
                                                <input type="text" class="form-control " name = "recipient" id = "recipient" value="" readonly/>
                                            </div>
                                        </div>
                                        <div style="clear: both"></div>
                                        <div class="form-group mmar">
                                            <label  class="col-sm-3 control-label text-left">Subject: </label>
                                            <div class="col-sm-7">
                                                <input type="text" class="form-control " name = "mail_subject" id = "mail_subject" value=""/>
                                            </div>
                                        </div>
                                        <div style="clear: both"></div>
                                        <div class="form-group mmar">
                                            <label  class="col-sm-3 control-label text-left">Message: </label>
                                            <div class="col-sm-9">
                                                <textarea class="form-control" id="message_desc" name="message_desc" ></textarea>
                                            </div>
                                        </div>
                                        <div style="clear: both"></div>
                                        <div class="form-group mmar">
                                            <label  class="col-sm-3 control-label text-left">Attachment: </label>
                                            <div class="col-sm-9">
                                                <input type="file" name="attachment_for_file"> &nbsp; <small>Attach document</small>
                                            </div>
                                        </div>
                                        <div style="clear: both"></div>
                                        <div class="form-group mmar">
                                            <div class="col-sm-offset-4 col-sm-8">
                                                <input type="hidden" id="system_base_url" value="<?php echo base_url();?>">
                                                <button type="submit" class="btn btn-primary" id="send_individual_mail">Submit</button>
                                            </div>
                                        </div>
                                        <div style="clear: both"></div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="<?php echo base_url(); ?>assets/library/jquery/jquery.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/subscriber.js"></script>
