Solved: Website noob needs assistance with PHP

  • Thread starter Deleted member 252027
  • Start date
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.
D

Deleted member 252027

Thread Starter
Hello everyone,

I have a website (passed on to me by someone) which has a roster in it. Link: http://www.beluxvacc.org/index.php?option=com_wrapper&Itemid=64

As you can see it contains some names of our virtual air traffic controllers and many other things.

BUT (why oh why always is there a "BUT" ;))

I would like to add a column called "ELLX (Regional)", just like EBBR.
From admin point of view it looks like this ... (see attachment).
Basically , as you can see with EBBR, there should be an option "none, TWR and APP" also for ELLX. And the option should be shown in the roster on the website.

At the moment there is a module on our website with following code:
Code:
<?php
//Related Content//
/**
* Related Content Module
* @package Mambo
* @Copyright (C) 2000 - 2003 Miro International Pty Ltd
* @ All rights reserved
* @ Mambo is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version $Revision: 1.3 $
**/
 
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
?>
<p><font size="4" color="#004080"><br>
  <img src="../images/plane.jpg" width="20" height="15"> Belux vACC Controller 
  Roster</font></p>
<p class="text">Belux vACC Controllers who where active the last six months.
<br>(This list is updated manually)<br>
<b>TESTING</b>
<?
 
$option = trim( mosGetParam( $_REQUEST, 'option', null ) );
$task = trim( mosGetParam( $_REQUEST, 'task', null ) );
$id = intval( mosGetParam( $_REQUEST, 'id', null ) );
 
//if ($option == 'content' && $task == 'view' && $id) {
 
 $table_name = "members_belux";
 $where = " WHERE active = '1' ";
 // select the meta keywords from the item
 //$query = "SELECT metakey FROM mos_content WHERE id='$id'";
 $query = "SELECT fname, sname, vatsimid, rat_num, rating, info, staff, visiting, 
  active FROM $table_name".$where."ORDER BY fname ASC, sname ASC";
 
 $database->setQuery( $query );
 
 if ($data = trim( $database->loadResult() )) {
 print_r($data) ."<br>";
?>
	 <table class="datatable" >
  		<tr>
    		<th ><b>Name</b></th>
    		<th align=center><b>Rating</b></th>
    		<th align=center><b>Vatsim ID</b></th>
    		<th ><b>Remarks</b></th>
    		<th><b>Guest</b></th>
    		<th><b>Staff</b></th>
		  </tr>
<?
  foreach ( $data as $member )
  {
?>
	<tr>
	<td align=left><? echo "$member->fname $member->sname"; ?></td>
	<td align=center><? echo $member->rating; ?></td>
	<td align=center><a href="http://data.vatsim.net/stats/private/list3.html?id=<?php echo $member->vatsimid; ?>"  target="_blank"><?php echo $member->vatsimid; ?></a></td>
	<td align=left><?php echo $member->info; ?></td>
	<td align=center><?php if ($member->visiting == '1') { echo "X"; } ?></td>
	<td align=center><?php if ($member->staff == '1') { echo "X" ;} ?></td>
	</tr>
	
	<?php


  }

  //$date = $db->get_var("SELECT last_change FROM $table_name ORDER BY last_change DESC") ;
  //$date = substr($date, 8, 2)."-".substr($date, 5, 3).substr($date, 0, 4);
  
	?>
	</table> <?
 } else {
  echo "no data loaded";
 }
//}
?>
What do I have to change here in order to get this column ??
As you probably read in my post ... I know absolutly nothing about PHP so please be as specific and clear as possible

I hope you can help me out here

Regards

Vipersf
 

Attachments

Joined
Feb 10, 2005
Messages
625
Hi Viper,

How are you updating the list at the moment? say if you want to change one of the EBBR values from APP to TWR?

Do you manually change the html ? or is it in a form somewhere?

Basically, you need to store the info to go in the ELLX column in a database the call it using that module.

However I dont see in the module where the EBBR values come from ?
 
D

Deleted member 252027

Thread Starter
McCabe,

- As you can see on the screen shot .. it's just a simply drop-down column on which you select the correct value.

-Where these values come from I do not know (it's my presedor who gave me the website) .. is it possible that it's coming from a SqlDatabase ? Because I have seen that we have one of those ....

Vipersf
 
Joined
Feb 10, 2005
Messages
625
It will be an sql db, but even still to me it makes no sense as there is no column for EBBR listed in that code, but there is for the other columns

Is this the code as it is at the moment on your site or is this just the module as it is downloaded?.

Whoever did the site before may have modified this module slightly.

would need to see the modified file I think.
 

MMJ

Guest
Joined
Oct 15, 2006
Messages
3,625
It will be an sql db, but even still to me it makes no sense as there is no column for EBBR listed in that code, but there is for the other columns

Is this the code as it is at the moment on your site or is this just the module as it is downloaded?.

Whoever did the site before may have modified this module slightly.

would need to see the modified file I think.
I too had a look and couldn't see the EBBR column in the code.
 
D

Deleted member 252027

Thread Starter
This is the code as it is at the moment on my site.
 
Joined
Feb 10, 2005
Messages
625
Sorry Viper, not trying to be a pain for you, but the code above can't be as it is on the website.

If you look at the code above you see this line:
Code:
<p class="text">Belux vACC Controllers who where active the last six months.
<br>(This list is updated manually)<br>
<b>TESTING</b>
then look at the site and you can see the (This list is updated manually) bit, but then nowhere on the page does it say TESTING. So it can't be using that code.

FTP to your website, then download this module directly.
 
D

Deleted member 252027

Thread Starter
You'll probably kill me for this, but any advice on how to do this ??
 
Joined
Feb 10, 2005
Messages
625
hehehehe :)

