
            <div class="breadcome-area">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                            <div class="breadcome-list">
                                <div class="row">
                                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
                                        <div class="breadcomb-wp">
											<div class="breadcomb-icon">
												<i class="icon nalika-home"></i>
											</div>
											<div class="breadcomb-ctn">
												<h2>Dashboard</h2>
												<p>Welcome to Spectracloud<span class="bread-ntd">Admin </span></p>
											</div>
										</div>
                                    </div>
                                 
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="section-admin container-fluid">
            <div class="row admin text-center">
                <div class="col-md-12">
                    <div class="row">
 <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12" style="margin-bottom:1px;">
                            <div class="admin-content analysis-progrebar-ctn res-mg-t-30">
                                <h4 class="text-left text-uppercase"><b>Datacenter</b></h4>
                                <div class="row vertical-center-box vertical-center-box-tablet">
                                    <div class="text-left col-xs-3 mar-bot-15">
									<?php
									 $sql = "SELECT count(*) as count FROM datacenter where IsActive=0";
									 $record = $this->db->query($sql);
									 $d=$record->row('count');
									?>                                    </div>
                                    <div class="col-xs-9 cus-gh-hd-pro">
                                        <h2 class="text-right no-margin"><?=$d?></h2>
                                    </div>
                                </div>
                                <div class="progress progress-mini">
                                    <div style="width: 100%;" class="progress-bar progress-bar-danger bg-red"></div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12" style="margin-bottom:1px;">
                            <div class="admin-content analysis-progrebar-ctn res-mg-t-30">
                                <h4 class="text-left text-uppercase"><b>Rack</b></h4>
                                <div class="row vertical-center-box vertical-center-box-tablet">
                                    <div class="text-left col-xs-3 mar-bot-15">
									<?php
									 $sql1 = "SELECT count(*) as count FROM rack where IsActive=0";
									 $record1 = $this->db->query($sql1);
									 $rack=$record1->row('count');
									?>                                    </div>
                                    <div class="col-xs-9 cus-gh-hd-pro">
                                        <h2 class="text-right no-margin"><?=$rack?></h2>
                                    </div>
                                </div>
                                <div class="progress progress-mini">
                                    <div style="width: 100%;" class="progress-bar progress-bar-danger bg-red"></div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
                            <div class="admin-content analysis-progrebar-ctn res-mg-t-30">
                                <h4 class="text-left text-uppercase"><b>Server</b></h4>
                                <div class="row vertical-center-box vertical-center-box-tablet">
                                    <div class="text-left col-xs-3 mar-bot-15">
                                    </div>
									<?php
									 $sql11 = "SELECT count(*) as count FROM server where IsActive=0";
									 $record11 = $this->db->query($sql11);
									 $server=$record11->row('count');
									?> 
                                    <div class="col-xs-9 cus-gh-hd-pro">
                                        <h2 class="text-right no-margin"><?=$server?></h2>
                                    </div>
                                </div>
                                <div class="progress progress-mini">
                                    <div style="width: 100%;" class="progress-bar bg-blue"></div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
                            <div class="admin-content analysis-progrebar-ctn res-mg-t-30">
                                <h4 class="text-left text-uppercase"><b>Customer</b></h4>
                                <div class="row vertical-center-box vertical-center-box-tablet">
                                    <div class="text-left col-xs-3 mar-bot-15">
                                    </div>
									<?php
									 $sql111 = "SELECT count(*) as count FROM customer where IsActive=0";
									 $record111 = $this->db->query($sql111);
									 $cust=$record111->row('count');
									?>
                                    <div class="col-xs-9 cus-gh-hd-pro">
                                        <h2 class="text-right no-margin"><?=$cust?></h2>
                                    </div>
                                </div>
                                <div class="progress progress-mini">
                                    <div style="width: 100%;" class="progress-bar bg-purple"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="product-sales-area mg-tb-30">
            <div class="container-fluid">
                <div class="row">
				         <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
                        <div class="sparkline8-list mt-b-30">

								 <div class="sparkline8-hd">
                                <div class="main-sparkline8-hd">
                                    <h1>
                            </div>
							                							    <script type="text/javascript">
function personalia_showform(obj){
	var no_of_vehicle = obj.value;
	var pers_gesl = obj.value;
<?php echo "window.location.href='main?cat=' +pers_gesl";?>
}
</script> 
                            <div class="sparkline8-graph">
                                <div class="basic-login-form-ad">
                      
                                    <div class="row">
                                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                            <div class="basic-login-inner">
                                                <p></p>
                                              
													<div class="form-group-inner">
                                                        <label>Server</label>
                                                        <select required name="server" class="form-control" onchange="personalia_showform(this);">
														<option>select</option>
														<?php
														 $sqls = "SELECT * FROM server where IsActive=0";
														$records = $this->db->query($sqls);
														$ss=$records->result_array();
														foreach($ss as $s)
														{
															?>
															<option value="<?=$s['id']?>"><?=$s['server_name']?></option>
															<?php
														}
														?>
														</select>
                                                    </div> 
												
                                                  
                                            </div>
                                        </div>
                                     
                                    </div>
                                </div>
                            </div>
							</div>
								
                        
                    </div>
                    </div>
                    <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12">
                        <div class="product-sales-chart">
                            <div class="portlet-title">
                                <div class="row">
                                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
															   <?php
						   $cat=$_GET['cat'];
						  // echo $cat;
						//   exit;
						
				 $sql4 = "SELECT server_name,ram FROM server where id='$cat'";
        $record4 = $this->db->query($sql4);
        $s1=$record4->row('ram');
        $server_name=$record4->row('server_name');

		$sql5 = "SELECT sum(ram) as ram_a FROM allocation where server_id='$cat'";
        $record5 = $this->db->query($sql5);
        $s2=$record5->row('ram_a');
		
