 
<?php
$user_id = $this->session->userdata('user_id');
// $this->cf->dd($person_detail);
?>

                <div class="col-sm-12 gray_ttc text-left" style="border-bottom: 2px solid #8CC73F;padding: 10px 0 10px 0;font-weight: bold">
                    <div class="col-sm-2" style="padding: 10px">Image</div>
                    <div class="col-sm-5" style="padding: 10px">Title</div>
                    <div class="col-sm-3" style="padding: 10px">Date</div>
                    <div class="col-sm-2" style="padding: 10px">Action</div>
                </div>
                <div class="col-sm-12"><br></div> 
<!--                Post image album part start-->
            <?php if(isset($post_images) && !empty($post_images)){ ?>
                <div class="col-sm-12 gray text-left" >
                    <div class="col-sm-2" style="padding: 10px 0 0 20px  ">
                        <img src="<?php echo base_url('content-library/'.$this->session->person_url.'/'.$post_last_image->image_location);?>" width="50px">
                    </div>
                    <div class="col-sm-5" style="padding: 10px 0 0 20px  ">
                        <a href="<?php echo base_url() ?>post-image-album">Post Image Album </a>
                    </div>
                    <div class="col-sm-offset-3 col-sm-2" style="padding: 10px 0 0 20px  ">
                        <a href="<?php echo base_url() ?>post-image-album" title="Details Album"><i class="fa fa-th"></i></a>
                    </div>
                </div>
                <div class="col-sm-12"><br></div>
            <?php } ?>
<!--                Post image album part End           -->
<!--                Profile image album part start              -->
            <?php if(isset($profile_images) && !empty($profile_images)){ ?>
                <div class="col-sm-12 gray text-left" >
                    <div class="col-sm-2" style="padding: 10px 0 0 20px  ">
                        <img src="<?php 
                                    if(isset($person_detail->person_image)){
                                        echo base_url('content-library/'.$this->session->person_url.'/'.$person_detail->person_image);
                                    }
                                    else{
                                        echo base_url('image/no_profile_picture.png');
                                    }
                                ?>" width="50px">
                    </div>
                    <div class="col-sm-5" style="padding: 10px 0 0 20px  ">
                        <a href="<?php echo base_url() ?>profile-image-album" title="Details Album"> Profile Image Album </a>
                    </div>
                    <div class="col-sm-offset-3 col-sm-2" style="padding: 10px 0 0 20px  ">
                        <a href="<?php echo base_url() ?>profile-image-album" title="Details Album"><i class="fa fa-th"></i></a>
                    </div>
                </div>
                <div class="col-sm-12"><br></div>
                <?php } ?>
