<?php
require_once("../pidbco/pidbjoin.php");
if(!isset($_SESSION))
{
    session_start();
}

if(!isset($_SESSION['jay_proj_mngmnt']) && empty($_SESSION['jay_proj_mngmnt']))
{
    echo '<script type="text/javascript">alert("You Want To Login Now.."); window.location.href="Login";</script>';
}


//fetching Client IP address
function get_client_ip()
{
    $ipaddress = '';
    if (getenv('HTTP_CLIENT_IP'))
        $ipaddress = getenv('HTTP_CLIENT_IP');
    else if(getenv('HTTP_X_FORWARDED_FOR'))
        $ipaddress = getenv('HTTP_X_FORWARDED_FOR');
    else if(getenv('HTTP_X_FORWARDED'))
        $ipaddress = getenv('HTTP_X_FORWARDED');
    else if(getenv('HTTP_FORWARDED_FOR'))
        $ipaddress = getenv('HTTP_FORWARDED_FOR');
    else if(getenv('HTTP_FORWARDED'))
        $ipaddress = getenv('HTTP_FORWARDED');
    else if(getenv('REMOTE_ADDR'))
        $ipaddress = getenv('REMOTE_ADDR');
    else
        $ipaddress = 'UNKNOWN';
    return $ipaddress;
}
$ip=get_client_ip();
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>:: Office Organizer</title>

    <!-- CSS -->
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="assets/css/style1.css">


    <script src="assets/js/jquery-1.10.2.js"></script>
    <link rel="stylesheet" href="assets/css/animate.css">
    <script src="assets/js/animate-script.js"></script>
    
    <style>
		.pro_logo{ margin-top:22px; }
		#top-dt { background-color:#FFFFFF; height:75px; box-shadow:0px 0px 7px 7px rgba(0,0,0,0.5); }
	</style>


</head>

<body style="background:url(assets/img/logo/main_bg.jpg) repeat top center;" onLoad="startTime();">

<script>
    $( document ).ready(function() {
        $('#marketing').each(function()
        {
            animationHover(this, 'tada');
        });

        $('#admin').each(function()
        {
            animationHover(this, 'tada');
        });

        $('#finance').each(function()
        {
            animationHover(this, 'tada');
        });

        $('#crm').each(function()
        {
            animationHover(this, 'tada');
        });

        $('#project').each(function()
        {
            animationHover(this, 'tada');
        });
        $('#settings').each(function()
        {
            animationHover(this, 'tada');
        });

    });

</script>
<script language="JavaScript" src="http://www.geoplugin.net/javascript.gp" type="text/javascript"></script>
<script>
    function startTime()
    {
        var today=new Date();
        var h=today.getHours();
        var m=today.getMinutes();
        var s=today.getSeconds();
        m = checkTime(m);
        s = checkTime(s);
        document.getElementById('time').innerHTML = h+":"+m+":"+s;
        var t = setTimeout(function(){startTime()},500);


           // ajax to get city,state,country
            var city = geoplugin_city();
            var state=geoplugin_region();
            var country=geoplugin_countryName();
            xmlhttp = new XMLHttpRequest();
            xmlhttp.open("GET", "ses_write.php?city=" + city + "&state=" + state+ "&country=" + country, true);
            xmlhttp.send();

    }

    function checkTime(i)
    {
        if (i<10) {i = "0" + i};  // add zero in front of numbers < 10
        return i;
    }
