Jump to content

Help wit populating a select box


SA Rob

Recommended Posts

Hi Folks,I have a page that look like this and in it I have a description of my requirements.However the first of these is to populate a message box correctly that I can place a series of messages in the box and when I select a message it will be allocated to all the names seen on the left or only to a specific name in the list on the left.I do not know php at all and have relied on the services of others at this stage to get to this stage.I hope someone can help

Link to comment
Share on other sites

Hi Folks,I have managed to make some changes but need a little help.The code is shown below - I am aware that it is not entriely correct but what I would like it to do is that when the selction is made the selection remains in view and populates next to each players name under the message column.I would appreciate it if someone could help in this regards

<div><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute;left:10px;top:70px; font-size:11px; width:715px; border:1px solid #81BEF7; margin: 5px auto; font-family:Calibri; color:#00008B; text-align:center;"><legend>MESSAGE CHOICE</legend><select name="tournament"><option value="The tournament has been cancelled at">The tournament has been cancelled at</option><option value="Your Tee off time for the Glacier Series event to be held at KYALAMI GC on the 27/02/2011 is">Your Tee off time for the Glacier Series event to be held at KYALAMI GC on the 27/02/2011 is </option><option value="Your Tee off time for the Glacier Series event to be held at St. FRANCIS LINKS on the 06/03/2011 is">Your Tee off time for the Glacier Series event to be held at St. FRANCIS LINKS on the 06/03/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at GARDENER ROSS GE on the 27/03/2011 is">Your Tee off time for the Glacier Series event to be held at GARDENER ROSS GE on the 27/03/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at RUSTENBURG GC on the 28/03/2011 is">Your Tee off time for the Glacier Series event to be held at RUSTENBURG GC on the 28/03/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at WITBANK GC on the 31/03/2011 is">WITBANK GC on the 31/03/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at WEST BANK GC on the 02/04/2011 is">Your Tee off time for the Glacier Series event to be held at WEST BANK GC on the 02/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at EBOTSE GE on the 03/04/2011 is">Your Tee off time for the Glacier Series event to be held at EBOTSE GE on the 03/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at UMHLALI GE on the 06/04/2011 is">UMHLALI GE on the 06/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at DURBAN CC on the 08/04/2011 is">DURBAN CC on the 08/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at STEENBERG GC on the 10/04/2011 is">STEENBERG GC on the 10/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at MACCAUVLEI GC on the 26/04/2011 is">MACCAUVLEI GC on the 26/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at MOUNT EDGECOMBE CC on the 02/05/2011 is">MOUNT EDGECOMBE CC on the 02/05/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at RANDPARK GC on the 22/05/2011 is">Your Tee off time for the Glacier Series event to be held at RANDPARK GC on the 22/05/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at OUBAAI GC on the 12/06/2011 is">OUBAAI GC on the 12/06/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at ZWARTKOP CC on the 26/06/2011 is">ZWARTKOP CC on the 26/06/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at ERPM GC on the 30/06/2011 is">Your Tee off time for the Glacier Series event to be held at ERPM GC on the 30/06/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at POLOKWANE GC on the 02/07/2011 is">Your Tee off time for the Glacier Series event to be held at POLOKWANE GC - 02/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at ERINVALE on the 03/07/2011 is">Your Tee off time for the Glacier Series event to be held at ERINVALE on the 03/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at ROYAL CAPE GC on the 04/07/2011 is">Your Tee off time for the Glacier Series event to be held at ROYAL CAPE GC on the 04/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at PAARL GC on the 05/07/2011 is">Your Tee off time for the Glacier Series event to be held at PAARL GC on the 05/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at IRENE CC on the 10/07/2011 is">Your Tee off time for the Glacier Series event to be held at IRENE CC on the 10/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at STELLENBOSCH GC on the 14/07/2011 is">Your Tee off time for the Glacier Series event to be held at STELLENBOSCH GC on the 14/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at MOWBRAY GC on the 15/07/2011 is">Your Tee off time for the Glacier Series event to be held at MOWBRAY GC on the 15/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at BRYANSTON CC on the 31/07/2011 is">Your Tee off time for the Glacier Series event to be held at BRYANSTON CC on the 31/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at SCHOEMAN PARK GC on the 07/08/2011 is">Your Tee off time for the Glacier Series event to be held at SCHOEMAN PARK GC on the 07/08/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at NELSPRUIT GC on the 14/08/2011 is">Your Tee off time for the Glacier Series event to be held at NELSPRUIT GC on the 14/08/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at THE HILL on the 21/08/2011 is">Your Tee off time for the Glacier Series event to be held at THE HILL on the 21/08/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at MOSSEL BAY GC on the 28/08/2011 is">Your Tee off time for the Glacier Series event to be held at MOSSEL BAY GC on the 28/08/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at WANDERERS GC on the 18/09/2011 is">Your Tee off time for the Glacier Series event to be held at WANDERERS GC on the 18/09/2011 is</option></select></div></div>

Link to comment
Share on other sites

just use arrays to store current tee-off time, and player name as the table is produced, then loop through the array and display relative information, with current message selected.

$SMS_Time = array(); $SMS_Player = array(); $SMS_Count=0;

$SMS_Time[$SMS_Count]=$teetime; $SMS_Player[$SMS_Count] = strtoupper($row['name']).', '.strtoupper($row['surname']); $SMS_Count++;

		if(isset($_POST['tournament']))		{		for($smsloop=0; $smsloop<count($SMS_Time); $smsloop++)			{			if($_POST['tournament'] != "The tournament has been cancelled at")				{				echo $SMS_Player[$smsloop].'|'.$_POST['tournament'].'|'.$SMS_Time[$smsloop].'|<br/>'."\n";				}			else				{				echo $SMS_Player[$smsloop].'|'.$_POST['tournament'].'| |<br/>'."\n";				}			}		}

I don't know if dropdown is manual or produced by database table?if phpas you loop through the table records to produce the dropdown, compare the value to $_POST['tournament'] value, if they match, add selected="selected" to that option.if manual use php/javascript

<?php	if(isset($_POST['tournament']))	 {	 ?> <script type="text/javascript"> /*<![CDATA[*//*---->*/   window.onload=function() {  x=document.getElementById("tournament"); for(i=0;i<x.length;i++) { if(x.options[i].value=="<?php echo $_POST['tournament']; ?>") {alert("boo") x.options[i].selected="selected"; break; } } }  /*--*//*]]>*/ </script> <?php } ?>

together

