Jump to content

Jeff

Members
  • Posts

    1307
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Jeff

  1. Anywhere you want. I created a new page called Videos (in the Admin Panel) and added it there. Then I created a link in my navigation menu to go to the page www.yoursite.com/index.php/pages/videos

    Here is an example table I have in my Videos page to show the videos on my site:

    <table>
    <thead width="100%" align="center">
    <th>Video 1</th>
    <th>Extreme Crosswind Landing</th> //THIS IS AN EXAMPLE VIDEO NAME THAT WILL SHOW ABOVE THE VIDEO
    </thead>
    <tbody>
    <td>YOUR IFRAME CODE GOES HERE</td>
    <td><iframe width="455" height="300" src="http://www.youtube.com/embed/lnHHelsfXYE" frameborder="0" allowfullscreen></iframe></td> //THIS IS HOW YOUR IFRAME SHOULD LOOK
    </tbody>
    </table>
    <table>
    <thead width="100%" align="center">
    <th>Video 3</th>
    <th>Video 4</th>
    </thead>
    <tbody>
    <td>YOUR IFRAME CODE GOES HERE</iframe></td>
    <td>YOUR IFRAME CODE GOES HERE</iframe></td>
    </tbody>
    </table>

  2. I am in a slight predicament. I am trying to display total hours flown for a specific airline. The code I am using is not displaying the correct output for it. It keeps displaying my total VA hours instead of just the individual Airline I want.

    Here is the code I am using

    <?php echo StatsData::TotalHours(AA); ?>

    If I use these codes

    <?php echo StatsData::TotalPaxCarried(AA); ?>
    <?php echo StatsData::TotalMilesFlown(AA); ?>
    <?php echo StatsData::totalschedules(AA); ?>
    <?php echo StatsData::TotalFlights(AA); ?>

    These all show up correctly. Any idea why the Total Hours one isn't showing correctly?

  3. Images

    <img src="http://www.mysite.com/images/myimage.jpg">

    YouTube Videos

    <iframe width="455" height="300" src="http://www.youtube.com/embed/lnHHelsfXYE" frameborder="0" allowfullscreen></iframe>

    The above video code is an example code to embed on your site. You can find the code on the YouTube page of the video. This video shows a Extreme 747 landing in crosswinds. You can change the size of the video by changing the width and height.

  4. Are you using the correct code to call for the gate numbers?

    schedule_results.tpl

    <?php echo $route->depgate ?>
    <?php echo $route->arrgate ?>

    schedule_details.tpl

    <?php echo $schedule->depgate?>
    <?php echo $schedule->arrgate?>

  5. Your Schedule CSV

    1) Open your .csv using Microsoft Excel (I find this better than notepad).

    2) Create 2 fields at the top called depgate and arrgate

    3) Type your gate numbers in their respected boxes for each flight.

    4) Save your .csv

    phpMyAdmin

    1) Open phpMyAdmin from your cPanel

    2) Choose your database name (from the left)

    3) From the scroll-down, click "phpvms_schedules"

    4) At the top, click "Structure"

    5) Just below the table, look for this b_insrow.png Add 1 Column. click the radio button for "After" then choose "Enabled" from the drop-down.

    6) Type the following in their correct boxes:

    Column depgate

    Type TEXT

    Default None

    Collation latin1_swedish_ci

    7) Click SAVE

    8) Repeat steps 5-7 to add the arrgate to the structure (you want to type arrgate instead of depgate on this one, and instead of entering it after "Enabled", you want to add it after "depgate").

    File Manager (Editing the schedules module)

    1) Go to the following directory: /public_html/admin/modules/Import

    2) Open the Import.php file (please make a back-up of this before editing)

    3) Look for this code:

    	public function processexport()
    {
    	$export='';
    	$all_schedules = SchedulesData::GetSchedules('', false);
    
    	if(!$all_schedules)
    	{
    		echo 'No schedules found!';
    		return;
    	}
    
    	header('Content-Type: text/plain');
    	header('Content-Disposition: attachment; filename="schedules.csv"');
    
    	$fp = fopen('php://output', 'w');
    
    	$line=file_get_contents(SITE_ROOT.'/admin/lib/template.csv');
    	fputcsv($fp, explode(',', $line));
    
    	foreach($all_schedules as $s)
    	{
    		$line ="{$s->code},{$s->flightnum},{$s->depicao},{$s->arricao},"
    				."{$s->route},{$s->registration},{$s->flightlevel},{$s->distance},"
    				."{$s->deptime}, {$s->arrtime}, {$s->flighttime}, {$s->notes}, "
    				."{$s->price}, {$s->flighttype}, {$s->daysofweek}, {$s->enabled}";
    
    		fputcsv($fp, explode(',', $line));
    	}
    
    	fclose($fp);
    }
    

    4) Change it to this:

    	public function processexport()
    {
    	$export='';
    	$all_schedules = SchedulesData::GetSchedules('', false);
    
    	if(!$all_schedules)
    	{
    		echo 'No schedules found!';
    		return;
    	}
    
    	header('Content-Type: text/plain');
    	header('Content-Disposition: attachment; filename="schedules.csv"');
    
    	$fp = fopen('php://output', 'w');
    
    	$line=file_get_contents(SITE_ROOT.'/admin/lib/template.csv');
    	fputcsv($fp, explode(',', $line));
    
    	foreach($all_schedules as $s)
    	{
    		$line ="{$s->code},{$s->flightnum},{$s->depicao},{$s->arricao},"
    				."{$s->route},{$s->registration},{$s->flightlevel},{$s->distance},"
    				."{$s->deptime}, {$s->arrtime}, {$s->flighttime}, {$s->notes}, "
    				."{$s->price}, {$s->flighttype}, {$s->daysofweek}, {$s->enabled}, "
    				."{$s->depgate}, {$s->arrgate}, ";
    
    		fputcsv($fp, explode(',', $line));
    	}
    
    	fclose($fp);
    }

    5) Scroll down, and look for this:

    echo '<div style="overflow: auto; height: 400px; border: 1px solid #666; margin-bottom: 20px; padding: 5px; padding-top: 0px; padding-bottom: 20px;">';
    
    	while($fields = fgetcsv($fp, 1000, ','))
    	{
    		// Skip the first line
    		if($skip == true)
    		{
    			$skip = false;
    			continue;
    		}
    
    		// list fields:
    		$code = $fields[0];
    		$flightnum = $fields[1];
    		$depicao = $fields[2];
    		$arricao = $fields[3];
    		$route = $fields[4];
    		$aircraft = $fields[5];
    		$flightlevel = $fields[6];
    		$distance = $fields[7];
    		$deptime = $fields[8];
    		$arrtime = $fields[9];
    		$flighttime = $fields[10];
    		$notes = $fields[11];
    		$price = $fields[12];
    		$flighttype = $fields[13];
    		$daysofweek = $fields[14];
    		$enabled = $fields[15];
    
    		if($code == '')
    		{
    			continue;
    		}
    

    6) Change it to this:

    echo '<div style="overflow: auto; height: 400px; border: 1px solid #666; margin-bottom: 20px; padding: 5px; padding-top: 0px; padding-bottom: 20px;">';
    
    	while($fields = fgetcsv($fp, 1000, ','))
    	{
    		// Skip the first line
    		if($skip == true)
    		{
    			$skip = false;
    			continue;
    		}
    
    		// list fields:
    		$code = $fields[0];
    		$flightnum = $fields[1];
    		$depicao = $fields[2];
    		$arricao = $fields[3];
    		$route = $fields[4];
    		$aircraft = $fields[5];
    		$flightlevel = $fields[6];
    		$distance = $fields[7];
    		$deptime = $fields[8];
    		$arrtime = $fields[9];
    		$flighttime = $fields[10];
    		$notes = $fields[11];
    		$price = $fields[12];
    		$flighttype = $fields[13];
    		$daysofweek = $fields[14];
    		$enabled = $fields[15];
    		$depgate = $fields[16];
    		$arrgate = $fields[17];
    
    		if($code == '')
    		{
    			continue;
    		}
    

    7) Scroll down a little more, and find this:

    			# This is our 'struct' we're passing into the schedule function
    		#	to add or edit it
    
    		$data = array(	'code'=>$code,
    						'flightnum'=>$flightnum,
    						'depicao'=>$depicao,
    						'arricao'=>$arricao,
    						'route'=>$route,
    						'aircraft'=>$ac,
    						'flightlevel'=>$flightlevel,
    						'distance'=>$distance,
    						'deptime'=>$deptime,
    						'arrtime'=>$arrtime,
    						'flighttime'=>$flighttime,
    						'daysofweek'=>$daysofweek,
    						'notes'=>$notes,
    						'enabled'=>$enabled,
    						'price'=>$price,
    						'flighttype'=>$flighttype);
    
    

    8) Change it to this:

    			# This is our 'struct' we're passing into the schedule function
    		#	to add or edit it
    
    		$data = array(	'code'=>$code,
    						'flightnum'=>$flightnum,
    						'depicao'=>$depicao,
    						'arricao'=>$arricao,
    						'route'=>$route,
    						'aircraft'=>$ac,
    						'flightlevel'=>$flightlevel,
    						'distance'=>$distance,
    						'deptime'=>$deptime,
    						'arrtime'=>$arrtime,
    						'flighttime'=>$flighttime,
    						'daysofweek'=>$daysofweek,
    						'notes'=>$notes,
    						'enabled'=>$enabled,
    						'price'=>$price,
    						'flighttype'=>$flighttype,
    						'depgate'=>$depgate,
    						'arrgate'=>$arrgate);
    
    

    9) Save your work.

    Testing out csv

    1) Import your schedules to your database using your Admin Center (I have to upload it twice for some reason in order for them to show up for me).

    2) Let me know if you run into any problems.

×
×
  • Create New...