</script>

	<?php //include "ses_write.php"; ?>

    <!-- Header Content -->
    <div class="container-fluid navbar-fixed-top">
    
        <div class="row">
        
            <div id="top-dt" class="col-md-12">
            
                <div class="col-md-4 hidden-xs hidden-sm">
                    <img src="assets/img/logo/programers_logo.jpg" class="img-responsive pro_logo">
                </div>
                
                <div class="col-md-4 col-xs-8 col-sm-8" style="padding-top:12px;">
                    <img src="assets/img/logo/office_organizer_logo.jpg" class="img-responsive org_logo" alt="" />
                </div>
                
                <div class="col-md-4 col-xs-4 col-sm-4">
                	
                    <ul class="nav navbar-top-links navbar-right">
        
                        <li class="dropdown">
                        
                            <a class="dropdown-toggle log" data-toggle="dropdown" href="#" style="overflow:hidden; padding-left:8px;">
                            	
                                <div style="width:55px; height:55px; border-radius:28px; background:url(assets/img/logo/user_default_photo.jpg) no-repeat center #b9b9b9; background-size:25px; float:left; border:solid 2px #666666;">
                                    <?php
                                    if(!empty($_SESSION['user_photo'])) {
                                    ?>
                                        <img src="images/users/<?php echo $_SESSION['user_photo']; ?>" width="50" height="50" class="img-circle" />
                                    <?php } ?>
                                </div>
                                
                                <div style="float:left; color:#999999; margin-left:10px; font-size:12px; margin-top:5px;" class="hidden-xs hidden-sm">
                                    Logged as<br />
                                    <b style="color:#000000; font-size:14px;"><?php echo $_SESSION['user_name']; ?></b>
                                </div>
                                
                                <!--<i class="fa fa-list-ul  hidden-md hidden-lg"></i>-->
                                
                            </a>
                            <ul class="dropdown-menu dropdown-user" style="position:absolute; z-index:99999;">
                                <li><a href="#"><i class="fa fa-user fa-fw"></i> User Profile</a>
                                </li>
                                <li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a>
                                </li>
                                <li class="divider"></li>
                                <li ><a href="#"><?php if(!empty($ip)){ echo $ip; } ?></a></li>
                           		<li><a href="#"><?php echo date('d-D-Y'); ?></a></li>
                                <li><a href="#" id="time"></a></li>
                           		<li><a href="#"><?php if(!empty($_SESSION['city'])){ echo $_SESSION['city']; } ?></a></li>
                                <li class="divider"></li>
                                <li><a href="logout.php"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
                                </li>
                            </ul>
                            
                        </li>
                        
                    </ul>
                    <!-- /.navbar-top-links -->
                
                </div>
    
            </div>
            
        </div>
        
    </div>
    <!-- Header Content -->


	<div class="container" style="margin-top:75px;">
    
    	<div class="row">
        	<div class="col-md-12">
            
            	<div class="row">
                
               		<div class="col-md-12">
               
                		<div class="col-md-4 col-sm-4 col-xs-12 but_sec" id="marketing">
                        
                        	<div class="row">
                            
                            	<div class="col-md-10 col-md-offset-1">
                               
                                 	<a href="#" style="text-decoration:none;">
                                 
                                    
                                        <div class="dashboard-div-wrapper bk-clr">
                                        
                                            <i class="fa fa-line-chart dashboard-div-icon" style="background-color:#f000d8;" ></i>
                                            
                                            <div class="progress progress-striped active">
                                            
                                                <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%; background-color:#102b46;">
                                                    <div class="head_nm">
                                                        Marketing
                                                    </div>
                                                
                                                </div>
                    
                                            </div>
                                            
                                        </div>
                                    
                                    </a>
                                    
                                </div>
                                
                            </div>
                           
                		</div>

                        <div class="col-md-4 col-sm-4 col-xs-12 but_sec" id="admin">
                        
                        	<div class="row">
                            
                            	<div class="col-md-10 col-md-offset-1">
                                
                                	<a href="admin" style="text-decoration:none;">
                                    
                                        <div class="dashboard-div-wrapper bk-clr">
                                        
                                            <i class="fa fa-user dashboard-div-icon" style="background-color:#fe9900;" ></i>
                                            
                                            <div class="progress progress-striped active">
                                            
                                                <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%; background-color:#102b46;">
                                                    <div class="head_nm">
                                                        Admin
                                                    </div>
                                                
                                                </div>
                    
                                            </div>
                                            
                                        </div>
                                    
                                    </a>
                        
                            	</div>
                                
                            </div>
                            
                        </div>

                        <div class="col-md-4 col-sm-4 col-xs-12 but_sec" id="finance">
                        
                        	<div class="row">
                            
                            	<div class="col-md-10 col-md-offset-1">
                                	
                                    <a href="" style="text-decoration:none;">
                                    
                                        <div class="dashboard-div-wrapper bk-clr">
                                        
                                            <i class="fa fa-money dashboard-div-icon" style="background-color:#03bfa7;" ></i>
                                            
                                            <div class="progress progress-striped active">
                                            
                                                <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%; background-color:#102b46;">
                                                    <div class="head_nm">
                                                        Finance
                                                    </div>
                                                
                                                </div>
                    
                                            </div>
                                            
                                        </div>
                                    
                                    </a>
                                
                                </div>
                                
                            </div>
                            
                        </div>
                
                    </div>
                    
                </div>
                
                
                <div class="row">
                
               		<div class="col-md-12">
               
                		<div class="col-md-4 col-sm-4 col-xs-12 but_sec" id="project">
                        
                        	<div class="row">
                            
                            	<div class="col-md-10 col-md-offset-1">
                                   <?php if($_SESSION['per_mission'] == 'admin'){ ?>
                                  	<a href="projects" style="text-decoration:none;">
                                    <?php } else { ?>
                                    <a href="#" style="text-decoration:none;">	
                                      <?php } ?>
                                        <div class="dashboard-div-wrapper bk-clr">
                                        
                                            <i class="fa fa-book dashboard-div-icon" style="background-color:#1200d5;" ></i>
                                            
                                            <div class="progress progress-striped active">
                                            
                                                <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%; background-color:#102b46;">
                                                    <div class="head_nm">
                                                        Projects
                                                    </div>
                                                
                                                </div>
                    
                                            </div>
                                            
                                        </div>
                                    
                                    </a>
                                    
                                </div>
                                
                            </div>
                           
                		</div>

                        <div class="col-md-4 col-sm-4 col-xs-12 but_sec" id="crm">
                        
                        	<div class="row">
                            	
                            	<div class="col-md-10 col-md-offset-1">
                                
                                  <?php if($_SESSION['per_mission'] == 'admin'){ ?>
                                  	<a href="crm" style="text-decoration:none;">
                                    <?php } else { ?>
                                    <a href="#" style="text-decoration:none;">	
                                      <?php } ?>
                                    
                                        <div class="dashboard-div-wrapper bk-clr">
                                        
                                            <i class="fa fa-group dashboard-div-icon" style="background-color:#0ab001;" ></i>
                                            
                                            <div class="progress progress-striped active">
                                            
                                                <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%; background-color:#102b46;">
                                                    <div class="head_nm">
                                                        CRM
                                                    </div>
                                                
                                                </div>
                    
                                            </div>
                                            
                                        </div>
                                    
                                    </a>
                        
                            	</div>
                                
                            </div>
                            
                        </div>

                        <div class="col-md-4 col-sm-4 col-xs-12 but_sec" id="settings">
                        
                        	<div class="row">
                            
                            	<div class="col-md-10 col-md-offset-1">
                                  <?php if($_SESSION['per_mission'] == 'admin'){ ?>
                                      <a href="settings" style="text-decoration:none;">
                                   <?php } else { ?>
                                      <a href="#" style="text-decoration:none;">	
                                   <?php } ?>
                                        <div class="dashboard-div-wrapper bk-clr">
                                        
                                            <i class="fa fa-gears dashboard-div-icon" style="background-color:#c3be02;" ></i>
                                            
                                            <div class="progress progress-striped active">
                                            
                                                <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%; background-color:#102b46;">
                                                    <div class="head_nm">
                                                        Settings
                                                    </div>
                                                
                                                </div>
                    
                                            </div>
                                            
                                        </div>
                                    
                                    </a>
                                
                                </div>
                                
                            </div>
                            
                        </div>
                
                    </div>
                    
                </div>
                
        	</div>
    	</div>
        
	</div>
    
    <footer>
                
        &copy; PROGRAMERS, Allrights Reserved

    </footer>

</body>

<!-- Javascript -->
<script src="assets/js/jquery-1.11.1.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>

