<?php
/************************************************************************/
/*     PROGRAMMER     :  SMA                                            */
/*     SCRIPT NAME    :  AffiliateGroupForm.php                         */
/*     CREATED ON     :  27/JULY/2009                                   */
/*	 	AffiliateGroup Management section. 								*/
/*      Admin can add or edit affiliate groups with name and           */
/*      commission levels (1 to 5).                                     */
/************************************************************************/

// Display error message if set
if (!empty($msg)) {
    echo '<p align="center" class="textred">' . htmlspecialchars($msg) . '</p>';
}
?>

<form name="frm_group" method="post" action="index.php?Act=AffiliateGroup&mode=submit">
    <input type="hidden" name="groupId" value="<?= htmlspecialchars($groupId) ?>" />

    <table border="0" cellpadding="0" cellspacing="0" class="tablebdr" width="65%" align="center">
        <tr>
            <td align="center" colspan="2" class="tdhead">
                <b><?= $groupId ? 'Edit' : 'Add' ?> Affiliate Group</b>
            </td>
        </tr>

        <tr>
            <td height="30" align="right" width="50%">Group Title&nbsp;&nbsp;&nbsp;&nbsp;</td>
            <td height="30" align="left" width="50%">
                <input type="text" name="grouptitle" value="<?= htmlspecialchars($grouptitle) ?>" />
            </td>
        </tr>

        <tr>
            <td height="30" align="right" width="50%">Levels of Commission&nbsp;&nbsp;&nbsp;&nbsp;</td>
            <td height="30" align="left" width="50%">
                <select name="level" id="level">
                    <?php for ($i = 1; $i <= 5; $i++): ?>
                        <option value="<?= $i ?>" <?= ($i == $level) ? "selected='selected'" : "" ?>><?= $i ?></option>
                    <?php endfor; ?>
                </select>
            </td>
        </tr>

        <tr>
            <td height="30" align="center" colspan="2">
                <input type="submit" name="btn_add" value="<?= $groupId ? 'Edit' : 'Add' ?>" />
            </td>
        </tr>
    </table>
</form>
