RomanTaylor
01-14-2012, 12:09 PM
Hey guys, I need some assistance here.
Long story short is that I need to edit this array.
Right now it shows current and next month.
Needs to show next and one after the next.
I've tried using array_slice to skip the first month in the array, however then it only shows one month instead of two.
I need some help since someone else wrote this page and I don't completely understand why my logic did not work.
<?php
$oneMonth = VarsItem::getVarsValue('oneMonthTravel');
$oneMonth == ($oneMonth == '') ? 1 : $oneMonth;
$monthAll = TravelItem::getAllMount(array('limit' => 2, 'start' => $oneMonth));
if (sizeof($monthAll) > 0)
{
$i = 0; ?>
<table border="0" cellspacing="0" cellpadding="0" width="520" align="center">
<tr valign="top">
<td width="100%"><img src="/image/0.gif" width="1" height="15" border="0" /></td>
</tr>
</table>
<a name="inquirer"></a>
<table border="0" cellspacing="0" cellpadding="0" width="520" align="center">
<tr valign="top">
<td align="center" colspan="2"><img src="/image/where.gif" width="505" height="16" border="0" /></td>
</tr>
<tr valign="top">
<?
foreach ($monthAll as $onemonth)
{
$i++;
?>
<td width="260">
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="latestmain">
<tr><td colspan="2"><h3><%= strtoupper(monthAll($onemonth["month_id"],'namer')) %></h3></td></tr>
<?
$rowTravel = TravelItem::SelectAll(array('month_id' => $onemonth["month_id"], 'is_show' => 1));
foreach ($rowTravel as $onerowTravel)
{
$style ='style="padding-left:5px;"';
$partArray = checkEmptyPartitions($part, CountryItem::getCountryWorkName($onerowTravel['country_id']));
$hrefTravel = CountryItem::getCountryWorkName($onerowTravel['country_id'])."/".(($partArray["$part"] == 1) ? $part.'/' : ""); ?>
<tr valign="top">
<td><img src="/image/bullet-a.gif" width="9" height="9" border="0" style="margin-top:2px;" /></td>
<td width="100%" <%= $style %>><b><span id="orange"><%= CountryItem::getCountryName($onerowTravel['country_id']) %>:</span></b> <small><%= $onerowTravel['title'] %> <a href="<%= $hrefTravel %>">details...</a></small></td>
</tr>
<?
} ?>
</table>
</td>
<?
} ?>
</tr>
<tr valign="top">
<td colspan="<%= $i+1 %>">
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="latestmain">
<tr><td><a href="travel.htm">where else to go</a></td></tr>
</table>
</td>
</tr>
</table>
<?
} ?>
Thank you in advance.
Long story short is that I need to edit this array.
Right now it shows current and next month.
Needs to show next and one after the next.
I've tried using array_slice to skip the first month in the array, however then it only shows one month instead of two.
I need some help since someone else wrote this page and I don't completely understand why my logic did not work.
<?php
$oneMonth = VarsItem::getVarsValue('oneMonthTravel');
$oneMonth == ($oneMonth == '') ? 1 : $oneMonth;
$monthAll = TravelItem::getAllMount(array('limit' => 2, 'start' => $oneMonth));
if (sizeof($monthAll) > 0)
{
$i = 0; ?>
<table border="0" cellspacing="0" cellpadding="0" width="520" align="center">
<tr valign="top">
<td width="100%"><img src="/image/0.gif" width="1" height="15" border="0" /></td>
</tr>
</table>
<a name="inquirer"></a>
<table border="0" cellspacing="0" cellpadding="0" width="520" align="center">
<tr valign="top">
<td align="center" colspan="2"><img src="/image/where.gif" width="505" height="16" border="0" /></td>
</tr>
<tr valign="top">
<?
foreach ($monthAll as $onemonth)
{
$i++;
?>
<td width="260">
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="latestmain">
<tr><td colspan="2"><h3><%= strtoupper(monthAll($onemonth["month_id"],'namer')) %></h3></td></tr>
<?
$rowTravel = TravelItem::SelectAll(array('month_id' => $onemonth["month_id"], 'is_show' => 1));
foreach ($rowTravel as $onerowTravel)
{
$style ='style="padding-left:5px;"';
$partArray = checkEmptyPartitions($part, CountryItem::getCountryWorkName($onerowTravel['country_id']));
$hrefTravel = CountryItem::getCountryWorkName($onerowTravel['country_id'])."/".(($partArray["$part"] == 1) ? $part.'/' : ""); ?>
<tr valign="top">
<td><img src="/image/bullet-a.gif" width="9" height="9" border="0" style="margin-top:2px;" /></td>
<td width="100%" <%= $style %>><b><span id="orange"><%= CountryItem::getCountryName($onerowTravel['country_id']) %>:</span></b> <small><%= $onerowTravel['title'] %> <a href="<%= $hrefTravel %>">details...</a></small></td>
</tr>
<?
} ?>
</table>
</td>
<?
} ?>
</tr>
<tr valign="top">
<td colspan="<%= $i+1 %>">
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="latestmain">
<tr><td><a href="travel.htm">where else to go</a></td></tr>
</table>
</td>
</tr>
</table>
<?
} ?>
Thank you in advance.