<?php
session_start();
?>
<!DOCTYPE html>
<html>
    <head>
        <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
        <!-- bootstrap 3.0.2 -->
        <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <!-- font Awesome -->
        <link href="css/font-awesome.min.css" rel="stylesheet" type="text/css" />
        <!-- Ionicons -->
        <link href="css/ionicons.min.css" rel="stylesheet" type="text/css" />
        <!-- Morris chart -->
        <link href="css/morris/morris.css" rel="stylesheet" type="text/css" />
        <!-- jvectormap -->
        <link href="css/jvectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" />
        <!-- Date Picker -->
        <link href="css/datepicker/datepicker3.css" rel="stylesheet" type="text/css" />
        <!-- Daterange picker -->
        <link href="css/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
        <!-- bootstrap wysihtml5 - text editor -->
        <link href="css/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css" />
        <!-- Theme style -->
        <link href="css/AdminLTE.css" rel="stylesheet" type="text/css" />
		<link href="css/chat.css" rel="stylesheet" type="text/css" />
			<link href="css/clockedin-admin.css" rel="stylesheet" type="text/css" />

        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
        <![endif]-->
		
	<style type="text/css">

.weather-widget{position: relative;}.weather-widget i{margin-right: 5px;}.weather-widget .overlay-weather-info{position: absolute;z-index: 1;top: 15px;left: 15px;right: 15px;}.weather-widget .overlay-weather-info .weather-info-city{color: #fff;margin: 20px 0;}.weather-widget .overlay-weather-info .weather-info-city h4{font-size: 16px;font-weight: 600;}.weather-widget .overlay-weather-info h4{color: #fff;font-weight: 400;}.weather-widget .overlay-weather-info .weather-info-city h1{font-weight: 600;padding: 0;margin: 0;}.weather-widget .overlay-weather-info i.weather-icon{font-size: 70px;}
svg{
  width: 100% !important
}
</style>	
    </head>


<?php

$base_url = 'http://www.aadhocc.com/demo/AdminLTE-master/';

	if(isset($_SESSION['username']))
	{
	$user=$_SESSION['username'];
	$userdept=$_SESSION['depart_id'];
	$userid=$_SESSION['admin_id'];
	$branch_id=$_SESSION['branch_id'];
	}else{
	//header("location:index.php");
?>
<script>	
	window.location = "index.php";
</script>	
<?php
	}
	include_once("class/class.MySQL.php");
	$db	=new MySQL();


$where['status'] = 1;
$employees = $db->fetchAll("employee",$where,'','50',false,'','e_id,e_fname,e_lname,username,e_gender,branchid,departid');


	
	$rowsg = mysql_query("SELECT e_post,e_id,departid FROM employee where e_id='$userid'");
    $rowsg = mysql_fetch_array($rowsg);
	$desigs = mysql_query("SELECT * FROM designation where desig_id='$rowsg[e_post]' and departs_id='$rowsg[departid]'");
    $desigs = mysql_fetch_array($desigs);
	//echo $desigs['desig_rights'];
	
	$resultemp = mysql_query("SELECT * FROM employee");
$resultemp = mysql_num_rows($resultemp);

$resultbnch = mysql_query("SELECT * FROM branches");
$resultbnch = mysql_num_rows($resultbnch);
$date = date('Y-m-d');
$sel_emp = mysql_query("SELECT * FROM employee e,time t,file f,designation d where e.e_id=t.e_id and t.e_date='$date' and e.e_post=d.desig_id and f.e_id=e.e_id");
$sel_emp = mysql_num_rows($sel_emp);

$y = date('Y',strtotime($date));

$mm=date("m", strtotime($date));

$yrstrt=$y-4; 
$p=0;
for($i=$yrstrt; $i<=$y; $i++)
{
 $w=0; 
 $p=$p+1;
 $ddats=$i.'-12-31';
 $ddatss='31-12-'.$i;
 
 $end_date = $i.'-12-31';

	$timestamp_loop = strtotime($i.'-12-31');

	$sel_dat = mysql_query("SELECT e_id,date_join FROM employee  where   date_join!=''");
	$sel_dat_num_rows = mysql_num_rows($sel_dat);
	while($sel_datss=mysql_fetch_array($sel_dat)){
		$sel_datss['date_join'];	
	$date_join_val_temp = date("Y-m-d", strtotime($sel_datss['date_join']));	
	
		$timestamp_inner = strtotime($date_join_val_temp);
		if($timestamp_inner <=$timestamp_loop)
        {
		$w=$w+1;
		}
	
	}

?>
<input type="hidden" name="datemp" id="datemp<?php echo $p;?>" value="<?php echo $w;?>">
<input type="hidden" name="dateyr" id="dateyr<?php echo $p;?>" value="<?php echo $i;?>">
<?php
}
?>

<?php 
//echo "SELECT date_join FROM employee e where `date_join` LIKE '%$y%' ";
$sel_datss = mysql_query("SELECT date_join FROM employee e where `date_join` LIKE '%$y%' ");
 $sel_datss = mysql_num_rows($sel_datss);

for($j=1; $j<=12; $j++)
{
  if($j<10){
 $datsrt=$y.'-0'.$j.'-01';
 $datend=$y.'-0'.$j.'-31';
 }else{ $datsrt=$y.'-'.$j.'-01';
 $datend=$y.'-'.$j.'-31';}

$sel_emp_pcnt = mysql_query("SELECT distinct t.e_date,t.e_id FROM employee e,time t where e.date_join LIKE '%$y%'  and e.e_id=t.e_id and   t.e_date BETWEEN '$datsrt' AND '$datend' GROUP BY t.e_date,t.e_id");
$sel_emp_pcnt = mysql_num_rows($sel_emp_pcnt);

 $ppercnt=($sel_emp_pcnt*100);
 $ppercnt=$ppercnt/($sel_datss*30);
?>
<input type="hidden" name="pcntemp" id="pcntemp<?php echo $j;?>" value="<?php echo round($ppercnt); ?>">
<?php
}
?>

<input type="hidden" name="userid" class="userid" value="<?=$userid?>"  /><input type="hidden" name="depart_id" class="depart_id" value="<?=$userdept?>"  /><input type="hidden" name="user_name" class="user_name" value="<?=$user?>"  /><input type="hidden" name="sessionbranch_id" class="sessionbranch_id" value="<?=$branch_id?>"  /><input type="hidden" name="hiddenuser_type" id="hiddenuser_type" class=".hiddenuser_type" value="<?php echo $_SESSION['usertype'];?>" />

<?php
						
						$db	=new MySQL();
						if($userid==1)
						{
						//echo "SELECT * FROM menu where  sort_order!=0 order by sort_order";
						$menu_list=$db->fetchQuery("SELECT * FROM menu where  sort_order!=0 order by sort_order");
						}
						else
						{
						//echo "SELECT * FROM menu where menu_id in(".$desigs['desig_rights'].") order by sort_order";
						$menu_list=$db->fetchQuery("SELECT * FROM menu where menu_id in(".$desigs['desig_rights'].") and sort_order!=0 order by sort_order");
						}
$sel_empimg = $db->fetchQuery("SELECT * FROM employee e,file f,designation d where  e.e_post=d.desig_id and f.e_id=e.e_id order by e.e_id desc");
//$sel_emp = mysql_num_rows($sel_emp);			
						?>
						
	<script>
var userid = <?php echo $_SESSION['admin_id']; ?>;
<?php
$userdetails = $db->fetchQuery("SELECT * FROM file where e_id='$userid'");
?>
var userimage = "<?php echo $userdetails[0]['photo']; ?>";



</script>					
	<?php
	$userdetailss = $db->fetchQuery("SELECT * FROM file where e_id='$userid'");
	 $imgs=$userdetailss[0]['photo'];?>					
    <body class="skin-blue">
        <!-- header logo: style can be found in header.less -->
        <header class="header">
            <a href="dashboard.php" class="logo">
                <!-- Add the class icon to your logo image or logo icon to add the margining -->
                AddHRM
            </a>
            <!-- Header Navbar: style can be found in header.less -->
            <nav class="navbar navbar-static-top" role="navigation">
                <!-- Sidebar toggle button-->
                <a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <div class="navbar-right">
                    <ul class="nav navbar-nav">
                        <!-- Messages: style can be found in dropdown.less-->
                     
                        <!-- Notifications: style can be found in dropdown.less -->
                   
                        <!-- Tasks: style can be found in dropdown.less -->
                      
                        <!-- User Account: style can be found in dropdown.less -->
                        <li class="dropdown user user-menu">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <i class="glyphicon glyphicon-user"></i>
                                <span> <?php echo $_SESSION['username'];?> <i class="caret"></i></span>
                            </a>
                            <ul class="dropdown-menu">
                                <!-- User image -->
                                <li class="user-header bg-light-blue">
                                    <img src="<?php if($userimage==''){?>img/avatar3.png<?php } else {?>upload/image/<?php echo $userimage;?><?php } ?>" class="img-circle" alt="User Image" />
                                    <p>
                                         <?php echo $_SESSION['username'];?>
                                        <small></small>
                                    </p>
                                </li>
                                <!-- Menu Body -->
                      
                                <!-- Menu Footer-->
                                <li class="user-footer">
                                    <div class="pull-left">
                                        <a href="profile-view.php?employ_id=<?php echo $userid;?>" class="btn btn-default btn-flat" style="color:#3c8dbc;">Profile</a>
                                    </div>
                                    <div class="pull-right">
                                        <a href="logout.php" class="btn btn-default btn-flat" style="color:#3c8dbc;">Sign out</a>
                                    </div>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </nav>
        </header>
        <div class="wrapper row-offcanvas row-offcanvas-left">
            <!-- Left side column. contains the logo and sidebar -->
            <aside class="left-side sidebar-offcanvas">
                <!-- sidebar: style can be found in sidebar.less -->
                <section class="sidebar">
                    <!-- Sidebar user panel -->
                    <div class="user-panel">
                        <div class="pull-left image">
                            <img src="img/avatar3.png" class="img-circle" alt="User Image" />
                        </div>
                        <div class="pull-left info">
                            <p><translate>Hello, <?php echo $_SESSION['username'];?></translate></p>

                            <a href="#"><i class="fa fa-circle text-success"></i> <translate>Online</translate></a>
                        </div>
                    </div>
       <!-- .clockedin-admin-tab -->
	   <?php 
	   	$dateq = date('Y-m-d');
		$clockins = mysql_query("SELECT * FROM time t,employee e where t.e_id='$userid' and t.e_date='$dateq' and e.e_id=t.e_id  order by id desc");
        $clockins = mysql_fetch_array($clockins);
	   ?>
<?php if($clockins['time_in']=='' && $clockins['time_out']==''){?>
<div class="clockedin-admin-tab">


<div class="clockedin-admin-click" ><a href="javascript:void(0)" 
onclick="clock('<?php echo $userid;?>',1);">Clocked In</a></div>
<div class="clockedin-admin-click-over"  style="display:none;"><a href="javascript:void(0)" onClick="clock('<?php echo $userid;?>',2);">Clocked Out</a></div>

<?php /*?><div class="clockedin-admin-click-content">
<div><?php echo $clockins['e_fname'];?> <strong> <?php if($clockins['time_in'] !=''){echo 'Clocked In';}else{echo 'Out';}?></strong></div>
<div><?php echo $clockins['e_date'];?>, <?php echo $clockins['time_in'].' '.$clockins['time_inloc'];?></div><?php */?>
</div>


<?php }else if($clockins['time_in']!='' && $clockins['time_out']!='') {?>
<div class="clockedin-admin-tab rrr">
<div class="clockedin-admin-click" ><a href="javascript:void(0)" 
onclick="clock('<?php echo $userid;?>',2);">Clocked In</a></div>


<div class="clockedin-admin-click-content">
<div><?php echo $clockins['e_fname'];?> <strong> <?php if($clockins['time_out'] !=''){echo 'Clocked Out';}?></strong></div>
<div><?php echo $clockins['e_date'];?>, <?php echo $clockins['time_out'].' '.$clockins['time_outloc'];?></div>
</div>
</div>



<?php }else {?>
<div class="clockedin-admin-tab rrr">
<div class="clockedin-admin-click" style="display:none;"><a href="javascript:void(0)" 
onclick="clock('<?php echo $userid;?>',1);">Clocked In</a></div>
<div class="clockedin-admin-click-over" <?php if($clockins['e_id']){?>style="display:display;"<?php }else {?> style="display:none;"<?php }?>><a href="javascript:void(0)" onClick="clock('<?php echo $userid;?>',2);">Clocked Out</a></div>

<div class="clockedin-admin-click-content">
<div><?php echo $clockins['e_fname'];?> <strong> <?php if($clockins['time_in'] !=''){echo 'Clocked In';}else{echo 'Out';}?></strong></div>
<div><?php echo $clockins['e_date'];?>, <?php echo $clockins['time_in'].' '.$clockins['time_inloc'];?></div>
</div>
</div>
<?php } ?>
<!-- /.clockedin-admin-tab -->
                    <!-- sidebar menu: : style can be found in sidebar.less -->
                    <ul class="sidebar-menu">
                        <li class="active">
                            <a href="dashboard.php">
                                <i class="fa fa-dashboard"></i> <span><translate>Dashboard</translate></span>
                            </a>
                        </li>
						<?php 
						$i=2;
						foreach($menu_list as $menu_items)
						{
						?>
                        <li>
                            <a href="<?php echo $menu_items['menu_link'];?>">
                                <i class="fa fa-th"></i> <span><translate><?php echo $menu_items['menu_name'];?></translate></span> 
                            </a>
                        </li>
						<?php } ?>
                      
                        <li>
                            <a href="calendar.php">
                                <i class="fa fa-calendar"></i> <span><translate>Calendar</translate></span>
              <?php /*?>                  <small class="badge pull-right bg-red"></small><?php */?>
                            </a>
                        </li>
                  
                    
                    </ul>
                </section>
                <!-- /.sidebar -->
            </aside>

            <!-- Right side column. Contains the navbar and content of the page -->
            <aside class="right-side">
                <!-- Content Header (Page header) -->
                <section class="content-header">
                    <h1>
                       <translate> Dashboard</translate>
                        <small><translate>Control panel</translate></small>
                    </h1>
                    <ol class="breadcrumb">
                        <li><a href="#"><i class="fa fa-dashboard"></i> <translate>Home</translate></a></li>
                        <li class="active"><translate>Dashboard</translate></li>
                    </ol>
                </section>

                <!-- Main content -->
                <section class="content">

                    <!-- Small boxes (Stat box) -->
                    <div class="row">
                        <div class="col-lg-3 col-xs-6">
                            <!-- small box -->
                            <div class="small-box bg-aqua">
                                <div class="inner">
                                    <h3>
                                       <translate> <?php echo $resultbnch;?></translate>
                                    </h3>
                                    <p>
                                       <translate> Branches</translate>
                                    </p>
                                </div>
                                <div class="icon">
                                    <i class="ion ion-bag"></i>
                                </div>
                                <a href="#" class="small-box-footer">
                                  <br>
                                </a>
                            </div>
                        </div><!-- ./col -->
                        <div class="col-lg-3 col-xs-6">
                            <!-- small box -->
                            <div class="small-box bg-green">
                                <div class="inner">
                                    <h3>
                                       <translate> <?php echo $resultemp;?></translate><sup style="font-size: 20px"></sup>
                                    </h3>
                                    <p>
                                        <translate>Total Employees</translate>
                                    </p>
                                </div>
                                <div class="icon">
                                   <!-- <i class="ion ion-stats-bars"></i>-->
								    <i class="ion ion-person-add"></i>
                                </div>
                                <a href="employee-lists.php" class="small-box-footer">
                                    <translate>More info</translate> <i class="fa fa-arrow-circle-right"></i>
                                </a>
                            </div>
                        </div><!-- ./col -->
                        <div class="col-lg-3 col-xs-6">
                            <!-- small box -->
                            <div class="small-box bg-yellow">
                                <div class="inner">
                                    <h3>
                                        <translate> <?php echo $sel_emp;?></translate>
                                    </h3>
                                    <p>
                                      <translate>Clock In Today</translate>
                                    </p>
                                </div>
                                <div class="icon">
                                    <i class="ion ion-person-add"></i>
                                </div>
                                <a href="employee-lists_today.php" class="small-box-footer">
                                    <translate>More info</translate> <i class="fa fa-arrow-circle-right"></i>
                                </a>
                            </div>
                        </div><!-- ./col -->
                        <div class="col-lg-3 col-xs-6">
                            <!-- small box -->
                            <div class="small-box bg-red">
                                <div class="inner">
                                    <h3>
                                
                                    </h3>
                                    <p>
                                        <translate><script src="http://weatherandtime.net/swfobject.js" type="text/javascript" ></script><div id="div_clock_02" style="padding:0px;text-align:center; margin:auto auto;width:178px; height:58px;"><div style="padding:1px;position:absolute; z-index:100; color:#000000; text-align:center; width:173px;height:auto;overflow:hidden;"><a style="margin:0px 0px 0px 2px;color:#000000; text-decoration:none; font-size:10px;" href="http://weatherandtime.net/en/Middle-East/United-Arab-Emirates/Dubai-time.html" title="Dubai time"><nobr>Dubai time</nobr></a></div><span id="swf_clock_02">&nbsp;</span></div><script type="text/javascript" language="Javascript">swfobject.embedSWF("http://weatherandtime.net/clock_02.swf", "swf_clock_02", "178", "58", "10","clock_02.swf", {city: "18321",lang:"en",color1:"#0288F0",color2:"#000000"}, {menu: "false",wmode: "transparent",allowScriptAccess:"always"}, {id:"clock_02",name:"clock_02"});</script></translate>
                                    </p>
                                </div>
                                <div class="icon">
                                      </br>
                                </div>
                                <a href="#" class="small-box-footer">
                                   </br>
                                </a>
                            </div>
                        </div><!-- ./col -->
                    </div><!-- /.row -->

                    <!-- Main row -->
                    <div class="row">
                        <!-- Left col -->
                        <section class="col-lg-6 connectedSortable">                            


                            <!-- Custom tabs (Charts with tabs)style="width:535px !important;"-->
                            <div class="nav-tabs-custom" >
                                <!-- Tabs within a box -->
                                <ul class="nav nav-tabs pull-right">
                                   <!-- <li class="active"><a href="#revenue-chart" data-toggle="tab">Area</a></li>
                                    <li><a href="#sales-chart" data-toggle="tab">Donut</a></li>-->
                                    <li class="pull-left header"><i class="fa fa-inbox"></i> <translate>Employee Graph</translate></li>
                                </ul>
                                <div class="tab-content no-padding">
                                    <!-- Morris chart - Sales -->
                                    <div class="chart tab-pane active" id="revenue-chart" style="position: relative; height: 300px;"></div>
                                    <div class="chart tab-pane" id="sales-chart" style="position: relative; height: 300px;"></div>
									
								
                                </div>
                            </div><!-- /.nav-tabs-custom -->

                            <!-- Chat box -->
                            <!-- /.box (chat box) -->                                                        

<div class="box box-solid bg-blue-gradient">
                                <div class="box-header">
                                    <i class="fa fa-calendar"></i>
                                    <h3 class="box-title"><translate>Employee Gallery</translate></h3>
                                    <!-- tools box -->
                                    <div class="pull-right box-tools" style="background:#fff; margin-top:6px; margin-right:6px; border-radius:5px;">
                                        <!-- button with a dropdown -->
                                            <a href="<?php echo $base_url ;?>employee-lists.php">View All</a>
                                    </div><!-- /. tools -->
                                </div><!-- /.box-header -->
                                <div class="box-body no-padding">
                                    <!--The calendar -->
                                    <div style="width: 100%"></div>
                                </div><!-- /.box-body -->  
                                <div class="box-footer text-black">
                                    <div class="row">
										<?php 
						$a=0;
						foreach($sel_empimg as $sel_img)
						{ $a=$a+1;
						if($a<=8){
						?>
                                        <div class="col-xs-6 col-sm-3" style="margin-top: 10px;">
                         <a href="<?php echo $base_url ;?>profile-view.php?employ_id=<?php echo $sel_img['e_id']; ?>"> <img src="<?php echo $base_url;?>/upload/image/<?php echo $sel_img['photo'];  ?>" alt="" border="0" width="170" height="100" /></a>
                                   </div><!-- /.col -->
                                           <?php }}?> 
										   
										  
                                    </div><!-- /.row -->                                                                        
                                </div>
                            </div>

                            

                            <!-- quick email widget -->
                            <div class="box box-info">
                                <div class="box-header">
                                    <i class="fa fa-envelope"></i>
                                    <h3 class="box-title"><translate>Quick Email</translate></h3>
                                    <!-- tools box -->
                                    <div class="pull-right box-tools">
                                        <!--<button class="btn btn-info btn-sm" data-widget="remove" data-toggle="tooltip" title="Remove"><i class="fa fa-times"></i></button>-->
                                    </div><!-- /. tools -->
                                </div>
                                <div class="box-body">
                                    <form action="#" method="post" name="myform" id="myform">
                                        <div class="form-group">
                                            <input type="email" class="form-control" name="emailto" id="emailto" placeholder="Email to:"/>
                                        </div>
                                        <div class="form-group">
                                            <input type="text" class="form-control" name="subjects" id="subjects" placeholder="Subject"/>
                                        </div>
                                        <div>
                                            <textarea class="textarea" placeholder="Message" name="msgs" id="msgs" style="width: 100%; height: 125px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;"></textarea>
                                        </div>
                                    </form>
                                </div>
                                <div class="box-footer clearfix">
                                    <button class="pull-right btn btn-default" id="sendEmail" type="button" onClick="zendmail();"><translate>Send </translate><i class="fa fa-arrow-circle-right"></i></button>
                                </div>
                            </div>
							
							
							 <!-- Image gallery -->
                            <?php /*?><div class="box box-info">
                                <div class="box-header">
                                    <i class="fa fa-envelope"></i>
                                    <h3 class="box-title">Image Gallery</h3>
                                    <!-- tools box -->
                                </div>
                                <div class="box-body">
                                    <form action="#" method="post">
                                      
                                        <div class="form-group">
                                            <input type="file" class="form-control" name="imgfil" id="imgfil" placeholder="Subject"/>
                                        </div>
                                      
                                    </form>
                                </div>
                                <div class="box-footer clearfix">
                                    <button class="pull-right btn btn-default" id="sendEmail">Send <i class="fa fa-arrow-circle-right"></i></button>
                                </div>
                            </div><?php */?>
							 <!-- /Image gallery -->


                        </section><!-- /.Left col -->
                        <!-- right col (We are only adding the ID to make the widgets sortable)-->
                        <section class="col-lg-6 connectedSortable"> 

                            <!-- Map box -->
                      <div class="nav-tabs-custom">
                                <!-- Tabs within a box -->
                                <ul class="nav nav-tabs ">
                                   <!-- <li class="active"><a href="#revenue-chart" data-toggle="tab">Area</a></li>
                                    <li><a href="#sales-chart" data-toggle="tab">Donut</a></li>-->
                                    <li class="pull-left header"><i class="fa fa-inbox"></i><translate> Employee Attendence Graph</translate></li>
                                </ul>
                                <div class="tab-content no-padding">
                                       <div id="chart_div" style="height: 300px;"></div>
								
                                </div>
                            </div>
                            <!-- /.box -->

                            <!-- solid sales graph -->
							<div class="box box-info">
                                <div class="box-header">
                                    <i class="fa fa-envelopess"></i>
                                    <h3 class="box-title"><translate>Weather Widget</translate></h3>
                                    <!-- tools box -->
                                    <div class="pull-right box-tools">
                                       
                                    </div><!-- /. tools -->
                                </div>
                           <div class="box-info full weather-widget" style="display:none;">
							<img src="images/weather-bg.jpg" class="img-responsive" alt="Weather city">
							<div class="overlay-weather-info">
								<h4><translate>WEATHER WIDGET</translate></h4>
								<div class="weather-info-city">
									<h4><i class="fa fa-map-marker"></i> <translate class="location">YOGYAKARTA, INDONESIA</translate></h4>
									<div class="row">
										<div class="col-xs-3">
											<i class="wi-day-sprinkle weather-icon"></i>
										</div>
										<div class="col-xs-9">
											<h5><translate class="condition">Sprinkle day</translate></h5>
											<h1><span class="temp"></span><sup>&#176;</sup>C</h1>
										</div>
									</div><!-- End div .row -->
								</div><!-- End div .weather-info-city -->
							</div><!-- End div .overlay-weather-info -->
						</div>      	</div>                      

                            <!-- Calendar -->
                            <div class="box box-solid bg-gradient">
                                <div class="box-header">
                                    <i class="fa fa-calendar"></i>
                                    <h3 class="box-title"><translate>Calendar</translate></h3>
                                    <!-- tools box -->
                                    <div class="pull-right box-tools">
                                        <!-- button with a dropdown -->
                                   <!--     <div class="btn-group">
                                            <button class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-bars"></i></button>
                               
                                        </div>
                                        <button class="btn btn-success btn-sm" data-widget="collapse"><i class="fa fa-minus"></i></button>
                                        <button class="btn btn-success btn-sm" data-widget="remove"><i class="fa fa-times"></i></button>  -->                                      
                                    </div><!-- /. tools -->
                                </div><!-- /.box-header -->
                                <div class="box-body no-padding">
                                    <!--The calendar -->
                                    <div id="calendars" style="width: 100%"></div>
                                </div><!-- /.box-body -->  
                                <?php /*?><div class="box-footer text-black">
                                    <div class="row">
                                        <div class="col-sm-6">
                                            <!-- Progress bars -->
                                           
                                        

                                          
                                          
                                        </div><!-- /.col -->
                                       
                                    </div><!-- /.row -->                                                                        
                                </div><?php */?>
                            </div><!-- /.box -->                            


<!-----new section sgk------------>
   
<!-----new section sgk------------>


<!-----Employee Gallery------------>

<!-----/Employee Gallery------------>


                        </section><!-- right col -->
                    </div><!-- /.row (main row) -->

                </section><!-- /.content -->
            </aside><!-- /.right-side -->
        </div><!-- ./wrapper -->

        <!-- add new calendar event modal -->


        <!-- jQuery 2.0.2 -->
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
        <!-- jQuery UI 1.10.3 -->
        <script src="js/jquery-ui-1.10.3.min.js" type="text/javascript"></script>
		<script src="js/chat.js" type="text/javascript"></script>
		<script>
		$(function(){
			var location;
			var country;
			var condition;
			var temp;
			
		     var geoFORECAST = 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid=1940345%20and%20u=%27c%27&format=json';
                    $.getJSON(geoFORECAST, function(json) {
                       console.log(json);
                      results = json.query.results.channel;
					  location = results.location.city+", "+results.location.country;
					  condition = results.item.condition.text;
					  temp  = results.item.condition.temp;
					  
					  $('.condition').text(condition);
					   $('.temp').text(temp);
					   $('.location').text(location);
					  $('.weather-widget').show('blind',500);
                     });
		 
		});
		</script>
		                           
      <!--   Bootstrap -->
        <script src="js/bootstrap.min.js" type="text/javascript"></script>
        <!-- Morris.js charts -->
        <script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
        <script src="js/plugins/morris/morris.min.js" type="text/javascript"></script>
        <!-- Sparkline -->
        <script src="js/plugins/sparkline/jquery.sparkline.min.js" type="text/javascript"></script>
        <!-- jvectormap -->
        <script src="js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js" type="text/javascript"></script>
        <script src="js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js" type="text/javascript"></script>
        <!-- jQuery Knob Chart -->
        <script src="js/plugins/jqueryKnob/jquery.knob.js" type="text/javascript"></script>
        <!-- daterangepicker -->
        <script src="js/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
        <!-- datepicker -->
        <script src="js/plugins/datepicker/bootstrap-datepicker.js" type="text/javascript"></script>
        <!-- Bootstrap WYSIHTML5 -->
        <script src="js/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js" type="text/javascript"></script>
        <!-- iCheck -->
        <script src="js/plugins/iCheck/icheck.min.js" type="text/javascript"></script>

        <!-- AdminLTE App -->
        <script src="js/AdminLTE/app.js" type="text/javascript"></script>

        <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
        <script src="js/AdminLTE/dashboard.js" type="text/javascript"></script>

        <!-- AdminLTE for demo purposes -->
        <script src="js/AdminLTE/demo.js" type="text/javascript"></script>
<script src="js/showpath.js" type="text/javascript"></script>

    </body>
</html>


<!-- <script type="text/javascript" src="https://www.google.com/jsapi"></script>-->
<script type="text/javascript" src="js/barimage.js"></script>

 <script type="text/javascript">

 
     var empc1=Number(document.getElementById("pcntemp1").value);
	var empc2=Number(document.getElementById("pcntemp2").value);
	var empc3=Number(document.getElementById("pcntemp3").value);
	var empc4=Number(document.getElementById("pcntemp4").value);
	var empc5=Number(document.getElementById("pcntemp5").value);
	var empc6=Number(document.getElementById("pcntemp6").value);
	var empc7=Number(document.getElementById("pcntemp7").value);
	var empc8=Number(document.getElementById("pcntemp8").value);
	var empc9=Number(document.getElementById("pcntemp9").value);
	var empc10=Number(document.getElementById("pcntemp10").value);
	var empc11=Number(document.getElementById("pcntemp11").value);
	var empc12=Number(document.getElementById("pcntemp12").value);
	///years
	var yr1=document.getElementById("dateyr1").value;
	var yr2=document.getElementById("dateyr2").value;
	var yr3=document.getElementById("dateyr3").value;
	var yr4=document.getElementById("dateyr4").value;
	var yr5=document.getElementById("dateyr5").value;
	
      google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {

  var data = google.visualization.arrayToDataTable([
    ['Month', 'Attendance'],
    ['Jan',  empc1],
    ['Feb',  empc2],
    ['Mar',  empc3],
    ['Apr',  empc4],
    ['May',  empc5],
    ['Jun',  empc6],
    ['Jul',  empc7],
    ['Aug',  empc8],
    ['Sep',  empc9],
    ['Oct',  empc10],
    ['Nov',  empc11],
    ['Dec',  empc12]
  ]);

  var options = {
    title: 'Attendance In %',
    hAxis: {title: 'Month', titleTextStyle: {color: 'red'}},
	'chartArea': {'width': '80%', 'height': '80%'}
  };

  var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));

  chart.draw(data, options);
  
 
}
    </script>
		<link href='fullcalendar/fullcalendar.css' rel='stylesheet' />