$i=$s1;
$j=$s2;
$k=$s1-$s2;


	 $sql6 = "SELECT cpu FROM server where id='$cat'";
        $record6 = $this->db->query($sql6);
        $s3=$record6->row('cpu');

		$sql7 = "SELECT sum(cpu) as cpu FROM allocation where server_id='$cat'";
        $record7 = $this->db->query($sql7);
        $s4=$record7->row('cpu');
		
$i1=$s3;
$j1=$s4;
$k1=$s3-$s4;


 $sql8 = "SELECT hard_drive FROM server where id='$cat'";
        $record8 = $this->db->query($sql8);
        $s5=$record8->row('hard_drive');

		$sql9 = "SELECT sum(hard_drive) as hard_drive FROM allocation where server_id='$cat'";
        $record9 = $this->db->query($sql9);
        $s6=$record9->row('hard_drive');
		
$i2=$s5;
$j2=$s6;
$k2=$s5-$s6;

$sql10 = "SELECT count(*) as count FROM allocation where server_id='$cat'";
        $record10 = $this->db->query($sql10);
        $s7=$record10->row('count');

$c1=$s7;
?>
                                        <div class="caption pro-sl-hd">
                                            <span class="caption-subject text-uppercase"><b>Server <?=$server_name?> Details </b></span>
                                        </div>
                                    </div>
                                    <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12">
                                        <div class="actions graph-rp">
                                            <div class="btn-group" data-toggle="buttons">
                                                <label class="btn btn-grey active">
													<input type="radio" name="options" class="toggle" id="option1" checked=""></label>
                                                <label class="btn btn-grey">
													<input type="radio" name="options" class="toggle" id="option2"></label>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                           <div>

    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript">
      google.charts.load('current', {'packages':['bar']});
      google.charts.setOnLoadCallback(drawChart);

      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Server', 'Total', 'Used','Remaining'],
          ['RAM', <?php echo $i?>, <?php echo $j?>,<?php echo $k?>],
          ['CPU', <?php echo $i1?>, <?php echo $j1?>,<?php echo $k1?>],
          ['HARD DISK', <?php echo $i2?>, <?php echo $j2?>,<?php echo $k2?>],
          ['ALLOCATION', <?php echo $c1?>,0,0],
        ]);

        var options = {
          chart: {
            title: 'Server details',
          }
        };

        var chart = new google.charts.Bar(document.getElementById('columnchart_material'));

        chart.draw(data, google.charts.Bar.convertOptions(options));
      }
    </script>
  </head>
    <div id="columnchart_material" style="width:100%; height: 400px;"></div>
 
 </div>
 
 
                        </div>
                    </div>
					<!--
                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
                        <div class="white-box analytics-info-cs mg-b-30 res-mg-t-30">
                            <h3 class="box-title">RAM</h3>
                            <ul class="list-inline two-part-sp">
                                <li>
                                    <div id="sparklinedash"></div>
                                </li>
                                <li class="text-right sp-cn-r"><i class="fa fa-level-up" aria-hidden="true"></i> <span class="counter sales-sts-ctn">20</span></li>
                            </ul>
                        </div>
                        <div class="white-box analytics-info-cs mg-b-30">
                            <h3 class="box-title">CPU</h3>
                            <ul class="list-inline two-part-sp">
                                <li>
                                    <div id="sparklinedash2"></div>
                                </li>
                                <li class="text-right"><i class="fa fa-level-up" aria-hidden="true"></i> <span class="counter sales-sts-ctn">2</span></li>
                            </ul>
                        </div>
                        <div class="white-box analytics-info-cs mg-b-30">
                            <h3 class="box-title">HARD DISK</h3>
                            <ul class="list-inline two-part-sp">
                                <li>
                                    <div id="sparklinedash3"></div>
                                </li>
                                <li class="text-right"><i class="fa fa-level-up" aria-hidden="true"></i> <span class="counter sales-sts-ctn">500</span></li>
                            </ul>
                        </div>
                        <div class="white-box analytics-info-cs">
                            <h3 class="box-title">CUSTOMER ALLOCATION</h3>
                            <ul class="list-inline two-part-sp">
                                <li>
                                    <div id="sparklinedash4"></div>
                                </li>
                                <li class="text-right"><i class="fa fa-level-down" aria-hidden="true"></i> <span class="sales-sts-ctn">2</span></li>
                            </ul>
                        </div>
                    </div>-->
                </div>
            </div>
        </div>




