modified on 21 March 2008 at 16:18 ••• 43,137 views

User Manager/Voucher template

From MikroTik Wiki

Jump to: navigation, search
  • Voucher template can be edited in customer section.
  • Each customer has it's own voucher template;
  • Several predefined constants can be included in voucher template. When constructing voucher these constants will be replaced with actual values of user attributes. See documentation about users to understand meaning of each user attribute.
  • Every constant must be included in percent signs. For example: %u_username%, %u_password%.
  • Also usage information (for example, used uptime) can be included in vouchers. This means that actually also reports can be printed using voucher generation.
  • You have to choose which attributes must be printed on the voucher.

Recommendations

  • If basic knowledge of HTML and CSS is present, the template can be redesigned completely, having different look and information. Otherwise it is recommended to leave the default structure and only translate or edit phrases displayed on original voucher;
  • Don't leave open HTML tags. This means, if you have <div>, then also </div> must be present. Otherwise vouchers can damage the entire page and browser content refresh will be required;
  • Be careful with tags. As template editing is only accessible to customers (and router console users) there is no restriction in tag use. This means more flexibility and responsibility at the same time;
  • Table is recommended for formatting data;
  • Table should be centered using the way it is done in default template;
  • Vertical centering is not a very simple thing. Default template uses workaround - rows (having class "space1" and "space2") with fixed height for this reason.
  • Images are not be printed by default. To show images in printable form, width and display attributes must be explicitly specified for image, i.e., you must write <img src="url_to_image.jpg" style="display: inline; width: auto" />

Examples

Example posted in forum by airforce1:

<table style="color: black; font-size: 11px;" border="2" height="10">
<tr>
  <td colspan="2" bordercolorlight="#000000" bordercolordark="#000000">
    <b><font size="2" face="Arial">YOUR COMPANY NAME GOES HERE!</font></b>
  </td>
</tr>
<tr>
  <td bordercolorlight="#000000" bordercolordark="#000000">
    <b><font size="2" face="Arial">Time:</font></b>
  </td>
  <td bordercolorlight="#000000" bordercolordark="#000000">
    <b><font size="2" face="Arial">%u_limit_uptime%</font></b>
  </td>
</tr>
<tr>
  <td bordercolorlight="#000000" bordercolordark="#000000">
    <font face="Arial" size="2"><b>Validity</b></font>
  </td>
  <td bordercolorlight="#000000" bordercolordark="#000000">
    <b><font size="2" face="Arial">%u_prep_time%</font></b>
  </td>
</tr>
<tr>
  <td bordercolorlight="#000000" bordercolordark="#000000">
    <b><font size="2" face="Arial">Price:</font></b>
  </td>
  <td bordercolorlight="#000000" bordercolordark="#000000">
    <b><font size="2" face="Arial">%u_tot_price%</font></b>
  </td>
</tr>
<tr>
  <td bordercolorlight="#000000" bordercolordark="#000000">
    <b><font size="2" face="Arial">Username:</font></b>
  </td>
  <td bordercolorlight="#000000" bordercolordark="#000000">
    </font><b><font size="2" face="Arial">%u_username%</font></b>
  </td>
</tr>
<tr>
  <td bordercolorlight="#000000" bordercolordark="#000000">
    <b><font size="2" face="Arial">Password:</font></b>
  </td>
  <td bordercolorlight="#000000" bordercolordark="#000000">
    <font face="Arial"><b><font size="2">%u_password%</font></b></font>
  </td>
</tr>
</table>

Example posted in forum by csickles:

Hotspot Tiket

This one is created in a package called "Bartender". The tickets are produced by exporting user CSVs to a local dirrectory then some VB automates bartender that then prints the ticket out on a thermal POS printer.