Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    New Coder
    Join Date
    Nov 2013
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Old Pedant View Post
    Bring up the page in your browser.

    Click on the browser's VIEW menu.

    Click on the SOURCE or PAGE SOURCE menu item of the view menu.

    Now you will be seeing the HTML source code AS THE BROWSER sees it.

    Copy/paste a few lines of the HTML <table> here so we can see what the browser is trying to handle.
    Sorry for the late reply,
    I tried your suggestion of encoding the URL and it then stopped showing the clickable text.
    Here is the source of the table. I think one possibility is that i have nothing directing the clickable text into what to display from the DB in the new table.

    Code:
    <table cellpadding="0" cellspacing="1" width="100%" class="sortable paginated">
    <thead>
       <tr>
          <th>Date</th>
          <th>Candidate Name</th>
          <th>Interviewer Name</th>
          <th>Age</th>
          <th>Possible Outcome</th>
       </tr>
    </thead>
    <tbody>
    <tr>
        <td>12/11/2013</td>
        <td><a href="rro.php?id=1" <font color='FF0000'>Charles Kidd</font></a></td>
        <td>Ashton</td>
        <td>18</td>
        <td>Accept</td>
    </tr>
    <tr>
        <td>13/11/2013</td>
        <td><a href="rro.php?id=8" <font color='FF0000'>gvgfghfhgfv</font></a></td>
        <td></td>
        <td>18</td>
        <td></td>
    </tr>
    </tbody>
    </table>
    Instead of using 'cname' im using 'ID'.
    Thanks,
    Ashton
    Last edited by ashton324; 12-09-2013 at 11:10 PM.

  2. #17
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    ILLEGAL HTML!!! And also ancient and obsolete HTML. The <font> tag is long since deprecated.

    Wrong:
    Code:
    <td><a href="rro.php?id=1" <font color='FF0000'>Charles Kidd</font></a></td>
    Missing the > delimiter of the <a tag!!!!!!

    Try this:
    [code]
    <td><a href="rro.php?id=1" style="color: #FF0000;">Charles Kidd</a></td>
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  3. #18
    New Coder
    Join Date
    Nov 2013
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Old Pedant View Post
    ILLEGAL HTML!!! And also ancient and obsolete HTML. The <font> tag is long since deprecated.

    Wrong:
    Code:
    <td><a href="rro.php?id=1" <font color='FF0000'>Charles Kidd</font></a></td>
    Missing the > delimiter of the <a tag!!!!!!

    Try this:
    [code]
    <td><a href="rro.php?id=1" style="color: #FF0000;">Charles Kidd</a></td>
    I have removed the <font> tag as it was there for testing purposes and forgot to remove it. Anyway, upon removal the PHP now looks like this..
    RRO.php
    Code:
    $sql = "SELECT Time_Of_Submission AS tos, id, cn, nint, Age, wya FROM ".$mysql_table;
    $result = mysql_query($sql, $db);
    ?>
    <table cellpadding="0" cellspacing="1" width="100%" class="sortable paginated">
    <thead>
       <tr>
          <th>Date</th>
          <th>Candidate Name</th>
          <th>Interviewer Name</th>
          <th>Age</th>
          <th>Possible Outcome</th>
       </tr>
    </thead>
    <tbody>
    <?php
    while ($row = mysql_fetch_assoc($result))
    {
        $tos = $row["tos"]; // and then you could use PHP to format this as desired
        $cname = $row["cn"];
        $iname = $row["nint"];
        $age = $row["Age"];
        $wya = $row["wya"];
        $id = $row["id"];
    
        echo "<tr>\n"
        . "    <td>$tos</td>\n"
        . "    <td><a href=\"rro.php?name=$id\">$cname</a></td>\n"
        . "    <td>$iname</td>\n"
        . "    <td>$age</td>\n"
        . "    <td>$wya</td>\n"
        . "</tr>\n";
    } // end of while loop
    ?>
    The page source now looks like this
    Code:
    <table cellpadding="0" cellspacing="1" width="100%" class="sortable paginated">
    <thead>
       <tr>
          <th>Date</th>
          <th>Candidate Name</th>
          <th>Interviewer Name</th>
          <th>Age</th>
          <th>Possible Outcome</th>
       </tr>
    </thead>
    <tbody>
    <tr>
        <td>12/11/2013</td>
        <td><a href="rro.php?name=1">Charles Kidd</a></td>
        <td>Ashton</td>
        <td>18</td>
        <td>Accept</td>
    </tr>
    <tr>
        <td>13/11/2013</td>
        <td><a href="rro.php?name=8">gvgfghfhgfv</a></td>
        <td></td>
        <td>18</td>
        <td></td>
    </tr>
    </tbody>
    </table>
    Upon clicking the clickable text nothing happens. It redirects to a different page with the php parameters but the table stays the same with no extra data. So am i missing something? How do i get it to show more data i.e other tables from DB to display upon clicking the text?

    The table as default currently displays
    Date Name Interviewer Name Age Outcome

    When i click a name i would like to display
    Date Name Interviewer Name Age Outcome Date Applied Interview Notes etc..

    I hope i haven't confused you.. So far you have really helped!
    Thanks,
    Ashton

  4. #19
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    So what does the code for "rro.php" look like? It clearly will look *NOTHING* like the code for this page. COMPLETELY different code for COMPLETELY different purpose.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  5. #20
    New Coder
    Join Date
    Nov 2013
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts
    The full code for RRO.php is this...

    Code:
    <?php
    if (session_id() == "")
    {
       session_start();
    }
    if (!isset($_SESSION['username']))
    {
       header('Location: ./../../confirm/accessden.html');
       exit;
    }
    if (isset($_SESSION['expires_by']))
    {
       $expires_by = intval($_SESSION['expires_by']);
       if (time() < $expires_by)
       {
          $_SESSION['expires_by'] = time() + intval($_SESSION['expires_timeout']);
       }
       else
       {
          unset($_SESSION['username']);
          unset($_SESSION['expires_by']);
          unset($_SESSION['expires_timeout']);
          header('Location: ./../../confirm/accessden.html');
          exit;
       }
    }
    ?>
    <?php
    if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['form_name'] == 'logoutform')
    {
       if (session_id() == "")
       {
          session_start();
       }
       unset($_SESSION['username']);
       header('Location: ./../../login.php');
       exit;
    }
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>RRO Management</title>
    <meta name="author" content="Ashton">
    <style type="text/css">
    div#container
    {
       width: 1523px;
       position: relative;
       margin-top: 0px;
       margin-left: auto;
       margin-right: auto;
       text-align: left;
    }
    body
    {
       text-align: center;
       margin: 0;
       background-color: #FFFFFF;
       background-image: url(/images/Darkness3/darkness3/back3.gif);
       color: #000000;
    }
    </style>
    <style type="text/css">
    a
    {
       color: #FF0000;
       text-decoration: underline;
    }
    a:visited
    {
       color: #800080;
    }
    a:active
    {
       color: #FF0000;
    }
    a:hover
    {
       color: #0000FF;
       text-decoration: underline;
    }
    </style>
    <style type="text/css">
    #TabMenu1
    {
       text-align: left;
       float: left;
       margin: 0;
       width: 100%;
       font-family: "Courier New";
       font-size: 13px;
       font-weight: normal;
       border-bottom: 1px solid #1A1A1A;
       list-style-type: none;
       padding: 15px 0px 4px 10px;
       overflow: hidden;
    }
    #TabMenu1 li
    {
       float: left;
    }
    #TabMenu1 li a.active, #TabMenu1 li a:hover.active
    {
       background-color: #1A1A1A;
       color: #BDB76B;
       position: relative;
       font-weight: normal;
       text-decoration: none;
       z-index: 2;
    }
    #TabMenu1 li a
    {
       padding: 5px 14px 8px 14px;
       border: 1px solid #1A1A1A;
       border-top-left-radius: 6px;
       border-top-right-radius: 6px;
       background-color: #1A1A1A;
       color: #FF0000;
       margin-right: 1px;
       text-decoration: underline;
       border-bottom: none;
       position: relative;
       top: 0;
       -webkit-transition: 200ms all linear;
       -moz-transition: 200ms all linear;
       -ms-transition: 200ms all linear;
       transition: 200ms all linear;
    }
    #TabMenu1 li a:hover
    {
       background: #E4F1FB;
       color: #0070A3;
       font-weight: normal;
       text-decoration: none;
       top: -4px;
    }
    .logoutform_button
    {
       background-color: #1A1A1A;
       border-color: #1A1A1A;
       border-width: 1px;
       border-style: solid;
       color: #FF0000;
       font-family: "Courier New";
       font-size: 13px;
    }
    </style>
    <script type="text/javascript" src="jquery-1.9.1.min.js"></script>
    <style type="text/css">
    #dataviewer
    {
       color: #FF0000;
       font-family: Courier New;
       font-size: 13px;
       font-weight: normal;
       font-style: normal;
    }
    #dataviewer th,
    #dataviewer td 
    {
       padding: 3px 6px;
       vertical-align: top;
    }
    #dataviewer th 
    {
       text-align: left;
       color: #FF0000;
       font-weight: bold;
       font-style: italic;
    }
    #dataviewer table
    {
       border:1px #808000 solid;
       }
    #dataviewer thead th
    {
       background-color: #000000;
    }
    #dataviewer .sortable thead th
    {
       padding-left: 18px;
    }
    tr.even, tr.first
    {
       background-color: transparent;
    }
    td.sorted
    {
       background: #FFFFDD;
    }
    th.clickable
    {
       background: transparent url(./images/white_arrows.gif) no-repeat 0 0;
    }
    th.sorted-asc
    {
       background-position: 0 -20px;
    }
    th.sorted-desc
    {
       background-position: 0 -40px;
    }
    .clickable
    {
       cursor: pointer;
    }
    .hover
    {
       text-decoration: underline;
    }
    </style>
    <script type="text/javascript">
    $(document).ready(function()
    {
       $.fn.alternateRowColors = function()
       {
          $('tbody tr:odd', this).removeClass('even').addClass('odd');
          $('tbody tr:even', this).removeClass('odd').addClass('even');
          return this;
       };
       $('table.sortable').each(function()
       {
          var $dataviewer = $(this);
          $dataviewer.alternateRowColors();
          $('th', $dataviewer).each(function(column)
          {
             var $header = $(this);
             var findSortKey;
             findSortKey = function($cell)
             {
                return $cell.find('.sort-key').text().toUpperCase() + ' ' + $cell.text().toUpperCase();
             };
             if (findSortKey)
             {
                $header.addClass('clickable').hover(function()
                {
                   $header.addClass('hover');
                }, function()
                {
                   $header.removeClass('hover');
                }).click(function()
                {
                   var sortDirection = 1;
                   if ($header.is('.sorted-asc'))
                   {
                      sortDirection = -1;
                   }
                   var rows = $dataviewer.find('tbody > tr').get();
                   $.each(rows, function(index, row)
                   {
                      var $cell = $(row).children('td').eq(column);
                      row.sortKey = findSortKey($cell);
                   });
                   rows.sort(function(a, b)
                   {
                      if (a.sortKey < b.sortKey) return -sortDirection;
                      if (a.sortKey > b.sortKey) return sortDirection;
                      return 0;
                   });
                   $.each(rows, function(index, row)
                   {
                      $dataviewer.children('tbody').append(row);
                      row.sortKey = null;
                   });
                   $dataviewer.find('th').removeClass('sorted-asc').removeClass('sorted-desc');
                   if (sortDirection == 1)
                   {
                      $header.addClass('sorted-asc');
                   }
                   else
                   {
                      $header.addClass('sorted-desc');
                   }
                   $dataviewer.find('td').removeClass('sorted').filter(':nth-child(' + (column + 1) + ')').addClass('sorted');
                   $dataviewer.alternateRowColors();
                });
             }
          });
       });
    });
    </script>
    </head>
    <body link="#FF0000">
    <div id="container">
    <img src="images/img0019.jpg" id="Banner1" alt="RRO Management" style="position:absolute;left:572px;top:60px;width:418px;height:75px;border-width:0;z-index:0;">
    
    <div id="wb_TabMenu1" style="position:absolute;left:522px;top:156px;width:506px;height:51px;z-index:2;overflow:hidden;">
    <ul id="TabMenu1">
    <li><a href="./../Dashboard.php">Dashboard</a></li>
    <li><a href="./../Unitman/addmem.php">Add Member</a></li>
    <li><a href="./../Unitman/editmem.php">Edit Member</a></li>
    <li><a href="./interview.php">Interview</a></li>
    <li><a href="javascript:history.back()">Back</a></li>
    </ul>
    </div>
    <div id="wb_Logout1" style="position:absolute;left:733px;top:140px;width:95px;height:16px;z-index:3;">
    <form name="logoutform" method="post" action="<?php echo basename(__FILE__); ?>" id="logoutform">
    <input type="hidden" name="form_name" value="logoutform">
    <input class="logoutform_button" type="submit" name="logout"value="Logout" id="logout" style="width:95px;height:16px;" />
    </form>
    </div>
    <div id="dataviewer" style="position:absolute;overflow:auto;left:422px;top:193px;width:694px;height:299px;z-index:4">
    <?php
    $mysql_host = 'localhost';
    $mysql_user = 'rro_tools';
    $mysql_password = '*******';
    $mysql_database = 'rro_tools';
    $mysql_table = 'interviews';
    $db = mysql_connect($mysql_host, $mysql_user, $mysql_password);
    mysql_select_db($mysql_database, $db);
    $sql = "SELECT Time_Of_Submission AS tos, id, cn, nint, Age, wya FROM ".$mysql_table;
    $result = mysql_query($sql, $db);
    ?>
    <table cellpadding="0" cellspacing="1" width="100%" class="sortable paginated">
    <thead>
       <tr>
          <th>Date</th>
          <th>Candidate Name</th>
          <th>Interviewer Name</th>
          <th>Age</th>
          <th>Possible Outcome</th>
       </tr>
    </thead>
    <tbody>
    <?php
    while ($row = mysql_fetch_assoc($result))
    {
        $tos = $row["tos"]; // and then you could use PHP to format this as desired
        $cname = $row["cn"];
        $iname = $row["nint"];
        $age = $row["Age"];
        $wya = $row["wya"];
    	$id = $row["id"];
    
        echo "<tr>\n"
        . "    <td>$tos</td>\n"
        . "    <td><a href=\"rro.php?name=$id\">$cname</a></td>\n"
        . "    <td>$iname</td>\n"
        . "    <td>$age</td>\n"
        . "    <td>$wya</td>\n"
        . "</tr>\n";
    } // end of while loop
    ?>
    </tbody>
    </table>
    </div>
    </div>
    </body>
    </html>

  6. #21
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    THAT IS THE CODE FOR THE MAIN PAGE!!! The page with the list of *ALL* candidates.

    WHERE is the code for the page for displaying the DETAILS of a SINGLE candidate.

    YOU NEED TWO SEPARATE PAGES!

    That's what I *TRIED* to show you back in post #11:
    Code:
        echo "<tr>\n"
        . "    <td>$tos</td>\n"
        . "    <td><a href=\"showCandidate.php?name=$cname\">$cname</a></td>\n"
        . "    <td>$iname</td>\n"
        . "    <td>$age</td>\n"
        . "    <td>$wya</td>\n"
        . "</tr>\n";
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  7. #22
    New Coder
    Join Date
    Nov 2013
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Old Pedant View Post
    THAT IS THE CODE FOR THE MAIN PAGE!!! The page with the list of *ALL* candidates.

    WHERE is the code for the page for displaying the DETAILS of a SINGLE candidate.

    YOU NEED TWO SEPARATE PAGES!

    That's what I *TRIED* to show you back in post #11:
    Code:
        echo "<tr>\n"
        . "    <td>$tos</td>\n"
        . "    <td><a href=\"showCandidate.php?name=$cname\">$cname</a></td>\n"
        . "    <td>$iname</td>\n"
        . "    <td>$age</td>\n"
        . "    <td>$wya</td>\n"
        . "</tr>\n";
    Thanks for the input, but with an attitude like that i have no reason to carry this on. I have since figured the problem out myself and it is now working.
    Thanks again but take a look at your attitude.

  8. #23
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    My attitude came completely from your refusal to follow directions. I wish you luck with any boss you may have in the future if you can't learn to do better than that.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


 
Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •