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

  • SEARCH
  • Home
  • 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 4622866
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:54:15+00:00 2026-05-22T02:54:15+00:00

here is my code, i would like my links to open with just a

  • 0

here is my code, i would like my links to open with just a single click. all is functioning properly, its just that, the delete,approve ant not approve link must be double click for its function to run. i hope someone could hear me.

index.php

<?php       
                            $search = '%';
                            $fgmembersite->DBLogin();
                            $limit = 5;
                            if(isset($_GET['offset'])) {
                                $offset = mysql_real_escape_string($_GET['offset']);
                            } else {
                                $offset = 0;
                            }

                            //for namelist a-z
                            $listname = '%';
                            If (isset($_GET['namelist']))
                            {                                   
                                $listname = $_GET['namelist'];
                            }

                            //for search file
                            if(isset($_POST['searchfile']))
                            {
                                $search = $_POST['searchfile'];
                            }                               
                            else if(isset($_GET['searchfile']))
                            {
                                $search = $_GET['searchfile'];
                            }

                            if($_SESSION[$fgmembersite->GetLoginSessionVar()] == 'sa' OR $_SESSION[$fgmembersite->GetLoginSessionVar()] == 'admin')
                            {                                   
                                    $sql="select * from gmdc_employee where employee_name like '%$search%' AND employee_name like '$listname%' ";                                                                                           
                            }
                            else
                            {                                   
                                $sql = "select b.* from gmdc_user a, gmdc_employee b where a.username = '".$_SESSION[$fgmembersite->GetLoginSessionVar()]."' and a.company_id = b.company_id AND b.employee_name like '$listname%' AND b.employee_name like '%$search%'"; 

                            }
                            $query = mysql_query("$sql ORDER BY employee_name,confirmation DESC ,file_id DESC,file_date DESC LIMIT $offset,$limit") or die ( mysql_error () );
                            $result = mysql_query($sql) or die (mysql_error());
                            $total = mysql_num_rows($result);

                            if(!$result || mysql_num_rows($result) <= 0)
                            {
                                $fgmembersite->HandleError("No file found.");
                                return false;
                            }
                            while ($row = mysql_fetch_assoc($query))
                            {
                                $file_id = $row['file_id'];
                                $file_desc = $row['file_description'];
                                $file_date = $row['file_date'];
                                $file_name = $row['file_name'];
                                $file_accs = $row['folder_access'];
                                $file_employee  = $row['employee_id'];
                                $file_confir = $row['confirmation'];
                                $file_ename = ucwords($row['employee_name']);


                                $info = pathinfo($file_name);
                                $file_ext = $info['extension'];                                 



                                echo '<tr>
                                    <td>
                                        &nbsp; 
                                    </td>
                                    </tr>
                                    <tr class="subone">
                                    <td class="sub" width="100">
                                        '.$file_employee.'
                                        <br />
                                        &nbsp;
                                    </td>';
                                    if($_SESSION[$fgmembersite->GetLoginSessionVar()] == 'sa')
                                    {

                                    ?><td class="sub" width="100">
                                        <a href="" onclick = javascript:newPopup('addfile.php?emp=<?php echo $file_employee ?>');><?php echo$file_ename?></a>
                                        <br />
                                        &nbsp;
                                    </td><?php
                                    }
                                    else
                                        {
                                            echo '<td class="sub" width="182">
                                            '.$file_ename.' 
                                            <br />
                                            &nbsp;
                                            </td>';
                                        }


                                    echo'<td  class="sub" width="218">
                                        <a href="'.$file_accs.$file_name.'" target="_blank" style="text-decoration: underline;">'.$file_desc.'</a>
                                        <br />
                                        &nbsp;
                                    </td>
                                    <td  class="sub" width="100">
                                        '.date('M d, Y',mktime(0,0,0,substr($file_date,5,2),substr($file_date,8,2),substr($file_date,0,4))).'
                                        <br />
                                        &nbsp;
                                    </td>
                                    <td  class="sub" width="100">   
                                                '.$file_confir.'                
                                    <br />
                                            &nbsp;
                                            </td>';
                                    if($_SESSION[$fgmembersite->GetLoginSessionVar()] == 'sa')
                                    {
                                        if($file_confir == 'Pending' OR $file_confir == 'NotApproved')
                                        {                                               
                                            if(isset($_GET['id']))
                                            {
                                                $fgmembersite->Delete_Db($_GET['id']);
                                            }
                                                echo '<td  class="sub" width="100"> 
                                                <a href="index.php?id='.$file_id.'">Delete</a>
                                                <br />
                                                &nbsp;
                                                </td>';
                                        }
                                    }
                                    else if($_SESSION[$fgmembersite->GetLoginSessionVar()] == 'admin')
                                        {
                                            if($file_confir == 'Pending')
                                            {   

                                                    if(isset($_GET['yes']))
                                                    {
                                                        $fgmembersite->UpdateYesDB($_GET['yes']);
                                                    }
                                                    else if(isset($_GET['no']))
                                                    {
                                                        $fgmembersite->UpdateNoDB($_GET['no']);
                                                    }
                                                    echo'<td  class="sub" width="100">  
                                                    <a href="index.php?yes='.$file_id.'">Approve</a>                                            
                                                    <br /><br />
                                                    <a href="index.php?no='.$file_id.'">NotApprove</a>                                      
                                                    &nbsp;
                                                    </td> ';
                                            }   
                                        }
                                    }?>

*fg_membersite.php*

function Delete_Db($id)
{   
    $ok = mysql_query("DELETE FROM gmdc_employee WHERE file_id='$id'");

    if (!$ok) 
    {
        $this->HandleError("Error deleting profile from database!");
    }


}
function UpdateYesDB($fid)
{
        $this->DBLogin();
        $yes = mysql_query("UPDATE gmdc_employee SET confirmation='Approved' WHERE file_id = '$fid'");          
        if (!$yes) 
        {
            $this->HandleError("Error updating from database!");
            return false;
        }
}
function UpdateNoDB($fids)
{
        $this->DBLogin();
        $no = mysql_query("UPDATE gmdc_employee SET confirmation='NotApproved' WHERE file_id = '$fids'");           
        if (!$no) 
        {
            $this->HandleError("Error updating from database!");
            return false;
        }   
}

*note, i only put the delete/approve/not approve function because thats my only problem. thanks

  • 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-05-22T02:54:15+00:00Added an answer on May 22, 2026 at 2:54 am

    Please modify the quote usage in the section as follows.

    echo "<td  class='sub' width='100'><a href='index.php?yes=".$file_id."'>Approve</a><br /><br /><a href='index.php?no=".$file_id."'>NotApprove</a></td>";
    

    Please let me know if you need any clarification.

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

Sidebar

Related Questions

I'm searching for the cleanest solution here. I would like to code a stored
enter code here Hi All, I have a simple windows service application that connects
Have a look here: In the following code, what would be the type of
Here is code from MSDN . I don't understand why the work isn't just
I have a pagination script that displays a list of all pages like so:
I have a flash movie using Actionscript 3 with some buttons that open links
here's the sample code (fully working - just copy to an empty html file
I would like to say that Im struggling with understanding the portal demo in
I would like to share a code snippet.. if (!key.contains(#)) { val = mp.get(key)
Here is my code <html> <body> <?php echo <b>Hello World</b> <br />; ?> </body>

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.