Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php include("DB_Connect.php");
- header("Content-Type: text/html; charset=utf-8");
- ?>
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
- <title>Результаты</title>
- <link href="css/Style.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="https://www.google.com/jsapi"></script>
- <script type="text/javascript" src="js/jquery-2.1.4.min.js"></script>
- <?php if(count($_POST["TestId"])>0){?>
- <script type="text/javascript">
- google.load("visualization", "1", {packages:["corechart"]});
- google.setOnLoadCallback(drawVisualization);
- function drawVisualization() {
- // Some raw data (not necessarily accurate)
- var data = google.visualization.arrayToDataTable([
- <?php include("GoogleComboData.php");?>
- ]);
- var options = {
- title : 'Динамика тестирования',
- vAxis: {title: "Проценты"},
- hAxis: {title: "Ученики"},
- seriesType: "bars",
- series: {5: {type: "line"}}
- };
- var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));
- chart.draw(data, options);
- }
- </script>
- <?php }?>
- <script type="text/javascript">
- $("select[id='ListFilterQuery']").change(function () {
- // получаем то, что написал пользователь
- var GroupNames = $("select[name=GroupName]").val();
- alert(GroupNames);
- // формируем строку запроса
- var data = 'GroupName='+GroupNames;
- // если GroupNames не пустая
- if(GroupNames) {
- // делаем ajax запрос
- $ajax({
- type: "POST",
- url: "GoogleFilterAjax.php",
- data: data,
- beforeSend: function(html) { // запустится до вызова запроса
- $("#resultsQuery").html('');
- //$(".word").html(GroupNames);
- },
- success: function(html){ // запустится после получения результатов
- $("#resultsQuery").show();
- $("#resultsQuery").append(html);
- }
- });
- }
- return false;
- });
- </script>
- </head>
- <body>
- <table class="frame">
- <tr>
- <td>
- <?php include("Menu.php");?>
- </td>
- </tr>
- <tr>
- <td>
- <?php $ListTestSQL=mysql_query("SELECT Name,Id FROM tests");
- $ListGroupSQL=mysql_query("SELECT `Id`,`Group` FROM users WHERE NOT `Group`='' GROUP BY `Group` ORDER BY `Group` ASC");?>
- <div class="contextdiv">
- <form method="post">
- <select multiple name="TestId[]" class="ListFilter">
- <?php while($ListTest=mysql_fetch_array($ListTestSQL)){
- echo"<option value='".$ListTest["Id"]."'>".$ListTest["Name"]."</option>";
- }?>
- </select>
- <select name="GroupName" class="ListFilter" id="ListFilterQuery" multiple="multiple">
- <?php while($ListGroup=mysql_fetch_array($ListGroupSQL)){
- echo"<option value='".$ListGroup["Group"]."'>".$ListGroup["Group"]."</option>";
- }?>
- </select>
- <select multiple name="UserName[]" class="ListFilter" id="resultsQuery">
- </select>
- <br/>
- <input type="submit" value="Построить" class='SubmitButton'>
- </form>
- </div>
- <?php if(count($_POST["TestId"])>0){?><div id="chart_div" style="width: 750px; height: 500px; float:left; margin:25px 0 0 25px"></div><?php }?>
- </td>
- </tr>
- <tr>
- <td style="padding-left:25%;"> </td>
- </tr>
- </table>
- <?php include("GoogleComboData.php");?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement