Guest User

Untitled

a guest
Dec 15th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. <link href='jquery-ui.css' rel='stylesheet' type='text/css'>
  2. <script src='jquery-1.12.0.min.js' type='text/javascript'></script>
  3. <script src='jquery-ui.js' type='text/javascript'></script>
  4.  
  5. <script>
  6. $(document).ready(function(){
  7.  
  8. // initialize tooltip
  9. $( ".panel-body td" ).tooltip({
  10. track:true,
  11. open: function( event, ui ) {
  12. var id = this.id;
  13. var split_id = id.split('_');
  14. var module_id = split_id[1];
  15.  
  16. $.ajax({
  17. url:'fetch_details.php',
  18. type:'post',
  19. data:{module_id:module_id},
  20. success: function(response){
  21.  
  22. // Setting content option
  23. $("#"+id).tooltip('option','content',response);
  24.  
  25. }
  26. });
  27. }
  28. });
  29.  
  30. $(".panel-body td").mouseout(function(){
  31. // re-initializing tooltip
  32. $(this).attr('title','Please wait...');
  33. $(this).tooltip();
  34. $('.ui-tooltip').hide();
  35. });
  36.  
  37. });
  38. </script>
  39.  
  40. <?php
  41.  
  42. $dbhost = 'localhost';
  43. $dbuser = 'root';
  44. $dbpass = '';
  45. $conn = mysql_connect($dbhost, $dbuser, $dbpass);
  46. if(! $conn ) {
  47. die('Could not connect: ' . mysql_error());
  48. }
  49. echo '';
  50. mysql_select_db( 'dbname' );
  51.  
  52. $moduleid = $_POST['module_id'];
  53.  
  54. $sql=mysql_query("SELECT title FROM table WHERE module_id='$moduleid'");
  55.  
  56.  
  57. $html = '<div>';
  58. $i = 1 ;
  59. if( $sql === FALSE ) {
  60. trigger_error('Query failed returning error: '. mysql_error(),E_USER_ERROR);
  61. } else {
  62. while($row = mysql_fetch_array($result)){
  63. $title = $row['title'];
  64.  
  65. $html .= "<span class='head'>"<?php echo $title ; ?> " :</span><span>"" mins</span><br/>";
  66. $i++;}}
  67. $html .= '</div>';
  68.  
  69. echo $html;
  70.  
  71. ?>
Add Comment
Please, Sign In to add comment