miniu Posted March 10, 2010 Share Posted March 10, 2010 I have a system that was made by an designer, but he is gone and seems not to come back and I have some little changes to make. I try to find solutions by myself, but with some things I have problems. If there is someone who can help me with it, please let me know here, or by mail [email protected] thank you Link to comment https://forums.phpfreaks.com/topic/194715-need-help-with-my-system/ Share on other sites More sharing options...
teamatomic Posted March 10, 2010 Share Posted March 10, 2010 Ask your questions HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/194715-need-help-with-my-system/#findComment-1023996 Share on other sites More sharing options...
miniu Posted March 10, 2010 Author Share Posted March 10, 2010 I have here a site where I have a list of games to be assigned by referees. Right now, when you choose the games, you have a drop down menu after selecting the league and divisions. This is how it is look like: <?php include("connect.php"); include("admin.session.php"); $LeftLinkSection = 1; $pagetitle="Assign Referee To Game"; $qstr=$_SERVER['QUERY_STRING']; if($_REQUEST["sub2"]==1) { $gid=$_REQUEST['gid']; $sel="select id from assigned_games where gid=".$gid; $res_sel=mysql_query($sel); if(mysql_num_rows($res_sel) > 0) { $msg=1; } else { $main_ref_id=$_REQUEST['mainref']; $ast_ref_id1=$_REQUEST['astref1']; $ast_ref_id2=$_REQUEST['astref2']; $main_ref_fee=$_REQUEST['mainref_fee']; $ast_ref1_fee=$_REQUEST['astref_fee']; $ast_ref2_fee=$_REQUEST['astref_fee']; $htmanager = $_REQUEST['htmanager']; $telephone = $_REQUEST['telephone']; $reffee = $_REQUEST['reffee']; $dname = $_REQUEST['dname']; $leaname = $_REQUEST['leaname']; $league_address = $_REQUEST['league_address']; $htname = $_REQUEST['htname']; $atname = $_REQUEST['atname']; $gdate = $_REQUEST['gdate']; $gtime = $_REQUEST['gtime']; $locname = $_REQUEST['lname']; $address = $_REQUEST['address']; if($main_ref_id=='') $main_ref_id=0; if($ast_ref_id1=='') $ast_ref_id1=0; if($ast_ref_id2=='') $ast_ref_id2=0; $sql_ins="insert into assigned_games set gid=$gid,main_ref_id=$main_ref_id,main_ref_fee='$main_ref_fee',ast_ref1_fee='$ast_ref1_fee',ast_ref2_fee='$ast_ref2_fee',ast_ref_id1=$ast_ref_id1,ast_ref_id2=$ast_ref_id2,assigner_id=".$_SESSION['UsErId']; $res_ins=mysql_query($sql_ins); echo mysql_error(); $sql_ass="select fname,lname,email,phone from assigners where username='".$_SESSION["UsErOfAdMiN"]."'"; $res_ass=mysql_query($sql_ass); $row_ass=mysql_fetch_object($res_ass); $fnamea=$row_ass->fname; $lnamea=$row_ass->lname; $phone=$row_ass->phone; $flname=$fnamea.' '.$lnamea; if($main_ref_id!='') { $sql_mainref="select fname,lname,email from referees where id=".$main_ref_id; $res_mainref=mysql_query($sql_mainref); $row_mainref=mysql_fetch_object($res_mainref); $fname=$row_mainref->fname; $lname=$row_mainref->lname; $email=$row_mainref->email; $mailcontent="<html><head></head><body> <table width='80%' border='0' align='center' cellpadding='0' cellspacing='0'> <tr><td colspan='2'> </td></tr> <tr> <td width='47%' height='56'>Dear <b>$fname $lname</b>,</td> <td width='117' align='center' nowrap='nowrap'></td> </tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'>You have been assigned to the following game by Assigner <strong>".$flname."</strong> and and You have been selected as <strong>Main Referee</strong>:</td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'><strong>League:</strong> ".stripslashes($leaname)."</td></tr> <tr><td colspan='2'><strong>Division:</strong> ".stripslashes($dname)."</td></tr> <tr><td colspan='2'><strong>Main Referee Fee:</strong> $$main_ref_fee</td></tr> <tr><td colspan='2'><strong>Home Team Name:</strong> ".stripslashes($htname)."</td></tr> <tr><td colspan='2'><strong>Away Team Name:</strong> ".stripslashes($atname)."</td></tr> <tr><td colspan='2'><strong>Home Team Manager:</strong> ".stripslashes($htmanager)."</td></tr> <tr><td colspan='2'><strong>Telephone:</strong> $telephone</td></tr> <tr><td colspan='2'><strong>Game Date:</strong> $gdate</td></tr> <tr><td colspan='2'><strong>Game Time:</strong> $gtime</td></tr> <tr><td colspan='2'><strong>Location:</strong> ".stripslashes($locname)."</td></tr> <tr><td colspan='2'><strong>Location Address:</strong> ".stripslashes($address)."</td></tr> <tr><td colspan='2'><strong>Assigner's Telephone:</strong> $phone</td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'>Upon completion of the game, please fill out the attached Report <a href='http://www.njsa-assignments.com/report/report.doc' target='_blank'>http://www.njsa-assignments.com/report/report.doc</a> and mail it to the $leaname WITHIN 24 HOURS at the address below:</td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'>".stripslashes($league_address)."</td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'>Please login at following link to accept or reject Assigned Game:</td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'><a href='$sitepath' target='_blank'>$sitepath</a></td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'>Regards,</td></tr> <tr><td colspan='2'>John Zangrilli</td></tr> <tr><td colspan='2'><a href='mailto:[email protected]' target='_blank'>[email protected]</a></td></tr> <tr><td colspan='2'> </td></tr> </table> </body> </html>"; //echo $mailcontent; $to=$email; $subject="Assigning details for game: ".stripslashes($htname)." VS ".stripslashes($atname);; $from="[email protected]"; /* echo $to.'<br>'; echo $subject.'<br>'; echo $from.'<br>'; echo $mailcontent.'<br>'; exit;*/ @SendHTMLMail1($to,$subject,$mailcontent,$from); } if($ast_ref_id1!='') { $sql_mainref="select fname,lname,email from referees where id=".$ast_ref_id1; $res_mainref=mysql_query($sql_mainref); $row_mainref=mysql_fetch_object($res_mainref); $fname=$row_mainref->fname; $lname=$row_mainref->lname; $email=$row_mainref->email; $mailcontent="<html><head></head><body> <table width='80%' border='0' align='center' cellpadding='0' cellspacing='0'> <tr><td colspan='2'> </td></tr> <tr> <td width='47%' height='56'>Dear <b>$fname $lname</b>,</td> <td width='117' align='center' nowrap='nowrap'></td> </tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'>You have been assigned to the following game by Assigner <strong>".$flname."</strong> and and You have been selected as <strong>Assistant Referee 1</strong>:</td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'><strong>League:</strong> ".stripslashes($leaname)."</td></tr> <tr><td colspan='2'><strong>Division:</strong> ".stripslashes($dname)."</td></tr> <tr><td colspan='2'><strong>Assistant Referee Fee:</strong> $$ast_ref1_fee</td></tr> <tr><td colspan='2'><strong>Home Team Name:</strong> ".stripslashes($htname)."</td></tr> <tr><td colspan='2'><strong>Away Team Name:</strong> ".stripslashes($atname)."</td></tr> <tr><td colspan='2'><strong>Home Team Manager:</strong> ".stripslashes($htmanager)."</td></tr> <tr><td colspan='2'><strong>Telephone:</strong> $telephone</td></tr> <tr><td colspan='2'><strong>Game Date:</strong> $gdate</td></tr> <tr><td colspan='2'><strong>Game Time:</strong> $gtime</td></tr> <tr><td colspan='2'><strong>Location:</strong> ".stripslashes($locname)."</td></tr> <tr><td colspan='2'><strong>Location Address:</strong> ".stripslashes($address)."</td></tr> <tr><td colspan='2'><strong>Assigner's Telephone:</strong> $phone</td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'>Upon completion of the game, please fill out the attached Report <a href='http://www.njsa-assignments.com/report/report.doc' target='_blank'>http://www.njsa-assignments.com/report/report.doc</a> and mail it to the $leaname WITHIN 24 HOURS at the address below:</td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'>".stripslashes($league_address)."</td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'>Please login at following link to accept or reject Assigned Game:</td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'><a href='$sitepath' target='_blank'>$sitepath</a></td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'>Regards,</td></tr> <tr><td colspan='2'>John Zangrilli</td></tr> <tr><td colspan='2'><a href='mailto:[email protected]' target='_blank'>[email protected]</a></td></tr> <tr><td colspan='2'> </td></tr> </table> </body> </html>"; $to=$email; $subject="Assigning details for game: ".stripslashes($htname)." VS ".stripslashes($atname); $from="[email protected]"; //echo $mailcontent; @SendHTMLMail1($to,$subject,$mailcontent,$from); } if($ast_ref_id2!='') { $sql_mainref="select fname,lname,email from referees where id=".$ast_ref_id2; $res_mainref=mysql_query($sql_mainref); $row_mainref=mysql_fetch_object($res_mainref); $fname=$row_mainref->fname; $lname=$row_mainref->lname; $email=$row_mainref->email; $mailcontent="<html><head></head><body> <table width='80%' border='0' align='center' cellpadding='0' cellspacing='0'> <tr><td colspan='2'> </td></tr> <tr> <td width='47%' height='56'>Dear <b>$fname $lname</b>,</td> <td width='117' align='center' nowrap='nowrap'></td> </tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'>You have been assigned to the following game by Assigner <strong>".$flname."</strong> and and You have been selected as <strong>Assistant Referee 2</strong>:</td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'><strong>League:</strong> ".stripslashes($leaname)."</td></tr> <tr><td colspan='2'><strong>Division:</strong> ".stripslashes($dname)."</td></tr> <tr><td colspan='2'><strong>Assistant Referee Fee:</strong> $$ast_ref2_fee</td></tr> <tr><td colspan='2'><strong>Home Team Name:</strong> ".stripslashes($htname)."</td></tr> <tr><td colspan='2'><strong>Away Team Name:</strong> ".stripslashes($atname)."</td></tr> <tr><td colspan='2'><strong>Home Team Manager:</strong> ".stripslashes($htmanager)."</td></tr> <tr><td colspan='2'><strong>Telephone:</strong> $telephone</td></tr> <tr><td colspan='2'><strong>Game Date:</strong> $gdate</td></tr> <tr><td colspan='2'><strong>Game Time:</strong> $gtime</td></tr> <tr><td colspan='2'><strong>Location:</strong> ".stripslashes($locname)."</td></tr> <tr><td colspan='2'><strong>Location Address:</strong> ".stripslashes($address)."</td></tr> <tr><td colspan='2'><strong>Assigner's Telephone:</strong> $phone</td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'>Upon completion of the game, please fill out the attached Report <a href='http://www.njsa-assignments.com/report/report.doc' target='_blank'>http://www.njsa-assignments.com/report/report.doc</a> and mail it to the $leaname WITHIN 24 HOURS at the address below:</td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'>".stripslashes($league_address)."</td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'>Please login at following link to accept or reject Assigned Game:</td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'><a href='$sitepath' target='_blank'>$sitepath</a></td></tr> <tr><td colspan='2'> </td></tr> <tr><td colspan='2'>Regards,</td></tr> <tr><td colspan='2'>John Zangrilli</td></tr> <tr><td colspan='2'><a href='mailto:[email protected]' target='_blank'>[email protected]</a></td></tr> <tr><td colspan='2'> </td></tr> </table> </body> </html>"; //echo $mailcontent; exit; $to=$email; $subject="Assigning details for game: ".stripslashes($htname)." VS ".stripslashes($atname);; $from="[email protected]"; @SendHTMLMail1($to,$subject,$mailcontent,$from); } //exit; header("location:message.php?mid=26"); exit; } } if($_REQUEST["sub1"]==1) { $sql_gamec="select id,gid from games where 1=1"; if($_REQUEST['txtfromdate']!='') { $txtfromdate=$_REQUEST['txtfromdate']; $txtfromdate_arr=explode("-",$txtfromdate); $txtfromdate=$txtfromdate_arr[2].'-'.$txtfromdate_arr[0].'-'.$txtfromdate_arr[1]; $txttodate=$_REQUEST['txttodate']; $txttodate_arr=explode("-",$txttodate); $txttodate=$txttodate_arr[2].'-'.$txttodate_arr[0].'-'.$txttodate_arr[1]; $sql_gamec.=" and gdate >='".$txtfromdate."' and gdate<='".$txttodate."'"; } if($_REQUEST['drpdivisions']!='') { $sql_gamec.=" and div_id=".$_REQUEST['drpdivisions']; } if($_REQUEST['drpleague']!='') { $sql_gamec.=" and league_id=".$_REQUEST['drpleague']; $league=$_REQUEST['drpleague']; } $sql_gamec.=" order by id desc"; //echo $sql_gamec; exit; $res_gamec=mysql_query($sql_gamec); $totgames=mysql_num_rows($res_gamec); } if($_REQUEST["sub2"]==1) { } if($_GET["gid"]) { $game_id=$_GET['gid']; $selsql= "SELECT lea.league_name,lea.address as league_address,d.mainref_fee,d.astref_fee,g.htmanager,g.telephone,g.id, g.gid,g.gdate,dayname(g.gdate) as gday,g.gtime, d.dname, ht.tname AS htname, at.tname AS atname, l.lname,l.address FROM games g INNER JOIN divisions d ON g.div_id = d.id INNER JOIN league lea ON g.league_id = lea.id INNER JOIN teams ht ON g.home_team_id = ht.id INNER JOIN teams at ON g.away_team_id = at.id INNER JOIN locations l ON g.location_id = l.id where gid=".$_GET["gid"] ; $selres = mysql_query($selsql); echo mysql_error(); $selobj = mysql_fetch_object($selres); $mainref_fee = stripslashes($selobj->mainref_fee); $astref_fee = stripslashes($selobj->astref_fee); $league_name = stripslashes($selobj->league_name); $league_address = stripslashes($selobj->league_address); $dname = stripslashes($selobj->dname); $htname = stripslashes($selobj->htname); $atname = stripslashes($selobj->atname); $htmanager = stripslashes($selobj->htmanager); $telephone = stripslashes($selobj->telephone); $gdate = stripslashes($selobj->gdate); $gdate2 = stripslashes($selobj->gdate); $kgdate=explode('-',$gdate); $gdate=$kgdate[1].'-'.$kgdate[2].'-'.$kgdate[0]; $gtime = stripslashes($selobj->gtime); $htime=explode(':',$gtime); $ampm=explode(' ',$htime[1]); $lname = stripslashes($selobj->lname); $address = stripslashes($selobj->address); $gday=stripslashes($selobj->gday); /*$sql_ref_fee="select * from referee_fees"; $res_ref_fee=mysql_query($sql_ref_fee); $row_ref_fee=mysql_fetch_object($res_ref_fee); $mainref_fee=$row_ref_fee->mainref_fee; $astref_fee=$row_ref_fee->astref_fee; */ //echo $gday; //echo $sql_mainref="select id,fname,lname from referees where '".$gdate2."' NOT BETWEEN fromdate and todate"; } if($_GET['league_id']!='') $league=$_GET['league_id']; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD><title><?=Site_Title; ?></title> <script language="javascript"> function kyb_check() { if(document.getElementById("drpgames").value=="") { alert("Please Select Game"); document.getElementById("drpgames").focus(); return false; } if(document.getElementById("astref1")!=null && document.getElementById("mainref")!=null) { if(document.getElementById("mainref").value!='' && document.getElementById("astref1").value!='') { if(document.getElementById("mainref").value==document.getElementById("astref1").value) { alert("Main Referee and Assistant Referee can not be Same"); document.getElementById("mainref").focus(); return false; } } } if(document.getElementById("astref2")!=null && document.getElementById("mainref")!=null) { if(document.getElementById("mainref").value!='' && document.getElementById("astref2").value!='') { if(document.getElementById("mainref").value==document.getElementById("astref2").value) { alert("Main Referee and Assistant Referee can not be Same"); document.getElementById("mainref").focus(); return false; } } } if(document.getElementById("astref1")!=null && document.getElementById("astref2")!=null) { if(document.getElementById("astref1").value!='' && document.getElementById("astref2").value!='') { if(document.getElementById("astref1").value==document.getElementById("astref2").value) { alert("Assistant Referee 1 and Assistant Referee 2 can not be Same"); document.getElementById("astref1").focus(); return false; } } } } function clearall() { document.getElementById('txtfromdate').value=''; document.getElementById('txttodate').value=''; document.getElementById('drpdivisions').value=''; } function IsNumericMain(strString) // check for valid numeric strings { var strValidChars = "0123456789."; var strChar; var blnResult = true; if (strString.length == 0) return false; // test strString consists of valid characters listed above for (i = 0; i < strString.length && blnResult == true; i++) { strChar = strString.charAt(i); if (strValidChars.indexOf(strChar) == -1) { alert("Please Enter Digits"); document.getElementById('main_ref_fee').value=''; document.getElementById('main_ref_fee').focus(); blnResult = false; } } return blnResult; } function IsNumericAstRef1(strString) { var strValidChars = "0123456789."; var strChar; var blnResult = true; if (strString.length == 0) return false; // test strString consists of valid characters listed above for (i = 0; i < strString.length && blnResult == true; i++) { strChar = strString.charAt(i); if (strValidChars.indexOf(strChar) == -1) { alert("Please Enter Digits"); document.getElementById('ast_ref1_fee').value=''; document.getElementById('ast_ref1_fee').focus(); blnResult = false; } } return blnResult; } function IsNumericAstRef2(strString) { var strValidChars = "0123456789."; var strChar; var blnResult = true; if (strString.length == 0) return false; // test strString consists of valid characters listed above for (i = 0; i < strString.length && blnResult == true; i++) { strChar = strString.charAt(i); if (strValidChars.indexOf(strChar) == -1) { alert("Please Enter Digits"); document.getElementById('ast_ref2_fee').value=''; document.getElementById('ast_ref2_fee').focus(); blnResult = false; } } return blnResult; } function select_game(val,sub1,txtfrom,txtto,drp_division) { window.location.href='assign_referee_to_game.php?gid=' + val + '&sub1=' + sub1 + '&txtfromdate=' + txtfrom + '&txttodate=' + txtto + '&drpdivisions=' + drp_division; } function show_divisions(val) { window.location.href='assign_referee_to_game.php?league_id=' + val; } function show_getgames() { if(document.getElementById('txtfromdate').value!='' && document.getElementById('txttodate').value=='') { alert('Please Select To Date'); document.getElementById('txttodate').focus(); return false; } if(document.getElementById('txttodate').value!='' && document.getElementById('txtfromdate').value=='') { alert('Please Select From Date'); document.getElementById('txtfromdate').focus(); return false; } if(document.getElementById('txttodate').value < document.getElementById('txtfromdate').value) { alert('To Date can not be less then From Date'); document.getElementById('txttodate').focus(); return false; } document.getElementById('sub1').value=1; document.frmgetgames.submit(); } </script> <script src="calendar.js"></script> <META http-equiv=Content-Type content="text/html; charset=utf-8"> <META content="MSHTML 6.00.2600.0" name=GENERATOR> <link rel="stylesheet" href="main.css" type="text/css"> </HEAD> <BODY leftMargin=0 topMargin=0 marginheight="0" marginwidth="0"> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 class="th-a"> <TR><TD height=60 colspan="2" bgColor=#FFFFFF><? include("top.php") ?></td> </TR> <tr> <td width="20%" valign="top" bgcolor="#1c6995"><? include("left.php"); ?></td> <td width="80%" valign="top" height="480" bgcolor="#FFFFFF"> <TABLE cellSpacing=0 cellPadding=0 border=0 width="90%" align="center"> <TR><TD width="100%" class=h1> </TD></TR> <TR><TD width="100%" class=H1><? echo ($_GET["id"]>0)?"Edit":"Add"; ?> <?=$pagetitle?></TD></TR> <TR><TD background="images/vdots.gif"></TD></TR> <tr><td> </td></tr> <tr><td> </td></tr> <tr><td align="center"><form name="frmgetgames" id="frmgetgames" method="post"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td width="100%" colspan="2" align="left"> From Date: <input type="text" name="txtfromdate" readonly="true" id="txtfromdate" size="15" value="<?=stripslashes($_REQUEST['txtfromdate']);?>"> <a href="#" onClick="getCalendar(document.getElementById('txtfromdate'));"> Select Date</a> To Date: <input type="text" name="txttodate" readonly="true" id="txttodate" size="15" value="<?=stripslashes($_REQUEST['txttodate']);?>"> <a href="#" onClick="getCalendar(document.getElementById('txttodate'));"> Select Date</a> <br><br> <select name="drpleague" id="drpleague" style="width:150px" onChange="show_divisions(this.value)"> <option value="">--Select--</option> <? $sql_league="select * from league"; $res_league=mysql_query($sql_league); while($row_league=mysql_fetch_object($res_league)) { ?> <option value="<?=$row_league->id?>" <? if($row_league->id==$league) echo "selected='selected'"; ?>><?=stripslashes($row_league->league_name)?></option> <? } ?> </select> <? if($league!='') { ?> <select id="drpdivisions" name="drpdivisions"> <option value="">--Select Division--</option> <? $sql_division="select * from divisions where league_id=".$league." order by dname"; $res_division=mysql_query($sql_division); while($row_division=mysql_fetch_object($res_division)) { ?> <option value="<?=$row_division->id?>" <? if($_REQUEST['drpdivisions']==$row_division->id) echo "selected='selected'"; ?>><?=stripslashes($row_division->dname);?></option> <? } ?> </select><? } ?><br><br> <input type="button" value="Get Games" onClick="show_getgames();"><input type="hidden" id="sub1" name="sub1" value="0"> <input type="button" value="Clear" onClick="clearall();"> </td> </tr> </table></form> </td></tr> <tr><td> </td></tr> <tr><td> </td></tr> <? if($msg==1) { ?> <tr><td class="error" height="30"><font color="red"><strong>Game is already assigned to Referees!</strong></font></td></tr> <? } ?> <TR> <TD> <? if(($_REQUEST['sub1']==1 && $totgames > 0) || ($_GET['gid']!='' && $totgames > 0)) { ?> <form method="post" enctype="multipart/form-data" name="frm"> <table width="90%" border="0" align="left" cellpadding="3" cellspacing="3" class="solidinput"> <tr> <td colspan="2" align="right" class="menu-a"><span class="a-l">* indicates required field</span> </td> </tr> <tr> <td class="H4" colspan="2" align="left"><?=$pagetitle?> </td> </tr> <tr> <td width="37%" align="right"><font color="red">*</font> Select Game:</td> <td width="63%"><font color="<?=$col?>"> <select name="drpgames" id="drpgames" style="width:300px" onChange="select_game(this.value,'<?=$_REQUEST['sub1']?>','<?=$_REQUEST['txtfromdate']?>','<?=$_REQUEST['txttodate']?>','<?=$_REQUEST['drpdivisions']?>');"> <option value="">--Select Game--</option> <? $sql_game="SELECT lea.league_name,lea.address as league_address,d.mainref_fee,d.astref_fee,g.htmanager,g.telephone,g.id,g.gid,g.gdate,dayname(g.gdate) as gday,g.gtime, d.dname, ht.tname AS htname, at.tname AS atname, l.lname,l.address FROM games g INNER JOIN divisions d ON g.div_id = d.id INNER JOIN league lea ON g.league_id = lea.id INNER JOIN teams ht ON g.home_team_id = ht.id INNER JOIN teams at ON g.away_team_id = at.id INNER JOIN locations l ON g.location_id = l.id where 1=1"; if($txtfromdate!='') { $sql_game.=" and g.gdate >='".$txtfromdate."' and g.gdate<='".$txttodate."'"; } if($_REQUEST['drpdivisions']!='') { $sql_game.=" and g.div_id=".$_REQUEST['drpdivisions']; } if($_REQUEST['drpleague']!='') { $sql_game.=" and lea.id=".$_REQUEST['drpleague']; $league=$_REQUEST['drpleague']; } $res_game=mysql_query($sql_game); while($row_game=mysql_fetch_object($res_game)) { ?> <option value="<?=$row_game->gid;?>" <? if($game_id==$row_game->gid) echo "selected='selected'"; ?>><? echo $row_game->league_name.'=>'.$row_game->dname.'=>'.$row_game->htname.' VS '.$row_game->atname;?></option> <? } ?> </select> </font></td> </tr> <? if($_GET['gid']!='') { ?> <tr> <td width="37%" align="right"><font color="red"></font> League:</td> <td width="63%"><font color="<?=$col?>"><?=$league_name;?><input type="hidden" id="leaname" name="leaname" value="<?=$league_name?>"> </font></td> </tr> <tr> <td width="37%" align="right"><font color="red"></font> League Address:</td> <td width="63%"><font color="<?=$col?>"><?=$league_address;?><input type="hidden" id="league_address" name="league_address" value="<?=$league_address?>"> </font></td> </tr> <tr> <td width="37%" align="right"><font color="red"></font> Division:</td> <td width="63%"><font color="<?=$col?>"><?=$dname;?><input type="hidden" id="dname" name="dname" value="<?=$dname?>"> </font></td> </tr> <tr> <td width="37%" align="right"><font color="red"></font> Home Team:</td> <td width="63%"><font color="<?=$col?>"><?=$htname;?><input type="hidden" id="htname" name="htname" value="<?=$htname?>"> </font></td> </tr> <tr> <td width="37%" align="right"><font color="red"></font> Away Team:</td> <td width="63%"><font color="<?=$col?>"><?=$atname;?><input type="hidden" id="atname" name="atname" value="<?=$atname?>"> </font></td> </tr> <tr> <td width="37%" align="right"><font color="red"></font> Home Team Manager:</td> <td width="63%"><font color="<?=$col?>"><?=$htmanager;?><input type="hidden" id="htmanager" name="htmanager" value="<?=$htmanager?>"> </font></td> </tr> <tr> <td width="37%" align="right"><font color="red"></font> Telephone:</td> <td width="63%"><font color="<?=$col?>"><?=$telephone;?><input type="hidden" id="telephone" name="telephone" value="<?=$telephone?>"> </font></td> </tr> <tr> <td width="37%" align="right"><font color="red"></font> Date of Game:</td> <td width="63%"><font color="<?=$col?>"><?=$gdate;?><input type="hidden" id="gdate" name="gdate" value="<?=$gdate?>"> </font></td> </tr> <tr> <td width="37%" align="right"><font color="red"></font> Game Time:</td> <td width="63%"><font color="<?=$col?>"><?=$gtime;?><input type="hidden" id="gtime" name="gtime" value="<?=$gtime?>"> </font></td> </tr> <tr> <td width="37%" align="right"><font color="red"></font> Location:</td> <td width="63%"><font color="<?=$col?>"><?=$lname;?><input type="hidden" id="lname" name="lname" value="<?=$lname?>"> </font></td> </tr> <tr> <td width="37%" align="right"><font color="red"></font> Location Address:</td> <td width="63%"><font color="<?=$col?>"><?=$address;?><input type="hidden" id="address" name="address" value="<?=$address?>"> </font></td> </tr> <? if($mainref_fee!='') { ?> <tr> <td width="37%" align="right"><font color="red"></font> Referee:</td> <td width="63%"> <font color="<?=$col?>"><select id="mainref" name="mainref" style="width:180px"> <option value="">--Select--</option> <? $sql_mainref = "SELECT id, lname, fname FROM `referees` WHERE '".$gdate2."' NOT BETWEEN fromdate AND todate ORDER BY lname"; $res_mainref=mysql_query($sql_mainref); while($row_mainref=mysql_fetch_object($res_mainref)) { ?> <option value="<?=$row_mainref->id?>"><?=$row_mainref->lname.' '.$row_mainref->fname?></option> <? } ?> </select> </font></td> </tr> <? } else { ?> <input type="hidden" name="old_main_ref_id" id="old_main_ref_id" value="<?=$main_ref_id?>"> <input type="hidden" name="mainref_fee" value="<?=$mainref_fee?>"> <? } ?> <? if($astref_fee!='') { ?> <tr> <td width="37%" align="right"><font color="red"></font> Assistant Referee 1:</td> <td width="63%"><font color="<?=$col?>"><select id="astref1" name="astref1" style="width:180px"> <option value="">--Select--</option> <? $sql_astref1="select id,fname,lname from referees where '".$gdate2."' NOT BETWEEN fromdate and todate ORDER BY lname"; $res_astref1=mysql_query($sql_astref1); while($row_astref1=mysql_fetch_object($res_astref1)) { ?> <option value="<?=$row_astref1->id?>"><?=$row_astref1->lname.' '.$row_astref1->fname?></option> <? } ?> </select> </font></td> </tr> <? } else { ?> <input type="hidden" name="old_ast_ref_id1" id="old_ast_ref_id1" value="<?=$ast_ref_id1?>"> <input type="hidden" name="astref_fee" value="<?=$astref_fee?>"> <? } ?> <? if($astref_fee!='') { ?> <tr> <td width="37%" align="right"><font color="red"></font> Assistant Referee 2:</td> <td width="63%"><font color="<?=$col?>"><select id="astref2" name="astref2" style="width:180px"> <option value="">--Select--</option> <? $sql_astref2="select id,fname,lname from referees where '".$gdate2."' NOT BETWEEN fromdate and todate ORDER BY lname"; $res_astref2=mysql_query($sql_astref2); while($row_astref2=mysql_fetch_object($res_astref2)) { ?> <option value="<?=$row_astref2->id?>"><?=$row_astref2->lname.' '.$row_astref2->fname?></option> <? } ?> </select> </font></td> </tr> <tr> <td width="37%" align="right"><font color="red"></font> Referee's Fee:</td> <td width="63%"><font color="<?=$col?>">$<?=$mainref_fee?><input type="hidden" name="mainref_fee" value="<?=$mainref_fee?>"> </font></td> </tr> <tr> <td width="37%" align="right"><font color="red"></font> Assistant Referee 1's Fee:</td> <td width="63%"><font color="<?=$col?>">$<?=$astref_fee?><input type="hidden" name="astref_fee" value="<?=$astref_fee?>"> </font></td> </tr> <tr> <td width="37%" align="right"><font color="red"></font> Assistant Referee 2's Fee:</td> <td width="63%"><font color="<?=$col?>">$<?=$astref_fee?> </font></td> </tr> <? } else { ?> <input type="hidden" name="old_ast_ref_id2" id="old_ast_ref_id2" value="<?=$ast_ref_id2?>"> <input type="hidden" name="astref_fee" value="<?=$astref_fee?>"> <? } ?> <? } ?> <tr> <td> <input type="hidden" value="<?=$_GET["id"]; ?>" name="id"></td> <td><input name="Submit" type="submit" class="buttonclass" value="Submit" onClick="return kyb_check();" /></td> <input type="hidden" name="sub2" value="1"> </tr> </table></form><? } else { ?><? if($_POST['sub1']!='') { ?><table cellpadding="0" cellspacing="0" border="0" align="center"> <tr><td class="error" height="30"><font color="red"><strong>No Games will be played between these Dates!</strong></font></td></tr> </table><? } ?> <? } ?> </TD> </TR> </TABLE> </td> </tr> </TABLE> </BODY></HTML> But I want that after selecting the league and division it will be shown in a table with a possibility to choose the referees at the end (right side of the table) Like that: http://www.soccerrec.com/dropdown.jpg Link to comment https://forums.phpfreaks.com/topic/194715-need-help-with-my-system/#findComment-1023998 Share on other sites More sharing options...
trq Posted March 10, 2010 Share Posted March 10, 2010 And, where are you stuck exactly? Link to comment https://forums.phpfreaks.com/topic/194715-need-help-with-my-system/#findComment-1024002 Share on other sites More sharing options...
miniu Posted March 10, 2010 Author Share Posted March 10, 2010 I don't know how to change this dropdown menu to a table Link to comment https://forums.phpfreaks.com/topic/194715-need-help-with-my-system/#findComment-1024004 Share on other sites More sharing options...
teamatomic Posted March 10, 2010 Share Posted March 10, 2010 In your form. You would have to remove the selects and change the options to something like checkboxes and a <br>. That way it would stay within the existing table structure. HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/194715-need-help-with-my-system/#findComment-1024026 Share on other sites More sharing options...
miniu Posted March 10, 2010 Author Share Posted March 10, 2010 yeah, but there is still the problem that I don't know how to do it Link to comment https://forums.phpfreaks.com/topic/194715-need-help-with-my-system/#findComment-1024261 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.