<?php  require_once('../Connections/golf_conn.php'); // need to adjust to your connection file location  mysql_select_db($database_golf_conn, $golf_conn);//$quey1 = "SELECT * FROM golf_db_form_nr_3 ORDER BY i_wish_to_play, my_handicap_is DESC";$quey1 = "SELECT * FROM golf_db_form_nr_3 ORDER BY i_wish_to_play, my_handicap_is BETWEEN 7 AND 18, my_handicap_is, my_handicap_is BETWEEN 19 AND 36, my_handicap_is BETWEEN -5 AND 6 DESC";$result = mysql_query($quey1) or die(mysql_error());$SMS_Time = array();$SMS_Player = array();$SMS_Count=0;$total_col=4;$teereftwo="First";$teerefone="Tenth";$teeperiod=6;$bordtop="";$trgroupcount=0;if(isset($_POST['columnselect'])){$total_col=$_POST['columnselect'];}if(isset($_POST['timeperiod'])){$teeperiod=$_POST['timeperiod'];}if(isset($_POST['1rowtee'])){$teerefone=$_POST['1rowtee'];}if(isset($_POST['row1time'])){$row1time=$_POST['row1time'];}else{$row1time="8:00";}if(isset($_POST['2rowtee'])){$teereftwo=$_POST['2rowtee'];}if(isset($_POST['clubselect'])){$clubselected=$_POST['clubselect'];}else{while ($row = mysql_fetch_assoc($result))	{	$clubselected=$row['i_wish_to_play'];	break;	}}	  $col_count=0;	  $currentclub="";	  $trcount=0;	$trclass="";		/////////////////////////  determine total row value and store in array ////////////////////////////////$rowsarray = array();$current_row_count=0;//$quey1 = "SELECT * FROM golf_db_form_nr_3 WHERE i_wish_to_play='$clubselected' ORDER BY i_wish_to_play, my_handicap_is DESC ";$quey1 = "SELECT * FROM golf_db_form_nr_3 WHERE i_wish_to_play='$clubselected' ORDER BY i_wish_to_play, my_handicap_is BETWEEN 7 AND 18, my_handicap_is, my_handicap_is BETWEEN 19 AND 36, my_handicap_is BETWEEN -5 AND 6 DESC";$result = mysql_query($quey1) or die(mysql_error());				while ($row = mysql_fetch_assoc($result))	{	  if($currentclub != $row['i_wish_to_play'] && $currentclub!="")		  {			$rowsarray[$current_row_count]=$trcount;		$trcount=0;		 $col_count=0;		$current_row_count++;		}	if($col_count==0)		  {		$trcount++;		  }		$col_count++;			   if($col_count==$total_col)		  {		  $col_count=0;		  }	$currentclub = $row['i_wish_to_play'];   }//end while loop   $rowsarray[$current_row_count]=$trcount;	  	  /////////////////////////////////////////// Show tables ////////////////////////////////////////////////////////////			  $col_colunt=0;	  $currentclub="";	  $trcount=0;	  $trclass="";	function fillemptygrouprows($trcount,$total_col, $thisrowvalue){if($trcount<(ceil($thisrowvalue/4)*4) && $trcount>0)		{				for($r=$trcount;$r<(ceil($thisrowvalue/4)*4);$r++)		{		echo '<tr><td class="time">  :  </td>';				for ($i=0;$i<$total_col;$i++)					{			echo '<td> </td><td> </td>';					}			echo '</tr>';			}		}}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title><?php	if(isset($_POST['tournament']))	{	?><script type="text/javascript">/*<![CDATA[*//*---->*/window.onload=function(){x=document.getElementById("tournament");for(i=0;i<x.length;i++){if(x.options[i].value=="<?php echo $_POST['tournament']; ?>"){x.options[i].selected="selected";break;}}}/*--*//*]]>*/</script><?php}?><style type="text/css">table {border:2px solid #D3E2FE;  width:100%;  font-size:12px;  font-family:Arial; color:#00008B;margin-bottom:20px;}table tr td {border-right:1px solid #D3E2FE;border-top:1px solid #D3E2FE;}tr.header{background-color:#D6D6D8; font-weight:bold;}.rowcol1 {background-color:#F0FFFF;}.rowcol2 {background-color:#FFFFCC;}.rowcol3 {background-color:#CCCCFF;}td.fullname { padding-left:2px; font-size: 11px;}tr.header td.fullname{width:<?php echo 78/$total_col; ?>%; }tr.header td.hcap{width:<?php echo 16/$total_col; ?>%;}td.hcap {text-align:center;}#wrapper {width:95%; margin:0 auto;}.starter {background-color:#D3E2FE;text-align:center}.time {text-align:center}.blank {background-color:#FFF; }.blank td { border-width:0;}.bordertop td {border-top:1px solid #D3E2FE;}.teeinput_outer {margin-top:10px;}.teeinput_outer div span { display:block;float:left;width:160px;margin-left:10px;}.highlight_tee_error{color:#FF0000; font-weight:bold;}</style></head><body><div id="wrapper">		<form action="" method="post" name="tablecontroller" target="_self" id="tablecontroller">	<div id="form_container" style="width:300px; border:2px solid #D3E2FE; margin: 20px auto; text-align:center;">	<h4>Club Selection:</h4>	<select name="clubselect">	<?php	//$quey1 = "SELECT * FROM golf_db_form_nr_3 ORDER BY i_wish_to_play, my_handicap_is DESC";	$quey1 = "SELECT * FROM golf_db_form_nr_3 WHERE i_wish_to_play='$clubselected' ORDER BY i_wish_to_play, my_handicap_is BETWEEN 7 AND 18,		 my_handicap_is, my_handicap_is BETWEEN 19 AND 36, my_handicap_is BETWEEN -5 AND 6 DESC";	$result = mysql_query($quey1) or die(mysql_error());	$current_table_count=-1;	while ($row = mysql_fetch_assoc($result))		{		if($currentclub!=$row['i_wish_to_play'])			{						if($clubselected == $row['i_wish_to_play'])				{				echo '<option value="'.$row['i_wish_to_play'].'" selected="selected">'.$row['i_wish_to_play'].' </option>'."\n";				}			else				{			echo '<option value="'.$row['i_wish_to_play'].'">'.$row['i_wish_to_play'].'</option>'."\n";				}			}		$currentclub=$row['i_wish_to_play'];		}	?>	</select>	<select name="columnselect">	<?php	for($j=2;$j<5;$j++)		{		if($total_col == $j)			{			echo '<option value="'.$j.'" selected="selected">'.($j).' Ball</option>'."\n";			}		else			{			echo '<option value="'.$j.'">'.($j).' Ball</option>'."\n";			}		}	$teeholetext= array('First', 'Second', 'Third', 'Fourth', 'Fifth',  'Sixth', 'Seventh', 'Eighth', 'Ninth', 'Tenth', 'Eleventh', 'Twelve', 'Thirteenth', 'Fourteenth', 'Fifteenth', 'Sixteenth', 'Seventeenth', 'Eighteenth');	?>	</select>		<div class="teeinput_outer">			<div>			<span>1st group row Tee Hole:</span>			<select name="1rowtee">			<?php			for($t=0;$t<18;$t++)				{				if($teerefone == $teeholetext[$t])					{					echo '<option selected="selected" value="'.$teeholetext[$t].'">'.$teeholetext[$t].'</option>'."\n";					}				else					{					echo '<option value="'.$teeholetext[$t].'">'.$teeholetext[$t].'</option>'."\n";					}				}			?>			</select>			</div><!--End teeinput_outer INNER DIV-->			<div><!-- Start inner div-->			<span>2nd group row Tee Hole:</span><select name="2rowtee">			<?php			for($t=0;$t<18;$t++)				{				if($teereftwo == $teeholetext[$t])					{					echo '<option selected="selected" value="'.$teeholetext[$t].'">'.$teeholetext[$t].'</option>'."\n";					}				else					{				echo '<option value="'.$teeholetext[$t].'">'.$teeholetext[$t].'</option>'."\n";					}				}			?>			</select>			</div><!--End teeinput_outer INNER DIV-->		</div><!--End teeinput_outer DIV-->		<div class="teeinput_outer">			<div>			<span>Tee off Time:</span>			<select name="row1time">			<?php			for($t=8;$t<21;$t++)				{				if($row1time == $t.':00')					{					echo '<option selected="selected" value="'.$t.':00">'.$t.':00</option>'."\n";					}				else					{					echo '<option value="'.$t.':00">'.$t.':00</option>'."\n";					}				}			?>			</select>			</div><!--End teeinput_outer INNER DIV-->		</div><!--End teeinput_outer DIV-->		<div class="teeinput_outer">			<div>			<span>Set Period:</span>			<select name="timeperiod">			<?php			for($t=6;$t<=10;$t++)				{				if($teeperiod == $t)					{					echo '<option selected="selected" value="'.$t.'">'.$t.'</option>'."\n";					}				else					{					echo '<option value="'.$t.'">'.$t.'</option>'."\n";					}				}			?>			</select>			</div><!--End teeinput_outer INNER DIV-->		</div><!--End teeinput_outer DIV-->	</div><select name="tournament" id="tournament" style="font-size:10px;"><option value="The tournament has been cancelled at">The tournament has been cancelled at</option><option value="Your Tee off time for the Glacier Series event to be held at KYALAMI GC on the 27/02/2011 is">Your Tee off time for the Glacier Series event to be held at KYALAMI GC on the 27/02/2011 is </option><option value="Your Tee off time for the Glacier Series event to be held at St. FRANCIS LINKS on the 06/03/2011 is">Your Tee off time for the Glacier Series event to be held at St. FRANCIS LINKS on the 06/03/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at GARDENER ROSS GE on the 27/03/2011 is">Your Tee off time for the Glacier Series event to be held at GARDENER ROSS GE on the 27/03/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at RUSTENBURG GC on the 28/03/2011 is">Your Tee off time for the Glacier Series event to be held at RUSTENBURG GC on the 28/03/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at WITBANK GC on the 31/03/2011 is">Your Tee off time for the Glacier Series event to be held at WITBANK GC on the 31/03/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at WEST BANK GC on the 02/04/2011 is">Your Tee off time for the Glacier Series event to be held at WEST BANK GC on the 02/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at EBOTSE GE on the 03/04/2011 is">Your Tee off time for the Glacier Series event to be held at EBOTSE GE on the 03/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at UMHLALI GE on the 06/04/2011 is">Your Tee off time for the Glacier Series event to be held at UMHLALI GE on the 06/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at DURBAN CC on the 08/04/2011 is">Your Tee off time for the Glacier Series event to be held at DURBAN CC on the 08/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at STEENBERG GC on the 10/04/2011 is">Your Tee off time for the Glacier Series event to be held at STEENBERG GC on the 10/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at MACCAUVLEI GC on the 26/04/2011 is">Your Tee off time for the Glacier Series event to be held at MACCAUVLEI GC on the 26/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at MOUNT EDGECOMBE CC on the 02/05/2011 is">Your Tee off time for the Glacier Series event to be held at MOUNT EDGECOMBE CC on the 02/05/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at RANDPARK GC on the 22/05/2011 is">Your Tee off time for the Glacier Series event to be held at RANDPARK GC on the 22/05/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at OUBAAI GC on the 12/06/2011 is">Your Tee off time for the Glacier Series event to be held at OUBAAI GC on the 12/06/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at ZWARTKOP CC on the 26/06/2011 is">Your Tee off time for the Glacier Series event to be held at ZWARTKOP CC on the 26/06/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at ERPM GC on the 30/06/2011 is">Your Tee off time for the Glacier Series event to be held at ERPM GC on the 30/06/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at POLOKWANE GC on the 02/07/2011 is">Your Tee off time for the Glacier Series event to be held at POLOKWANE GC - 02/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at ERINVALE on the 03/07/2011 is">Your Tee off time for the Glacier Series event to be held at ERINVALE on the 03/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at ROYAL CAPE GC on the 04/07/2011 is">Your Tee off time for the Glacier Series event to be held at ROYAL CAPE GC on the 04/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at PAARL GC on the 05/07/2011 is">Your Tee off time for the Glacier Series event to be held at PAARL GC on the 05/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at IRENE CC on the 10/07/2011 is">Your Tee off time for the Glacier Series event to be held at IRENE CC on the 10/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at STELLENBOSCH GC on the 14/07/2011 is">Your Tee off time for the Glacier Series event to be held at STELLENBOSCH GC on the 14/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at MOWBRAY GC on the 15/07/2011 is">Your Tee off time for the Glacier Series event to be held at MOWBRAY GC on the 15/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at BRYANSTON CC on the 31/07/2011 is">Your Tee off time for the Glacier Series event to be held at BRYANSTON CC on the 31/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at SCHOEMAN PARK GC on the 07/08/2011 is">Your Tee off time for the Glacier Series event to be held at SCHOEMAN PARK GC on the 07/08/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at NELSPRUIT GC on the 14/08/2011 is">Your Tee off time for the Glacier Series event to be held at NELSPRUIT GC on the 14/08/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at THE HILL on the 21/08/2011 is">Your Tee off time for the Glacier Series event to be held at THE HILL on the 21/08/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at MOSSEL BAY GC on the 28/08/2011 is">Your Tee off time for the Glacier Series event to be held at MOSSEL BAY GC on the 28/08/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at WANDERERS GC on the 18/09/2011 is">Your Tee off time for the Glacier Series event to be held at WANDERERS GC on the 18/09/2011 is</option></select><div style="margin:20px; text-align:center; "><input name="clubsubmit" type="submit" value="Submit" /></div></form><?php$currentclub="";//$quey1 = "SELECT * FROM golf_db_form_nr_3 WHERE i_wish_to_play='$clubselected' ORDER BY i_wish_to_play, my_handicap_is DESC ";$quey1 = "SELECT * FROM golf_db_form_nr_3 WHERE i_wish_to_play='$clubselected' ORDER BY i_wish_to_play, my_handicap_is BETWEEN 7 AND 18, my_handicap_is, my_handicap_is BETWEEN 19 AND 36, my_handicap_is BETWEEN -5 AND 6 DESC";$result = mysql_query($quey1) or die(mysql_error());	$current_table_count=-1;$teecount=0;while ($row = mysql_fetch_assoc($result))	{	  if($currentclub != $row['i_wish_to_play'])		  {		$current_table_count++;		$teecount=0;					   if($col_count<$total_col && $col_count!=0 && $currentclub !="") /// use to fill empty cells			   {			   for($i=$col_count;$i<$total_col;$i++)				   {				   echo "<td> </td><td> </td>";				   }			  echo "</tr>";			fillemptygrouprows($trcount,$total_col, ceil($rowsarray[$current_table_count]));				echo "</table>";				  $trcount=0;						  }		 else if ($currentclub !="")			 {			fillemptygrouprows($trcount,$total_col, ceil($rowsarray[$current_table_count]));						   echo "</table> ";			$trcount=0;			}  ?><table border="0" cellpadding="0" cellspacing="0">  <tr>  <th colspan="<?php echo ($total_col*2)+1; ?>"><?php echo $row['i_wish_to_play']; ?></th>  </tr>  <?php	echo '<tr class="blank'.$bordtop.'"><td> </td>';		for ($i=0;$i<$total_col;$i++) // adds top tee number header		{		if($i == 0)			{			echo '<td style="font-weight:bold; text-align:center;">'.strtoupper($teerefone).' TEE</td><td> </td>';			}		else			{			echo '<td> </td><td> </td>';			}					}					echo '</tr>';	?>  <tr class="header"><td style="width:40px; text-align: center;">TIME</td><?php		for ($i=0;$i<$total_col;$i++)//add fullname and h/cap header			{			echo '<td class="fullname">FULL NAME</td><td class="hcap">H/CAP</td>';			}			?>	</tr><?php		$col_count=0;		}				if($col_count==0)	  {		if($trcount == ceil($rowsarray[$current_table_count]/4) || $trcount == (ceil($rowsarray[$current_table_count]/4)+ceil($rowsarray[$current_table_count]/4)*2))			{			$timestamp=strtotime($row1time);			$timeinterval=$trgroupcount*$teeperiod;			$teetime=date('H:i', strtotime("+$timeinterval minutes", $timestamp));			$trgroupcount++;			echo '<tr class="starter"><td>'.$teetime.'</td>';			for ($i=0;$i<$total_col;$i++)				{				echo '<td class="fullname">STARTER</td><td class="hcap"> </td>';				}			echo '</tr>';			}		else			{			if($trcount  % ((ceil($rowsarray[$current_table_count]/4)*2)) ==0 && $trcount!=0)				{								for($j=0;$j<2;$j++)					{					if($j==0)						{						$bordtop=" bordertop";						}					else						{						$bordtop="";						}					 echo '<tr class="blank'.$bordtop.'"><td> </td>';					for ($i=0;$i<$total_col;$i++)						{						if($i == 0 && $j !=0)							{							$trgroupcount=0;							$teetexterror="";							if($teereftwo==$teerefone)							{							$teetexterror="highlight_tee_error";							$teereftwo="Matching Tee holes";							}														echo '<td style="font-weight:bold; text-align:center;"><span class="'.$teetexterror.'">'.strtoupper("$teereftwo").'</span> TEE</td><td> </td>';							}						else							{							echo '<td> </td><td> </td>';							}						}			echo '</tr>';					}				}			}			$timestamp=strtotime($row1time);			$timeinterval=$trgroupcount*$teeperiod;			$teetime=date('H:i', strtotime("+$timeinterval minutes", $timestamp));		echo '<tr><td class="time">'.$teetime.'</td>';		$trcount++;		$trgroupcount++;	  }  	  /*if($col_count % 2 == 0)		   {		$trclass="rowcol1";		}	else		{		$trclass="rowcol2";		}*/				if($row['my_handicap_is'] >= -5 && $row['my_handicap_is'] <=6)		   {			$trclass="rowcol1";			}		elseif($row['my_handicap_is'] >= 7 && $row['my_handicap_is'] <=18)			{		$trclass="rowcol2";			}		else			{			$trclass="rowcol3";			}				if($col_count < (ceil($rowsarray[$current_table_count]*$total_col)/$total_col)+1)		{		$SMS_Time[$SMS_Count]=$teetime;$SMS_Player[$SMS_Count] = strtoupper($row['name']).', '.strtoupper($row['surname']);$SMS_Count++;  ?>  <td class="fullname <?php echo $trclass; ?>"><?php echo strtoupper($row['name']); ?>, <?php echo strtoupper($row['surname']); ?></td>		<td class="hcap <?php echo $trclass; ?>"><?php echo $row['my_handicap_is']; ?></td><?php  }		  $col_count++;		   if($col_count==$total_col)			  {			  echo "</tr>";			  $col_count=0;			  }			$currentclub = $row['i_wish_to_play'];	   }//end while loop       if($col_count<$total_col && $col_count!=0 && $currentclub !="") /// use to fill empty cells		   {		   for($i=$col_count;$i<$total_col;$i++)			   {			   echo "<td> </td><td> </td>";			   }		   echo "</tr>";		}		fillemptygrouprows($trcount,$total_col, ceil($rowsarray[$current_table_count]));	?></table></div><?php$quey1 = "SELECT * FROM golf_db_form_nr_3 WHERE i_wish_to_play='$clubselected' ORDER BY i_wish_to_play, my_handicap_is BETWEEN 7 AND 18, my_handicap_is, my_handicap_is BETWEEN 19 AND 36, my_handicap_is BETWEEN -5 AND 6 DESC";$result = mysql_query($quey1) or die(mysql_error());	echo '-5 to 6 = light green <br/>7 to 18 = light yellow<br />19 to 36 = light blue<br />';/*while ($row = mysql_fetch_assoc($result))	{	echo $row['my_handicap_is'].'<br />';	}*/		echo '<hr />';		//show pipe delimtered sms text			if(isset($_POST['tournament']))		{		for($smsloop=0; $smsloop<count($SMS_Time); $smsloop++)			{			if($_POST['tournament'] != "The tournament has been cancelled at")				{				echo $SMS_Player[$smsloop].'|'.$_POST['tournament'].'|'.$SMS_Time[$smsloop].'|<br/>'."\n";				}			else				{				echo $SMS_Player[$smsloop].'|'.$_POST['tournament'].'| |<br/>'."\n";				}			}		}	?></body></html>

