<?php
$person_id = $this->session->userdata('person_id');
$profile_id = $this->session->userdata('profile_id');
$person_info = $this->person_model->get_single_person_information_by_person_id($person_id);
if ($person_info) {
    $person_role = $person_info->person_role;
    $person_first_name = $person_info->person_first_name;
    $person_url = $person_info->url;
}
?>
<?php if (!$person_id || $person_role == 1 || $person_role == 2 || $person_role == 6) { ?>
    <nav class="navbar yamm navbar-default navbar-fixed-top" id="ttc_top_menu">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a href="<?php echo base_url(); ?>"><img src="<?php echo base_url()?>image/logo.png" style="max-width: 41px;max-height: 50px" class="img-responsive" alt="TTC LOGO"/></a>
            </div>

            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">


                <?php
                $i = 0;
                foreach ($header_menu as $header_menu_value) {
                    ++$i;
                    ?>
                    <ul class="nav navbar-nav">
                        <?php
                        if ($child_menu[$header_menu_value->menu_id]) {
                            echo '<li class="dropdown" id="mega_menu_main">';
                        } else {
                            echo '<li>';
                        }
                        ?>
                        <a href="<?php echo base_url() . $header_menu_value->url; ?>"
                        <?php
                        if ($child_menu[$header_menu_value->menu_id]) {
                            echo 'class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"';
                        }
                        ?> >
                            <span onclick="getDropMenu()"><?php echo $header_menu_value->menu_name; ?></span>
                            <?php
                            if ($child_menu[$header_menu_value->menu_id]) {
                                echo '<span class="caret"></span>';
                            }
                            ?>

                        </a>

                        <script>

                            $(document).ready(function () {
                                amazonmenu.init({
                                    menuid: "mysidebarmenu" + "<?php echo $i; ?>"
                                });
                            });
                        </script>



                        <!------------------------------Start Child Menu---------------------------->
                        <ul class="dropdown-menu" id="megaMenuLeftSide"> 
                            <li>
                                <!-- Content container to add padding -->
                                <div class="yamm-content mega-main-menu" >
                                    <div class="row RowMegaMenu">
                                        <!-- Customized mega menu start here -->
                                        <nav id="mysidebarmenu<?php echo $i; ?>" class="amazonmenu">
                                            <ul> 
                                                <?php
                                                foreach ($child_menu[$header_menu_value->menu_id] as $child_menu_value) {
                                                    ?>
                                                    <li 
                                                    <?php
                                                    if ($child_menu_array[$header_menu_value->menu_id][0] == $child_menu_value->menu_id) {
                                                        echo 'class="selected"';
                                                    }
                                                    ?>>
                                                        <a href="javascript:void(0)" >
                                                            <?php echo $child_menu_value->menu_name; ?>
                                                        </a>



                                                        <!---------------Start Child Menu with section---------------------------------->
                                                        <?php
                                                        if ($header_section[$child_menu_value->menu_id]) {
                                                            ?>
                                                            <div id="megaMenuRightSide" style="background-color:#E0EEE1;margin-top: -25px;
                                                            <?php
                                                            if ($child_menu_array[$header_menu_value->menu_id][0] == $child_menu_value->menu_id) {
                                                                echo 'display:block;';
                                                            }
                                                            ?>
                                                                 " class="sub-mega">
                                                                <h3 style="color: #fff;font-size: 22px;text-align: left !important;padding-left: 10px" ><i id="megaMenuBackBtn" style="font-size: 25px;cursor: pointer;display: none" class="fa fa-angle-left megaMenuBackBtn"> </i><span id="ttMenuNam"> <?php echo $child_menu_value->menu_name; ?></span></h3>
                                                                <!--<hr/>-->

                                                                <?php
                                                                foreach ($header_section[$child_menu_value->menu_id] as $section_value) {
                                                                    ?>
                                                                    <div style="width: 33%; float: left;" id="megaMenuRightSideSection">
                                                                        <ul>
                                                                            <li style="font-size: 16px;
                                                                                color:#fff;opacity: 1;
                                                                                font-weight: bold;padding: 10px">
                                                                                <?php echo $section_value->menu_section ?>
                                                                            </li>
                                                                            <?php
                                                                            foreach ($child_menu_with_section[$section_value->menu_section][$section_value->parent_menu_id] as $child_section_value) {
                                                                                ?>
                                                                                <li>
                                                                                    <a href="<?php echo base_url() . $child_section_value->url; ?>">
                                                                                        <?php echo $child_section_value->menu_name; ?>
                                                                                    </a> 
                                                                                </li>
                                                                                <?php
                                                                            }
                                                                            ?>

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

                                                            </div>
                                                            <?php
                                                        }
                                                        ?>
                                                        <!---------------END Child Menu with section---------------------------------->



                                                    </li>
                                                    <?php
                                                }
                                                ?>
                                                <li><hr/></li>
                                                <li><a href="<?php echo base_url() . $header_menu_value->url; ?>">Browse All</a></li>
                                            </ul>
                                        </nav>
                                        <!-- Customized mega menu start here -->
                                    </div>
                                </div>
                            </li>
                        </ul>

                        <!------------------------------END Child Menu---------------------------->



                        </li>
                    </ul>
                <?php }
                ?>
                <div id="tt-search-area" class="nav navbar-nav " >

                    <ul class="test nav navbar-nav">
                        <form class="navbar-form navbar-left mobileViewSearch" role="search">
                            <div class="input-group searchArea">
                                <?php
                                if (isset($course_value_for_search)) {
                                    if ($course_value_for_search == 1) {
                                        ?>
                                        <input type="text" 
                                               class="form-control" 
                                               id="search-input"
                                               oninput="searchCourses(this.value,'<?php echo base_url() . 'view-search-courses' ?>')"
                                               placeholder="Search Course here..." 
                                               aria-describedby="basic-addon1">
                                               <?php
                                           } else if ($course_value_for_search == 2) {
                                               ?>
                                        <input type="text" 
                                               class="form-control" 
                                               id="search-input"
                                               oninput="searchVideoCourse(this.value,'<?php echo base_url() . 'view-searched-video-courses' ?>')"
                                               placeholder="Search Video Course here..." 
                                               aria-describedby="basic-addon1">
                                               <?php
                                           } else if ($course_value_for_search == 3) {
                                               ?>
                                        <input type="text" 
                                               class="form-control" 
                                               id="search-input"
                                               oninput="viewSearchBatch(this.value,'<?php echo $person_id; ?>','<?php echo base_url() . 'view-searched-batch' ?>')"
                                               placeholder="Search Video Course here..." 
                                               aria-describedby="basic-addon1">
                                               <?php
                                           } else if ($course_value_for_search == 4) {
                                               ?>
                                        <input type="text" 
                                               class="form-control" 
                                               id="search-input"
                                               oninput="searchALLVideoCourse(this.value,'<?php echo base_url() . 'all-video-course-search' ?>')"
                                               placeholder="Search Video Course here..." 
                                               aria-describedby="basic-addon1">
                                        <?php
                                           } else if ($course_value_for_search == 5) {
                                               ?>
                                        <input type="text" 
                                               class="form-control" 
                                               id="search-input"
                                               oninput="search_all_video_course(this.value,'<?php echo base_url() . 'search-all-video-course' ?>')"
                                               placeholder="Search Video Course here..." 
                                               aria-describedby="basic-addon1">
                                               <?php
                                           } else {
                                               ?>
                                        <input type="text" 
                                               class="form-control " 
                                               id="search-input"
                                               oninput="getsearchValue(this.value,'<?php echo base_url() . 'view-searched-information' ?>')"
                                               placeholder="Search here..." 
                                               aria-describedby="basic-addon1">


                                        <?php
                                    }
                                } else {
                                    ?>
                                    <input type="text" 
                                           class="form-control " 
                                           id="search-input"
                                           oninput="getsearchValue(this.value,'<?php echo base_url() . 'view-searched-information' ?>')"
                                           placeholder="Search here..." 
                                           aria-describedby="basic-addon1">
                                       <?php } ?>
                                <span class="input-group-addon" id="basic-addon1"><i class="fa fa-search"></i></span>

                                <!--view search part-->
                                <div id="searchContainer" class="searchdivContainer" style="display: none"></div>
                            </div>
                        </form>
                    </ul>
                </div>
                <?php 
                    if($person_id != 1){
                ?>
                <ul class="nav navbar-nav navbar-right">
                    <li class="active" id="signInUp">
                        <a href="<?php echo base_url() . 'sign-in'; ?>" class="btn btn-success">
                            <i class="fa fa-user-plus"></i> Sign in /Sign up
                        </a>
                    </li>
                </ul>
                    <?php }?>
            </div>
        </div>
    </nav>
<?php } else if ($person_id && $person_role != 1 && $person_role != 2 && $person_role != 6) { ?>



    <nav class="navbar yamm navbar-default navbar-fixed-top" id="ttc_top_menu">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a href="<?php echo base_url(); ?>"><img src="<?php echo base_url()?>image/logo.png" class="img-responsive" style="float: left;width: 41px;height: 50px" alt="TT LOGO" title="Talha Training"/></a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse padding-zero" id="bs-example-navbar-collapse-1">

                <ul class="nav navbar-nav"  >
                    <li class="text-center padding-zero margin-zero person_first_name">
                        <a href="<?php echo base_url() . $person_url . '/profile'; ?>" class="padding-zero user_image"> <i class="fa fa-user fa-2x"> </i> 
                            
                            <?php 
                            if(strlen($person_first_name) < 30){
                            echo $person_first_name;                  
                            }
                            else{
                                //echo character_limiter($person_first_name, 15);
                                echo substr($person_first_name, 0, 30).'.'.' '.'.'.' '.'.';
                            }
                            echo '</a>';
                            
                            ?>
                    </li>
                </ul>

                <ul class="test nav navbar-nav col-sm-offset-2 mobile_dashboard_serach_width" style="float: left;">
                    <form class="navbar-form navbar-left mobile_dashboard_serach_border" role="search">
                        <div class="input-group" id="tt-search-area">
                            <?php
                            if (isset($course_value_for_search)) {
                                if ($course_value_for_search == 1) {
                                    ?>
                                    <input type="text" 
                                           class="form-control" 
                                           id="search-input"
                                           oninput="searchCourses(this.value,'<?php echo base_url() . 'view-search-courses' ?>')"
                                           placeholder="Search Course here..." 
                                           aria-describedby="basic-addon1">
                                           <?php
                                       } else if ($course_value_for_search == 2) {
                                           ?>
                                    <input type="text" 
                                           class="form-control" 
                                           id="search-input"
                                           oninput="searchVideoCourse(this.value,'<?php echo base_url() . 'view-searched-video-courses' ?>')"
                                           placeholder="Search Video Course here..." 
                                           aria-describedby="basic-addon1">
                                           <?php
                                       } else if ($course_value_for_search == 3) {
                                           ?>
                                    <input type="text" 
                                           class="form-control" 
                                           id="search-input"
                                           oninput="viewSearchBatch(this.value,'<?php echo $person_id; ?>','<?php echo base_url() . 'view-searched-batch' ?>')"
                                           placeholder="Search batch here..." 
                                           aria-describedby="basic-addon1">
                                           <?php
                                       } else {
                                           ?>
                                    <input type="text" 
                                           class="form-control " 
                                           id="search-input"
                                           oninput="getsearchValue(this.value,'<?php echo base_url() . 'view-searched-information' ?>')"
                                           placeholder="Search here..." 
                                           aria-describedby="basic-addon1">


                                    <?php
                                }
                            } else {
                                ?>
                                <input type="text" 
                                       class="form-control " 
                                       id="search-input"
                                       oninput="getsearchValue(this.value,'<?php echo base_url() . 'view-searched-information' ?>')"
                                       placeholder="Search here..." 
                                       aria-describedby="basic-addon1">
                                   <?php } ?>
                            <span class="input-group-addon" id="basic-addon1"><i class="fa fa-search"></i></span>

                            <!--view search part-->
                            <div id="searchContainer" class="searchdivContainer" style="display: none"></div>
                        </div>
                    </form>
                </ul>



                <ul class=" nav navbar-nav navbar-right notificationsSettingArea" id="notification_menu">

                    <li class="mobileHomeIconWidth" >
                        <div  style="margin-top: 12px;cursor: pointer">
                            <span   style="color: #777;padding-right: 20px">
                                <a href="<?php echo base_url() ?>" title="Home"> <i style="font-size: 16px" class="fa fa-home"></i></a>
                            </span>
                        </div>
                    </li>

                   <!-- <li class="mobileIconWidth" >
                        <div  style="margin-top: 12px;cursor: pointer">
                            <span   style="color: #777;padding-right: 20px">
                                <a href="<?php //echo base_url() ?>video-course" title="Video Course" target="_blank"> <i style="font-size: 16px" class="fa fa-file-video-o"></i></a>
                            </span>
                        </div>
                    </li> -->

                    <li class="mobileIconWidth" >
                        <div  style="margin-top: 12px;cursor: pointer">
                            <span   style="color: #777;padding-right: 20px">
                                <a href="<?php echo base_url() ?>course" title="Course"  target="_blank"> <i style="font-size: 16px" class="fa fa-book"></i></a>
                            </span>
                        </div>
                    </li>


                    <!-- start notification work by afrin jahan noumin && MD Jaherul Islam(17-07-16) -->
                    <li class="mobileNotificationIconWidth" >
                        <?php
                        $total_unseen_notification = $this->notification_model->get_total_unseen_notification($person_id); //for pick all unseen notification
                        ?>
                        <div  style="margin-top: 12px;cursor: pointer">
                            <div id="notification_detail">
                                <span  id="notificationLink" style="color: #80c12c;padding-right: 20px">
                                    <i class="fa fa-bell-o" ></i>
                                    <?php
                                    if ($total_unseen_notification > 0) {
                                        ?>
                                        <sup style="color: red"> 
                                            <strong id="totalUnseenNotification">
                                                <?php
                                                echo $total_unseen_notification;
                                                ?>
                                            </strong>
                                        </sup> 
                                    <?php } ?>
                                </span>

                                <div id="notificationContainer">
                                    <div id="notificationTitle">Notifications <a id="mark_all_as_read" href='javascript:void(0)'><span class="text-right">Mark all as read</span></a></div>
                                    <div id="notificationsBody" class="notifications">
                                        <?php
                                        $data = Array();
                                        $notification_data = $this->notification_model->get_all_notification_data($data, $person_id, '', 0, 5);
                                        
                                        if ($notification_data['all_notification']) {
                                            foreach ($notification_data['all_notification'] as $val_notification) {
                                                ?>
                                                <ul id="viewSingleLeftnotification<?php echo $val_notification->notification_id ?>" class="padding-zero <?php echo ($notification_data['notification_seen_info'][$val_notification->notification_id] == 2) ? 'deep_green' : '' ?>" style="font-size: 13px;">
                                                    <li> 
                                                        <span class="col-lg-12 padding-zero">
                                                            <span class="col-lg-2" style="padding-top: 10px;">
                                                                <?php
                                                                if (in_array($notification_data['notify_by_info'][$val_notification->notification_id]->person_role, Array(1, 2, 6, 8, 9))) {
                                                                    ?>
                                                                    <img class="media-object" height="40" width="40" src="<?php echo base_url() ?>images/logo-50.png" alt="logo">
                                                                    <?php
                                                                } else {
                                                                    if ($notification_data['notify_by_info'][$val_notification->notification_id]->person_image) {
                                                                        ?>
                                                                        <img class="media-object " height="40" width="40"
                                                                             src="<?php echo base_url() . 'content-library/' . $notification_data['notify_by_info'][$val_notification->notification_id]->url . '/' . $notification_data['notify_by_info'][$val_notification->notification_id]->person_image ?>" alt="logo">
                                                                             <?php
                                                                         } else {
                                                                             ?>
                                                                        <img class="media-object" height="40" width="40" src="<?php echo base_url() ?>images/logo-50.png" alt="logo">
                                                                        <?php
                                                                    }
                                                                }
                                                                ?>
                                                            </span>
                                                            <span class="col-lg-10" style="padding-top: 10px;">
                                                                <?php
                                                                echo $notification_data['notification_message'][$val_notification->notification_id];
                                                                ?>
                                                            </span>
                                                        </span>
                                                        <span class="text-left" style="padding-left: 75px;">
                                                            <?php
                                                            echo $notification_data['notification_date_time'][$val_notification->notification_id];
                                                            ?>
                                                        </span>
                                                    </li>  
                                                </ul>
                                                <hr>
                                                <?php
                                            }
                                        } else {
                                            ?>
                                            <ul id="viewSingleLeftnotification" style="font-size: 13px;">
                                                There is no notification
                                            </ul>
                                            <?php
                                        }
                                        ?>
                                    </div>
                                    <div id="notificationFooter">
                                        <a href="<?php echo base_url('user/view-notification'); ?>" class="text-center">More Notifications
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </li>
                    <!-- end notification work by afrin jahan noumin && MD Jaherul Islam(17-07-16) -->


                    <li class="mobileSettingIconWidth">
                        <div class="dropdown" style="margin-top: 12px;cursor: pointer">
                            <span class=" dropdown-toggle" role="menu" id="TTdropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="color: #80c12c;">
                                <!--Setting--><i class="fa fa-wrench"></i>
                                <span class="caret"></span>
                            </span>
                            <ul id="dashboardSetting" class="dropdown-menu" aria-labelledby="TTdropdownMenu1"  style="background: #F2F9EA !important;border: none">
                                <li><a href="<?php echo base_url() . $person_url . '/profile'; ?>">View Profile</a></li>
<!--                                <li><a href="<?php //echo base_url() . $person_url . '/edit-profile'; ?>">Edit Profile</a></li>-->
                                <li><a href="<?php echo base_url() . 'logout'; ?>">Logout</a></li>
                            </ul>
                        </div>
                    </li>  
                </ul>

            </div>
        </div>
    </nav>
<?php } ?>
<input type="hidden" id="basUrl" value="<?php echo base_url(); ?>">


<!--</div>-->

<!-- /.container-fluid -->

<script type="text/javascript" >

    $(document).ready(function ()
    {
        $(".searchdivContainer").hide();
//        $("#tt-search-area").keyup(function () {
//            $("#searchContainer").slideDown('slow');
//            return false;
//        });
//
        $(document).click(function ()
        {
            $(".searchdivContainer").hide();
        });
////Popup Click
//        $("#searchContainer").click(function ()
//        {
//             $(".searchdivContainer").show();
//        });
//
    });</script>

<style>

    #searchContainer {
        background-color: #F2F9EA;
        border: 1px solid rgba(100, 100, 100, .4);
        /*-webkit-box-shadow: 0 3px 8px rgba(0, 0, 0, .25);*/
        overflow: visible;
        position: absolute;
        top: 30px;
        /*        margin-left: 115px;*/
        margin-left: -438px;
        width: 400px;
        z-index: 9999;
        /*display: none;*/
    }

    #searchContainer:before {
        content: '';
        display: block;
        position: absolute;
        width: 0;
        height: 0;
        color: transparent;
        /*border: 10px solid black;*/
        border-color: transparent transparent white;
        margin-top: -20px;
        margin-left: 188px;
    }

    #searchTitle {
        z-index: 1000;
        font-weight: bold;
        padding: 8px;
        font-size: 13px;
        background-color: #F2F9EA;
        width: 384px;
        border-bottom: 1px solid #dddddd;
    }

    #notificationsBody {
        padding: 5px 0px 0px 0px !important;
    }

    #notificationFooter {
        background-color: #F2F9EA;
        text-align: center;
        font-weight: bold;
        padding: 8px;
        font-size: 12px;
        border-top: 1px solid #dddddd;
    }

    #notification_count {
        padding: 3px 7px 3px 7px;
        background: #cc0000;
        color: #ffffff;
        font-weight: bold;
        margin-left: 77px;
        border-radius: 9px;
        position: absolute;
        margin-top: -11px;
        font-size: 11px;
    }
</style>

<script type="text/javascript" >
//     var Swidth = $(window).width();
//     alert(Swidth);

    $(document).ready(function ()
    {
        $("#megaMenuBackBtn").click(function ()
        {
            $("#megaMenuRightSide").hide();
            return false;
        });
        $(".ttMenu_Name").hover(function ()
        {
            $("#megaMenuRightSide").hide();
            return false;
        });
    });</script>
<script>
    function checkXMLHTTP(xmlhttp) {
        xmlhttp = false;
        try {
            return xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                return xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (E) {
                xmlhttp = false;
            }
        }
        if (!xmlhttp && typeof XMLHttpRequest !== 'undefined') {
            return xmlhttp = new XMLHttpRequest();
        }
    }

    function documentID(el) {
        return document.getElementById(el);
    }


    /*
     * @Function            : getsearchValue 
     * @Used IN             : @function-'front_end/master/header_menu.php'
     * @Description         : get public search value
     * @Developed By        : Ripon Jaherul
     * @Start DateTime      : 27-03-2016 11:51 AM     
     * @Status              : available      
     */
    function getsearchValue(searchValue, url) {
        var searchValueResponse;
        searchValueResponse = checkXMLHTTP(searchValueResponse);
        var formdata = new FormData();
        formdata.append("search_value", searchValue);
        searchValueResponse.addEventListener("load", function () {

            if (searchValueResponse.responseText === 'no') {
                documentID('searchContainer').innerHTML = '';
                documentID('searchContainer').style.display = 'none';
            } else {
                documentID('searchContainer').style.display = 'block';
                documentID('searchContainer').innerHTML = searchValueResponse.responseText;
            }

        }, false);
        searchValueResponse.open("POST", url);
        searchValueResponse.send(formdata);
    }

    /*
     * @Function            : getMoreSearchInfo 
     * @Used IN             : @function-'front_end/master/header_menu.php'
     * @Description         : get more search info
     * @Developed By        : Ripon Jaherul
     * @Start DateTime      : 27-03-2016 11:52 AM     
     * @Status              : available      
     */
    function getMoreSearchInfo(type, url, searchValue, counter) {
        var moreSearchInfoResponse;
        moreSearchInfoResponse = checkXMLHTTP(moreSearchInfoResponse);
        var formdata = new FormData();
        formdata.append("type", type);
        formdata.append("counter", counter);
        formdata.append("search_value", searchValue);
        moreSearchInfoResponse.addEventListener("load", function () {

            $(".searchdivContainer").show();
            documentID('searchContainer').innerHTML = moreSearchInfoResponse.responseText;
        }, false);
        moreSearchInfoResponse.open("POST", url);
        moreSearchInfoResponse.send(formdata);
    }
