<!-- File to be deprecated under oa_content_spoofing_deprecation feature -->
<?php $trackCount = 1;
if (isset($this->view->trackCount)) {
    $trackCount = $this->view->trackCount;
}
foreach ($this->view->trackPricingList as $key => $trackPricing) {
    if (!isset($this->viewType)) {
?>
	<div id="trackPricingListPanel_<?=$key?>">
<?php
    }?>
<div class="panelHeader">
	<h3>Track <?=$trackCount?> Pricing</h3>
</div>
<div class="panelContent" id="trackPricing_<?=$key?>">
	<?php  if (isset($trackPricing)) {
?>
        <table class="data" width="100%">
            <tr>
                <th class="center">Scheme</th>
                <th class="center">Tier</th>
                <th class="center">Territory</th>
                <th></th>
            </tr>
			<input type="hidden" id="trackCount_<?=$key?>" value="<?=$trackCount?>">
			<?php foreach ($trackPricing as $id => $trkPricing) {
                 $trackTierId = $id;
                ?>
				<tr id="msg_trackpricing_<?php echo $trackTierId;?>" style="display: none">
                    <td colspan="4"></td>
                </tr>
				<tr id="track_row_<?php echo $trackTierId;?>">
					<td id="track_scheme_<?php echo $trackTierId;?>" width="25%" class="center">
						<?php echo $trkPricing['dmsMasterPricingScheme'];?>
                    </td>
					<td id="track_tier_<?php echo $trackTierId;?>" width="25%" class="center">
						<?php echo $trkPricing['pricingTier'];?>
						<?php if (!empty($trkPricing['trackCustomPricing'])) {
                                echo $trkPricing['trackCustomPricing'][0]->customPrice. "&nbsp;";
                                $customCurrencyCode = $trkPricing['trackCustomPricing'][0]->currencyCode;
                                $currencyCode = isset($customCurrencyCode) ? $customCurrencyCode : null;
                                echo $currencyCode;
}
                            
                        ?>
                    </td>
					<td id="track_territory_<?php echo $trackTierId;?>" width="25%" class="center">
						<?php  if (is_array($trkPricing['trackPricingTierCountry'])) {
                                    $trkCountryArr = array();
                            foreach ($trkPricing['trackPricingTierCountry'] as $territoryObject) {
                                        $trkCountryArr[] = $territoryObject->country->name;
                            }
}
                        ?>
						<p><?php echo implode(",", $trkCountryArr);?></p>
                    </td>
                    <td align="right" width="25%">
                    <!-- INTERNAL-881: J. Chitra -->
						<a href="javascript:void(0);" onclick="deletePricingScheme(<?= $trackTierId;
?>,<?= $this->view->releaseId;?>,'trackpricing')">Deactivate</a>
                    </td>
                </tr>
				<tr id="trackrowedit_<?php echo $trackTierId;?>" style="display:none;">
                    <td colspan="4"></td>
                </tr>
			<?php
}?>
        </table>
	<?php
} else {
?>
        <p align="center">Default pricing has been applied since there aren't any user entered values.</p>
	<?php
}?>
</div>
<?php if (!isset($this->viewType)) {
?>
</div>
<?php
}
$trackCount++;
}