Link to comment
Share on other sites

Hi,Thank you very very much -you really hav epulled out the stops - I appreciate it.Would you be able to make three adjustments, please?1.Button to view CSV - when selected the CSV can be seen on the screen2. Create a CSV button that dumps the CSV portion to a place say "C:/SMS/data.txt" or better still the name of the tournament "C:/SMS/Bryanston.txt"3.The Tournament selection box only populates with one tournament currently and not the whole list that can be found in the database, I need to be able to select from the tournaments as in the past - theonly difference being that the table that we see is only veiwable as a single table of names rather than a table where on selction of "2/3/4 ball "we will see multiple columns of names. I changed this line (as my cheat)

for($j=2;$j<5;$j++)

to be

for($j=1;$j<5;$j++)

so as to understand the effect, except this now changes the actual groupings which I wanted to stay the same when selected.I have create da page of your latest file at this link (with my cheat "1Ball")4.If I select say the tournment is there a manner in which the message will change say

"Your Tee off time for the Glacier Series event to be held at BRYANSTON GC on the 14/07/2011 is
to be "The selected Tournament" on the "Respective tournament date"I hope this is not too much.This process will eliminate a lot of typo's and errors that may creep in by an administrator.My page that is not as functionally correct as yours is seen at this link and to view the perspective please press submit?Thanks again for all your efforts.
Link to comment
Share on other sites

To question 4.if these values (Tournament Name, Tournament date) are stored in database, and you are looking for the SMS message select dropdown to show only the relevant message to that tournament as in:<select name="tournament" id="tournament" style="font-size:10px;"><option value="The tournament has been cancelled at">The tournament has been cancelled at</option><option value="Your Tee off time for the Glacier Series event to be held at BRYANSTON GC on the 14/07/2011 is">Your Tee off time for the Glacier Series event to be held at BRYANSTON GC on the 14/07/2011 is</option></select>This will have to be updated AFTER the tournament name is selected, and you may want to disable this dropdown (sms message) , until the tournament name is selected.This can be done using ajax/php, javascript will pick up the onchange event, and connect to a external php, which will echo out the option listing you require according to a value posted to it 'q=BRYANSTON GC', this option list then updates/overwrites the current sms message listing to a specific element id reference (usually the select element).This updates the listing instantly, and does not require reload.

Link to comment
Share on other sites

Thanks for the reply.The good news is that it can be done. So often I set out ina direction only to find out that the process thought of will not work.In terms of planning forward I will give the disable protion some consideration.I was however considering another option in that if I selct the tournament then the selct box "players" will populate starting with All and then the individual names.If I select ALL then ALL the players will get the selected message and if I select a players name then that players name can be updated with a new message - then the cropdown will enable to enable an individaul message to be entered and not a preselected message.I will play a bit with it when I get home tonight.

Link to comment
Share on other sites

