<script data-cfasync="false" type="text/javascript">
    $(document).ready(function() {
        $('.price').each(function() {
            $(this).keydown(function (e) {
                // Allow: delete, backspace, tab, escape, enter, . (110, 190)
                if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
                     // Allow: Ctrl+A
                    (e.keyCode == 65 && e.ctrlKey === true) ||
                    // Allow: Ctrl+C
                    (e.keyCode == 67 && e.ctrlKey === true) ||
                     // Allow: Ctrl+V
                    (e.keyCode == 86 && e.ctrlKey === true) ||
                     // Allow: home, end, left, right
                    (e.keyCode >= 35 && e.keyCode <= 39)) {
                         // let it happen, don't do anything
                         return;
                }
                // Ensure that it is a number and stop the keypress
                if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
                    e.preventDefault();
                }
            });
        });
    });
</script>

<div class="fieldwrapper">

    <form id="pricingtab">
        <table class="table table-striped" cellpadding="5" cellspacing="5" style="width:100%">
            <thead>
            <tr>
                <td width="150">
                </td>
                <td width="50">
                    <label style="text-align:center;font-weight:bold;" class="fieldlabel"><?php echo $this->user->lang("Price");?></label>
                </td>
                <td width="50">
                    <label style="text-align:center;font-weight:bold;" class="fieldlabel"><?php echo $this->user->lang("Setup");?></label>
                </td>
                <td width="100">
                    <label style="text-align:center;font-weight:bold;" class="fieldlabel"><?php echo $this->user->lang("Allow in signup?");?></label>
                </td>
                <td><!-- THIS ADDITIONAL CELL IS TO AVOID EXPANDING THE PREVIOUS CELLS -->
                </td>
            </tr>
            </thead>
            <tbody>

            <?php foreach ($this->priceExtraData as $cycle => $extraDataValues) {
                if ($cycle == 0) {
                    continue;
                } ?>

                <tr>
                    <td>
                        <?php echo $this->user->lang($this->priceExtraData[$cycle]['price_name']);?>
                    </td>
                    <td>
                        <input class="price" type="text" value="<?php echo $this->priceExtraData[$cycle]['price'];?>" name="price<?php echo $cycle; ?>" style="width:50px;"/>
                    </td>
                    <td>
                        <input class="price" type="text" value="<?php echo $this->priceExtraData[$cycle]['setup'];?>" name="setup<?php echo $cycle; ?>" style="width:50px;"/>
                    </td>
                    <td style="text-align:center;">
                        <input type="checkbox" name="price<?php echo $cycle; ?>_checked" value="1" <?php if ($this->priceExtraData[$cycle]['price_checked'] == 1) echo "checked";?> />
                    </td>
                    <td>
                    </td>
                </tr>
            <?php } ?>

            <tr>
                <td>
                    <?php echo $this->user->lang($this->priceExtraData[0]['price_name']);?>
                </td>
                <td colspan="2">
                    <input class="price" type="text" value="<?php echo $this->priceExtraData[0]['price'];?>" name="price0" style="width:50px;"/>
                </td>
                <td style="text-align:center;">
                    <input type="checkbox" name="price0_checked" value="1" <?php if ($this->priceExtraData[0]['price_checked'] == 1) echo "checked";?> />
                </td>
                <td>
                </td>
            </tr>

            <tr>
                <td>
                    <?php echo $this->user->lang("Late Fee");?>
                </td>
                <td colspan="4">
                    <input class="price" type="text" value="<?php echo $this->latefee;?>" name="latefee" style="width:50px;"/>
                </td>
            </tr>
            <tr>
                <td colspan="5">
                    <label class="checkbox inline"><input type="checkbox" name="taxable" value="1" <?php if ($this->taxable == 1) echo "checked";?> /><?php echo $this->user->lang("Product is Taxable?");?></label>
                </td>
            </tr>
            </tbody>
            <tfoot>
            <tr>
                <td colspan="5" style="border-top: 0px;">

                    <div class="alert alert-block">
                        <?php echo $this->user->lang('Addon prices for billing cycles not used in this product will not be available to the client, unless you select the force show option in the addon setup screen.');?>
                    </div>

                    <div class="form-actions">
                        <div class="pull-right">
                          <button type="submit" class="submit-pricing btn btn-primary"><?php echo $this->user->lang("Save Changes");?></button>
                        </div>
                    </div>
                </td>
            </tr>
            </tfoot>
        </table>
    </form>

</div>