KenG Posted August 27, 2018 Report Posted August 27, 2018 I added the code from this thread https://forum.phpvms.net/topic/2125-add-bid-from-pilot-brief/ and it seems to work, but when I try to click add it does nothing. Is there something else I need to do? Running phpvms 5.5 on php 5.6. Thank you, -Ken Quote
Administrators ProAvia Posted August 28, 2018 Administrators Report Posted August 28, 2018 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...... Quote
KenG Posted August 28, 2018 Author Report Posted August 28, 2018 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 Quote
Administrators ProAvia Posted August 28, 2018 Administrators Report Posted August 28, 2018 (edited) 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 August 29, 2018 by ProAvia Quote
KenG Posted August 29, 2018 Author Report Posted August 29, 2018 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> Quote
Administrators ProAvia Posted August 29, 2018 Administrators Report Posted August 29, 2018 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 Quote
KenG Posted August 29, 2018 Author Report Posted August 29, 2018 (edited) 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 August 29, 2018 by KenG Quote
Administrators ProAvia Posted August 29, 2018 Administrators Report Posted August 29, 2018 Glad you got it working! Quote
KenG Posted August 30, 2018 Author Report Posted August 30, 2018 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.