<link href='fullcalendar/fullcalendar.print.css' rel='stylesheet' media='print' />
<script src='fullcalendar/fullcalendar.min.js'></script>
<link rel="stylesheet" href="css/simplePagination.css" /><?php /*?><?php */?>
	<script type="text/javascript">
	function zendmail()
	{
	
	var serviceURLHR 	=localStorage['serviceURLHR'];
var HRPATH 			=localStorage['basicPATH'];
var hosturl    		=localStorage['basicURL'];
var HRPATH 			=HRPATH+'AdminLTE-master/';
	
		var frms = $('#myform').serialize(); 
	   		 	var rel=this.value;
			   $.ajax({
							type: "POST",
							url: serviceURLHR + "quickmail.php",
							data: frms,
							cache: false,
							beforeSend: function()
							{
				
							//$("#karygdistdiv").html('Loading..');
							
							},
							success: function(data)
							{
				
								//$("#msgs").val('');alert();
							}
	 	 });
		 
		 			
					goto_clr();
	}
	
	
	function goto_clr()
{

  document.getElementById('emailto').value = "";
    document.getElementById('subjects').value = "";
  
 $('#msgs').data("wysihtml5").editor.clear();
}
		</script>
	
<script>


var url_path=serviceURL + "advertisement.php?act=new";

