Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8789053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:17:46+00:00 2026-06-13T22:17:46+00:00

I have created one jquery mobile site which having the tab control and it

  • 0

I have created one jquery mobile site which having the tab control and it is not working when we are seeing the page at the first time,but after reloading the page it is working.

I wanted to make it should work before reloading also…..

Here the code For that ….

<?php
require_once"session.php";
require_once"getDetails.php";
$docId =$_GET['docId'];
$selDoc=$dbHandle->execQuery("SELECT * FROM master_doctor WHERE doctor_id='$docId'");
$fetDoc=$dbHandle->fetchObjectQuery($selDoc);

$qlfyVal='';
$qualId =explode(",",$fetDoc->qualification_id);
for($i=0;$i<sizeof($qualId);$i++)
{
    $qlfyVal .=comnName('doc_qualification','name','qualification_id',$qualId[$i]).',';
}
$qlfyVal =substr($qlfyVal,0,strlen($qlfyVal)-1);
?>
<!DOCTYPE html> 
<html> 
<head> 
    <title><?php echo $fetDoc->salutation.'.'.ucfirst($fetDoc->fname).ucfirst($fetDoc->lname).' '.$qlfyVal;?> Details</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <?php require_once"header.php";?>

    <script type="text/javascript">
        function ShowHide(id)
        {
            $('.datatab').each(function(){
                if($(this).attr('id') != id)
                {
                    $(this).hide();
                }
                else
                {
                    $(this).show();
                }
            });
        }
    </script>
