<div class="row " style="padding:10px 8px 0px  18px ">
    <?php
    $post_counter = 0;
    $total_public_assaignment = $this->post_model->total_public_assaignment_person_id($profile_person_id);
    $public_assaignment = $this->post_model->all_public_assignment_person_id($profile_person_id, $post_counter);
    if ($public_assaignment) {
        //$this->cf->debug($public_assaignment);
        ?>
        <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-2" style="padding: 10px">Image</div>
            <div class="col-sm-4" style="padding: 10px">Title</div>
            <div class="col-sm-3" style="padding: 10px">Date</div>
            <div class="col-sm-3" style="padding: 10px">Action</div>
        </div>

        <div id="assignment">
            <?php
            foreach ($public_assaignment as $assaignment_value) {
                ?>
                <div class="col-sm-12 gray text-left ">
                    <div class="col-sm-2" style="padding:10px 9px 0px  19px" >
                        <?php
                        $file_name = explode(".", $assaignment_value->post_details);
                        switch (strtolower($file_name[1])) {
                            case 'pdf':
                                ?>
                                <a href="javascript:void(0)" 
                                   onclick="downloadPublicContentLibrary('<?php echo base_url() . 'download-public-content-library' ?>', '<?php echo $assaignment_value->post_id; ?>')" >
                                    <img src=" <?php echo base_url() . 'image/assignment/pdf.png' ?>">
                                </a>
                                <?php
                                break;
                            case $file_name[1] == 'zip' || $file_name[1] == 'rar':
                                ?>
                                <a href="javascript:void(0)" 
                                   onclick="downloadPublicContentLibrary('<?php echo base_url() . 'download-public-content-library' ?>', '<?php echo $assaignment_value->post_id; ?>')" >
                                    <img src=" <?php echo base_url() . 'image/assignment/rar.png' ?>">
                                </a>
                                <?php
                                break;
                            case $file_name[1] == 'doc' || $file_name[1] == 'docx':
                                ?>
                                <a href="javascript:void(0)" 
                                   onclick="downloadPublicContentLibrary('<?php echo base_url() . 'download-public-content-library' ?>', '<?php echo $assaignment_value->post_id; ?>')" >
                                    <img src=" <?php echo base_url() . 'image/assignment/word.png' ?>">
                                </a>
                                <?php
                                break;
                            case $file_name[1] == 'xls' || $file_name[1] == 'xlsx':
                                ?>
                                <a href="javascript:void(0)" 
                                   onclick="downloadPublicContentLibrary('<?php echo base_url() . 'download-public-content-library' ?>', '<?php echo $assaignment_value->post_id; ?>')" >
                                    <img src=" <?php echo base_url() . 'image/assignment/excel.png' ?>">
                                </a>
                                <?php
                                break;
                            case $file_name[1] == 'ppt' || $file_name[1] == 'pptx':
                                ?>
                                <a href="javascript:void(0)" 
                                   onclick="downloadPublicContentLibrary('<?php echo base_url() . 'download-public-content-library' ?>', '<?php echo $assaignment_value->post_id; ?>')" >
                                    <img src=" <?php echo base_url() . 'image/assignment/powerpoint.png' ?>">
                                </a>
                                <?php
                                break;
                            default :
                                ?>
                                <a href="javascript:void(0)" 
                                   onclick="downloadPublicContentLibrary('<?php echo base_url() . 'download-public-content-library' ?>', '<?php echo $assaignment_value->post_id; ?>')" >
                                    <img src=" <?php echo base_url() . 'image/assignment/unknown.png' ?>">
                                </a>
                                <?php
                                break;
                        }
                        ?>

                    </div>
                    <div class="col-sm-4 text-justify " style="padding: 10px 0 0 0  ">
                        <?php echo $assaignment_value->post_file_original_name ?>
                    </div>
                    <div class="col-sm-3" style="padding: 10px 0 0 0  ">
                        <?php
                            echo $this->utility_model->date_time_format_with_offset($assaignment_value->post_date_time);
                        ?>
                    </div>
                    <?php
                        $posted_public_assignment_link = base_url() . 'view-content/' . $this->utility_model->encode_id($assaignment_value->post_id, '/', 'Tt') . '/2';
                    ?>
                    <div class="col-sm-3 text-left" style="color: #80c12c; 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_assignment_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?text=<?php echo $posted_public_assignment_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_assignment_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_assignment_link); ?>&title=<?php echo $profile_name.' posted file on TalhaTraining'; ?>&summary=<?php echo $assaignment_value->post_file_original_name; ?>">
                             <i class="fa fa-linkedin"></i>
                        </a>
                    </div>
                </div>
            <?php
            }
            ?>
            <?php
            if ($total_public_assaignment->total_assignment > 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_assaignment->posted_by . '/' . ($post_counter + 5) . '/assignment' ?>', 'assignment')"
                       class="pull-right">
                        Next
                    </a>
                </div>
        <?php } ?>

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