var dataString = $('.save-advt').serialize();

  var formData = new FormData($('.save-advt')[0]);
  
  $.ajax({
   url: url_path,  //Server script to process data
   type: 'POST',
   data: formData,
   dataType:'json',
   processData: false,  // tell jQuery not to process the data
   contentType: false ,  // tell jQuery not to set contentType
   success: function(data)
   {
   }
   
   });
</script>

<script type="text/javascript">
holidayCalendars();
function holidayCalendars(){
	

	$("#calendars").append('<table class="calendarHolder" style="display:none;" ><tr></td><div id="calendar-div"></div></td></tr></table>');

	
	
		var calendar = $('#calendar-div').fullCalendar({
			eventSources: [ {url: "holidat.php?act=list"}],
			eventDrop: function(event, delta) {
				date = new Date(event.start).format("yyyy-mm-dd");
				$.get("holidat.php?act=update&title"+event.title+"&start="+date+"&id="+event.id);
			},
			selectable: true,
			selectHelper: true,
			select: function(start, end, allDay) {
				if(user_type == 'Superadmin')
				{
				var title = prompt('Event Title:');
				if (title) {
					date = new Date(start).format("yyyy-mm-dd");
					$.get("holidat.php?act=addNew&title="+title+"&start="+date,function(){
					
					calendar.fullCalendar('renderEvent',{
							title: title,
							start: start,
							end: end,
							allDay: allDay
						},true );
					 });
				}
				calendar.fullCalendar('unselect');
				}
			},
		/*	eventClick: function (calEvent, jsEvent, view) {       
				 if(confirm('Are you sure from removing the event?')){
					 $.get("holidat.php?act=remove&id="+calEvent._id)
						$('#calendar-div').fullCalendar('removeEvents', calEvent._id);
				 }
			},*/
			
			loading: function(bool) {
				if (bool) $('#loading').show();
				else $('#loading').hide();
			}
			
		});
	$('.calendarHolder').show('blind',500);
	//calendar.fullCalendar()
	
}
</script>

<script type="text/javascript">
function clock(eid,i)
{

if(i==1)
{

$(".clockedin-admin-click").hide();
$(".clockedin-admin-click-over").show();
}
if(i==2)
{

$(".clockedin-admin-click").show();
$(".clockedin-admin-click-over").hide();
}
			   $.ajax({
							type: "POST",
							url: "clockin.php",
							data: "rel_ID="+i,
							cache: false,
							beforeSend: function()
							{
						
							$(".clockedin-admin-click").html('Loading..');
							
							},
							success: function(data)
							{ if(i==2){
								$(".rrr").html(data);}
							}
	 	 });
			 
}
</script>
			