<?php $this->load->view('site/students/profile_header') ?>
<style>
    .prod_name{
        float: left;
    }
    .rtl .prod_name{
        float: right;
    }
</style>
<div class="flex-row-fluid ml-lg-8">
    <!--begin::Card-->
    <div class="card card-custom card-stretch">
        <div class="card-header py-3">
            <div class="card-title align-items-start flex-column" style="float: left;margin-bottom: 0px">
                <h3 class="card-label font-weight-bolder text-dark"><?= $this->lang->line('advs') ?></h3>
                <span class="text-muted font-weight-bold font-size-sm mt-1"><?= $this->lang->line('check_your'). ' ' .$this->lang->line('advs') ?></span>
            </div>
            <div class="clearfix"></div>
        </div>

<div class="card-body" style="overflow: scroll">
					<?php if (empty($announcments)) { ?>
                        <div class="alert alert-warning alert-dismissible">
                            <!--<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>-->
                            <div>
                                <?= $this->lang->line('no_msgs'); ?>
                            </div>
                        </div>
                    <?php } ?>

      
                <!--begin::Example-->
                <div class="example example-basic">
                    <div class="example-preview">
                        <!--begin::Timeline-->
                        <div class="timeline timeline-3">
                            <div class="timeline-items">
                                <?php $icon_color = array('text-danger','text-primary','text-warning','text-info');
                                $i=0;
                                foreach ($announcments as $ann) { ?>
                                    <div class="timeline-item">
                                        <div class="timeline-media">
                                            <i class="fa fa-envelope <?= $icon_color[$i] ?>"></i>
                                        </div>
                                        <div class="timeline-content">
                                            <div class="d-flex align-items-center justify-content-between mb-3">
                                                <div class="mr-2">
                                                    <a class="text-dark-75 text-hover-primary font-weight-bold prod_name"><?= $ann->product_name ?></a>
                                                    <span class="text-muted ml-2" style="float: left"><?= date('d F Y h:ma',strtotime($ann->date_added)) ?></span>
                                                    
                                                </div>
                                            
                                            </div>
                                            <p class="p-0"><?= $ann->msg ?></p>
                                        </div>
                                    </div>
                                <?php
                                $i++;
                                if($i==4){
                                    $i=0;
                                }
                                } ?>
                            </div>
                        </div>
                        <!--end::Timeline-->
                    </div>
                </div>
                <!--end::Example-->

            </div>

    </div>
</div>
<?php $this->load->view('site/students/profile_footer') ?>
<script>
    $(function () {
        $('.select2').select2({
            placeholder: "<?= $this->lang->line('select') ?>"
        });
    });
</script>
