Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. <?php
  2. // First execute our common code to connection to the database and start the session
  3. require("common.php");
  4.  
  5. //find the university's id from the url
  6. $current_id = $_GET[id];
  7.  
  8. //run a query to find the name of the hall, using the id in the url ($current_id)
  9. if ($findname = $db->prepare("SELECT * FROM hall WHERE id = :current_id")) {
  10. $findname->bindParam(':current_id', $current_id);
  11. $findname->execute(); // Execute the prepared query.
  12.  
  13. //search table for all fields and save them in $hall_name
  14. $nametemp = $findname->fetchAll();
  15. foreach( $nametemp as $hall_name) {
  16. ?>
  17. <head>
  18.  
  19. <title><? echo $hall_name['name'];?></title>
  20.  
  21. </head>
  22.  
  23. <body>
  24.  
  25. <div id="Name">
  26. <? echo $hall_name['name']; }}?>
  27. </div>
  28.  
  29. <?php // content="text/plain; charset=utf-8"
  30. require_once ('jpgraph/jpgraph.php');
  31. require_once ('jpgraph/jpgraph_line.php');
  32.  
  33. $datay1 = array(20,15,23,15);
  34. $datay2 = array(12,9,42,8);
  35. $datay3 = array(5,17,32,24);
  36.  
  37. // Setup the graph
  38. $graph = new Graph(300,250);
  39. $graph->SetScale("textlin");
  40.  
  41. $theme_class=new UniversalTheme;
  42.  
  43. $graph->SetTheme($theme_class);
  44. $graph->img->SetAntiAliasing(false);
  45. $graph->title->Set('Filled Y-grid');
  46. $graph->SetBox(false);
  47.  
  48. $graph->img->SetAntiAliasing();
  49.  
  50. $graph->yaxis->HideZeroLabel();
  51. $graph->yaxis->HideLine(false);
  52. $graph->yaxis->HideTicks(false,false);
  53.  
  54. $graph->xgrid->Show();
  55. $graph->xgrid->SetLineStyle("solid");
  56. $graph->xaxis->SetTickLabels(array('A','B','C','D'));
  57. $graph->xgrid->SetColor('#E3E3E3');
  58.  
  59. // Create the first line
  60. $p1 = new LinePlot($datay1);
  61. $graph->Add($p1);
  62. $p1->SetColor("#6495ED");
  63. $p1->SetLegend('Line 1');
  64.  
  65. // Create the second line
  66. $p2 = new LinePlot($datay2);
  67. $graph->Add($p2);
  68. $p2->SetColor("#B22222");
  69. $p2->SetLegend('Line 2');
  70.  
  71. // Create the third line
  72. $p3 = new LinePlot($datay3);
  73. $graph->Add($p3);
  74. $p3->SetColor("#FF1493");
  75. $p3->SetLegend('Line 3');
  76.  
  77. $graph->legend->SetFrameWeight(1);
  78.  
  79. // Output line
  80. $graph->Stroke();
  81.  
  82. ?>
  83.  
  84. </body>
  85. </html>
  86.  
  87. <img src="foo.php">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement