<?php
if(!empty($sem_commissions))
{
    echo 'Prowizja SEM:';
    echo '<select name="client"style="width:200px;" onchange="location.href=this.options[this.selectedIndex].value">';
    if(!empty($sem_commissions))
    {
        foreach($sem_commissions as $k=>$v)
            echo '<option value="'.base_url().$this->uri->segment(1).'/'.$this->uri->segment(2).'/sem_commission/'.$v['id'].'#tabs-2" '.((isset($values['id']) && $values['id']==$v['id']) ? 'selected="selected"':'').'>['.$v['od'].' - '.$v['do'].']</option>';
    }
    echo '</select><br/><br/>';
}
?>

<?php if(!empty($info['settings_sem_commission']))
	echo '<p class="info_box">'.$info['settings_sem_commission'].'</p>';

if(!empty($values))
{
?>
    <form action="/master/settings/sem_commissions/<?php echo $values['id']; ?>/#tabs-2" method="post">
        <table width="100%">
            <!-- ID -->
            <input type="hidden" name="id" value="<?php if(!empty($values['id'])) echo $values['id'];?>"/>
            <!-- Prowizja -->
            <tr>
                <td width="200">Procent*</td>
                <td>
                    <input type="text" name="procent" value="<?php if(isset($values['procent'])) echo $values['procent'];?>"/>
                </td>
            </tr>
            <tr>
                <td></td>
                <td><span class="error_info"><?php if(isset($errors['procent'])) echo $errors['procent'];?></span></td>
            </tr>
            <tr>
                <td colspan="2" align="left">
                    <div class="formHr">&nbsp;</div>
                    <div class="form_buttons_v1">
                        <input type="submit" name="sem_commission" value="Zatwierdź" class="formButton"/>
                        <input type="button" name="anuluj" value="Anuluj" class="formButton" onClick="document.location.href='<?php echo base_url();?>master';"/>
                        <span class="field_required">* - pole wymagane</span>
                    </div>
                </td>
            </tr>
        </table>
    </form>
<?php
}
else
    echo 'Brak danych';
?>