Hi,
The Open (blue) and Closed (red) is the visual effect desured as the Pay now button only shows on Open (blue).
I have included the PHP below of what I have done for the first couple of rows.
Each one is slightly different as I am trying different options to work.
I have put a new column in "Total Entered" so that I can see the total amout of players entering and then hopefully also confirm that the scipt we are using infact gets the value required.
At this stage I am not sure it is getting the correct value or whether it gets the value at all.
Regards
Rob
PHP Code:</style>
</head>
<body>
<table id="customers">
<tr class="th">
<td> </td>
<div><font style="font-size:16px" color="#5A6A83" face="Arial">UPCOMING TOURNAMENTS ARE LISTED BELOW</font></div></button>
</tr>
<tr>
<th>HOST</th>
<th>GOLF COURSE</th>
<th>DATE</th>
<th>DAY</th>
<th>TOTAL ENTERED</th>
<th>ENTRY STATUS</th>
<th>ENTER</th>
</tr>
<tr class="alt2">
<td>HETTIE ELS</td>
<td>KEMPTON PARK</td>
<td>05 JANUARY 2011</td>
<td>WEDNESDAY</td>
<td>*</td>
<?php
$connect = mysql_connect("localhost", "e****_****", "*****") or
die ("Hey loser, check your server connection.");
mysql_select_db("e****_Members");
// name of tournament you wish to count entries from
// maybe from a form entry?
$tournament = 'KEMPTON PARK - 05/01/2011';
// count the total entries with that tournament name
$c = mysql_query ("SELECT count(*) from `_Form_Nr_4` WHERE `I_wish_to_play` = '$tournament'");
// add these two lines here:
$c = mysql_fetch_row($c);
$c = $c[0];
$c = $_GET['v'];
// these lines take the result (a mysql resource)
// and turn it into an array - something we can actually use
// in php. The entry count is in the first index ( index 0 ).
$openORclosed = $c >= 1 ? 'Closed' : 'Open';
echo "<td>";
if ($openORclosed != 'Open') {
?>
<form action="https://www.payfast.co.za/eng/process" method="post">
<input type="hidden" name="cmd" value="_paynow">
<input type="hidden" name="receiver" value="junior@hayesgolf.co.za">
<input type="hidden" name="item_name" value="Payment - KEMPTON PARK - Glacier Series">
<input type="hidden" name="item_description" value="payment">
<input type="hidden" name="amount" value="120.00">
<input type="hidden" name="return_url" value="http://www.gnjgf.co.za/entryform.php">
<input type="hidden" name="cancel_url" value="http://www.gnjgf.co.za/Glacier_Main.html">
<input type="submit" style="width:66px;height:20px;background-color:#B5CCE4;font-size:10px; font-family: arial, sans-serif;" value="PAY NOW">
<?php
} else {
echo $openORclosed;
}
?>
</tr>
<tr class="alt">
<td>THE GOLF SCHOOL OF EXCELLENCE</td>
<td>GLENDOWER</td>
<td>27 FEBRUARY 2011</td>
<td>?</td>
<td>*</td>
<?php
// name of tournament you wish to count entries from
// maybe from a form entry?
$tournament = 'GLENDOWER - 27/02/2011';
// count the total entries with that tournament name
$c = mysql_query ("SELECT count(*) from `_Form_Nr_4` WHERE `I_wish_to_play` = '$tournament'");
// add these two lines here:
$c = mysql_fetch_row($c);
$c = $c[0];
$c = $_GET['v'];
// these lines take the result (a mysql resource)
// and turn it into an array - something we can actually use
// in php. The entry count is in the first index ( index 0 ).
$openORclosed = $c >= 1 ? 'Closed' : 'Open';
echo "<td>";
if ($openORclosed != 'Open') {
?>
<form action="https://www.payfast.co.za/eng/process" method="post">
<input type="hidden" name="cmd" value="_paynow">
<input type="hidden" name="receiver" value="junior@hayesgolf.co.za">
<input type="hidden" name="item_name" value="Payment - GLENDOWER - Glacier Series">
<input type="hidden" name="item_description" value="payment">
<input type="hidden" name="amount" value="120.00">
<input type="hidden" name="return_url" value="http://www.gnjgf.co.za/entryform.php">
<input type="hidden" name="cancel_url" value="http://www.gnjgf.co.za/Glacier_Main.html">
<input type="submit" style="width:66px;height:20px;background-color:#B5CCE4;font-size:10px; font-family: arial, sans-serif;" value="PAY NOW">
<?php
} else {
echo $openORclosed;
}
?>
</tr>
<tr class="alt2">
<td>?</td>
<td>GARDENER ROSS</td>
<td>27 MARCH 2011</td>
<td>?</td>
<td>*</td>
<?php
// name of tournament you wish to count entries from
// maybe from a form entry?
$tournament = 'GARDENER ROSS - 27/03/2011';
// count the total entries with that tournament name
$c = mysql_query ("SELECT count(*) from `_Form_Nr_4` WHERE `I_wish_to_play` = '$tournament'");
// add these two lines here:
$c = mysql_fetch_row($c);
if($c >= 0){
echo '<td><font style="font-size:11px" color="Red" face="Arial">CLOSED</td>
<td> </td>';
}
else {
echo '<td><b><font style="font-size:11px" color="Blue" face="Arial">OPEN</b></td>
<td><form action="https://www.payfast.co.za/eng/process" method="post">
<input type="hidden" name="cmd" value="_paynow">
<input type="hidden" name="receiver" value="junior@hayesgolf.co.za">
<input type="hidden" name="item_name" value="Payment - Gardener Ross - Glacier Series">
<input type="hidden" name="item_description" value="payment">
<input type="hidden" name="amount" value="120.00">
<input type="hidden" name="return_url" value="http://www.gnjgf.co.za/entryform.php">
<input type="hidden" name="cancel_url" value="http://www.gnjgf.co.za/Glacier_Main.html">
<input type="submit" style="width:66px;height:20px;background-color:#B5CCE4;font-size:10px; font-family: arial, sans-serif;" value="PAY NOW">
</td>
';
}
?>
</tr>



Reply With Quote



Bookmarks