
<div class="row " style="padding:10px 8px 0px  18px ">
    <?php
    $you_tube_regExp = '/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/';
    $vimo_regExp = '/(?:vimeo)\.com.*(?:videos|video|channels|)\/([\d]+)/i';
    $post_counter = 0;
    $total_public_note_alert = $this->post_model->total_public_note_alert_person_id($profile_person_id);
    $public_note_alert = $this->post_model->all_public_alert_person_id($profile_person_id, $post_counter);

    if ($public_note_alert) {
        ?>
        <div class="col-sm-12 gray_ttc text-left" style="border-bottom: 2px solid #8CC73F;padding: 0px 5px 0px 5px;font-weight: bold">
                <div class="col-sm-6" style="padding: 10px">Public Alert</div>
                <div class="col-sm-3" style="padding: 10px">Date</div>
                <div class="col-sm-3" style="padding: 10px">Action</div>
        </div>
        <div id="alert">
            <?php
            foreach ($public_note_alert as $note_alert_value) {
                ?>
                <div class="col-sm-12 gray text-left">

                        <div class="col-sm-6" style="padding:10px 9px 0px  19px ">
                            <p class="text-justify" <?php
                                    echo 'style="color: #a70b0c"';
                                ?>
                                id="post_detail<?php echo $note_alert_value->post_id ?>" >
                                <?php
                                    $post_original_value = $this->tt_post->get_post_details($note_alert_value->post_details);
                                   if (strlen($post_original_value) > 100) {
                                       $limited_string = mb_substr($post_original_value, 0, 100, 'utf-8');
                                       echo $this->cf->view_emoticons($limited_string);
                                ?>
                                    <a href="javascript:void(0)" style="padding-left: 10px;"
                                       onclick="viewDetails('<?php echo base_url() . 'welcome/view_post_details/' . $note_alert_value->post_id . '/post' ?>', 'post_detail', '<?php echo $note_alert_value->post_id ?>')" >
                                        more...
                                    </a>
                                <?php
                                    } else {
                                        echo $this->cf->view_emoticons($post_original_value);
                                    }
                                ?>

                                <span>
                                    <?php
                                    $post_url[$note_alert_value->post_id] = $this->post_model->select_post_comment_url($note_alert_value->post_id, 1);
                                    if ($post_url[$note_alert_value->post_id]) {
                                        $url_value = explode("URL: ", $post_url[$note_alert_value->post_id]->post_comment_url_info);
                                        if (preg_match($you_tube_regExp, $url_value[1])) {
                                            ?>
                                            <div class="embed-responsive embed-responsive-16by9">
                                                <iframe class="embed-responsive-item" width="420" height="345" webkitallowfullscreen mozallowfullscreen allowfullscreen
                                                        src="<?php echo $url_value[1]; ?>">
                                                </iframe>
                                            </div> 
                                            <?php
                                        } else if (preg_match($vimo_regExp, $url_value[1])) {
                                            ?>
                                            <div class="embed-responsive embed-responsive-16by9">
                                                <iframe class="embed-responsive-item"  src="<?php echo $url_value[1]; ?>" 
                                                        width="420" height="345" 
                                                        frameborder="0" 
                                                        webkitallowfullscreen mozallowfullscreen allowfullscreen>
                                                </iframe>
                                            </div>     
                                            <?php
                                        } else {
                                            ?>
                                            <a href="<?php echo $url_value[1]; ?>" target="_blank" style="color: #545457">
                                                <?php echo $url_value[2]; ?>
                                            </a>
                                            <?php
                                        }
                                    }
                                    ?>
                                </span>

                            </p>
                        </div>
                        <div class="col-sm-3" style="padding: 10px 0 0 0  ">
                            <?php
                            echo $this->utility_model->date_time_format_with_offset($note_alert_value->post_date_time);
                            ?>
                        </div>
                        <?php
                            $posted_public_alert_link = base_url() . 'view-content/' . $this->utility_model->encode_id($note_alert_value->post_id, '/', 'Tt') . '/1';
                            $this->session->set_flashdata('$posted_public_alert_details',$note_alert_value->post_details);
                        ?>
                        <div class="col-sm-3" style="padding: 10px 0 0 0  ">
                            <a class="btn btn-facebook-custom" title="Share in Facebook" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode($posted_public_alert_link); ?>">
                                <i class="fa fa-facebook" aria-hidden="true"></i>
                            </a>
                            <a class="btn btn-twitter-custom" title="Share in Twitter" target="_blank" href="https://twitter.com/intent/tweet?url=<?php echo $posted_public_alert_link; ?>">
                                <i class="fa fa-twitter" aria-hidden="true"></i>
                            </a>
                            <a class="btn btn-google-custom" title="Share in G+" target="_blank" href="https://plus.google.com/share?url=<?php echo urlencode($posted_public_alert_link); ?>">
                                <i class="fa fa-google-plus"></i>
                            </a>
                            <a class="btn btn-linkedin-custom" title="Share in Linkedin" target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo urlencode($posted_public_alert_link); ?>&summary=<?php echo $note_alert_value->post_details; ?>">
                                 <i class="fa fa-linkedin"></i>
                            </a>
                        </div>
                </div>

                <?php
            }
            ?>
                <?php
                            if ($total_public_note_alert->total_note_alert > 5) {
                                ?>
                                <div class="col-sm-12">
                                    <?php
                                    if ($post_counter >= 5) {
                                        ?>
                                        <a href="javascript:void(0)"
                                           class="pull-left">
                                            Previous
                                        </a>
                                    <?php } ?>
                                    <a href="javascript:void(0)"
                                       onclick="nextPostValue('<?php echo base_url() . 'welcome/view_next_post_value/' . $total_public_note_alert->posted_by . '/' . ($post_counter + 5) . '/alert' ?>', 'alert')"
                                       class="pull-right">
                                        Next
                                    </a>
                                </div>
                            <?php } ?>

        </div>
        <?php
    }
    ?>
</div>