<div class='panel'>
  <div class='panel-heading'><strong><?php echo $mode == 'default' ? $lang->salary->defaultSSF : $lang->salary->personalSSF;?></strong></div>
  <div class='panel-body'>
    <form id='ajaxForm' method='post'>
      <table class='table table-condensed table-borderless'>
        <?php if($mode != 'default'):?>
        <tr class='text-middle'>
          <th class='w-100px text-center'><?php echo $lang->salary->account;?></th>
          <td colspan='2'>
            <div class='required required-wrapper'></div>
            <?php if($mode == 'create'):?>
            <?php echo html::select('account', $users, $account, "class='form-control chosen'");?>
            <?php else:?>
            <?php echo html::select('account', $users, $account, "class='form-control chosen' disabled='disabled'");?>
            <?php echo html::hidden('account', $account);?>
            <?php endif;?>
          </td>
          <td colspan='2'></td>
        </tr>
        <?php endif;?>
        <tr class='text-center'>
          <th class='w-100px'><?php echo $lang->salary->name;?></th>
          <th class='w-120px'><?php echo $lang->salary->base;?></th>
          <th class='w-120px'><?php echo $lang->salary->companyRate;?></th>
          <th class='w-120px'><?php echo $lang->salary->personalRate;?></th>
          <th></th>
        </tr>
        <?php foreach($ssfList as $name => $ssf):?>
        <?php if($name == 'default') continue;?>
        <tr class='text-center text-middle'>
          <td>
            <?php echo $name;?>
            <?php echo html::hidden('names[]', $name);?>
          </td>
          <td><?php echo html::input("amounts[]", $ssf->amount, "class='form-control ssf amount'");?></td>
          <td>
            <div class='input-group'>
              <?php echo html::input("companyRates[]", $ssf->companyRate, "class='form-control ssf companyRate'");?>
              <span class='input-group-addon'><?php echo $lang->percent;?></span>
            </div>
          </td>
          <td>
            <div class='input-group'>
              <?php echo html::input("personalRates[]", $ssf->personalRate, "class='form-control ssf personalRate'");?>
              <span class='input-group-addon'><?php echo $lang->percent;?></span>
            </div>
          </td>
          <td></td>
        </tr>
        <?php endforeach;?>
        <tr>
          <th class='text-center'><?php echo $lang->salary->total;?></td>
          <td></td>
          <td class='text-right' id='totalCompany'></td>
          <td class='text-right' id='totalPersonal'></td>
          <td></td>
        </tr>
        <tr>
          <td colspan='5' class='form-actions'>
            <?php if($mode == 'default') echo html::hidden('account', 'default');?>
            <?php echo html::submitButton();?>
            <?php echo html::backButton();?>
          </td>
        </tr>
      </table>
    </form>
  </div>
</div>