Hi,In reply to question 4.The values of tournament and tournament date are stored in the database.The idea is to populate the drop down box with message that can be selected and if the tournament is selected then all the messages that are created could or could not have the tournament name or date there in.The idea is for me to plan the message wording that when the tournament name or date is required there can be no error as it is determined by the tournament selected -if that makes sense.The message management is determined then also by the list presented under the players name box where not just the players names are listed but also the word "ALL" and "PRESIDENTS" where all=the players in each tournament and presidents=the administrators from a different database.The message will be viewable in the table under the respective column and on the selection of the CSV it is dumped not to screen but to the C:/SMS/Bryanston.txt as pipedelimited or C:/SMS/Steeburg.txt pending the tournament selected and finally the selction of the CSV button.If I use the Submit button the idea is for the table to view showing all th emassages and what message respective folk/players would receive - thus creating one table with differing messages if say a players name and presidents are selected.Once the table is veiwed and accepted then CSV to file on local drive.Please select the CSV button before viewing to get an idea of the look and feel currently planned.I have worked a bit on my file to look like this, just battling a bit to get the look and feel right using:

</div><select name="Combobox1" size="1" id="Combobox1" onselect="ShowObject('', 1);return false;" style="position:absolute;left:470px;top:140px;width:150px;background-color:#FFFFE0;color:#00008B;font-family:Calibri;font-size:13px;z-index:2"><option selected value="TEST">TEST</option></select>

If I use this option it jumps out of the container -if that makes sense.Thanks again for helping me with these tasks

Link to comment
Share on other sites

Moving the flag pole again!getting the dropdown list of messages related to tournament, and presidents etc. no problem.individual players, presidents, receiving different messages?? big problem.producing delimited messages, and displaying them, depends if above can be achieved, can't think of workable/practical solution yet!if the players, presidents received the same message relative to if they are a player OR president, you could filter the messages to do this, but different messages for different players makes it more complicated.

Link to comment
Share on other sites

Sorry,Dont mean to change the posts - more sharing of ideas - We are in the process involved in two files - one doing the draw and one doing the messaging prep. I will try take heed my rampant mind.I will stick with the simple messaging and the tournament selection.The delimited solution offered originally is ok except that I would like the dump to a file option. Viewing it in the table is ideal and I believe that can be done.I will give the filtering option of messages a thought.

Link to comment
Share on other sites

Hi,Here is a copy of the file I have been working on.I hope I havent caused to much damge in terms of structures.