I am guessing you do everything through front end at the moment, but do have any kind of access to upload and download files from the web site?#

You will normally have an ftp address something like:
ftp.beluxvacc.org
then a username and password to access it?

do you have these?

(dont tell me them lol, just want to know if you have the details)
 
D

Deleted member 252027

Thread Starter
I think I found it:

Code:
 roster.php 
HTML document text 
--------------------------------------------------------------------------------

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
all.clsMenuItemNS, .clsMenuItemIE{text-decoration: none; font: bold 12px Arial; color: white; cursor: hand; z-index:100}
#MainTable A:hover {color: yellow;}
</style>
<link rel="stylesheet" href="css/belux.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" class="text">
<p><font size="4" color="#004080"><br>
  <img src="../images/plane.jpg" width="20" height="15"> Belux vACC Controller 
  Roster</font></p>
<p class="text">Belux vACC Controllers who where active the last six months.
<br>(This list is updated manually)<br>
<?php 	
require_once "../bincludes/ez_sql.php";
$table_name = "members_belux";

if (isset($_GET['active'])) {
  if ($_GET['active'] == '1') {
    $list = "active";
    $where = " WHERE active = '1' ";
    echo "<a href='".$_SERVER['PHP_SELF']."?active=0' target='_self'>Show unactive controllers</a><br><br>";
  } elseif ($_GET['active'] == '0') {
    $list = "active";
    $where = " WHERE active <> '1' ";  
    echo "<a href='".$_SERVER['PHP_SELF']."?active=1' target='_self'>Show active controllers</a><br><br>";
  }
} else {
    $list = "active";
    $where = " WHERE active = '1' ";
    echo "<a href='".$_SERVER['PHP_SELF']."?active=0' target='_self'>Show unactive controllers</a><br><br>";
}

$sql = "SELECT fname, sname, vatsimid, rat_num, rating, ebbr, info, staff, visiting, 
  active FROM $table_name".$where."ORDER BY fname ASC, sname ASC";
  
if ($data = $db->get_results("$sql")) {
?>
	 <table class="datatable" >
  		<tr>
    		<th ><b>Name</b></th>
    		<th align=center><b>Rating</b></th>
    		<th align=center><b>EBBR</b></th>
    		<th align=center><b>Vatsim ID</b></th>
    		<th ><b>Remarks</b></th>
    		<th><b>Guest</b></th>
    		<th><b>Staff</b></th>
		  </tr>
<?
  foreach ( $data as $member )
  {
?>
	<tr>
	<td align=left><? echo "$member->fname $member->sname"; ?></td>
	<td align=center><? echo $member->rating; ?></td>
	<td align=left><?php echo $member->ebbr; ?></td>
	<td align=center><a href="http://data.vatsim.net/stats/private/list3.html?id=<?php echo $member->vatsimid; ?>"  target="_blank"><?php echo $member->vatsimid; ?></a></td>
	<td align=left><?php echo $member->info; ?></td>
	<td align=center><?php if ($member->visiting == '1') { echo "X"; } ?></td>
	<td align=center><?php if ($member->staff == '1') { echo "X" ;} ?></td>
	</tr>
	
	<?php


  }

  $date = $db->get_var("SELECT last_change FROM $table_name ORDER BY last_change DESC") ;
  $date = substr($date, 8, 2)."-".substr($date, 5, 3).substr($date, 0, 4);
  
	?>
	</table> <?

} else {

	echo "Sorry, no records were found!";	

}
?>

<hr>
<span class="updated">Last update: 
<!-- #BeginDate format:Am1 -->
<?php echo empty($date) ? "August 22, 2007" : $date; ?><!-- #EndDate -->
</span> 
</body>
</html>
Could this be the possible thing you were looking for ?
 
D

Deleted member 252027

Thread Starter
Well it's not that I don't trust you, but I would really like to learn so that I do not have to contact you again when I have the same problem when adding a new column in a couple of weeks weeks/years ...

So I don't know ... what would be best for you
 
Joined
Feb 10, 2005
Messages
625
ok I will write up some instructions, but bere with me this will not be straight forward lol
 
Joined
Feb 10, 2005
Messages
625
ok no probs however there is one more file we need to see before I can tell you exactly what you need to do.

Tha page in the screenshot is an admin page whereby you can edit that table on your website and it's values.

I need to see the code behind that page too.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top