<?php
/*
 * Copyright (c) 2018 Earworks.
 * Codeigniter Project Template Modification
 * Please contact our email for more information :
 *  contact@earworks.co.id
 */
defined('BASEPATH') OR exit('No direct script access allowed');
$user = $this->session->userdata(CI_NAME . 'log');
if ($user['profilepath']) {
    $url = 'media/uploads/' . $user['profilepath'];
}else{
    $url = 'media/static/user.png';
}
?>
<!-- BEGIN QUICK SIDEBAR -->
<a href="javascript:;" class="page-quick-sidebar-toggler">
    <i class="icon-login"></i>
</a>
<div class="page-quick-sidebar-wrapper" data-close-on-body-click="false">
    <div class="page-quick-sidebar" >
        <div class="page-quick-sidebar-alerts-list">
            <h3 class="list-heading"><?php echo CI_NAME ?></h3>
            <div class="feeds list-items">
                <div class="profile-sidebar">
                    <!-- PORTLET MAIN -->
                    <div class="portlet dark profile-sidebar-portlet "
                         style="background: #000000;">
                        <!-- SIDEBAR USERPIC -->
                        <div class="profile-userpic">
                            <img src="<?php echo image($url, "medium"); ?>" 
                                 class="img-responsive img-circle" 
                                 style="width: 50%;margin: 0px auto;"
                                 title="<?php echo $user['profilepathtitle'] ?>"
                                 alt="<?php echo $user['profilepathalt'] ?>">
                        </div>
                        <!-- END SIDEBAR USERPIC -->
                        <!-- SIDEBAR USER TITLE -->
                        <div class="profile-usertitle" style="text-align: center;">
                            <div class="profile-usertitle-name"><?php echo ($user['profilename']) ? $user['profilename'] : null ?></div>
                            <div class="profile-usertitle-job"><?php echo ($user['rolename']) ? $user['rolename'] : null ?></div>
                        </div>
                        <!-- END SIDEBAR USER TITLE -->
                        <!-- SIDEBAR MENU -->
                        <div class="tab-pane page-quick-sidebar-settings" id="quick_sidebar_tab_3">
                            <div class="page-quick-sidebar-settings-list">
                                <ul class="list-items borderless" >
                                    <?php if (in_array($user['roleid'], array(1,2))) : ?>
                                    <li> 
                                        <a href="<?php echo base_url("backoffice/dashboard/profile") ?>">
                                            <i class="icon-notebook"></i> &nbsp; 
                                            <?php echo $this->lang->line('view_profile') ?>
                                        </a> 
                                    </li>
                                    <li> 
                                        <a href="<?php echo base_url("backoffice/dashboard/password") ?>">
                                            <i class="icon-puzzle"></i> &nbsp; 
                                            <?php echo $this->lang->line('change_password') ?>
                                        </a>
                                    </li>
                                    <?php endif; ?>
                                    <li>
                                        <a href="<?php echo base_url("backoffice/user/logout") ?>">
                                            <i class="icon-power"></i> &nbsp;
                                            <?php echo $this->lang->line('logout') ?>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

