ok
Direktori : /proc/self/root/home2/selectio/www/wedding-info-new/ |
Current File : //proc/self/root/home2/selectio/www/wedding-info-new/ranking.php |
<?php include "header.php"; ?> <?php $query = "SELECT * FROM `tbl_seller` ORDER BY `share_count` DESC LIMIT 10"; $prepared2 = $pdo->prepare($query); $prepared2->execute(); $result = $prepared2->fetchAll(PDO::FETCH_ASSOC); $dataPoints = array(); $i=0; foreach ($result as $row) { $i+=1; $dataPoints[] = array("x" => $i, "y" => $row['share_count'], "indexLabel" => $row['company_name']); } ?> <style> .canvasjs-chart-credit { display: none; } </style> <section class="form-section px-15 section-b-space"> <div class="row" > <div class="col-12" > <div style="margin:10px" id="chartContainer" style="height: 370px; width: 100%;"></div> </div> </div> <div class="row" style="position:relative;top:470px"> <div class="col-12" > <table class="table table-sm"> <tr> <th>Sl.No</th> <th>Company Name</th> <th>City</th> <th>Mail</th> </tr> <?php $i=0; foreach ( $result as $data ) { $i++ ?> <tr> <td><?=$i?></td> <td><?=$data['company_name']?></td> <td><?=$data['c_city']?></td> <td><?=$data['c_email_id']?></td> </tr> <?php } ?> </table> </div> <br> <div class="col-12" > <center>First - <?=$result[0]['company_name']?></center> <center>Second - <?=$result[1]['company_name']?></center> <center>Third - <?=$result[2]['company_name']?></center> </div> </div> </div> <script> window.onload = function () { var chart = new CanvasJS.Chart("chartContainer", { animationEnabled: true, exportEnabled: true, theme: "light1", title: { text: "Top Seller Ranking" }, axisY: { includeZero: true }, data: [{ type: "column", indexLabelFontColor: "#5A5757", indexLabelPlacement: "outside", dataPoints: <?php echo json_encode($dataPoints, JSON_NUMERIC_CHECK); ?> }] }); chart.render(); } </script> <?php include "footer2.php"; ?>