<?php

date_default_timezone_set('Africa/Kampala');

session_start();

include ("connect.php");

$result20 = $dbh->query("select * from scrap where type='timeout'");

$row20  = $result20->fetchObject();



$nictimeout=$row20->item;

if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > $nictimeout)) {

    session_unset();     // unset $_SESSION variable for the run-time 

    session_destroy();   // destroy session data in storage

    header('Location:../index.php?wasgoinghere='.urlencode($_SERVER['REQUEST_URI']));

}$_SESSION['LAST_ACTIVITY'] = time();

if (!isset($_SESSION['username'])) {

header('Location:../index.php?wasgoinghere='.urlencode($_SERVER['REQUEST_URI']));

}

include('includes.php');

similar_text($mencdna,$dnaneed,$percentagekufanagana);

if (($percentagekufanagana>'97')and($admindate<$timezaffe)){

$today=date("Y-m-d");
$todaynow=date("Y-m-d H:i:s");
$currentyear=date("y");
$currentmonth=date("m");
$twodaysback=date('Y-m-d', strtotime('-2 days', strtotime($today)));
$twodaysbacknow=date('Y-m-d H:i:s', strtotime('-2 days', strtotime($todaynow)));
function printColor($message, $mycolor) {
  echo "<br><span style='color:".$mycolor."'>".$message."</span>";
}
?>

<html>

<head>

    <title></title>

<style>

.kscrollchecks{

height: 150px;

overflow: auto;

border: 5px solid rgb(238, 238, 238);

color: rgb(255, 255, 255);

margin-bottom: 0.1em;   

}

#company1{background: #107BA7;}

#company2{background: #FF00AA;}

#company3{background: #A6C628;}

.alertnote{

background: red none repeat scroll 0% 0%; 

border-radius: 20px; 

padding: 5px; 

color: white; 

text-decoration: blink;

border-bottom-right-radius: 50px;

    }

</style>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

<script src="js/input.js"></script>

</head>

<body>

<?php

include ("connect.php");



$role=$_SESSION["role"];

$rolenumber=$_SESSION["rolenumber"];





$getuser = $dbh->query("select * from users where rolenumber='$rolenumber'");

$rowuser=$getuser->fetchObject();

$usertype=$rowuser->title;



$resultpath=$dbh->query("select * from scrap where type='pathtoshire'");

$rowpath=$resultpath->fetchObject();

$pathtoshire=$rowpath->item;



$result10=$dbh->query("select * from menu where role like '%$role%' order by itemorder");

$row10=$result10->fetchObject();





if($row10->role=='priadmin'){

if ($usertype="Admin - Primary"){$userini="priadmin";}

$dashboardlink="<a href='admin.php'>Dashboard</a>";

/* vars */

$names=$_SESSION["firstname"]." ".$_SESSION["lastname"];

}



elseif($row10->role=='secadmin'){

$userini="secadmin";

$dashboardlink="<a href='admin.php'>Dashboard</a>";

/* vars */

$adminid=$_SESSION["adminid"];

$names=$_SESSION["firstname"]." ".$_SESSION["lastname"];

}



elseif($row10->role=="overadmin"){

$userini="overadmin";

$rolenumber=$_SESSION["rolenumber"];

$dashboardlink="<a href='admin.php'>Dashboard</a>";

/* vars */

$adminid=$_SESSION["adminid"];

$names=$_SESSION["firstname"]." ".$_SESSION["lastname"];

}



elseif($row10->role=='priaccount'){

$userini="priaccount";

$dashboardlink="<a href='bursar.php'>Dashboard</a>";

$rolenumber=$_SESSION["rolenumber"];

$adminid=$_SESSION["adminid"];

$names=$_SESSION["firstname"]." ".$_SESSION["lastname"];

}



elseif($row10->role=='priaccount2'){

$userini="priaccount";

$dashboardlink="<a href='bursar.php'>Dashboard</a>";

$rolenumber=$_SESSION["rolenumber"];

$adminid=$_SESSION["adminid"];

$names=$_SESSION["firstname"]." ".$_SESSION["lastname"];

}

elseif($row10->role=="secaccount"){

$userini="secaccount";

$rolenumber=$_SESSION["rolenumber"];

$dashboardlink="<a href='bursar.php'>Dashboard</a>";

/* vars */

$adminid=$_SESSION["adminid"];

$names=$_SESSION["firstname"]." ".$_SESSION["lastname"];



}elseif($row10->role=="secaccount2"){

$userini="secaccount";

$rolenumber=$_SESSION["rolenumber"];

$dashboardlink="<a href='bursar.php'>Dashboard</a>";

/* vars */

$adminid=$_SESSION["adminid"];

$names=$_SESSION["firstname"]." ".$_SESSION["lastname"];

}



elseif($row10->role=="hmp"){

$userini="hmp";

$rolenumber=$_SESSION["rolenumber"];

$dashboardlink="<a href='tr.php'>Dashboard</a>";

/* vars */

$adminid=$_SESSION["adminid"];

$names=$_SESSION["firstname"]." ".$_SESSION["lastname"];

}



elseif($row10->role=="hms"){

$userini="hms";

$rolenumber=$_SESSION["rolenumber"];

$dashboardlink="<a href='tr.php'>Dashboard</a>";

/* vars */

$adminid=$_SESSION["adminid"];

$names=$_SESSION["firstname"]." ".$_SESSION["lastname"];

}



elseif($row10->role=="dosp"){

$userini="dosp";

$rolenumber=$_SESSION["rolenumber"];

$dashboardlink="<a href='tr.php'>Dashboard</a>";

/* vars */

$adminid=$_SESSION["adminid"];

$names=$_SESSION["firstname"]." ".$_SESSION["lastname"];

}



elseif($row10->role=="doss"){

$userini="doss";

$rolenumber=$_SESSION["rolenumber"];

$dashboardlink="<a href='tr.php'>Dashboard</a>";

/* vars */

$adminid=$_SESSION["adminid"];

$names=$_SESSION["firstname"]." ".$_SESSION["lastname"];

}



elseif($row10->role=="classtr"){

$userini="classtr";

$rolenumber=$_SESSION["rolenumber"];

$dashboardlink="<a href='tr.php'>Dashboard</a>";

/* vars */

$adminid=$_SESSION["adminid"];

$names=$_SESSION["firstname"]." ".$_SESSION["lastname"];

}



elseif($row10->role=='tech'){

$userini="tech";

$rolenumber=$_SESSION["rolenumber"];

$dashboardlink="<a href='tech.php'>Dashboard</a>";

$names=$_SESSION["firstname"]." ".$_SESSION["lastname"];

}



elseif($row10->role=='tchs'){

$userini="tech";

$rolenumber=$_SESSION["rolenumber"];

$dashboardlink="<a href='tech.php'>Dashboard</a>";

$names=$_SESSION["firstname"]." ".$_SESSION["lastname"];

}





function kheader(){

    

    include ("connect.php");



    $result500 = $dbh->query ("select * from scrap where type='title'");

    $row500 = $result500->fetchObject();





    echo "

    <title>".$row500->item."</title>

    <!-- Bootstrap Core CSS -->

    <link href='css/bootstrap.min.css' rel='stylesheet'>



    <!-- Custom CSS -->

    <link href='css/sb-admin.css' rel='stylesheet'>

    <link href='css/bootstrap-datepicker' rel='stylesheet'>



    <!-- Morris Charts CSS -->

    <link href='css/plugins/morris.css' rel='stylesheet'>



    <!-- Custom Fonts -->

    <link href='font-awesome/css/font-awesome.min.css' rel='stylesheet' type='text/css'>

<style>

.kprocess{    

    color: #fff;

    background-color: #3a4148;

    border-color: #fff;

}

.kprocess a {color: #fff;}

</style>

    ";

    }

function ktopbar(){



$color3="color:#fff;";



    global $usertype;

    global $names;

    global $role;

 

    

    echo "

    <div class='navbar-header'>

                <button type='button' class='navbar-toggle' data-toggle='collapse' data-target='.navbar-ex1-collapse'>

                    <span class='sr-only'>Toggle navigation</span>

                    <span class='icon-bar'></span>

                    <span class='icon-bar'></span>

                    <span class='icon-bar'></span>

                </button>";

                

 include ("connect.php");

    $result500 = $dbh->query ("select * from scrap where type='title'");

    $row500 = $result500->fetchObject();



                echo "

                <a style='".$color3."' class='navbar-brand'>".$row500->item." |&nbsp;".$usertype."</a>

                </div>





            <!-- Top Menu Items -->";

            if ($role=='priaccount'||$role=='secaccount'||$role=='overadmin'){

                echo "

<form method='get' action='search.php' style='margin-top:10px;'>

  <div class='col-lg-2'>

  <input class='form-control' name='search' type='text' placeholder='Type child name'>

   </div>

   <div class='col-lg-2'>

   <input class='btn btn-sm btn-primary' type='submit' value='Search'>

    </div>

    </form>



<div class='col-lg-1' style='margin-top:15px;'>

<input type='checkbox' id='childtype1' onclick='fchild_checker()' value='Debtor'> <span style='color:#fff;'>Debtor</span>

                </div>

                <div class='col-lg-1' style='margin-top:15px;'>

<input type='checkbox' id='childtype2' onclick='fchild_checker()' value='All' checked> <span style='color:#fff;'>All</span>

                </div>";}



                echo "

              

          <ul class='nav navbar-right top-nav'>

			<li class='dropdown'>

                    <a href='#' style='".$color3."' class='dropdown-toggle' data-toggle='dropdown'><i class='fa fa-bell'></i> <b class='caret'></b><span class='alertnote'>0</span></a>

                    <ul class='dropdown-menu message-dropdown'>";



                            echo "

                    <li class='message-preview'>

                            <a href='#' & process=fly'>

                                <div class='media'>

                                    <span class='pull-left'>

                                        <img class='media-object' alt=''>

                                    </span>

                                    <div class='media-body'>

                                        <h5 class='media-heading'><strong></strong>

                                        </h5>

                                        <p class='small text-muted'><i class='fa fa-clock-o'></i>&nbsp;&nbsp;Time</p>

                                        <p>Alerts here</p>

                                    </div>

                                </div>

                            </a>

                        </li>";

						echo "

                        <li class='message-footer'>

                            <a href='#'>Read All New Notifications</a>

                        </li>

                    </ul>

                </li>";



include ("connect.php");

    $rolenumber = $_SESSION["rolenumber"];

    $resultmessage = $dbh->query ("select * from message where recepient='$rolenumber' or recepient='all' order by autoid desc");

$countmessage = $resultmessage->rowCount();

if ($countmessage>0){    

$rowmessage = $resultmessage->fetchObject();

    }

else

{    

$rowmessage = '0';

    }



$resultmessage2 = $dbh->query ("select * from message where dateread='' and (recepient='$rolenumber' or recepient='all')");

    $rowmessage2 = $resultmessage2->fetchObject();

    $countmessage2 = $resultmessage2->rowCount();

			

			

			echo "

                <li class='dropdown'>

                    <a href='#' style='".$color3."' class='dropdown-toggle' data-toggle='dropdown'><i class='fa fa-envelope'></i> <b class='caret'></b><span class='alertnote'>".$countmessage2."</span></a>

                    <ul class='dropdown-menu message-dropdown'>

                        ";

                        do{

							if($countmessage=='0'){

						echo "";

						}else{

							$sender = $rowmessage->sender;

							$resulterd = $dbh->query("select * from users where rolenumber='$sender'");

							$rowerd=$resulterd->fetchObject();

						}

                            echo "

                    

                        <li class='message-preview'>

                            <a href='message.php?status20=rd&id="; if ($countmessage=='0'){echo "";}else {echo $rowmessage->messageid;} echo "&id2=".$sender."'>

                                <div class='media'>

                                    <span class='pull-left'>

                                        <img class='media-object' alt=''>

                                    </span>

                                    <div class='media-body'>

                                        <h5 class='media-heading'><strong>"; if($countmessage=='0'){echo "";}



                else{ echo $rowerd->firstname."&nbsp;".$rowerd->lastname; } echo "</strong>

                                        </h5>

                                        &nbsp;&nbsp;"; if($countmessage==0){echo "";}else{echo $rowmessage->dater;} echo "

                                        <p>"; if($countmessage==0){echo "There are no messages";}else{echo $rowmessage->message;} echo "</p>

                                    </div>

                                </div>

                            </a>

                        </li>"; }while($rowmessage = $resultmessage->fetchObject());



                        

                        echo "

                        <li class='message-footer'>

                            <a href='message.php?msgt=inb'>Read All New Messages</a>

                        </li>

                    </ul>

                </li>



                

                <li class='dropdown'>

                    <a href='#' style='".$color3."' class='dropdown-toggle' data-toggle='dropdown'><i class='fa fa-user'></i>&nbsp;". $_SESSION['firstname']. " ".$_SESSION['lastname']."<b class='caret'></b></a>

                    <ul class='dropdown-menu'>

                        

                        <li>

                            <a href='compose.php'><i class='fa fa-fw fa-envelope'></i> Send Message</a>

                        </li>

						<li>

                            <a href='password.php'><i class='fa fa-fw fa-wrench'></i> Password</a>

                        </li>

                       <li>

                            <a href='color.php'><i class='fa fa-fw fa-eye'></i> Color</a>

                        </li>

                       

					    

                        <li class='divider'></li>

                        <li>

                            <a href='../logout.php'><i class='fa fa-fw fa-power-off'></i> Log Out</a>

                        </li>

                    </ul>

                </li>

            </ul>

    ";

    }

    





    

function kleftbar(){

    include ("connect.php");

$role=$_SESSION["role"];



$result10=$dbh->query("select * from menu where role like '%$role%' and type='' order by itemorder");

$row10=$result10->fetchObject();



$rolenumber = $_SESSION["rolenumber"];

	$result50 = $dbh->query("select * from users where rolenumber='$rolenumber'");

	$row50 = $result50->fetchObject();

	

if($role=='priadmin'){

	

$colorz = $row50->color;

	

if($colorz==''){

$color = '';

$color2 = '';

}else{

$color = "style='background-color :".$colorz."'";

$color2 = "style='background-color :".$colorz."'";

}	





$color3="color:#fff;";

$color4="color:#fff;";

$search='';



}elseif($role=='secadmin'){

$colorz = $row50->color;

if($colorz==''){

$color = "style='background-color : #337ab7;'";

$color2 = "style='background-color: #337ab7;'";

}else{

$color = "style='background-color :".$colorz."'";

$color2 = "style='background-color :".$colorz."'";

}	

	



$color3 = "color: #fff;";

$color4="color: #fff;";

$search='';



}elseif($role=='hmp'){

$colorz = $row50->color;

if($colorz==''){

$color = "style='background-color : #337ab7;'";

$color2 = "style='background-color: #337ab7;'";

}else{

$color = "style='background-color :".$colorz."'";

$color2 = "style='background-color :".$colorz."'";



}   

    



$color3 = "color: #fff;";

$color4="color: #fff;";

$search='';



}elseif($role=='hms'){

$colorz = $row50->color;

if($colorz==''){

$color = "style='background-color : #337ab7;'";

$color2 = "style='background-color: #337ab7;'";

}else{

$color = "style='background-color :".$colorz."'";

$color2 = "style='background-color :".$colorz."'";



}   

    



$color3 = "color: #fff;";

$color4="color: #fff;";

$search='';



}elseif($role=='dosp'){

$colorz = $row50->color;

if($colorz==''){

$color = "style='background-color : #337ab7;'";

$color2 = "style='background-color: #337ab7;'";

}else{

$color = "style='background-color :".$colorz."'";

$color2 = "style='background-color :".$colorz."'";



}   

    



$color3 = "color: #fff;";

$color4="color: #fff;";

$search='';



}elseif($role=='doss'){

$colorz = $row50->color;

if($colorz==''){

$color = "style='background-color : #337ab7;'";

$color2 = "style='background-color: #337ab7;'";

}else{

$color = "style='background-color :".$colorz."'";

$color2 = "style='background-color :".$colorz."'";



}   

    



$color3 = "color: #fff;";

$color4="color: #fff;";

$search='';



}elseif($role=='priaccount'){

    

$colorz = $row50->color;

if($colorz==''){

$color = "style='background-color : #5cb85c;'";

$color2 = "style='background-color : #5cb85c;'";

}else{

$color = "style='background-color :".$colorz."'";

$color2 = "style='background-color :".$colorz."'";

}	



$color3="color: #fff;";

$color4="color: #fff;";

$search='';



}elseif($role=='priaccount2'){

    

$colorz = $row50->color;

if($colorz==''){

$color = "style='background-color : #5cb85c;'";

$color2 = "style='background-color : #5cb85c;'";

}else{

$color = "style='background-color :".$colorz."'";

$color2 = "style='background-color :".$colorz."'";

}   



$color3="color: #fff;";

$color4="color: #fff;";

$search='';



}elseif($role=='secaccount'){

$colorz = $row50->color;

if($colorz==''){

$color = "style='background-color : #a239ca;'";

$color2 = "style='background-color :#a239ca;'";

}else{

$color = "style='background-color :".$colorz."'";

$color2 = "style='background-color :".$colorz."'";

}



$color3="color: #fff;";

$color4="color: #fff;";

$search='';



}elseif($role=='secaccount2'){

$colorz = $row50->color;

if($colorz==''){

$color = "style='background-color : #a239ca;'";

$color2 = "style='background-color :#a239ca;'";

}else{

$color = "style='background-color :".$colorz."'";

$color2 = "style='background-color :".$colorz."'";

}



$color3="color: #fff;";

$color4="color: #fff;";

$search='';



}elseif($role=='overadmin'){

$colorz = $row50->color;

if($colorz==''){

$color = "style='background-color : #008080;'";

$color2 = "style='background-color : #008080;'";

}else{

$color = "style='background-color :".$colorz."'";

$color2 = "style='background-color :".$colorz."'";

}

$color3="color: #fff;";

$color4='';

$search='';



}elseif($role=='tech'){

	

$colorz = $row50->color;

if($colorz==''){

$color = "style='background-color : deepskyblue;'";

$color2 = "style='background-color : deepskyblue;'";

}else{

$color = "style='background-color :".$colorz."'";

$color2 = "style='background-color :".$colorz."'";

}

$color3="color: #fff;";

$color4='';

$search='';



}elseif($role=='hmp' || $role=='dos' || $role=='classtr' || $role='tchs'){

    

$colorz = $row50->color;

if($colorz==''){

$color = "style='background-color : deepskyblue;'";

$color2 = "style='background-color : deepskyblue;'";

}else{

$color = "style='background-color :".$colorz."'";

$color2 = "style='background-color :".$colorz."'";

}

$color3="color: #fff;";

$color4='';

$search='';



}

    global $userini;

echo "

<div class='collapse navbar-collapse navbar-ex1-collapse' ".$color.">

                <ul ".$color2." class='nav navbar-nav side-nav'>

                    ";

                    

                    if($role=='ss'){

                    $color7="success";

                    }else{

                        $color7="primary";

                    

                    }

					if($role=='se'){

						$result41 = $dbh->query("select * from menu where role like '%$role%' and type='dash'");

                    $row41 = $result41->fetchObject();

					

					echo "

					

					<li class='kprocess'>";

					

	$colorzz = $row50->color;

	echo "

                        <a title='".$row41->title."'  style='background-color :"; if($colorzz==''){echo $row41->color;}else{echo $colorzz;} echo ";".$color3."' href='".$row41->link."'><i class='fa fa-fw fa-".$row41->img."'></i> ".$row41->item."</a>

                    </li>

					

                    <li>

                        <a style='".$color3."' href='javascript:;' data-toggle='collapse' data-target='#padaco'><i class='fa fa-fw fa-arrows-v'></i>PADACO<i class='fa fa-fw fa-caret-down'></i></a>

                        <ul id='padaco' class='collapse'>";

						$colorzz = $row50->color;

                    do{

                        echo"

                    <li class='kprocess'>

                        <a title='".$row10->title."'  style='background-color :"; if($colorzz==''){echo $row10->color;}else{echo $colorzz;} echo";".$color3."' href='".$row10->link."'><i class='fa fa-fw fa-".$row10->img."'></i> ".$row10->item."</a>

                    </li>";

                    

                    }while($row10=$result10->fetchObject());

                    

					echo "</ul></li>";

					

					$result40 = $dbh->query("select * from menu where role like '%$role%' and type='out'");

                    $row40 = $result40->fetchObject();

					

					do{

					echo "

					<li class='kprocess'>

                        <a title='".$row40->title."'  style='background-color :"; if($colorzz==''){echo $row40->color;}else{echo $colorzz;} echo ";".$color3."' href='".$row40->link."'><i class='fa fa-fw fa-".$row40->img."'></i> ".$row40->item."</a>

                    </li>";

					

}while($row40 = $result40->fetchObject());



}else{



$colorzz = $row50->color;

                    do{

                        echo"

                    <li class='kprocess'>

                        <a title='".$row10->title."'  style='background-color :"; if($colorzz==''){echo $row10->color;}else{echo $colorzz;} echo";".$color3."' href='".$row10->link."'><i class='fa fa-fw fa-".$row10->img."'></i> ".$row10->item."</a>

                    </li>";

                    

                    }while($row10=$result10->fetchObject());

                    

					

}



					$item = $_SESSION['role'];

					$result39 = $dbh->query("select * from menu where role like '%$item%' and type='rc'");

                    $row39 = $result39->fetchObject();

					

					if(($role=='tr')||($role=='mm')||($role=='fm')){

					echo "";

					}else{

						if($role=='ra'){

							echo "";

							}/*else{

					echo "<li>

                        <a style='".$color3."' href='upcoming.php'><i class='fa fa-fw fa-edit'></i> Upcoming</a>

                    </li>";

							}

                    echo "

					<li>

                        <a style='".$color3."' href='javascript:;' data-toggle='collapse' data-target='#demo'><i class='fa fa-fw fa-arrows-v'></i> Resource Center <i class='fa fa-fw fa-caret-down'></i></a>

                        <ul id='demo' class='collapse'>";

						

                           do {

							   echo "

                            <li>

                                <a style='".$color4."' href='".$row39->link."'>".$row39->item."</a>

                            </li>";

						   }while($row39=$result39->fetchObject());

							

							echo"

                        </ul>

                    </li>"; */

					}

					

					echo $search."<br>";

                    if(isset($_POST["submitterd"])){

    global $names;

    $suggestion = $_POST["suggestion"];

    $ip_ad=$_SERVER['REMOTE_ADDR'];

$kbrowser=$_SERVER['HTTP_USER_AGENT'];

              

                    $count = $dbh->exec("insert into suggestion (user,suggestion,ip_address,browserdetail) values('$names','$suggestion','$ip_ad','$kbrowser')");

                    echo "<li><div class='alert alert-success'>Success..!!! Your suggestion has been submitted</div></li>";

                    }

                    

                    

                    

                    echo "

                   <li><form method='post'>

				   <div class='col-lg-12'>

                    <textarea class='form-control' name='suggestion' placeholder='Type your suggestion'></textarea>

					

                    <input type='submit' title='Click to submit your suggestion' class='btn btn-".$color7."' name='submitterd' value='Submit your suggestion'>

					</div>

                    </form>                </li>

                </ul>

            </div>

";



    

}







echo "

<div class='col-lg-10' style='margin-left:16.5%;margin-top:-1000px;position:absolute;z-index:99;' id='childdetails'>

<div class='panel panel-yellow'>

<div class='panel-body' style='overflow-y:scroll;height:400px;' id='child_out'>



</div>

</div>

</div>";



function eventrange($rangetype){

    echo "

<form action='eventsrange.php' method='get'>

<input type='hidden' name='showchoice' value='".$rangetype."'>

<div class='controls input-append date form_date col-lg-3' data-date='' data-date-format='yyyy-mm-dd' data-link-field='dtp_input2' data-link-format='yyyy-mm-dd'>

<input size='16' readonly type='text' name='startdate' placeholder='Date' class='form-control' id='bpnextdate1'>

<span class='add-on'><i class='icon-th'></i></span>

</div>



<div class='controls input-append date form_date col-lg-3' data-date='' data-date-format='yyyy-mm-dd' data-link-field='dtp_input2' data-link-format='yyyy-mm-dd'>

<input size='16' readonly type='text' name='enddate' placeholder='Date' class='form-control' id='bpnextdate1'>

<span class='add-on'><i class='icon-th'></i></span>

</div>

<input type='submit' class='btn btn-sm btn-primary' value='Show all in range'></form>   

    ";

    }



    function useractivity($activity,$stage){

        include ('connect.php');

$ip_ad=$_SERVER['REMOTE_ADDR'];

$kbrowser=$_SERVER['HTTP_USER_AGENT'];

$currentpage=$_SERVER['SCRIPT_NAME'];

$userid = $_SESSION["rolenumber"];



$insertactivity = $dbh->exec("insert into useractivity (activity,userid,deviceid,browser,currentpage,stage) 

    values('$activity','$userid','$ip_ad','$kbrowser','$currentpage','$stage')");



    }



function mainquery($query){

 include("connect.php");

$result=$dbh->query($query);

$row=$result->fetchObject();

$count=$result->rowCount(); 



return $row;

return $count;  

}



    function role($rolemember){

$role = $_SESSION["role"];



if($role==$rolemember){

}else{

header("location:../logout.php");

}

}



function role2($rolemember1,$rolemember2){

$role = $_SESSION["role"];



if($role==$rolemember1 || $role==$rolemember2){

}else{

header("location:../logout.php");

}

}



function adminall($rolemember1,$rolemember2,$rolemember3){

$role = $_SESSION["role"];





if(($role==$rolemember1)||($role==$rolemember2)||($role==$rolemember3)||($role==$rolemember4)){

}else{

header("location:../logout.php");

}

}

















}

else {echo "www.kinglinepress.com | +256703611691 | David | +256705540340 | Linxon";}



?>

<script src="js/input_down.js"></script>

</body>

</html>