Jump to content

Adding One


Xtremer360

Recommended Posts

The idea here when the user selects the event name then it goes to the efed_content_booking and finds the same event name and then find the one with the highest label number and then add 1 then take that number and put it back in the text box for label on the form

 

<tr>
<td width="150" valign="center" class="rowheading">Show Name:</td>
                    <td class="row3">
                    <select name="event" class="dropdown">
                    <option value="0">- Select -</option>
                    <?php
                    $query = "SELECT * FROM efed_list_shownames";
                    $result = mysql_query ( $query );
                    while ( $row = mysql_fetch_assoc ( $result ) )
                    {
                        print "<option value=\"".$row['name']."\">".$row['name']."</option>\r";
                    }
                    ?>
                    </select></td>
                    <td class="row3" width="180"><span class="reduced">Set up in show Name Manager</span></td>
                </tr>
                <tr>
                    <td width="150" valign="center" class="rowheading">Label:</td>
                    <td class="row3"><input type="text" name="label" class="fieldtext40" readonly></td>
                    <td class="row3" width="180"><span class="reduced">e.g. Consecutive Number, Date</span></td>
                </tr>
                <tr>
                    <td width="150" valign="center" class="rowheading">Air Date</td>
                    <td class="row3"><input type="text" name="bookingdate" class="fieldtext80" value=""><a href="javascript:show_calendar(document.showbooker.bookingdate, document.showbooker.bookingdate.value);"><img src="http://www.defiantwrestling.net/backstage/images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick the date"></a></td>
                    <td class="row3"><span class="reduced">dd-mm-yyyy</span></td>
                </tr>

Link to comment
Share on other sites

Okay I've been working on this a little bit more. Here's what I have. It works mostly however the input box disappears and it shows say for example 1" /> so there's something wrong with the coding somewhere.

 

backstageajax.php

case 'eventlabel':
			$label = $_GET['showname'];
			$res2 = mysql_query("SELECT * FROM `efed_list_shownames` WHERE `name` = '$label'");
			$show_id = mysql_fetch_assoc($res2);
			$id = $show_id['id'];
			$res = mysql_query("SELECT * FROM `efed_content_booking` WHERE `event_id` = '$id' ORDER BY `label` DESC");
			$list = mysql_fetch_assoc($res);
			echo '<input type="text" name="label" class="fieldtext40" readonly value="'.$list['showlabel']+1 .'" />';
	break;

 

eventbooker.php

<tr>
                    <td width="150" valign="center" class="rowheading">Label:</td>
                    <td class="row3" id="label"><input type="text" name="label" class="fieldtext40" readonly></td>
                    <td class="row3" width="180"><span class="reduced">e.g. Consecutive Number, Date</span></td>
                </tr>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.