View unanswered posts | View active topics It is currently Mon Mar 27, 2017 10:13 pm



Reply to topic  [ 2 posts ] 
 How to use tooltip in php using ajax 
Author Message
Junior Member

Joined: Sun Apr 17, 2011 11:07 pm
Posts: 1
Post How to use tooltip in php using ajax
Hello All,
I am trying to apply tooltip class in my code in insertdata.php, but its not working can anyone help me
In this code tooltip class ie 'cont tooltip ui-corner-all' properly worked
my code is

Code:

<form name="myform" class="pager-form"&nbsp;method="post" action="">
           <div class="hastable" id="div_month_wise_follow_up">

                  &nbsp; <table class="sortable">
                  &nbsp;     <thead>
                  &nbsp;     <tr>
                  &nbsp;        &nbsp;<th width="40">Sr no</th>
                  &nbsp;        &nbsp;<th width="70">Name</th>
                  &nbsp;        &nbsp;<th width="90">Email Address</th>
                  &nbsp;        &nbsp;<th width="150">Follow Up Description</th>
                  &nbsp;        &nbsp;<th width="120">Assign To</th>;
                  &nbsp;     </tr>
                  &nbsp;     </thead>
                  &nbsp; <tbody>
                  &nbsp;     <?php
                  &nbsp;     $i=1;
                  &nbsp;     $sr_no = 1;
                  &nbsp;        &nbsp;if($_GET['page']==1 || $_GET['page']=='')
                  &nbsp;        &nbsp;        {
                  &nbsp;        &nbsp;        &nbsp;   $sr_no=1;
                  &nbsp;        &nbsp;        }
                  &nbsp;        &nbsp;        else
                  &nbsp;        &nbsp;        $sr_no= (($_GET['page']-1)*$limit)+1;
                  &nbsp;     $sum=0;
                  &nbsp;     $prevUserID =&nbsp;0;
                  &nbsp;     $a=0;

                  &nbsp;     while($res2=mysql_fetch_array($sql1)){


                  &nbsp;     ?>
                  &nbsp;        &nbsp; <tr class="0"<?php $class_name?>>
                  &nbsp;        &nbsp;   <td class="center"><;?php echo $sr_no; ?></td>
                  &nbsp;        &nbsp;   <td><?php echo ;$res2['name'];?></td>
                  &nbsp;        &nbsp;   <td><?php echo ;$res2['email']; ?></td>
                  &nbsp;        &nbsp;   <td><div class="cont tooltip ui-corner-all" title="<?php echo $res2['description']; ?> "><?php echo substr($res2['description'],0,30); ?> </div></td>
                  &nbsp;        &nbsp;   <td style="text-align:center"><?php echo $res2['fname'];?><;/td>
                  &nbsp;        &nbsp; </tr>

                  &nbsp;     <?php

                  &nbsp;        &nbsp;    $sr_no++;
                  &nbsp;     }   &nbsp;?>
             </tbody>

                </table>;
        </div>
        </form>



but in insertdata.php ,its not applying
my insertdata.php code is
Code:

<?php
if($_POST['formname'] == 'month_wise_follow_up_report')
{

    $trimmed = trim($var);
    $type = $_POST['type'];
    $mnt = $_POST['sel_month'];
    $yer = $_POST['sel_year'];
    $sels_r= $_POST['sales_representative'];
    if($_POST['sel_month']!= " " and $_POST['sel_year'] != "" and $_POST['sales_representative']!="")
        {        //echo "select cm.name,cm.email,fp.description,u.fname from client_master as cm,follow_up as fp,user as u where fp.client_id=cm.user_id and cm.assignto=u.admin_user_id and month(cm.created_date) = ".date('m')." and year(cm.created_date) = ".date('Y')."";           
            $sql2 = "select cm.name,cm.email,fp.description,u.fname from client_master as cm,follow_up as fp,user as u where fp.client_id=cm.user_id and cm.assignto=u.admin_user_id and month(fp.follow_up_date) = ".$mnt." and year(fp.follow_up_date) = ".$yer." and cm.assignto= $sels_r";
        }

    else
    {
           $sql2 = "select cm.name,cm.email,fp.description,u.fname from client_master as cm,follow_up as fp,user as u where fp.client_id=cm.user_id and cm.assignto=u.admin_user_id and month(fp.follow_up_date) = ".$mnt." and year(fp.follow_up_date) = ".$yer."";
    }

    $qry2 = mysql_query($sql2);     


    $new_month_wise_report = "";
    $new_month_wise_report .="
      <div class='hastable' id='div_month_wise_follow_up'>
    <table class='sortable'>
                        <thead>
                        <tr>
                            <th width='40'>Sr no</th>
                            <th width='70'>Name</th>
                            <th width='90'>Email Address</th>
                            <th width='150'>Follow Up Description</th>
                            <th width='120'>Assign To</th>
                        </tr>
                        </thead>
                    <tbody>";


                        $sr_no = 1;


                        while($res2=mysql_fetch_array($qry2))
                        {
                        //'<div class='cont tooltip ui-corner-all' title='".$res2['description'];."'>'   

            $new_month_wise_report .="<tr class='0'".$class_name.">
                                <td class='center'>".$sr_no."</td>
                                <td>
                                    ".$res2['name']."
                                </td>
                                <td>".$res2['email']."</td>
                                <td><div class='cont tooltip ui-corner-all' title='".$res2['description']."' > ".substr($res2['description'],0,30)."</div></td>
                                <td style='text-align:center'>".$res2['fname']."</td>
                            </tr>";

                            $sr_no++;
                        }   
            $new_month_wise_report .="</tbody>

                            </table></div>";

    echo "month_wise_follow_up_report|".$new_month_wise_report;
}
?>




my validate\.js code is

Code:

function search_month_wise_follow_up_report(val)
{    //alert(val);
    var month = document.getElementById('sel_month').value;
    var year = document.getElementById('sel_year').value;
    var sales_r = document.getElementById('sales_representative').value;
    var type = val;

    var parameters ='formname=month_wise_follow_up_report&sel_month='+month+'&sel_year='+year+'&type='+type+'&sales_representative='+sales_r+'&';
    makeRequest('insert_data.php', parameters);   
    return false;
}




getcontent.js file is

Code:

if(act.indexOf('month_wise_follow_up_report')>0)
            {
                document.getElementById('div_month_wise_follow_up').innerHTML = "";
                document.getElementById('div_month_wise_follow_up').innerHTML=res[1];
                document.getElementById('div_pagination').innerHTML = "";
            }




Sun Apr 17, 2011 11:13 pm
Report this post
Profile
Junior Member

Joined: Mon Nov 28, 2011 11:43 pm
Posts: 2
Post Re: How to use tooltip in php using ajax
I have been using php for developing web application for the past couple of years but new to AJAX. I have implemented tooltip facility on a web application with the help of AJAX successfully and it is working fine. One of my friends, who is been working with AJAX with rfid reader implementation for more than a year has helped me in implementing the tooltip facility. I will share your problem with the tooltip class with him so that I think he can help you. I have saved the codes that you pasted in this post so that I can show it to him.


Mon Nov 28, 2011 11:46 pm
Report this post
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.