<?php   $connect = mysql_connect("localhost", "e****_***", "*****") ordie ("Hey loser, check your server connection.");mysql_select_db("eg****_M*****s");$quey1 = "SELECT * FROM _Form_Nr_4 ORDER BY i_wish_to_play, my_handicap_is DESC";$result = mysql_query($quey1) or die(mysql_error());$total_col=8;$teereftwo="1st";$teerefone="10th";$teeperiod=6;$message="select your message";if(isset($_POST['columnselect'])){$total_col=$_POST['columnselect'];}if(isset($_POST['timeperiod'])){$teeperiod=$_POST['timeperiod'];}if(isset($_POST['1rowtee'])){$teerefone=$_POST['1rowtee'];}if(isset($_POST['2rowtee'])){$teereftwo=$_POST['2rowtee'];}if(isset($_POST['message'])){$message=$_POST['message'];}if(isset($_POST['clubselect'])){$clubselected=$_POST['clubselect'];}else{while ($row = mysql_fetch_assoc($result)) 	{ 	$clubselected=$row['i_wish_to_play'];	break;	}}	  $col_count=0;	  $currentclub="";	  $trcount=0;	  $trclass="";	/////////////////////////  determine total row value and store in array ////////////////////////////////$rowsarray = array();$current_row_count=0;$quey1 = "SELECT * FROM _Form_Nr_4 WHERE i_wish_to_play='$clubselected' ORDER BY i_wish_to_play, my_handicap_is DESC ";$result = mysql_query($quey1) or die(mysql_error());				while ($row = mysql_fetch_assoc($result)) 	{ 	  if($currentclub != $row['i_wish_to_play'] && $currentclub!="")		  {			$rowsarray[$current_row_count]=$trcount;		$trcount=0;		 $col_count=0;		$current_row_count++;		}	if($col_count==0)		  {		$trcount++;		  }		$col_count++;			   if($col_count==$total_col)		  {		  $col_count=0;		  } 	$currentclub = $row['i_wish_to_play'];   }//end while loop    $rowsarray[$current_row_count]=$trcount;	   	   /////////////////////////////////////////// Show tables ////////////////////////////////////////////////////////////			  $col_count=0;	  $currentclub="";	  $trcount=0;	  $trclass="";	function fillemptygrouprows($trcount,$total_col, $thisrowvalue){if($trcount<(ceil($thisrowvalue/4)*4) && $trcount>0)		{				for($r=$trcount;$r<(ceil($thisrowvalue/4)*4);$r++)		{		echo '<tr><td class="time">  :  </td>';				for ($i=0;$i<$total_col;$i++)					{			echo '<td> </td><td> </td>';					}			echo '</tr>';			}		}}?><!------------------------------------------------------------------><!		THIS SECTION BELOW CALCULATES THE AGE OF A PERSON		 ><!------------------------------------------------------------------><?php		// Example Age Input   // $DateOfBirth=19770226;		// Calculate Age Using Function:	$Age= DetermineAgeFromDOB ($DateOfBirth);		// Display Results	//echo "A person born on ".$DateOfBirth." is now ".$Age." years old.";		// Define the function	function DetermineAgeFromDOB ($YYYYMMDD_In)	{	  // Parse Birthday Input Into Local Variables	  // Assumes Input In Form: YYYYMMDD	  $yIn=substr($YYYYMMDD_In, 0, 4);	  $mIn=substr($YYYYMMDD_In, 4, 2);	  $dIn=substr($YYYYMMDD_In, 6, 2);		  // Calculate Differences Between Birthday And Now	  // By Subtracting Birthday From Current Date	  $ddiff = date("d") - $dIn;	  $mdiff = date("m") - $mIn;	  $ydiff = date("Y") - $yIn;		  // Check If Birthday Month Has Been Reached	  if ($mdiff < 0) 	  {		// Birthday Month Not Reached		// Subtract 1 Year From Age		$ydiff--;	  } elseif ($mdiff==0)	  {		// Birthday Month Currently		// Check If BirthdayDay Passed		if ($ddiff < 0)		{		  //Birthday Not Reached		  // Subtract 1 Year From Age		  $ydiff--;		}	  }	  return $ydiff; 	} ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title><script type="text/javascript">/*<![CDATA[*//*---->*//*--*//*]]>*/</script> <style type="text/css">table {margin-left:0px; position:absolute;left:0px; top:145px; border:1px solid #81BEF7; width:35%; font-size:12px; font-family:Calibri; color:#00008B; margin-bottom:20px;}table tr td {border-right:1px solid #81BEF7; border-top:1px solid #81BEF7;}tr.header{background-color:#E4EAF2; font-weight:bold;}.rowcol1 {background-color:#F5F9FD;}.rowcol2 {background-color:#F5F9FD;}td.fullname { padding-left:2px; font-size: 9px;}td.fullname2 { padding-left:2px; font-size: 9px; color:#FF0000;}tr.header td.fullname{width:<?php echo 50/$total_col; ?>%; }tr.header td.hcap{width:<?php echo 20/$total_col; ?>%;}td.hcap {text-align:center;font-size: 9px;}#wrapper {width:95%; margin:5 auto;}.starter {background-color:#E4EAF2;text-align:center}.time {text-align:center;font-size: 9px;}.blank {background-color:#FFF; }.blank td { border-width:0;}.bordertop td {border-top:1px solid #81BEF7;}.teeinput_outer {margin-top:10px;}.teeinput_outer div span { display:block;float:left;width:160px;margin-left:10px;}.highlight_tee_error{color:#FF0000; font-weight:bold;}</style></head><body><div id="wrapper"><form id="tablecontroller" target="_self" name="tablecontroller" method="post" action=""><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute;left:10px; top:25px; font-size:11px; width:200px; border:1px solid #81BEF7; font-family:Calibri; color:#00008B; margin: 5px auto; text-align:center;"><legend>TOURNAMENT</legend><select name="clubselect"><?php$quey1 = "SELECT * FROM _Form_Nr_4 ORDER BY i_wish_to_play, my_handicap_is DESC";$result = mysql_query($quey1) or die(mysql_error());$current_table_count=-1;while ($row = mysql_fetch_assoc($result)) 	{ 	if($currentclub!=$row['i_wish_to_play'])		{					if($clubselected == $row['i_wish_to_play'])			{			echo '<option value="'.$row['i_wish_to_play'].'" selected="selected">'.$row['i_wish_to_play'].' </option>\n';			}		else			{			echo '<option value="'.$row['i_wish_to_play'].'">'.$row['i_wish_to_play'].'</option>\n';			}		}	$currentclub=$row['i_wish_to_play'];	}?></select></div><div id="form_container" style="font-size:16px; background-color:#E4EAF2; width:900px; top:25px; font-family:Calibri; color:#00008B; border:1px solid #81BEF7; margin: 5px auto; text-align:left;"><legend>   <b>MESSAGE BOARD - SMS DEVELOPER</b></legend><p> </p><p> </p><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute;left:575px;top:25px; font-size:11px; width:120px; font-family:Calibri; color:#00008B; border:1px solid #81BEF7; margin: 5px auto; text-align:center;"><legend>PLAYERS PER GROUP</legend><select name="columnselect">	<?php	for($j=1;$j<5;$j++)	{	if($total_col == $j)	{	echo '<option value="'.$j.'" selected="selected">'.($j).' Ball</option>\n';	}	else	{	echo '<option value="'.$j.'">'.($j).' Ball</option>\n';	}	}	$teeholetext= array('1st', '2nd', '3rd', '4th', '5th',  '6th', '7th', '8th', '9th', '10th', '11th', '12th', '13th', '14th', '15th', '16th', '17th', '18th');?></select></div><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute;left:215px;top:25px; font-size:11px; width:120px; font-family:Calibri; color:#00008B; border:1px solid #81BEF7; margin: 5px auto; text-align:center;"><legend>PLAYERS NAMES</legend><select name="columnselect">	<?php	for($j=1;$j<5;$j++)	{	if($total_col == $j)	{	echo '<option value="'.$j.'" selected="selected">'.($j).' Ball</option>\n';	}	else	{	echo '<option value="'.$j.'">'.($j).' Ball</option>\n';	}	}	$teeholetext= array('1st', '2nd', '3rd', '4th', '5th',  '6th', '7th', '8th', '9th', '10th', '11th', '12th', '13th', '14th', '15th', '16th', '17th', '18th');?></select></div><div class="teeinput_outer"><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute;left:365px;top:25px; font-size:11px; width:100px; border:1px solid #81BEF7; margin: 5px auto; font-family:Calibri; color:#00008B; text-align:center;"><legend>1st GROUP 'T' BOX</legend><select name="1rowtee">	<?php	for($t=0;$t<18;$t++)	{	if($teerefone == $teeholetext[$t])	{	echo '<option selected="selected" value="'.$teeholetext[$t].'">'.$teeholetext[$t].'</option>\n';	}	else	{	echo '<option value="'.$teeholetext[$t].'">'.$teeholetext[$t].'</option>\n';	}	}	?></select></div><div><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute;left:470px;top:25px; font-size:11px; width:100px; border:1px solid #81BEF7; margin: 5px auto; font-family:Calibri; color:#00008B; text-align:center;"><legend>2nd GROUP 'T' BOX</legend><select name="2rowtee">	<?php	for($t=0;$t<18;$t++)	{	if($teereftwo == $teeholetext[$t])	{	echo '<option selected="selected" value="'.$teeholetext[$t].'">'.$teeholetext[$t].'</option>\n';	}	else	{	echo '<option value="'.$teeholetext[$t].'">'.$teeholetext[$t].'</option>\n';	}	}	?></select></div></div><div><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute;left:10px;top:70px; font-size:11px; width:665px; border:1px solid #81BEF7; margin: 5px auto; font-family:Calibri; color:#00008B; text-align:center;"><legend>MESSAGE CHOICE</legend><select name="tournament" font-size:8px;><option value="The tournament has been cancelled at">The tournament has been cancelled at</option><option value="Your Tee off time for the Glacier Series event to be held at KYALAMI GC on the 27/02/2011 is">Your Tee off time for the Glacier Series event to be held at KYALAMI GC on the 27/02/2011 is </option><option value="Your Tee off time for the Glacier Series event to be held at St. FRANCIS LINKS on the 06/03/2011 is">Your Tee off time for the Glacier Series event to be held at St. FRANCIS LINKS on the 06/03/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at GARDENER ROSS GE on the 27/03/2011 is">Your Tee off time for the Glacier Series event to be held at GARDENER ROSS GE on the 27/03/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at RUSTENBURG GC on the 28/03/2011 is">Your Tee off time for the Glacier Series event to be held at RUSTENBURG GC on the 28/03/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at WITBANK GC on the 31/03/2011 is">Your Tee off time for the Glacier Series event to be held at WITBANK GC on the 31/03/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at WEST BANK GC on the 02/04/2011 is">Your Tee off time for the Glacier Series event to be held at WEST BANK GC on the 02/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at EBOTSE GE on the 03/04/2011 is">Your Tee off time for the Glacier Series event to be held at EBOTSE GE on the 03/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at UMHLALI GE on the 06/04/2011 is">Your Tee off time for the Glacier Series event to be held at UMHLALI GE on the 06/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at DURBAN CC on the 08/04/2011 is">Your Tee off time for the Glacier Series event to be held at DURBAN CC on the 08/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at STEENBERG GC on the 10/04/2011 is">Your Tee off time for the Glacier Series event to be held at STEENBERG GC on the 10/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at MACCAUVLEI GC on the 26/04/2011 is">Your Tee off time for the Glacier Series event to be held at MACCAUVLEI GC on the 26/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at MOUNT EDGECOMBE CC on the 02/05/2011 is">Your Tee off time for the Glacier Series event to be held at MOUNT EDGECOMBE CC on the 02/05/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at RANDPARK GC on the 22/05/2011 is">Your Tee off time for the Glacier Series event to be held at RANDPARK GC on the 22/05/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at OUBAAI GC on the 12/06/2011 is">Your Tee off time for the Glacier Series event to be held at OUBAAI GC on the 12/06/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at ZWARTKOP CC on the 26/06/2011 is">Your Tee off time for the Glacier Series event to be held at ZWARTKOP CC on the 26/06/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at ERPM GC on the 30/06/2011 is">Your Tee off time for the Glacier Series event to be held at ERPM GC on the 30/06/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at POLOKWANE GC on the 02/07/2011 is">Your Tee off time for the Glacier Series event to be held at POLOKWANE GC - 02/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at ERINVALE on the 03/07/2011 is">Your Tee off time for the Glacier Series event to be held at ERINVALE on the 03/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at ROYAL CAPE GC on the 04/07/2011 is">Your Tee off time for the Glacier Series event to be held at ROYAL CAPE GC on the 04/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at PAARL GC on the 05/07/2011 is">Your Tee off time for the Glacier Series event to be held at PAARL GC on the 05/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at IRENE CC on the 10/07/2011 is">Your Tee off time for the Glacier Series event to be held at IRENE CC on the 10/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at STELLENBOSCH GC on the 14/07/2011 is">Your Tee off time for the Glacier Series event to be held at STELLENBOSCH GC on the 14/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at MOWBRAY GC on the 15/07/2011 is">Your Tee off time for the Glacier Series event to be held at MOWBRAY GC on the 15/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at BRYANSTON CC on the 31/07/2011 is">Your Tee off time for the Glacier Series event to be held at BRYANSTON CC on the 31/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at SCHOEMAN PARK GC on the 07/08/2011 is">Your Tee off time for the Glacier Series event to be held at SCHOEMAN PARK GC on the 07/08/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at NELSPRUIT GC on the 14/08/2011 is">Your Tee off time for the Glacier Series event to be held at NELSPRUIT GC on the 14/08/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at THE HILL on the 21/08/2011 is">Your Tee off time for the Glacier Series event to be held at THE HILL on the 21/08/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at MOSSEL BAY GC on the 28/08/2011 is">Your Tee off time for the Glacier Series event to be held at MOSSEL BAY GC on the 28/08/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at WANDERERS GC on the 18/09/2011 is">Your Tee off time for the Glacier Series event to be held at WANDERERS GC on the 18/09/2011 is</option></select></div></div><div class="teeinput_outer"><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute;left:680px;top:70px; font-size:11px; width:90px; border:1px solid #81BEF7; margin: 5px auto; font-family:Calibri; color:#00008B; text-align:center;"><legend>START TIME</legend><select name="1rowtime"><?php for($t=6;$t<15;$t++){if($_POST['1rowtime'] == $t.':00'){echo '<option selected="selected" value="'.$t.':00">'.$t.':00</option>\n';}else{echo '<option value="'.$t.':00">'.$t.':00</option>\n';}}?></select></div></div><div class="teeinput_outer"><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute;left:700px;top:25px; font-size:11px; width:110px; border:1px solid #81BEF7; margin: 5px auto; font-family:Calibri; color:#00008B; text-align:center;"><legend>PLAYING INTERVALS</legend><select name="timeperiod"><?php for($t=6;$t<=10;$t++){if($_POST['timeperiod'] == $t){echo '<option selected="selected" value="'.$t.'">'.$t.'</option>\n';}else{echo '<option value="'.$t.'">'.$t.'</option>\n';}}?></select></div></div><div style="position:absolute;left:830px;top:125px;"><input name="clubsubmit" type="submit" value=" CSV " /></div></form></div><div style="position:absolute;left:830px;top:90px;"><input name="clubsubmit" type="submit" value="Submit" /></div></form></div><?php $currentclub="";$quey1 = "SELECT * FROM _Form_Nr_4 WHERE i_wish_to_play='$clubselected' ORDER BY i_wish_to_play, my_handicap_is ASC ";$result = mysql_query($quey1) or die(mysql_error());	//echo mysql_num_rows($result);$current_table_count=-1;$teecount=0;while ($row = mysql_fetch_assoc($result)) 	{ 		//echo $rowsarray[$current_table_count].'xxxxxxx<br />';	  if($currentclub != $row['i_wish_to_play']) // if(1)		  {		$current_table_count++;		$teecount=0;					   if($col_count<$total_col && $col_count!=0 && $currentclub !="") /// use to fill empty cells			   {			   for($i=$col_count;$i<$total_col;$i++)				   {				   echo "<td> </td><td> </td>";				   }			  echo "</tr>";			fillemptygrouprows($trcount,$total_col, ceil($rowsarray[$current_table_count]));			  echo "</table>";				 			  $trcount=0;						  }			  else if ($currentclub !="")			  {			  fillemptygrouprows($trcount,$total_col, ceil($rowsarray[$current_table_count]));						  echo "</table> ";			  $trcount=0;			  }  ?><table border="0" cellpadding="0" cellspacing="0" >  <tr>  <th style="font-weight:bold; font-size:16px; text-align: center;" colspan="<?php echo ($total_col*2)+1; ?>"><?php echo $row['i_wish_to_play']; ?></th>  </tr>  <?php	echo '<tr class="blank'.$bordtop.'"><td> </td>';		for ($i=0;$i<$total_col;$i++) //for (1) adds top tee number header		{		if($i == 0)			{			echo '<td style="font-weight:bold; font-size:18px; text-align:center;">'.strtoupper($teerefone).' TEE</td><td> </td>';			}		else			{			echo '<td> </td><td> </td>';			}					}//end for 1					echo '</tr>';	?>  <?php		for ($i=0;$i<$total_col;$i++)//add fullname and h/cap header			{			echo '<td class="fullname" font-size:14px; ><b>FULL NAME</b></td><td class="hcap"><b>CELL PHONE</b></td><td class="hcap"><b>MESSAGE</b></td><td class="hcap" style="width:30px; text-align:center;"><b>TIME</b></td>';			}			?><?php		$col_count=0;		} //end if (1)				if($col_count==0)	  {		if($trcount == ceil($rowsarray[$current_table_count]/4) || $trcount == (ceil($rowsarray[$current_table_count]/4)+ceil($rowsarray[$current_table_count]/4)*2))			{			$timestamp=strtotime($_POST['1rowtime']);			$timeinterval=$trgroupcount*$teeperiod;			$teetime=date('H:i', strtotime("+$timeinterval minutes", $timestamp));			$trgroupcount++;			echo '<tr class="starter"><td>'.$teetime.'</td>';			for ($i=0;$i<$total_col;$i++)				{				echo '<td class="fullname2">-xxx STARTER xxx-</td><td class="hcap"> </td>';				}			echo '</tr>';			}		else			{			if($trcount  % ((ceil($rowsarray[$current_table_count]/4)*2)) ==0 && $trcount!=0)				{								for($j=0;$j<2;$j++)					{					if($j==0)						{						$bordtop=" bordertop";						}					else						{						$bordtop="";						}					 echo '<tr class="blank'.$bordtop.'"><td> </td>';					for ($i=0;$i<$total_col;$i++)						{						if($i == 0 && $j !=0)							{							$trgroupcount=0;							$teetexterror="";							if($teereftwo==$teerefone)							{							$teetexterror="highlight_tee_error";							$teereftwo="Matching Tee holes";							}														echo '<td style="font-weight:bold; font-size:18px; text-align:right;"><span class="'.$teetexterror.'">'.strtoupper("$teereftwo").'</span> TEE</td><td> </td>';							}						else							{							echo '<td> </td><td> </td>';							}						}			echo '</tr>';					}				}			}			$timestamp=strtotime($_POST['1rowtime']);			$timeinterval=$trgroupcount*$teeperiod;			$teetime=date('H:i', strtotime("+$timeinterval minutes", $timestamp));		echo '<tr><td class="time">'.$teetime.'</td>';		$trcount++;		$trgroupcount++;	  }  	  if($col_count % 2 == 0)		   {		$trclass="rowcol1";		}	else		{		$trclass="rowcol2";		}				if($col_count < (ceil($rowsarray[$current_table_count]*$total_col)/$total_col)+1)		{  ?>  <td class="fullname <?php echo $trclass; ?>"><?php echo strtoupper($row['surname']); ?>, <?php echo strtoupper($row['name']); ?></td>  <td class="hcap <?php echo $trclass; ?>"></td>  <td class="hcap <?php echo $trclass; ?>"><?php echo $row['cell_phone']; ?></td>  <?php  }		  $col_count++;		   if($col_count==$total_col)			  {			  echo "</tr>";			  $col_count=0;			  } 			$currentclub = $row['i_wish_to_play'];	   }//end while loop          if($col_count<$total_col && $col_count!=0 && $currentclub !="") /// use to fill empty cells		   {		   for($i=$col_count;$i<$total_col;$i++)			   {			   echo "<td> </td><td> </td>";			   }		   echo "</tr>";		}		fillemptygrouprows($trcount,$total_col, ceil($rowsarray[$current_table_count]));	?></table></div></body></html>

