Jump to content

Tour Mod Page


CPC900
 Share

Recommended Posts

So, I guess where I am stuck is.....I have the Tour page where I want to put the tours side by side in two columns, all they way down. So, like 12 tours in 2 columns, 6 rows. I just can't figure out where/how to put the Div. Here is the current code in progress:

<?php
if(Auth::LoggedIn() == false)
{
  echo 'Please login to view this page.';
  echo '<br /><br /><br />';
  Template::Show('login_form.tpl');
  return;
}
?>

<?php

//////////////////////////////////////////////////////////////////////

//simpilotgroup Tour 1.0 module for phpVMS virtual airline system   //

//@author David Clark (simpilot)								    //

//@copyright Copyright (c) 2011, David Clark, All Rights Reserved   //

//////////////////////////////////////////////////////////////////////

echo '<center><h6>'.SITE_NAME.' Tours</h6></center>';

if($tours)

{

echo '<table width="40%" border="1px" align="center">';

foreach($tours as $tour)

{

   if($tour->active == '0'){continue;}

   $flights = unserialize($tour->flights);

   echo '<tr>';

   echo '<td width="25%">';

   echo '<center><h2>'.$tour->title.'</h2></center>';

   echo '<b>Status:</b> ';

   if($tour->active == '1'){echo '<font color="#00FF00"><b> Active</b></font>';}

   if($tour->active == '2'){echo '<font color="#FF0000"><b> Complete</b></font>';}

   if($tour->active == '3'){echo '<font color="#FF0000"><b> Upcoming</b></font>';}

   echo '<br /><b>Description:</b> '.$tour->description.'<br />';

   echo '<b>Participants:</b> '.TourData::participants($tour->id).'<br />';

   echo '<br /><a href="'.url('tour/details').'/'.$tour->id.'" text-decoration:underline;"><b>View Details</b></a>';

   // echo '</td><td>';

   if($tour->image == '')

   {echo 'No Image Available';}

   else

   {echo '<center><img src="'.$tour->image.'" alt="'.$tour->title.'" style="max-width:300px;" /></center>';}

   echo '</td>';

   echo '<td>';

   echo '<b>Flights:</b><br />';

   $i = 1;

   foreach($flights as $flight)

   {

    $schedule = SchedulesData::getSchedule($flight);

    echo 'Leg: '.$i.' - '.$schedule->code . $schedule->flightnum.' - '.$schedule->depicao.' to '.$schedule->arricao.'<br />';

    $i++;

   }

   echo '</td>';

   echo '</tr>';

}

echo '</table>';

}

else

{echo 'No Tours Have Been Created.';}

?>

Link to comment
Share on other sites

Yeah, sorry for taking so long to get back to you. The template, I think, was the original one that I had just modied along the way; but it has been so long, I forgot :(

But basically, the way it looks right now, with the changes I made above....is a smaller width table which I wanted to split into 2 columns essentially.

The tour module automatically puts it into a table, no?!

Link to comment
Share on other sites

  • Administrators

Can I do that?! Or does the module have to be modified?!

This will have to be set in the template, the module just gives an array of the data from the database.

Maybe something like this could be used as a base;

$columns = 1;
foreach($lines as $line)    {
   //check to see if we are on the first column of the row
   if($columns == 1){echo '<tr>';}
   echo '<td>'.mydata.'</td>';
   //check and see if we are on the second column
   //if we are - end the row and reset the column count
   //if not - add to the column count
   if($columns == 2){echo '</tr>'; $columns = 1;}
   else
   {$columns++;}
}
//check if we have an open row
if($columns == 2){echo '</tr>';}

Link to comment
Share on other sites

  • 1 year later...

Sorry, but I am coming back to this because I could never figure it out.  I can edit it with "inspect" mode, but I have no idea what file I need to edit.  I mean I would have thought the "tour_index.tpl" could be the item to edit, but apparently not.

I am just confused on this one, sorry :(  Any help would be appreciated.

Bruce

Link to comment
Share on other sites

2 hours ago, CPC900 said:

Sorry, but I am coming back to this because I could never figure it out.  I can edit it with "inspect" mode, but I have no idea what file I need to edit.  I mean I would have thought the "tour_index.tpl" could be the item to edit, but apparently not.

I am just confused on this one, sorry :(  Any help would be appreciated.

Bruce

I been editing mine, what are you trying to edit. I will try to help you.

Link to comment
Share on other sites

I just want to have the tours appear 2 or 3 across, instead of just one column.  Like I said, I can work on it in firefox or chrome with the inspect function to see what it could look like, but have no clue how to edit the tour_index.tpl to make that happen??!

So, default looks like:

tour_edit1.jpg

but want this:

tour_edit2.jpg

Bruce

 

Edited by CPC900
Link to comment
Share on other sites

  • 2 weeks later...
  • Moderators

I'd look at getting Bootstrap incorporated into your site.  It makes things a lot fresher, cleaner and allows you to make repsonsive layouts (ie. that resize dependant on broswer window size)

http://getbootstrap.com/docs/3.3/getting-started/#download

I can't just paste my code here as it will not work for you as mine has bootstrap classes assigned to it.

Link to comment
Share on other sites

Ok, I will look into that tonight.  I assume, Bootstrap is not TOO hard to install into my site, without causing too much mental anguish ;)

And what did you recommend to install in with: npm, yarn, composer or nuget??

Thanks,

Bruce

 

Edited by CPC900
Link to comment
Share on other sites

  • 8 months later...
  • 1 month later...
  • 1 month later...
  • 11 months later...

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...
 Share

×
×
  • Create New...