<li><a class="lll" ng-click="logout()"><span class="glyphicon glyphicon-log-out lll"></span> Logout</a></li>
                    </ul>
                </div>
                <!--.nav-collapse -->
            </div>
        </nav>
  
    
           

            
            <script src="js/portal.js"></script>
          <div class='container my-panels'>
<?php 
require_once __DIR__ . '/../php/sch_user.php';
$sch_user = new SchUser();
$school_record = json_decode($sch_user->get_schools("delta"), true);
$records = $school_record["result"];
// print_r($school_record);
echo "<table class='table table-striped table-hover table-responsive table-condensed'>";
echo "\n<tr>\n<div class='panel-head'>\n<td>School id</td>\n<td>User id</td>\n<td>School Name</td>\n<td>School Address</td>\n<td>Contact</td>\n<td>Email</td>\n<td>Name</td>\n<td>Username</td>\n<td>Password</td>\n\n<td></td></div>\n</tr>\n";
foreach ($records as $row) {
    echo "\n\t   <tr>\n\t   ";
    foreach ($row as $key => &$value) {
        echo "<td class='cells'>{$value}</td>";
    }
    echo "<td><input type='button' class='btn btn-danger' value='Delete' onclick='delete_sch({$row['user_id']})'/><input type='button' value='edit'  class='btn btn-warning' onclick='edit({$row['user_id']})'/></td></tr>\n\t   ";
}
echo "</table>";
?>
<div>
<?php

$response = array();
$response["success"] = -1;
session_start();
if (!isset($_SESSION["session_name"])) {
    header("Location:../index.php");
    exit;
} else {
    // reaching from current directory to _user_info
    require_once __DIR__ . '/../../php/user_info.php';
    require_once __DIR__ . '/php/sch_user.php';
    $user = new UserInfo();
    // echo $user->module_users("delta","./academic_scholorships");
    $given_id = $_SESSION["session_name"];
    $sch_user = new SchUser();
    $sch_record = json_decode($sch_user->system_users("delta", $given_id), true);
    $sch_arr = $sch_record["result"][0];
    $_SESSION["sch_id"] = $sch_arr["sch_id"];
    $_SESSION["user_id"] = $sch_arr["user_id"];
    $_SESSION["rating"] = $sch_arr["rating"];
    $_SESSION["is_school"] = $sch_arr["is_school"];
    $_SESSION["is_admin"] = $sch_arr["is_admin"];
    //print_r ($sch_arr);
    if ($sch_arr['is_admin'] == 1) {
        header("Location:../academic_scholorships/views/admin_view.php");
    } elseif ($sch_arr['is_school'] == 1) {
        header("Location:../academic_scholorships/views/school_view.php");
    } else {
        header("Location:../academic_scholorships/views/user_view.php");
    }