Jump to content

vbcoach

Members
  • Content Count

    109
  • Joined

  • Last visited

Community Reputation

0 Neutral

About vbcoach

  • Rank
    Advanced Member

Profile Information

  • Gender
    Not Telling
  1. Thank you ginerjm, I will give that a try. Much appreciated. I inherited this mess. Thanks for your help.
  2. I've dealt with you before. You're very good at accusing - not very good at helping. Why are you still here? Found someone at another site who was very helpful.
  3. Anyone else able to help?
  4. I am reading the replies. You are writing to me code that I am unfamiliar with. When you ask me to place this information in my code to see if it works, that's what I do. If something is missing from your example, it doesn't help me fix the issue, or learn the how and why you did it this way. So very humbly, what is missing here?
  5. Oh, I might add that what I am looking for overall here is that if the team captain select a tshirt at the time of registration, I would like it to be "SELECTED" and displayed here. If the field is blank, then I would like for all the tshirt options be be available to be chosen. Hope that helps?
  6. Hello Psycho, thanks for your very quick response. I know my code is older, but I inherited it. As I try to wrap my head around what you wrote, one thing that was apparent as I entered the code was the HTML portion seems to be mission some type of variable statement. The <select name="size" id="size"> <?php echo ; ?> </select> is not actually echoing anything. What's missing here?
  7. Hello all. I am having an issue displaying data in a form that IF EXISTS (not blank) will cause that option to be selected. The looping itself works. The variable called into the form works. Just can't seem to get the form to SELECT the correct variable. <select name="size" id="size"> <?php while ($lrow = mssqlfetchassoc($tres)) { ?> <option value="<?php echo $lrow['ts_id'];?>"> <?php if($lrow['tsdescription'] == $info['size']) echo 'selected';?> <?php echo "$lrow[tsdescription]";?> </option> <?php } ?> </select> So this is displaying the team captain's TShirt size from a database (mssql). In the database the field is called tsdescription. For sake of argument, let's say the tshirt description is "Blue 2XLarge". This variable exists and is passed into the form for updating by the team captain, if necessary. The loop works, as it loops through all the tshirt options (107 in total) and works as a pull-down menu. Somehow my IF statement doesn't work. What I am looking for is for PHP to "find" the existing tshirt description 'tsdescription' in the loop statement, and if found, cause it to be "Selected". The $info are the variables for the form when the captain's information page is loaded. So far, by itself, the $info['size'] returns the correct tshirt. "by itself" the dropdown works. Thus, something must be amiss in my IF statement. Can anyone help direct me to what I am missing to make this work? Thanks in advance. -J
  8. It took a lot or research and editing, but I found my answer. Thanks all.
  9. Let me try this again. In the middle of my page, there is a form statement that creates buttons to push. I would like to create an "IF" statement to display or not display these buttons. In my code I use "session" but it really means "season" as in Spring or Summer. So if the "season" = Summer, then display these buttons. The basic code for these buttons looks like this: <?php if($row['ptsordered'] == '') { ?> <form name="player<?= $row['p_id'] ?>" action="editPlayer.php" method="get"> <input type="hidden" name="p" value="<?= $row['p_id'] ?>"> <input name="Submit" type="submit" class="button" value="Edit"> </form> <?php } ?> </td> <td><form name="del_player<?= $row['p_id'] ?>" action="remPlayer.php" method="post" onSubmit="return(confirm('Are you sure you want to delete <?= $row['name']?>?\n\nThis cannot be reversed'))"> <input type="hidden" name="p" value="<?= $row['p_id'] ?>"> <input type="hidden" name="t" value="<?= $id ?>"> <input name="Submit" type="submit" class="button" value="Remove"> </form></td> </tr> <?php $i++; } ?> So I need help with a PHP statement that says if "session = 'Summer" then ..." displays the buttons, if not, the buttons are not displayed. Does this make sense now? Sorry for the confusion.
  10. Hello all. I have a sports league website that is used for captains to be able to view and manipulate certain items displayed in a form format. I want to be able to hide or disable two buttons in the form; the Edit and Remove buttons based on a simple IF statement. However I am not quite being able to make this happen, as the form is outside of the PHP statement. <body> <table width="800" border="0" cellpadding="0" cellspacing="0"> <tr> <td><img src="images/BBV_CP_top.jpg" width="800" height="200"></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td width="6%" class="menu"><a href="home.php"> Home</a> </td> <td width="9%" class="menu"> <?php if {echo "<a href=editTeam.php> Edit Team </a>";}?></td> <td width="12%" class="menu"> <?php if ($team[session] == 'Summer') {echo "<a href=addPlayer.php> Add Player </a>";}?></td> <td width="63%" class="menu"><br> <?php if ($team[session] == 'Summer') {echo "<a href=editInfo.php> Edit My Information </a>";}?></td> <td width="10%" class="menu"><a href="logout.php">Log Out </a></td> </tr> </table></td> </tr> <tr> <td><table width="765" border="0" cellspacing="1" cellpadding="1"> <?php if($info['feepaid'] == 'n') { ?> <tr> <td colspan="2" align="left" valign="top"> </td> </tr> <?php }?> <tr> <td width="37%" align="left" valign="top"><br> <table width="100%" border="0" cellpadding="2" cellspacing="0" class="grey2px"> <tr> <td colspan="2" class="dk_greyTxt"><h3><strong>Captain's Information</strong></h3></td> </tr> <tr> <td width="27%" class="dk_greyTxt"><strong>Name</strong></td> <td width="73%"><?php echo $info['cptname']; ?> </td> </tr> <tr> <td class="dk_greyTxt"><strong>Address</strong></td> <td><?php echo $info['address']; ?><br> <?php echo "$info[city], $info[state] $info[zip]"; ?> </td> </tr> <tr> <td class="dk_greyTxt"><strong>Phone</strong></td> <td><?php echo $info['phone'] ?></td> </tr> <tr> <td class="dk_greyTxt"><strong>E-mail</strong></td> <td><?php echo $info['email'] ?></td> </tr> <tr> <td class="dk_greyTxt"><strong>Shirt Size </strong></td> <td><?php echo $info['size'] ?></td> </tr> </table> <br></td> <td width="63%" rowspan="2" align="left" valign="top"><br> <table width="100%" cellpadding="1" cellspacing="0" class="grey2px"> <tr class="dk_greyTxt"> <td colspan="6"><h3><strong>Player's Information</strong></h3></td> </tr> <tr class="dk_greyTxt"> <td width="21%"><strong>Name</strong></td> <td width="23%"><strong>E-mail</strong></td> <td width="21%"><div align="center"><strong>Shirt Size</strong></div></td> <td width="19%"> </td> <td width="16%"> </td> </tr> <?php $i=0; while($row = mssqlfetchassoc($players)) { ?> <tr <?php if($i%2 == 0) echo "class='altbg'";?> > <td><?php echo $row['name'] ?></td> <td><?php echo $row['email'] ?></td> <td align="center"><?php echo $row['pshirt'] ?></td> <td><form name="del_player<?= $row['p_id'] ?>" action="remPlayer.php" method="post" onSubmit="return(confirm('Are you sure you want to delete <?= $row['name']?>?\n\nThis cannot be reversed'))"> </form></td> <td><form name="player<?= $row['p_id'] ?>" action="editPlayer.php" method="post"> </form></td> </tr> <?php $i++; } ?> </table></td> </tr> <tr> <td align="left" valign="top"><br> <table width="100%" border="0" cellpadding="2" cellspacing="0" class="grey2px"> <tr> <td colspan="2" class="dk_greyTxt"><h3>Team Information </h3></td> </tr> <tr> <td width="27%" class="dk_greyTxt"><strong>Name</strong></td> <td width="73%"><?php echo $team['teamname']; ?></td> </tr> <tr> <td class="dk_greyTxt"><strong>League</strong></td> <td><?php echo "$team[night] $team[type] $team[size]s"; ?></td> </tr> <tr> <td class="dk_greyTxt"><strong>Division</strong></td> <td><?php echo $team['division'] ?></td> </tr> <tr> <td class="dk_greyTxt"><strong>Shirt Color </strong></td> <td><?php echo $team['shirtcolor'] ?></td> </tr> <tr> <td class="dk_greyTxt"><strong>Registration Date </strong></td> <td><?php echo $team['reg_start'] ?></td> </tr> <?php if($info['feepaid'] == 'n') { ?> <?php } else { ?> <tr> <td class="dk_greyTxt"><strong>Registration Completed </strong></td> <td><?php echo $team['reg_done'] ?></td> </tr> <?php } ?> <?php mssqlclose(); ?> <tr> <td class="dk_greyTxt"><strong>Record </strong></td> <td> </td> </tr> </table></td> </tr> </table></td> </tr> </table> <br> </body> Under the Players table, there is an Edit and Remove button. I would like to hide this button based upon a PHP statement that looks a bit like this: <?php if ($team[session] == 'Summer')... Basically we are in the Spring session, thus at this point in the season, I do not want teams to be able to edit, add, or remove any player information. However the same database is used for both Spring and Summer registrations. So any help incorporating this php statement to hide these buttons would be greatly appreciated! -J
  11. Well these are all great ideas, but this doesn't help me with my initial query
  12. Is this a diagram of a "view"? Tried to create a database without the captain table, but a captain on one team can be a captain of other teams in other league nights, and still players on yet other teams. Never found a good way around this.
  13. Hello all. I could use some ms sql assistance. You see, I have a sports league that has various tables. I want to draw different information out of two tables; captain and player. Every team has a captain and multiple players. Each captain and player has shirt options. They choose their own shirt size and color. In the database under the captain’s table are columns for the tshirt description called “shirtsize”, and an associated TShirt ID number called “shirt_id” Under the players table are similar columns; pshirt and pshirt_id, respectively. I am not good with joins, so I could use some assistance getting a total shirt count of similar shirt_id’s from both tables. Captain’s shirt_id + player’s pshirt_id = total shirt_id counts. The results would look something like this: - Shirt - (ID) (Count) Unisex Small Hot Pink 1 3 Unisex Medium Hot Pink 2 8 Unisex Large Hot Pink 3 6 Unisex XLarge Hot Pink 4 2 Unisex Small Kelly Green 7 1 Unisex Medium Kelly Green 8 7 Unisex Large Kelly Green 9 8 Unisex XLarge Kelly Green 10 2 Unisex 2XLarge Kelly Green 11 1 Unisex Small Light Blue 13 4 Unisex Medium Light Blue 14 8 Unisex Large Light Blue 15 10 I can write this statement for one table (i.e.captain’s table) but can’t seem to merge the two tables for total shirt count. Anyone have any idea?
  14. Let's get one more thing straight! I use this forum for two purposes: To ask for help with an issue that I cannot otherwise figure out for myself, and to actually "learn" something along the way. These two go hand-in-hand. My request was simple, and I appreciated all the help along the way. Yet when I take someone's "suggestion" which is incomplete or doesn't work for me - and then ask for additional assistance as to "why", I really don't take kindly to what you call "unproductive" answers. I have shown my code all along, and simply asked for assistance in WHERE to place the suggested item responses I received here to make it all work. As stated, I tried myself in what I considered 'logical locations' but I am not an expert coder, or I wouldn't be here. Guru, you could have easily answered my question rather than this bickering and bantering back and forth. I love this place. Been here for years. Fortunately I do not have to come here all that often, but when I do - it is because I am "stuck" on something and really need some guidance - and yes at times to have someone write their suggestions for me into a usable code (my code) so I can figure out why mine didn't work, and what the proper method was. That was my intent here. A simple "I would placed this code 'here' inside your code" would have sufficed. To date, no one has actually directed me at to where this simple suggestive code should be placed. Now is that really this difficult? You could have also placed this in a private message versus blabbing this to the entire PHPFREAKS world. Now that is not good for either of us.
  15. Since you are either unable or unwilling to help, and it's been 3 days now, please close this topic as UNSOLVED and UNANSWERED. I had to spend hours manually entering this data into separate, new columns, just so it would display properly.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.