www.chilliwave.com

Wifi Network Distribution and Billing Server
It is currently Sat Feb 29, 2020 5:53 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Printing Tickets
PostPosted: Wed Mar 02, 2011 1:17 pm 
Offline

Joined: Tue Nov 23, 2010 9:47 am
Posts: 15
Is there any adjustment to printing tickets?

I wanted to print tickets on pre-preforated paper or card stock
and found the present PDF document off by just little bit.

Was hoping there was some adjustment to page layout etc..or another solution.

Thanks.


AB

_________________
Proxmox 1.8
CW 716 Bionic


Top
 Profile  
 
 Post subject: Re: Printing Tickets
PostPosted: Wed Mar 09, 2011 4:47 pm 
Offline

Joined: Sun Jan 02, 2011 3:40 am
Posts: 14
I'd like to know more about this section.

ie maybe using a Dymo printer with card stock

Also a customer asked if i can change the format, at the moment I export the data into excel scape the name / p/w of into a csv file then import into publisher...

Long handed way but I have full control. would be nice if I could just make the graphic and move the location of the data fields


Tony


Top
 Profile  
 
 Post subject: Re: Printing Tickets
PostPosted: Wed Mar 09, 2011 7:12 pm 
Offline
User avatar

Joined: Wed Dec 16, 2009 11:20 pm
Posts: 165
If you check admin/createuser.php you can change the layout systemwide at line 809, fonts and size of image can be adjusted. There's some notes from line 803 also.

_________________
------------
Running Proxmox with ChillwaveNG (heavily modified) in VMWARE on Windows 7
------------


Top
 Profile  
 
 Post subject: Re: Printing Tickets
PostPosted: Sat Mar 12, 2011 7:41 pm 
Offline

Joined: Tue Nov 23, 2010 9:47 am
Posts: 15
I tried changing the $height of ticket on line 563; which made the ticket bigger;
but I could not get the ticket to shift closer to bottom of page.

I think it has something to do with margins or the A4 page setting.
The ticket format now is pretty closeto pre-preforated paper card stock
I just need it to print a little closer to bottom of page and maybe an extra line after each ticket.

Open to any other suggestions.
How do you export to xl.

A good label program can be found at avery web site templates/software software "Avery DesignPro® for PC"

AB

_________________
Proxmox 1.8
CW 716 Bionic


Top
 Profile  
 
 Post subject: Re: Printing Tickets
PostPosted: Wed Apr 27, 2011 6:33 pm 
Offline

Joined: Mon Nov 16, 2009 3:27 pm
Posts: 13
Location: Norfolk Island
Just an update for people who want to modify or customize their tickets.

As above the code is in /var/www/admin/createuser.php

Basically the setup is a one row table with two columns which is repeated once to the right & down as many rows as required.
It's done in html & this is then converted to pdf with html2pdf.

It doesn't matter if you're not a coder (but it helps to know basic html), as there's only a couple of things you need to change. Of course you take a backup of the file first...

If you want multiple images then set them up & copy them into /var/www/admin/b-img/<nas-id>/ (ie, different images for each hotspot).
Note that the system will rename any image (gif or jpg) you upload to ticket.(gif or jpg), so if you upload through the webif you still need to rename them on the server.

In the php file:

Search for "// config" (about line 565), under here are the main settings, you can adjust settings here but can also override them further down. If you adjust column widths make sure you keep the total to 365

I changed the date format for the expiry so Australians & Kiwi's could understand it. The code is on line 600 & uses the PHP date function.
Details on the date format at php.net (http://www.php.net/manual/en/function.date.php)

You then need to mod the layout which is set in the $t variable on line 811. I copied the line then just commented out the original (# or // in front of the $t), I also restructure the text so it's readable & therefore easier to change.

Below is each of the sections mentioned above that shows the original settings plus my changes so you can see what needs to happen.

Config
Code:
// config
$height = '200'; // overall ticket height
$width_col_1 = '115';
$width_col_2 = '250';
$ticket_image_width = '233';
$ticket_image_height = '120';
$cursymbol = '$';
$table_border = '1';
// this just sets the text
//$duration = 'Good For:';
//Custom Edit - insert my own validity message in the HTML
$duration = '';


Date
Code:
//$expon = date('M j, y',  time() + "$expires2");
//Custom Edit - change date format to dd/mm/yyyy
$expon = date('d/m/Y',  time() + "$expires2");


Layout
Code:
// $t = '<td valign="top" width="'.$width_col_1.'" height="'.$height.'"><br> <br><font color="gray">Username:<br></font><b>'.stripslashes($r['UserName']) .'</b><br><font color="gray">Password:</font><br><b>'.stripslashes($r['Value']).'</b><br> '.$bandwidthmsg.' <br>'.$cursymbol.$price.' <br> <font color="gray">Expires:</font><br><b>'.$expon.'</b><br></td><td valign="top" width="'.$width_col_2.'"><br><p><img src="./b-img/'.$nasid.'/'.$ticket_image.'" width="'.$ticket_image_width.'" height="'.$ticket_image_height.'" align="baseline"><br> <br> <br> <br> <br> <br> <br> <br> '.$duration.'</td>';

//Custom Edit - set custom images, font colours & general layout
$t = '<td valign="top" width="'.$width_col_1.'" align="left" height="'.$height.'">
                <img src="./b-img/'.$nasid.'/logo.jpg" width="110" height="34"><br> <br><p>
                <font color="#666666">Username</font><br>
                <b>'.stripslashes($r['UserName']) .'</b><br>
                <font color="#666666">Password</font><br>
                <b>'.stripslashes($r['Value']).'</b><br>
                <font color="#666666">Expiry Date</font><br>
                <b>'.$expon.'</b> </p>
                </font><br>
        </td>
        <td width="'.$width_col_2.'" valign="top" align="left">
                <img src="./b-img/'.$nasid.'/logo2.jpg" width="230" height="34"><br> <br><p>
                <font color="#666666" size="-1">Voucher Price : </font><strong>'.$cursymbol.$price.'</strong><br>
                <font color="#666666" size="-1">Connect to network</font><br><strong> Norfolk Telecom Hotspot</strong><br> <br>
                <font color="#666666" size="-1">Valid for : </font><strong>'.$duration.'</strong><br>
                <font color="#666666" size="-1">To log off : </font><strong>http://exit </strong>(.ninet.nf)</p>
        </td>';


The resulting ticket attached

Cheers
Stu


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
 Post subject: Re: Printing Tickets
PostPosted: Thu Apr 28, 2011 12:54 am 
Offline
User avatar

Joined: Fri Sep 04, 2009 8:42 pm
Posts: 67
Thanks stu, another very good write up that I will be making use of! Log off on ticket is a real good idea! 8)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group