Link to comment
Share on other sites

Hi, The Table is still the same date1 = example. 31/03/2011i_wish_to_play = example. BRYANSTON GCI also have:tournament = example BRYANSTON GC - 31/03/2011Date = example. 2011-03-31I hope this helps and is not to confusing

Link to comment
Share on other sites

Hi,The sms section/ message section show as I need it -thanks.What I was trying to do was get the same information that is shown - to be seen in the table.Then if the table looks correct in terms of messaging use abutton to send it to a text file on the hard drive . . . C:/SMS/"tournament".txt

Link to comment
Share on other sites

Hi,I have managed to get the page to look something like thiserrors.JPGI have circled 5 areas which need ammending in order for it to be virtually complete.The select box below the word "Tournament" on populates the tournament for Bryanston GC and needs to populate the remining 28 othe rtournaments as well.The Container around "Players in the Group" needs to resize in order it look the same vertically as those containers to the right of it.The two vertical red circles (Left side) I would like to insert the "Cell Number" and the (Right Side) the Tee Box (i.e 10th TEE or 1st TEE) in most instances.Lastly the lowest red circle - I would like this space to remian the same and as the container increases in size so the table below will float downwards.

<?php$connect = mysql_connect("localhost", "e*******", "*******") ordie ("Hey loser, check your server connection.");mysql_select_db("e********"); // need to adjust to your connection file location$quey1 = "SELECT * FROM _Form_Nr_4 ORDER BY i_wish_to_play, my_handicap_is DESC";//$quey1 = "SELECT * FROM _Form_Nr_4 ORDER BY i_wish_to_play, my_handicap_is BETWEEN 7 AND 18, my_handicap_is, my_handicap_is BETWEEN 19 AND 36, my_handicap_is BETWEEN -5 AND 6 DESC";$result = mysql_query($quey1) or die(mysql_error());$SMS_Time = array();$SMS_Player = array();$SMS_Count=0;$total_col=8;$teereftwo="First";$teerefone="Tenth";$teeperiod=6;$bordtop="";$trgroupcount=0;if(isset($_POST['columnselect'])){$total_col=$_POST['columnselect'];}if(isset($_POST['timeperiod'])){$teeperiod=$_POST['timeperiod'];}if(isset($_POST['1rowtee'])){$teerefone=$_POST['1rowtee'];}if(isset($_POST['row1time'])){$row1time=$_POST['row1time'];}else{$row1time="8:00";}if(isset($_POST['2rowtee'])){$teereftwo=$_POST['2rowtee'];}if(isset($_POST['clubselect'])){$clubselected=$_POST['clubselect'];}else{while ($row = mysql_fetch_assoc($result))	{	$clubselected=$row['i_wish_to_play'];	break;	}}	  $col_count=0;	  $currentclub="";	  $trcount=0;	$trclass="";		/////////////////////////  determine total row value and store in array ////////////////////////////////$rowsarray = array();$current_row_count=0;//$quey1 = "SELECT * FROM _Form_Nr_4 WHERE i_wish_to_play='$clubselected' ORDER BY i_wish_to_play, my_handicap_is DESC ";$quey1 = "SELECT * FROM _Form_Nr_4 WHERE i_wish_to_play='$clubselected' ORDER BY i_wish_to_play, my_handicap_is BETWEEN 7 AND 18, my_handicap_is, my_handicap_is BETWEEN 19 AND 36, my_handicap_is BETWEEN -5 AND 6 DESC";$result = mysql_query($quey1) or die(mysql_error());				while ($row = mysql_fetch_assoc($result))	{	  if($currentclub != $row['i_wish_to_play'] && $currentclub!="")		  {			$rowsarray[$current_row_count]=$trcount;		$trcount=0;		 $col_count=0;		$current_row_count++;		}	if($col_count==0)		  {		$trcount++;		  }		$col_count++;			   if($col_count==$total_col)		  {		  $col_count=0;		  }	$currentclub = $row['i_wish_to_play'];   }//end while loop   $rowsarray[$current_row_count]=$trcount;	  	  /////////////////////////////////////////// Show tables ////////////////////////////////////////////////////////////			  $col_colunt=0;	  $currentclub="";	  $trcount=0;	  $trclass="";	function fillemptygrouprows($trcount,$total_col, $thisrowvalue){if($trcount<(ceil($thisrowvalue/4)*4) && $trcount>0)		{				for($r=$trcount;$r<(ceil($thisrowvalue/4)*4);$r++)		{		echo '<tr><td class="time">  :  </td>';				for ($i=0;$i<$total_col;$i++)					{			echo '<td> </td>';					}			echo '</tr>';			}		}}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title><?php	if(isset($_POST['tournament']))	{	?><script type="text/javascript">/*<![CDATA[*//*---->*/window.onload=function(){x=document.getElementById("tournament");for(i=0;i<x.length;i++){if(x.options[i].value=="<?php echo $_POST['tournament']; ?>"){x.options[i].selected="selected";break;}}}/*--*//*]]>*/</script><?php}?><style type="text/css">table {margin-left:0px; position:absolute; left:-172px; top:480px; border:2px solid #81BEF7; width:120%; font-size:12px; font-family:Calibri; color:#00008B; margin-bottom:20px;}table tr td {border-right:1px solid #81BEF7; border-top:1px solid #81BEF7;}tr.header{background-color:#D6D6D8; font-weight:bold;}.rowcol1 {background-color:#F0FFFF;}.rowcol2 {background-color:#FFFFCC;}.rowcol3 {background-color:#CCCCFF;}td.fullname { padding-left:2px; font-size: 11px;}tr.header td.fullname{width:<?php echo 78/$total_col; ?>%; }tr.header td.hcap{width:<?php echo 16/$total_col; ?>%;}td.hcap {text-align:center;}#wrapper {width:95%; margin:0 auto;}.starter {background-color:#D3E2FE;text-align:center}.time {text-align:center}.blank {background-color:#FFF; }.blank td { border-width:0;}.bordertop td {border-top:1px solid #D3E2FE;}.teeinput_outer {margin-top:10px;}.teeinput_outer div span { display:block; float:left; width:160px; margin-left:10px;}.highlight_tee_error{color:#FF0000; font-weight:bold;}</style></head><body><form action="" method="post" name="tablecontroller" target="_self" id="tablecontroller">   <div id="form_container" style="font-size:16px; background-color:#E4EAF2; width:900px; top:25px; font-family:Calibri; color:#00008B; border:1px solid #81BEF7; margin: 5px auto; text-align:left;"><legend>   <b>MESSAGE BOARD - SMS DEVELOPER</b></legend><p> </p><p> </p><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute; left:10px; top:25px; font-size:11px; width:165px; border:1px solid #81BEF7; font-family:Calibri; color:#00008B; text-align:center;"><legend>TOURNAMENT</legend>	<select name="clubselect" style="font-size:12px; color:#00008B; background-color:#FFFFE0; font-family:Calibri;">	<?php	//$quey1 = "SELECT * FROM _Form_Nr_4 ORDER BY i_wish_to_play, my_handicap_is DESC";	$quey1 = "SELECT * FROM _Form_Nr_4 WHERE i_wish_to_play='$clubselected' ORDER BY i_wish_to_play, my_handicap_is BETWEEN 7 AND 18, my_handicap_is, my_handicap_is BETWEEN 19 AND 36, my_handicap_is BETWEEN -5 AND 6 DESC";	$result = mysql_query($quey1) or die(mysql_error());	$current_table_count=-1;	while ($row = mysql_fetch_assoc($result))		{		if($currentclub!=$row['i_wish_to_play'])			{						if($clubselected == $row['i_wish_to_play'])				{				echo '<option value="'.$row['i_wish_to_play'].'" selected="selected">'.$row['i_wish_to_play'].' </option>'."\n";				}			else				{			echo '<option value="'.$row['i_wish_to_play'].'">'.$row['i_wish_to_play'].'</option>'."\n";				}			}		$currentclub=$row['i_wish_to_play'];		}	?>	</select><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute; left:170px; top:-1px; font-size:11px; width:140px; font-family:Calibri; color:#00008B; border:1px solid #81BEF7; text-align:center;"><legend>PLAYERS PER GROUP</legend>	<select name="columnselect" style="font-size:12px; color:#00008B; background-color:#FFFFE0; font-family:Calibri;">	<?php	for($j=1;$j<5;$j++)		{		if($total_col == $j)			{			echo '<option value="'.$j.'" selected="selected">'.($j).' Ball</option>'."\n";			}		else			{			echo '<option value="'.$j.'">'.($j).' Ball</option>'."\n";			}		}	$teeholetext= array('1st', '2nd', '3rd', '4th', '5th',  '6th', '7th', '8th', '9th', '10th', '11th', '12th', '13th', '14th', '15th', '16th', '17th', '18th');	?> </select><div class="teeinput_outer"><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute; left:145px; top:-6px; font-size:11px; width:100px; border:1px solid #81BEF7; margin: 5px auto; font-family:Calibri; color:#00008B; text-align:center;"><legend>1st GROUP TEE BOX</legend>			<select name="1rowtee" style="font-size:12px; color:#00008B; background-color:#FFFFE0; font-family:Calibri;">			<?php			for($t=0;$t<18;$t++)				{				if($teerefone == $teeholetext[$t])					{					echo '<option selected="selected" value="'.$teeholetext[$t].'">'.$teeholetext[$t].'</option>'."\n";					}				else					{					echo '<option value="'.$teeholetext[$t].'">'.$teeholetext[$t].'</option>'."\n";					}				}			?>			</select>			</div><!--End teeinput_outer INNER DIV-->			<div><!-- Start inner div--><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute;left:250px;top:-6px; font-size:11px; width:100px; border:1px solid #81BEF7; margin: 5px auto; font-family:Calibri; color:#00008B; text-align:center;"><legend>2nd GROUP 'T' BOX</legend>			<select name="2rowtee" style="font-size:12px; color:#00008B; background-color:#FFFFE0; font-family:Calibri;">			<?php			for($t=0;$t<18;$t++)				{				if($teereftwo == $teeholetext[$t])					{					echo '<option selected="selected" value="'.$teeholetext[$t].'">'.$teeholetext[$t].'</option>'."\n";					}				else					{				echo '<option value="'.$teeholetext[$t].'">'.$teeholetext[$t].'</option>'."\n";					}				}			?>			</select>			</div><!--End teeinput_outer INNER DIV-->		</div><!--End teeinput_outer DIV--><div class="teeinput_outer"><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute;left:470px; top:-6px; font-size:11px; width:90px; border:1px solid #81BEF7; margin: 5px auto; font-family:Calibri; color:#00008B; text-align:center;"><legend>START TIME</legend>			<select name="row1time" style="font-size:12px; color:#00008B; background-color:#FFFFE0; font-family:Calibri;">			<?php			for($t=8;$t<21;$t++)				{				if($row1time == $t.':00')					{					echo '<option selected="selected" value="'.$t.':00">'.$t.':00</option>'."\n";					}				else					{					echo '<option value="'.$t.':00">'.$t.':00</option>'."\n";					}				}			?>			</select>			</div><!--End teeinput_outer INNER DIV-->		</div><!--End teeinput_outer DIV--><div class="teeinput_outer"><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute;left:355px;top:-6px; font-size:11px; width:110px; border:1px solid #81BEF7; margin: 5px auto; font-family:Calibri; color:#00008B; text-align:center;"><legend>PLAYING INTERVALS</legend>			<select name="timeperiod" style="font-size:12px; color:#00008B; background-color:#FFFFE0; font-family:Calibri;">			<?php			for($t=6;$t<=10;$t++)				{				if($teeperiod == $t)					{					echo '<option selected="selected" value="'.$t.'">'.$t.'</option>'."\n";					}				else					{					echo '<option value="'.$t.'">'.$t.'</option>'."\n";					}				}			?>			</select>			</div><!--End teeinput_outer INNER DIV-->		</div><!--End teeinput_outer DIV-->	</div><div><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute;left:-172px; top:40px; font-size:11px; width:600px; border:1px solid #81BEF7; font-family:Calibri; color:#00008B; margin: 5px auto; text-align:center;"><legend><b>MESSAGE SELECTION</b></legend><select name="tournament" id="tournament" style="font-size:12px; color:#00008B; background-color:#FFFFE0; font-family:Calibri;"><option value="The tournament has been cancelled at">The tournament has been cancelled at</option><option value="Glacier Series - Your Tee off time at KYALAMI GC on the 27/02/2011 is">Glacier Series - Your Tee off time at KYALAMI GC on the 27/02/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at St. FRANCIS LINKS on the 06/03/2011 is">Your Tee off time for the Glacier Series event to be held at St. FRANCIS LINKS on the 06/03/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at GARDENER ROSS GE on the 27/03/2011 is">Your Tee off time for the Glacier Series event to be held at GARDENER ROSS GE on the 27/03/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at RUSTENBURG GC on the 28/03/2011 is">Your Tee off time for the Glacier Series event to be held at RUSTENBURG GC on the 28/03/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at WITBANK GC on the 31/03/2011 is">Your Tee off time for the Glacier Series event to be held at WITBANK GC on the 31/03/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at WEST BANK GC on the 02/04/2011 is">Your Tee off time for the Glacier Series event to be held at WEST BANK GC on the 02/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at EBOTSE GE on the 03/04/2011 is">Your Tee off time for the Glacier Series event to be held at EBOTSE GE on the 03/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at UMHLALI GE on the 06/04/2011 is">Your Tee off time for the Glacier Series event to be held at UMHLALI GE on the 06/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at DURBAN CC on the 08/04/2011 is">Your Tee off time for the Glacier Series event to be held at DURBAN CC on the 08/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at STEENBERG GC on the 10/04/2011 is">Your Tee off time for the Glacier Series event to be held at STEENBERG GC on the 10/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at MACCAUVLEI GC on the 26/04/2011 is">Your Tee off time for the Glacier Series event to be held at MACCAUVLEI GC on the 26/04/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at MOUNT EDGECOMBE CC on the 02/05/2011 is">Your Tee off time for the Glacier Series event to be held at MOUNT EDGECOMBE CC on the 02/05/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at RANDPARK GC on the 22/05/2011 is">Your Tee off time for the Glacier Series event to be held at RANDPARK GC on the 22/05/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at OUBAAI GC on the 12/06/2011 is">Your Tee off time for the Glacier Series event to be held at OUBAAI GC on the 12/06/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at ZWARTKOP CC on the 26/06/2011 is">Your Tee off time for the Glacier Series event to be held at ZWARTKOP CC on the 26/06/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at ERPM GC on the 30/06/2011 is">Your Tee off time for the Glacier Series event to be held at ERPM GC on the 30/06/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at POLOKWANE GC on the 02/07/2011 is">Your Tee off time for the Glacier Series event to be held at POLOKWANE GC - 02/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at ERINVALE on the 03/07/2011 is">Your Tee off time for the Glacier Series event to be held at ERINVALE on the 03/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at ROYAL CAPE GC on the 04/07/2011 is">Your Tee off time for the Glacier Series event to be held at ROYAL CAPE GC on the 04/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at PAARL GC on the 05/07/2011 is">Your Tee off time for the Glacier Series event to be held at PAARL GC on the 05/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at IRENE CC on the 10/07/2011 is">Your Tee off time for the Glacier Series event to be held at IRENE CC on the 10/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at STELLENBOSCH GC on the 14/07/2011 is">Your Tee off time for the Glacier Series event to be held at STELLENBOSCH GC on the 14/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at MOWBRAY GC on the 15/07/2011 is">Your Tee off time for the Glacier Series event to be held at MOWBRAY GC on the 15/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at BRYANSTON CC on the 31/07/2011 is">Your Tee off time for the Glacier Series event to be held at BRYANSTON CC on the 31/07/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at SCHOEMAN PARK GC on the 07/08/2011 is">Your Tee off time for the Glacier Series event to be held at SCHOEMAN PARK GC on the 07/08/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at NELSPRUIT GC on the 14/08/2011 is">Your Tee off time for the Glacier Series event to be held at NELSPRUIT GC on the 14/08/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at THE HILL on the 21/08/2011 is">Your Tee off time for the Glacier Series event to be held at THE HILL on the 21/08/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at MOSSEL BAY GC on the 28/08/2011 is">Your Tee off time for the Glacier Series event to be held at MOSSEL BAY GC on the 28/08/2011 is</option><option value="Your Tee off time for the Glacier Series event to be held at WANDERERS GC on the 18/09/2011 is">Your Tee off time for the Glacier Series event to be held at WANDERERS GC on the 18/09/2011 is</option></select></div><div style="position:absolute;left:630px;top:50px;"><input name="clubsubmit" type="submit" value="Submit" /></div></form><?php$currentclub="";//$quey1 = "SELECT * FROM _Form_Nr_4 WHERE i_wish_to_play='$clubselected' ORDER BY i_wish_to_play, my_handicap_is DESC ";$quey1 = "SELECT * FROM _Form_Nr_4 WHERE i_wish_to_play='$clubselected' ORDER BY i_wish_to_play, my_handicap_is BETWEEN 7 AND 18, my_handicap_is, my_handicap_is BETWEEN 19 AND 36, my_handicap_is BETWEEN -5 AND 6 DESC";$result = mysql_query($quey1) or die(mysql_error());	$current_table_count=-1;$teecount=0;while ($row = mysql_fetch_assoc($result))	{	  if($currentclub != $row['i_wish_to_play'])		  {		$current_table_count++;		$teecount=0;					   if($col_count<$total_col && $col_count!=0 && $currentclub !="") /// use to fill empty cells			   {			   for($i=$col_count;$i<$total_col;$i++)				   {				   echo "<td> </td><td> </td>";				   }			  echo "</tr>";			fillemptygrouprows($trcount,$total_col, ceil($rowsarray[$current_table_count]));				echo "</table>";				  $trcount=0;						  }		 else if ($currentclub !="")			 {			fillemptygrouprows($trcount,$total_col, ceil($rowsarray[$current_table_count]));						   echo "</table> ";			$trcount=0;			}  ?><table border="0" cellpadding="0" cellspacing="0">  <tr>  <th colspan="<?php echo ($total_col*2)+1; ?>"><?php echo $row['i_wish_to_play']; ?></th>  </tr>  <?php	echo '<tr class="blank'.$bordtop.'"><td> </td>';		for ($i=0;$i<$total_col;$i++) // adds top tee number header		{		if($i == 0)			{			echo '<td style="font-weight:bold; text-align:center;">'.strtoupper($teerefone).' TEE</td><td> </td>';			}		else			{			echo '<td> </td><td> </td>';			}					}					echo '</tr>';	?>  <tr class="header"><td style="width:40px; text-align: center;">TIME</td><?php		for ($i=0;$i<$total_col;$i++)//add fullname and h/cap header			{			echo '<td class="fullname">FULL NAME</td><td class="hcap">H/CAP</td>';			}			?>	</tr><?php		$col_count=0;		}				if($col_count==0)	  {		if($trcount == ceil($rowsarray[$current_table_count]/4) || $trcount == (ceil($rowsarray[$current_table_count]/4)+ceil($rowsarray[$current_table_count]/4)*2))			{			$timestamp=strtotime($row1time);			$timeinterval=$trgroupcount*$teeperiod;			$teetime=date('H:i', strtotime("+$timeinterval minutes", $timestamp));			$trgroupcount++;			echo '<tr class="starter"><td>'.$teetime.'</td>';			for ($i=0;$i<$total_col;$i++)				{				echo '<td class="fullname">STARTER</td><td class="hcap"> </td>';				}			echo '</tr>';			}		else			{			if($trcount  % ((ceil($rowsarray[$current_table_count]/4)*2)) ==0 && $trcount!=0)				{								for($j=0;$j<2;$j++)					{					if($j==0)						{						$bordtop=" bordertop";						}					else						{						$bordtop="";						}					 echo '<tr class="blank'.$bordtop.'"><td> </td>';					for ($i=0;$i<$total_col;$i++)						{						if($i == 0 && $j !=0)							{							$trgroupcount=0;							$teetexterror="";							if($teereftwo==$teerefone)							{							$teetexterror="highlight_tee_error";							$teereftwo="Matching Tee holes";							}														echo '<td style="font-weight:bold; text-align:center;"><span class="'.$teetexterror.'">'.strtoupper("$teereftwo").'</span> TEE</td><td> </td>';							}						else							{							echo '<td> </td><td> </td>';							}						}			echo '</tr>';					}				}			}			$timestamp=strtotime($row1time);			$timeinterval=$trgroupcount*$teeperiod;			$teetime=date('H:i', strtotime("+$timeinterval minutes", $timestamp));		echo '<tr><td class="time">'.$teetime.'</td>';		$trcount++;		$trgroupcount++;	  }  	  /*if($col_count % 2 == 0)		   {		$trclass="rowcol1";		}	else		{		$trclass="rowcol2";		}*/				if($row['my_handicap_is'] >= -5 && $row['my_handicap_is'] <=6)		   {			$trclass="rowcol1";			}		elseif($row['my_handicap_is'] >= 7 && $row['my_handicap_is'] <=18)			{		$trclass="rowcol2";			}		else			{			$trclass="rowcol3";			}				if($col_count < (ceil($rowsarray[$current_table_count]*$total_col)/$total_col)+1)		{		$SMS_Time[$SMS_Count]=$teetime;$SMS_Player[$SMS_Count] = strtoupper($row['name']).', '.strtoupper($row['surname']);$SMS_Count++;  ?>  <td class="fullname <?php echo $trclass; ?>"><?php echo strtoupper($row['name']); ?>, <?php echo strtoupper($row['surname']); ?></td>	  <td class="hcap <?php echo $trclass; ?>"><?php echo $row['my_handicap_is']; ?></td><?php  }		  $col_count++;		   if($col_count==$total_col)			  {			  echo "</tr>";			  $col_count=0;			  }			$currentclub = $row['i_wish_to_play'];	   }//end while loop       if($col_count<$total_col && $col_count!=0 && $currentclub !="") /// use to fill empty cells		   {		   for($i=$col_count;$i<$total_col;$i++)			   {			   echo "<td> </td><td> </td>";			   }		   echo "</tr>";		}		fillemptygrouprows($trcount,$total_col, ceil($rowsarray[$current_table_count]));	?></table></div><div><div id="form_container" style="padding-bottom:3px; background-color:#F5F9FD; position:absolute; left:-172px; top:100px; font-size:12px; width:880px; border:1px solid #81BEF7; font-family:Calibri; color:#00008B; margin: 5px auto; text-align:left;"><legend><b>SMS MESSAGE SELECTION</b></legend><?php$quey1 = "SELECT * FROM _Form_Nr_4 WHERE i_wish_to_play='$clubselected' ORDER BY i_wish_to_play, my_handicap_is BETWEEN 7 AND 18, my_handicap_is, my_handicap_is BETWEEN 19 AND 36, my_handicap_is BETWEEN -5 AND 6 DESC";$result = mysql_query($quey1) or die(mysql_error());	/*while ($row = mysql_fetch_assoc($result))	{	echo $row['my_handicap_is'].'<br />';	}*/		echo '<hr />'; 	//show pipe delimited sms text			if(isset($_POST['tournament']))		{		for($smsloop=0; $smsloop<count($SMS_Time); $smsloop++)			{			if($_POST['tournament'] != "The tournament has been cancelled at")				{				echo $SMS_Player[$smsloop].'|'.$_POST['tournament'].'|'.$SMS_Time[$smsloop].'|<br/>'."\n";				}			else				{				echo $SMS_Player[$smsloop].'|'.$_POST['tournament'].'| |<br/>'."\n";				}			}		}	?></div></body></html>