</head> 
<body> 
<div data-role="page" id="docView" >
    <div data-role=header data-theme="e" >
        <a href="doctorgrid.php" data-icon="back" ><font size="2px">back</font></a>
        <h1 align="left"><font size="2px"><?php echo $fetDoc->salutation.'.'.ucfirst($fetDoc->fname).ucfirst($fetDoc->lname).' '.$qlfyVal;?> Details</font></h1>
    </div>
    <div data-role=content>
    <div data-role="navbar">
        <ul>
            <li class="tabLi"><a onclick="ShowHide('contact')" class="ui-btn-active ui-state-persist">Contact</a></li>
            <li class="tabLi"><a  onclick="ShowHide('primary')">Primary</a></li>
            <li class="tabLi"><a  onclick="ShowHide('working')">Working</a></li>
        </ul>
    </div>
    <div class="data-clear">
    </div>
    <div id="contact" class="datatab" >
    <ul data-role=listview data-inset=true data-theme=d>
      <li data-theme=e  ><font size="2px"> Contact Info </font></li>

      <li><font size="2px"> Phone No : 
      <?php 
      function ckVal($val,$ref)
      {
        $tmp="NA";
        if($val != '')
        {
            if($ref == 'tel')
            {
                $tmp =',<a href="tel:'.$val.'">'.$val.'</a>';
            }
            else if($ref == 'mail')
            {
                $tmp =',<a href="mail:'.$val.'">'.$val.'</a>';
            }
            else
            {
                $tmp =','.$val;
            }
        }
        return $tmp;
      }
     if($fetDoc->phone1!= '')
     {
        $ctNo ='<br/><a href="tel:'.$fetDoc->phone1.'">'.$fetDoc->phone1.'</a><br/>'.ckVal($fetDoc->phone2,'tel').'<br/>'.ckVal($fetDoc->mobile1,'tel').'<br/>'.ckVal($fetDoc->mobile2,'tel');
     }
     else
     {
        $ctNo ='<br/>'.ckVal($fetDoc->phone2,'tel').ckVal($fetDoc->mobile1,'tel').ckVal($fetDoc->mobile2,'tel');
     }
     echo $ctNo;
     ?></font></li>

      <li><font size="2px"> Mail : <?php 
      if($fetDoc->official_email != '')
      {
        $ctMail ='<br/><a href="mail:'.$fetDoc->official_email.'">'.$fetDoc->official_email.'</a><br/>'.ckVal($fetDoc->personal_email,'mail');
      }
      else
      {
        $ctMail ='<br/>'.ckVal($fetDoc->personal_email,'mail');
      }

      echo $ctMail;?> </font></li>

      <li><font size="2px"> Address : <?php 
      if($fetDoc->address1 != '')
      {
        $ctAddr ='<br/>'.$fetDoc->address1.'<br/>'.ckVal($fetDoc->address2,'');
      }
      else
      {
        $ctAddr ='<br/>'.ckVal($fetDoc->address2,'');
      }

      echo $ctAddr;?> </font></li>
    </ul>
    </div>
    <div id="primary" class="datatab" style="display:none">
    <ul data-role="listview" data-inset="true" data-theme="d" >

    <li data-theme=e  ><font size="2px"> Primary Info </font></li>

      <li><font size="2px"> Specialization : 
      <?php
        $splfyVal='';
        $splfyId =explode(",",$fetDoc->specialization_id);
        for($i=0;$i<sizeof($splfyId);$i++)
        {
            $splfyVal .=comnName('doc_specialization','name','specialization_id',$splfyId[$i]).',';
        }
        $splfyVal =substr($splfyVal,0,strlen($splfyVal)-1);
        echo $splfyVal;
      ?>
      </font></li>

      <li><font size="2px"> Patients / day : <?php echo $fetDoc->ave_patients;?> </font></li>

      <li><font size="2px"> Total RX Potental : 
        <?php
        $slRx =$dbHandle->execQuery("SELECT SUM(mdcp.tot_potential * mp.mrp) as tot,SUM(mdcp.nrx * mp.mrp + mdcp.rrx * mp.mrp )/30 as Comptot,SUM((mdcp.nrx_qty - mdcp.nrx) * mp.mrp + (mdcp.rrx_qty - mdcp.rrx) * mp.mrp ) as Cmptot FROM master_doctor_cmpny_prod mdcp,master_product mp WHERE mdcp.doctor_id='$docId' AND mp.product_id=mdcp.product_id");
        $fetRx =$dbHandle->fetchObjectQuery($slRx);
        echo getCurrency().' '.$fetRx->tot .'/ month';
        ?>
      </font></li>

      <li><font size="2px"> Support for CHTND : <?php echo getCurrency().' '.round($fetRx->Comptot,2);?> </font></li>

      <li><font size="2px"> Competitior Support : <?php echo getCurrency().' '.$fetRx->Cmptot;?> </font></li>

      <li><font size="2px"> Last Visited : <?php
      $toDy = date('Y-m-d H:i:s');
        $lvq = $dbHandle->execQuery("select DATEDIFF('$toDy',saved_on) as dt from  doctor_dcr where doctor_id='$docId'");
        $lvf = $dbHandle->fetchObjectQuery($lvq);
        if($lvf->dt != '')
        {
            if($lvf->dt > 0)
            {
                echo $lvf->dt.' Days ago';
            }
        }
        else
        {
            echo 'NA';
        }
        ?>
      </font></li>

      <li><font size="2px">Last 30 Days Ave Calls : <?php
        $tDate=date("Y-m-d");
        $toDate =strtotime ('-30 day',strtotime($tDate));
        $toDate=date ('Y-m-j',$toDate);
        $sCalls =$dbHandle->execQuery("SELECT * FROM doctor_dcr WHERE added_by='$usrId' AND flag='0' AND date(saved_on) BETWEEN '$toDate' AND '$tDate'");
        $nmRows =$dbHandle->getNumRows($sCalls);
        echo round($nmRows/30,2);
        ?>
      </font></li>
      <li><font size="2px"> Doctor Class : <?php echo $fetDoc->doc_class;?> </font></li>

    </ul>

  </div>
  <div id="working" class="datatab" style="display:none">
    <ul data-role=listview data-inset=true data-theme=d >

    <li data-theme=e><font size="2px"> Working Info </font></li>
        <?php 
        $tnt=0;
            function workLocation($ref)
            {
                GLOBAL $dbHandle;
                GLOBAL $docId;
                $wlData="";
                $h=0;
                if($ref == 'hospital')
                {
                    $slocDetails=$dbHandle->execQuery("SELECT hospital_id,hospital_name FROM doctor_hospital_link WHERE doctor_id='$docId'");
                    $getNR=$dbHandle->getNumRows($slocDetails);
                    if($getNR > 0)
                    {
                        while($fetDetails=$dbHandle->fetchObjectQuery($slocDetails))
                        {
                        $h++;
                            if($h < $getNR)
                            {
                                $wlData .='<a href="'.ROOT_PATH.'hospitalView.php?hospId='.$fetDetails->hospital_id.'">'.ucfirst($fetDetails->hospital_name).'</a>'.',';
                            }
                            else
                            {
                                $wlData .='<a href="'.ROOT_PATH.'hospitalView.php?hospId='.$fetDetails->hospital_id.'">'.ucfirst($fetDetails->hospital_name).'</a>';
                            }
                        }
                    }
                    else
                    {
                        $wlData="NA";
                    }
                }
                else if($ref == 'clinic')
                {
                    $slocDetails=$dbHandle->execQuery("SELECT clinic_id,clinic_name FROM doctor_clinic_link WHERE doctor_id='$docId'");
                    $getNR=$dbHandle->getNumRows($slocDetails);
                    if($getNR > 0)
                    {
                        while($fetDetails=$dbHandle->fetchObjectQuery($slocDetails))
                        {
                        $h++;
                            if($h < $getNR)
                            {
                                $wlData .='<a href="'.ROOT_PATH.'clinicView.php?clinicId='.$fetDetails->clinic_id.'">'.ucfirst($fetDetails->clinic_name).'</a>'.',';
                            }
                            else
                            {
                                $wlData .='<a href="'.ROOT_PATH.'clinicView.php?clinicId='.$fetDetails->clinic_id.'">'.ucfirst($fetDetails->clinic_name).'</a>';
                            }
                        }
                    }
                    else
                    {
                        $wlData="NA";
                    }
                }
                else
                {
                    $slocDetails=$dbHandle->execQuery("SELECT chemist_id,chemist_name FROM doctor_chemist_link WHERE doctor_id='$docId'");
                    $getNR=$dbHandle->getNumRows($slocDetails);
                    if($getNR > 0)
                    {
                        while($fetDetails=$dbHandle->fetchObjectQuery($slocDetails))
                        {
                        $h++;
                            if($h < $getNR)
                            {
                                $wlData .='<a href="'.ROOT_PATH.'chemistView.php?chemistId='.$fetDetails->chemist_id.'">'.ucfirst($fetDetails->chemist_name).'</a>'.',';
                            }
                            else
                            {
                                $wlData .='<a href="'.ROOT_PATH.'chemistView.php?chemistId='.$fetDetails->chemist_id.'">'.ucfirst($fetDetails->chemist_name).'</a>';
                            }
                        }
                    }
                    else
                    {
                        $wlData="NA";
                    }
                }
                return $wlData;
            }
        if(workLocation('hospital') != 'NA')
        {
        ?>
      <li><font size="2px"> Hospital Name : <?php echo workLocation('hospital');?></font></li>
      <?php
        }
        else
        {
            $tnt++;
        }
        if(workLocation('clinic'))
        {
        ?>
      <li><font size="2px"> Clinic Name :  <?php echo workLocation('clinic');?></font></li>
      <?php
        }
        else
        {
            $tnt++;
        }
        if(workLocation('chemist'))
        {
        ?>
        <li><font size="2px"> Chemist Name :  <?php echo workLocation('chemist');?></font></li>
      <?php
        }
        else
        {
            $tnt++;
        }
        if($tnt == 3)
        {
        ?>
        <li><font size="2px"> NO Data To Display</font></li>
        <?php
        }
        ?>      
    </ul>

  </div>
</div>
</body>
</html>

In "header.php" all js and css are there

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:17:48+00:00Added an answer on June 13, 2026 at 10:17 pm

    Here is the answer:

      Before You are calling to this page You have to specify in href like the following
    

    assume that you are having the following link to load:

    <a href="sample.php" rel="external">sample</a>
    

    here href="external" You have to specify otherwise it wont work…..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have created one jQuery function to check if elements exist or not
I am using jquery mobile. I have created a very simple page where there
I have a pretty basic jquery mobile page, it's 3 data-role:page divs in one
I have created tabs by using jQuery API and have bound one event handler
i have one question about jquery ajax().. I created a table grid and there
I’m working on a project that is using knockout.js and jQuery Mobile. I have
I have one field which can contain email or mobile (in my case mobile
Possible Duplicate: jQuery delay between animations I have created two functions: One that animates
I have created a custom jQuery UI theme. One of my styles .ui-state-hover takes
I have created an interface using jQuery UI Tabs, however one of my requirements

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.