ok
Direktori : /home2/globaltriumphfou/public_html/admin_panel/ |
Current File : /home2/globaltriumphfou/public_html/admin_panel/home.php |
<?php include "dbconn.php"; include "checklogin.php"; include "function.php"; function get_bar($table,$field,$asc,$connection,$type,$fromdate,$todate) { if($type=='DATE') $sqlt="select count(*) as F_Cnt,DATE($field) as fstate from $table where DATE(create_date)>='$fromdate' and DATE(create_date)<='$todate' group by DATE($field) $asc"; else $sqlt="select count(*) as F_Cnt,$field as fstate from $table where DATE(create_date)>='$fromdate' and DATE(create_date)<='$todate' group by $field $asc"; $query=mysqli_query($connection,$sqlt); $num=mysqli_num_rows($query); if($num>0){ $fstate = array(); $fcnt = array(); while($rows=mysqli_fetch_assoc($query)) { array_push($fstate, $rows['fstate']); array_push($fcnt, $rows['F_Cnt']); } $fstateall = "'" . implode ( "', '", $fstate ) . "'"; $fcntall = implode ( ',', $fcnt ); } return array($fstateall,$fcntall,$sqlt); } if(isset($_POST['searchbut'])) { $fromdate=$_POST['fromdate']; $todate=$_POST['todate']; } else { $fromdate=date('Y-m').'-01'; $todate=date('Y-m-d'); } $arrayval=get_bar('contact','create_date','desc',$connection,'DATE',$fromdate,$todate); $arrayval1=get_bar('nomination_enquiry','create_date','desc',$connection,'DATE',$fromdate,$todate); ?> <!DOCTYPE html> <html lang="en"> <head> <meta name="description" content="Admin"> <!-- Twitter meta--> <meta property="twitter:card" content="summary_large_image"> <meta property="twitter:site" content="@pankaj"> <meta property="twitter:creator" content="@pankaj"> <!-- Open Graph Meta--> <meta property="og:type" content="website"> <meta property="og:site_name" content="Aaram Chairs"> <meta property="og:title" content="Aaram Chairs"> <meta property="og:description" content="Aaram Chairs Admin"> <title>Home</title> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Main CSS--> <link rel="stylesheet" type="text/css" href="css/main.css"> <!-- Font-icon css--> <link rel="stylesheet" type="text/css" href="fontawesome/font-awesome.min.css"> <script type="text/javascript" src="js/sortable.js"></script> <style> #containerbar,#containerbar1,#containerbar2,#containerbar3{ height: 300px; } .highcharts-figure, .highcharts-data-table table { max-width: 100%; margin: 1em auto; } .highcharts-data-table table { font-family: Verdana, sans-serif; border-collapse: collapse; border: 1px solid #EBEBEB; margin: 10px auto; text-align: center; width: 90%; } .highcharts-data-table caption { padding: 1em 0; font-size: 1.2em; color: #555; } .highcharts-data-table th { font-weight: 600; padding: 0.1em; } .highcharts-data-table td, .highcharts-data-table th, .highcharts-data-table caption { padding: 0.1em; } .highcharts-data-table thead tr, .highcharts-data-table tr:nth-child(even) { background: #f8f8f8; } .highcharts-data-table tr:hover { background: #f1f7ff; } .table { width: 100%; max-width: 100%; margin-bottom: 0px; } </style> </head> <body class="app sidebar-mini rtl"> <!-- Navbar--> <?php include "header.php"; ?> <!-- Sidebar menu--> <div class="app-sidebar__overlay" data-toggle="sidebar"></div> <?php $currentPage="home"; include "aside.php"; ?> <main class="app-content"> <div class="app-title"> <div> <h1><i class="fa fa-dashboard"></i> Dashboard</h1> </div> <ul class="app-breadcrumb breadcrumb"> <form id="fm1" name="fm1" method="post"> <table class="table"> <tr> <td align="left" valign="middle"><input value="<?php echo $fromdate; ?>" name="fromdate" type="date" placeholder="From Date" class="form-control"></td> <td align="left" valign="middle"><input value="<?php echo $todate; ?>" name="todate" type="date" placeholder="To Date" class="form-control"></td> <td><input type="submit" name="searchbut" value="Search" class="btn btn-primary"></td> </tr> </table> </form> </ul> </div> <div class="row"> <div class="col-md-12"> <div class="tile"> <div class="tile-body table-responsive"> <!----> <table> <tr> <td><div id="containerbar"></div></td> <td><div id="containerbar1"></div></td> </tr> </table> <!----> </div> </div> </div> </div> </main> <?php include "footer.php"; ?> <!-- Essential javascripts for application to work--> <script src="js/jquery-3.2.1.min.js"></script> <script src="js/popper.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/main.js"></script> <!-- The javascript plugin to display page loading on top--> <script src="js/plugins/pace.min.js"></script> <script src="code/highcharts.js"></script> <script src="code/highcharts-3d.js"></script> <script type="text/javascript"> Highcharts.chart('containerbar', { chart: { type: 'column' }, title: { text: 'Contact-Enquiry' }, subtitle: { text: '' }, xAxis: { categories: [<?php echo $arrayval[0]; ?>], title: { text: null } }, yAxis: { min: 0, title: { text: '', align: 'high' }, labels: { overflow: 'justify' } }, tooltip: { valueSuffix: ' ' }, plotOptions: { bar: { dataLabels: { enabled: true } }, series: { colorByPoint: true }, column: { dataLabels: { enabled: true } } }, legend: { layout: 'horizontal', align: 'right', verticalAlign: 'bottom', x: -40, y: 80, floating: true, borderWidth: 1, backgroundColor: Highcharts.defaultOptions.legend.backgroundColor || '#FFFFFF', shadow: true }, credits: { enabled: false }, series: [{ name: 'Contact-Enquiry', data: [<?php echo $arrayval[1]; ?>] }] }); Highcharts.chart('containerbar1', { chart: { type: 'column' }, title: { text: 'Nomination-Enquiry' }, subtitle: { text: '' }, xAxis: { categories: [<?php echo $arrayval1[0]; ?>], title: { text: null } }, yAxis: { min: 0, title: { text: '', align: 'high' }, labels: { overflow: 'justify' } }, tooltip: { valueSuffix: ' ' }, plotOptions: { bar: { dataLabels: { enabled: true } }, series: { colorByPoint: true }, column: { dataLabels: { enabled: true } } }, legend: { layout: 'horizontal', align: 'right', verticalAlign: 'bottom', x: -40, y: 80, floating: true, borderWidth: 1, backgroundColor: Highcharts.defaultOptions.legend.backgroundColor || '#FFFFFF', shadow: true }, credits: { enabled: false }, series: [{ name: 'Nomination-Enquiry', data: [<?php echo $arrayval1[1]; ?>] }] }); </script> </body> </html>