Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <link href='jquery-ui.css' rel='stylesheet' type='text/css'>
- <script src='jquery-1.12.0.min.js' type='text/javascript'></script>
- <script src='jquery-ui.js' type='text/javascript'></script>
- <script>
- $(document).ready(function(){
- // initialize tooltip
- $( ".panel-body td" ).tooltip({
- track:true,
- open: function( event, ui ) {
- var id = this.id;
- var split_id = id.split('_');
- var module_id = split_id[1];
- $.ajax({
- url:'fetch_details.php',
- type:'post',
- data:{module_id:module_id},
- success: function(response){
- // Setting content option
- $("#"+id).tooltip('option','content',response);
- }
- });
- }
- });
- $(".panel-body td").mouseout(function(){
- // re-initializing tooltip
- $(this).attr('title','Please wait...');
- $(this).tooltip();
- $('.ui-tooltip').hide();
- });
- });
- </script>
- <?php
- $dbhost = 'localhost';
- $dbuser = 'root';
- $dbpass = '';
- $conn = mysql_connect($dbhost, $dbuser, $dbpass);
- if(! $conn ) {
- die('Could not connect: ' . mysql_error());
- }
- echo '';
- mysql_select_db( 'dbname' );
- $moduleid = $_POST['module_id'];
- $sql=mysql_query("SELECT title FROM table WHERE module_id='$moduleid'");
- $html = '<div>';
- $i = 1 ;
- if( $sql === FALSE ) {
- trigger_error('Query failed returning error: '. mysql_error(),E_USER_ERROR);
- } else {
- while($row = mysql_fetch_array($result)){
- $title = $row['title'];
- $html .= "<span class='head'>"<?php echo $title ; ?> " :</span><span>"" mins</span><br/>";
- $i++;}}
- $html .= '</div>';
- echo $html;
- ?>
Add Comment
Please, Sign In to add comment