Jump to content

Add Bid from Schedule Details Page


KenG

Recommended Posts

  • Administrators

This worked for me - but YMMV.....

Look in schedule_results.php on about line 103. Edit the file in your chosen skin folder - if it's not in your chosen skin folder, use the file in core/templates and place in your chosen skin folder.

If yours is

					href="<?php echo url('/schedules/addbid');?>">Add to Bid</a>

Change it to

					href="<?php echo url('/schedules/addbid/?id='.$schedule->id);?>">Add to Bid</a>

Back up your original file first......

Link to comment
Share on other sites

Thank you, I looked at schedule_results.php and it does not have 103 lines, only 67.

At line 39 to 59 it has the following:

<td nowrap>
		<a href="<?php echo url('/schedules/details/'.$schedule->id);?>">View Details</a><br />
		<a href="<?php echo url('/schedules/brief/'.$schedule->id);?>">Pilot Brief</a><br />
		
		<?php 
		# Don't allow overlapping bids and a bid exists
		if(Config::Get('DISABLE_SCHED_ON_BID') == true && $schedule->bidid != 0) {
		?>
			<a id="<?php echo $schedule->id; ?>" class="addbid" 
				href="<?php echo actionurl('/schedules/addbid/?id='.$schedule->id);?>">Add to Bid</a>
		<?php
		} else {
			if(Auth::LoggedIn()) {
			 ?>
				<a id="<?php echo $schedule->id; ?>" class="addbid" 
					href="<?php echo url('/schedules/addbid');?>">Add to Bid</a>
			<?php			 
			}
		}		
		?>
	</td>

The file I am trying to add bid capability to is schedule_detail.php, I am trying to add the capability right at the top.

<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<h3>Flight Details</h3>
<p>
	<?php 
	# Don't allow overlapping bids and a bid exists
	if(Config::Get('DISABLE_SCHED_ON_BID') == true && $schedule->bidid != 0)
	{
	?>
		<a id="<?php echo $schedule->id; ?>" class="addbid" 
			href="<?php echo actionurl('/schedules/addbid');?>">Add to Bid</a> <?
	}
	else
	{
		if (Auth::LoggedIn())
		{
	 ?><a id="<?php echo $schedule->id; ?>" class="addbid" 
				href="<?php echo url('/schedules/addbid');?>">Add to Bid</a>
		<?php		 
		}
	}		
	?>
</p>

I get the blue Add to Bid, but it is not a live link. I cannot click it as if the action is broken somehow.

Thank you,

-Ken

Link to comment
Share on other sites

  • Administrators

I believe we are using an addon module for schedule search. And that is why my schedule_results.php file has more lines.

In any case, in both your code snippets, make the href= line after "if  (Auth: :LoggedIn( ) )" the same as my last code snippet - and see if that fixes the issue. 

From

if(Auth::LoggedIn()) {
			 ?>
				<a id="<?php echo $schedule->id; ?>" class="addbid" 
					href="<?php echo url('/schedules/addbid');?>">Add to Bid</a>
			<?php			 
			}

To

if (Auth::LoggedIn())
		{
	 ?><a id="<?php echo $schedule->id; ?>" class="addbid" 
				href="<?php echo url('/schedules/addbid/?id='.$schedule->);?>">Add to Bid</a>
		<?php		 
		}

EDIT - see 2 posts down for correct code

Edited by ProAvia
Link to comment
Share on other sites

Thank you, when I make the change I get the following error:

Parse error: syntax error, unexpected ')', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home/flyelite/public_html/lib/skins/crazyskin01/schedule_details.php on line 16

Line 16 is: href="<?php echo url('/schedules/addbid/?id='.$schedule->);?>">Add to Bid</a>

 

Link to comment
Share on other sites

  • Administrators

Sorry, I messed up the copy/paste in my previous response. Here's the correct one....

href="<?php echo url('/schedules/addbid/?id='.$schedule->id);?>">Add to Bid</a>

Notice the "id" after ".$schedule->"

Hopefully that works for you

Link to comment
Share on other sites

Thank you, while this gets rid of the error I am back to square one in that while it shows "Add to Bid" and it shows like it is a hyperlink, however, the hyperlink is not active.

The schedule results page works just fine. I have compared the code on both .php files and cannot find anything different enough to make the links active on one page and not active on the other.

I pulled the $schedule id and had it showed it separately and the id is properly shown.

The only thing I can think of is how is the class addbid called? Is it required to be inside a table in order to fire?

EDIT: Bingo! addbid requires a table. Once I made it a table it worked fine.

Edited by KenG
Link to comment
Share on other sites

Thank you for your help. I am still reeling about the css was looking to find the code inside a table to work correctly. Just when I think I have my head wrapped around the logic something like this happens. 😊

I really appreciate the community of experts that help us neophytes muggle along bending phpvms into individual experiences. 

-Ken

Link to comment
Share on other sites

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.

Loading...
×
×
  • Create New...