<?php 
 include 'saveproj.php'
?>

<div class="d-flex flex-column flex-grow-1 bg-white">

    <!-- content header -->
    <div class="flex-grow-0">
        <!-- content title -->
        <div class="d-flex align-items-center pl-2 pr-3 py-3 pl-sm-3 pr-sm-4 py-sm-4 px-lg-5 py-lg-4  border-faded border-top-0 border-left-0 border-right-0 flex-shrink-0">
            <!-- button for mobile -->
            <a href="javascript:void(0);" class="pl-3 pr-3 py-2 d-flex d-lg-none align-items-center justify-content-center mr-2 btn" data-action="toggle" data-class="slide-on-mobile-left-show" data-target="#js-inbox-menu">
                <i class="fa fa-ellipsis-v h1 mb-0 "></i>
            </a>
            <!-- end button for mobile -->
            <h1 class="subheader-title ml-1 ml-lg-0">
                <i class="fa fa-bars mr-2 hidden-lg-down"></i>
                <?php echo $title;?>
            </h1>

            <div class="d-flex position-relative ml-auto" style="max-width: 23rem;">
                <a href="javascript:void(0);" onclick="window.location.reload(true);" class="btn btn-icon rounded-circle mr-1">
                    <i class="fa fa-undo fs-md"></i>
                </a>
            </div>

        </div>
        <!-- end content title -->

    </div>
    <!-- end content header -->

  <div class="flex-wrap align-items-center flex-grow-1 position-relative bg-gray-50">
    <div class="position-absolute pos-top pos-bottom w-100 custom-scroll">
        <div class="d-flex h-100 flex-column">

            <div class="row">
                <div class="col-xl-12">
                    <div id="panel-7" class="panel">
                        <div class="panel-hdr">
                            <h2>
                                Manage <span class="fw-300"><i>Projects</i></span>
                            </h2>
                            <div class="panel-toolbar">
                                <button class="btn btn-panel" data-action="panel-fullscreen" data-toggle="tooltip" data-offset="0,10" data-original-title="Fullscreen"></button>
                            </div>
                        </div>
                        <div class="panel-container show">

                            <div class="panel-content">
                                
                            <?php if(isset($msg)){?>
                                <div class="alert alert-success alert-dismissible fade show" role="alert" style="border-radius: 4px;">
                                    <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                    <i class="fa fa-fa-check-circle"></i>Well Done!  <?php echo htmlentities($msg); ?>
                                </div>
                            <?php                         
                            }elseif(isset($msge)){
                            ?>
                            <div class="alert alert-danger alert-dismissible fade show" role="alert" style="border-radius: 4px;">
                                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                <i class="fa fa-fa-check-circle"></i>OOOH SNAP!  <?php echo htmlentities($msge); ?>
                            </div>
                            <?php 
                               } 
                            ?>
           

                                <ul class="nav nav-pills" role="tablist">
                                    <li class="nav-item"><a class="nav-link active" data-toggle="pill" href="#listp"><i class="fa fa-list mr-1"></i> List</a></li>
                                    <?php 
                                    if($role_id==2){
                                    ?>
                                    <li class="nav-item"><a class="nav-link" data-toggle="pill" href="#newp"><i class="fa fa-plus-circle mr-1"></i> New Project</a></li>
                                    <?php }?>
                                    
                                    <?php 
                                    if($role_id==5){
                                    ?>
                                    <li class="nav-item"><a class="nav-link" data-toggle="pill" href="#wp"><i class="fa fa-cogs mr-1"></i> Set Work Progress</a></li>
                                    <?php }?>

                                    <?php 
                                    if($role_id==7){
                                    ?>
                                    <li class="nav-item"><a class="nav-link" data-toggle="pill" href="#inv"><i class="fa fa-edit mr-1"></i>Client Invoices</a></li>
                                    <li class="nav-item"><a class="nav-link" data-toggle="pill" href="#pmt"><i class="fa fa-circle-o-notch mr-1"></i>Payment(s)</a></li>
                                    <?php }?>
                                </ul>
                                <div class="tab-content py-3">
                                    <div class="tab-pane fade show active" id="listp" role="tabpanel">
                                        <?php 
                                          include 'projList.php';
                                        ?>
                                    </div>

                                    <?php 
                                    if($role_id==2){
                                    ?>
                                    <div class="tab-pane fade" id="newp" role="tabpanel">
                                    <?php include 'newproj.php';?>
                                    </div>
                                    <?php }?>

                                    <?php 
                                    if($role_id==5){
                                    ?>
                                    <div class="tab-pane fade" id="wp" role="tabpanel">
                                    <?php include 'wps.php';?>
                                    </div>
                                    <?php }?>

                                    <?php 
                                       if($role_id==7){
                                    ?>
                                    <div class="tab-pane fade" id="inv" role="tabpanel">
                                    <?php include 'finInv.php';?>
                                    </div>
                                    <div class="tab-pane fade" id="pmt" role="tabpanel">
                                    <?php include 'finPymt.php';?>
                                    </div>
                                    <?php }?>

                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        <!-- End row -->
        </div>
    </div>
  </div>  

</div>
      