Link to comment
Share on other sites

Hi,I have managed to sort this challenge out

The Container around "Players in the Group" needs to resize in order it look the same vertically as those containers to the right of it.
In moves my things around a </div> was lost and this seems to have had the desired effect.
Link to comment
Share on other sites

Hi Folks,I have got this portion sorted and seemingly working well

The select box below the word "Tournament" on populates the tournament for Bryanston GC and needs to populate the remining 28 other tournaments as well.
Link to comment
Share on other sites

Is there a short version of what you need without needing to read through a ton of code? I viewed the source of this thread and pasted it into a text editor to count the characters and my text editor crashed. Can we get a TL;DR version?

Link to comment
Share on other sites

Ok,This part

<?php$quey1 = "SELECT * FROM _Form_Nr_4 WHERE i_wish_to_play='$clubselected' ORDER BY i_wish_to_play, my_handicap_is BETWEEN 7 AND 18, my_handicap_is, my_handicap_is BETWEEN 19 AND 36, my_handicap_is BETWEEN -5 AND 6 DESC";$result = mysql_query($quey1) or die(mysql_error());	/*while ($row = mysql_fetch_assoc($result))	{	echo $row['my_handicap_is'].'<br />';	}*/		echo '<hr />';	//show pipe delimited sms text			if(isset($_POST['tournament']))		{		for($smsloop=0; $smsloop<count($SMS_Time); $smsloop++)			{			if($_POST['tournament'] != "The tournament has been cancelled at")				{				echo $SMS_Player[$smsloop].'|'.$_POST['tournament'].'|'.$SMS_Time[$smsloop].'|<br/>'."\n";				}			else				{				echo $SMS_Player[$smsloop].'|'.$_POST['tournament'].'| |<br/>'."\n";				}			}		}	?></div></body></html>

Creates a section on the page that when I press the submit button vewis as a pipe delmited list of names - cell numbers, etcWhat I would like is to have this information send to location on my hard drive say C:/SMS/Kyalami.txt where Kyalami is the tournament name and listed in the select box and also stroed in Mysql.The txt file obviously is not needed to be sent to the MySQL.I hope this helps and makes sense

Link to comment
Share on other sites

You can use file_put_contents to write to a file, as long as PHP has permission to do so. You just give it the filename and the string of data you want to write to it:

<?php$fname = 'C:\file.txt';$data = 'some data';file_put_contents($fname, $data);?>

That obviously saves the file on the server though. Is that what you want, or do you want to download the file on the client machine?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...