<!--                Post image album part End           -->
                <?php
                foreach ($content_library as $content_library_value) {
                    if($content_library_value->post_type != 4){
                    ?>
                
                    <div class="col-sm-12 gray text-left" >
                        <?php
                        switch ($content_library_value->post_type) {
                            case 5:
                                ?>
                                <div class="col-sm-2" style="padding: 10px 0 0 20px  ">
                                    <a href="javascript:void(0)"
                                       onclick="downloadContentLibrary('<?php echo base_url() . 'download-content-library' ?>', '<?php echo $content_library_value->post_id; ?>')">
                                        <img src="<?php echo base_url() ?>image/home/video.png">
                                    </a>
                                </div>
                                <?php
                                break;

                            case 4:
                                ?>
                                <div class="col-sm-2" style="padding: 10px 0 0 20px  ">
                                    <a href="javascript:void(0)"
                                       onclick="downloadContentLibrary('<?php echo base_url() . 'download-content-library' ?>', '<?php echo $content_library_value->post_id; ?>')">
                                        <img height="50" width="50"
                                             src="<?php echo base_url() . 'content-library/' . $content_library_value->url . '/' . $content_library_value->post_details; ?>">
                                    </a>
                                </div>
                                <?php
                                break;
                            case 3:
                                ?>
                                <div class="col-sm-2" style="padding: 10px 0 0 20px  ">
                                    <?php
                                    $file_name = explode(".", $content_library_value->post_details);
                                    switch (strtolower($file_name[1])) {
                                        case 'pdf':
                                            ?>
                                            <a href="javascript:void(0)"
                                               onclick="downloadContentLibrary('<?php echo base_url() . 'download-content-library' ?>', '<?php echo $content_library_value->post_id; ?>')">
                                                <img src="<?php echo base_url() . 'image/home/pdf.png' ?>">
                                            </a>
                                            <?php
                                            break;
                                        case $file_name[1] == 'zip' || $file_name[1] == 'rar':
                                            ?>
                                            <a href="javascript:void(0)"
                                               onclick="downloadContentLibrary('<?php echo base_url() . 'download-content-library' ?>', '<?php echo $content_library_value->post_id; ?>')" >
                                                <img src=" <?php echo base_url() . 'image/home/rar.png' ?>">
                                            </a>
                                            <?php
                                            break;
                                        case $file_name[1] == 'doc' || $file_name[1] == 'docx':
                                            ?>
                                            <a href="javascript:void(0)" 
                                               onclick="downloadContentLibrary('<?php echo base_url() . 'download-content-library' ?>', '<?php echo $content_library_value->post_id; ?>')" >
                                                <img src=" <?php echo base_url() . 'image/home/word.png' ?>">
                                            </a>
                                            <?php
                                            break;
                                        case $file_name[1] == 'xls' || $file_name[1] == 'xlsx':
                                            ?>
                                            <a href="javascript:void(0)" 
                                               onclick="downloadContentLibrary('<?php echo base_url() . 'download-content-library' ?>', '<?php echo $content_library_value->post_id; ?>')" >
                                                <img src=" <?php echo base_url() . 'image/home/excel.png' ?>">
                                            </a>
                                            <?php
                                            break;
                                        case $file_name[1] == 'ppt' || $file_name[1] == 'pptx':
                                            ?>
                                            <a href="javascript:void(0)" 
                                               onclick="downloadContentLibrary('<?php echo base_url() . 'download-content-library' ?>', '<?php echo $content_library_value->post_id; ?>')" >
                                                <img src=" <?php echo base_url() . 'image/home/powerpoint.png' ?>">
                                            </a>
                                            <?php
                                            break;
                                        default :
                                            ?>
                                            <a href="javascript:void(0)"
                                               onclick="downloadContentLibrary('<?php echo base_url() . 'download-content-library' ?>', '<?php echo $content_library_value->post_id; ?>')" >
                                                <img src=" <?php echo base_url() . 'image/home/unknown.png' ?>">
                                            </a>
                                            <?php
                                            break;
                                    }
                                    ?>
                                </div>
                                <?php
                                break;
                        }
                        ?>

                        <div class="col-sm-5" style="padding: 10px 0 0 0  ">
                            <a href="<?php echo base_url() . 'view-content/' . $this->utility_model->encode_id($content_library_value->post_id, '/', 'Tt') . '/2'; ?>"><?php
                                if (strlen($content_library_value->post_file_original_name) > 20) {
                                    echo mb_substr($content_library_value->post_file_original_name, 0, 25, 'utf-8') . '...';
                                } else {
                                    echo $content_library_value->post_file_original_name;
                                }
                                ?></a>
                        </div>
                        <div class="col-sm-3" style="padding: 10px 0 0 0  "><?php
                            echo $this->utility_model->date_time_format_with_offset($content_library_value->post_date_time);
                            ?></div>
                        <div class="col-sm-2" style="padding: 10px 0 0 0" id="content_action<?php echo $content_library_value->post_id ?>">
                            <?php
                            if ($content_library_value->posted_by == $user_id) {
                                if ($content_library_value->post_status == 1) {
                                    ?>
                                    <a href="javascript:void(0)" onclick="changePostStatus('<?php echo base_url() . 'post/change_post_status/' . $content_library_value->post_id . '/inactive/content' ?>', 'content', '<?php echo $content_library_value->post_id ?>')">
                                        <i class="fa fa-user-times " title="Inactive"></i>
                                    </a>&nbsp;
                                <?php } else { ?>
                                    <a href="javascript:void(0)" onclick="changePostStatus('<?php echo base_url() . 'post/change_post_status/' . $content_library_value->post_id . '/active/content' ?>', 'content', '<?php echo $content_library_value->post_id ?>')">
                                        <i class="fa fa-user-plus " title="Active"></i>
                                    </a>&nbsp;
                                <?php } ?>
                                <a href="<?php echo base_url() . 'user/edit-post/' . $this->utility_model->encode_id($content_library_value->post_id, '/', 'Tt'); ?>" target="_blank">
                                    <i class="fa fa-edit" aria-hidden="true" title="edit"></i>
                                </a>&nbsp;&nbsp;
                                <a href="javascript:void(0)" onclick="changePostDelete('<?php echo base_url() . 'post/change_post_status/' . $content_library_value->post_id . '/delete/content' ?>', 'content', '<?php echo $content_library_value->post_id ?>')">
                                    <i class="fa fa-trash-o" title="Delete"></i>
                                </a>&nbsp;&nbsp;
                                <a href="<?php echo base_url() . 'view-content/' . $this->utility_model->encode_id($content_library_value->post_id, '/', 'Tt') . '/2'; ?>">
                                    <i class="fa fa-th" title="View"></i>
                                </a>&nbsp;&nbsp;
                            <?php } else { ?>
                                <a href="<?php echo base_url() . 'view-content/' . $this->utility_model->encode_id($content_library_value->post_id, '/', 'Tt') . '/2'; ?>" target="_blank">
                                    <i class="fa fa-th" title="View"></i>
                                </a>&nbsp;&nbsp;
                            <?php } ?>
                        </div>
                    </div>
                    <div class="col-sm-12"><br></div>
                <?php }}
                ?>           


                <div class="col-sm-12">
                    <br>
                </div>

                <!--            Pagination start            -->
                <?php
               
                    echo $pagination_link;
               ?>