</script>
<script>
    /*
     * @Function            : searchCourses 
     * @Description         : search all course
     * @Developed By        : MD Jaherul Islam
     * @Start DateTime      : 24-08-2016 06:18 PM  
     * @Parameter           : searchInput, url
     * @Return              : NULL    
     * @Status              : Available        
     */
    var searchCourses = function (searchInput, url) {
        var courseInput = searchInput.replace(/  +/g, ' ').trim();

        var viewCourseData = {
            course_input: courseInput
        };

        $.ajax({
            type: 'post',
            url: url,
            data: JSON.stringify(viewCourseData),
            contentType: "application/json; charset=utf-8",
            traditional: true,
            beforeSend: function () {
                $('#loading_image').show();
                $('#view_without_paginzation').attr('style', 'opacity:0.2');
            },
            complete: function () {
                $('#loading_image').hide();
                $('#view_without_paginzation').attr('style', 'opacity:1');
            },
            success: function (data, status) {
                if (status === 'success') {
                    $('#course_view').html(data);
                }
            }
        });
    };


    $(document).ready(function () {
        /*
         * @Description         : view notification mousehove and click
         * @Developed By        : MD Jaherul Islam
         * @Start DateTime      : 03-10-2016 11:09 AM 
         * @Status              : Available       
         */
        $(document).on('mousemove', 'ul[id^="viewSingleLeftnotification"]', function () {
            $('#' + this.id).addClass('light_green');
        }).on('mouseout', 'ul[id^="viewSingleLeftnotification"]', function () {
            $('#' + this.id).removeClass('light_green');
        }).on('click', 'ul[id^="viewSingleLeftnotification"]', function () {
            var notificationID = this.id.replace('viewSingleLeftnotification', '');
            var baseUrl = $('#basUrl').val();
            var viewNotificationUrl = baseUrl + 'user/update-view-notification';

            $.post(viewNotificationUrl, {notification_id: notificationID}, function (notificationView) {
                if (notificationView === 'error') {
                    $('#headerViewDeleteWorkFile').modal('show');
                    $(document).on('click', 'button[id="modalOkButtonheaderNotification"]', function () {
                        location.reload();
                    });
                } else {
                    window.location.href = baseUrl + notificationView;
                }
            });
        });

        /*
         * @Description         : update all notification by view
         * @Developed By        : MD Jaherul Islam
         * @Start DateTime      : 03-10-2016 11:40 AM 
         * @Status              : Available       
         */
        $(document).on('click', 'a[id="mark_all_as_read"]', function () {
            var baseUrl = $('#basUrl').val();
            var markAsAllReadUrl = baseUrl + 'user/mark-all-as-read';

            $.post(markAsAllReadUrl, function () {
                if ($('#totalUnseenNotification').text() !== '') {
                    $('#totalUnseenNotification').text('');
                }
                $('ul.padding-zero').each(function () {
                    $(this).removeClass('deep_green');
                });
            });
        });
    });
</script>
