• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Template Roll Printer with options (for 2.2.6, 2.3, 2.3.4, 2.4.0, 2.4.4)

Captive Portal
34
90
38.0k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E
    empbilly
    last edited by Sep 18, 2016, 1:34 PM

    Hello,

    Great job DanieleIT!

    Any chance to create a package for pfsense?  ;D ;D

    https://eliasmoraispereira.wordpress.com/

    1 Reply Last reply Reply Quote 0
    • B
      Blackhat
      last edited by Sep 18, 2016, 3:08 PM

      How to install?

      1 Reply Last reply Reply Quote 0
      • D
        DanieleIT
        last edited by Sep 19, 2016, 8:56 AM

        @Blackhat:

        How to install?

        Follow the readme inside the zip file

        1 Reply Last reply Reply Quote 0
        • N
          newbie_sense
          last edited by Sep 20, 2016, 10:49 AM

          I used the permissions /etc/inc/priv/ and set those to a user, only after a reboot I can't seem to see what changed.

          1 Reply Last reply Reply Quote 0
          • A
            astatine
            last edited by Oct 31, 2016, 8:57 AM

            Hello DanieleIT,

            thank you very much for your great work.

            I have a question, if i would like to print  vouchers 4 X 10 (by yours is 3 X 7), how can i modify the php file?

            There is a print template attached. I had many this kleber Paper and would print the voucher on it. The only problem is: it is 4 X 10…...

            Thank you in advance!

            [4 X 10.zip](/public/imported_attachments/1/4 X 10.zip)

            1 Reply Last reply Reply Quote 0
            • D
              DanieleIT
              last edited by Oct 31, 2016, 3:53 PM

              @astatine:

              I have a question, if i would like to print  vouchers 4 X 10 (by yours is 3 X 7), how can i modify the php file?

              You don't have to modify the PHP file. You just have to edit the dimension of the voucher divs, trought the voucherprint.css file.

              At line 12 you have:

              .voucher {
              	border-left: 1px solid #F4F4F4;
              	border-right: 1px solid #F4F4F4;
              	border-bottom: 1px solid #F4F4F4;
              	page-break-inside: avoid;
              	float: left;
              	height: 134px;
              	width: 206px;
              	position: relative;
              }
              

              Just edit the height and the width according to your needs. (you may also need to edit a little more css based on the new dimension).

              Give it a try and let me know!

              Ciao

              1 Reply Last reply Reply Quote 0
              • K
                k0ster
                last edited by Nov 26, 2016, 5:07 PM

                Hello, DanieleIT

                Great job!
                Thanks.

                One question:

                in services_captiveportal_voucher.php in error check section you wrote following:

                // Check for form errors
                if ($_POST['charset'] && (strlen($_POST['charset'] < 2))) {
                $input_errors[] = gettext("Need at least 2 characters to create vouchers.");

                but original code is:
                // Check for form errors
                if ($_POST['charset'] && (strlen($_POST['charset']) < 2)) {
                $input_errors[] = gettext("Need at least 2 characters to create vouchers.");

                Why?

                1 Reply Last reply Reply Quote 0
                • D
                  DanieleIT
                  last edited by Nov 27, 2016, 3:53 PM

                  Hello K0ster,
                  The mod is probably based on an old version of the code. I did not change that part, but that is clearly a bugfix.
                  I'll have to merge the code when I can.

                  Thank you

                  1 Reply Last reply Reply Quote 0
                  • S
                    StofLE
                    last edited by Dec 27, 2016, 5:13 PM

                    Hi DanieleIT,

                    nice project!  :)

                    Would it be a big thing for you to implement a field for choosing how many Vouchers to print (and mark them in the DB as printed)?

                    Stefan

                    1 Reply Last reply Reply Quote 0
                    • C
                      Castrenze
                      last edited by Mar 16, 2017, 11:14 AM

                      Ciao Daniele.
                      Ottima idea.
                      Installo, provo e commento

                      –---------------------------

                      Hello Daniele.
                      Good idea.
                      I install, I try and comment

                      1 Reply Last reply Reply Quote 0
                      • A
                        AngelG
                        last edited by Mar 31, 2017, 6:36 PM

                        Thank you very much,  DanieleIT. Great job!  :)

                        1 Reply Last reply Reply Quote 0
                        • K
                          klm46
                          last edited by Apr 18, 2017, 8:27 AM

                          @DanieleIT:

                          @astatine:

                          I have a question, if i would like to print  vouchers 4 X 10 (by yours is 3 X 7), how can i modify the php file?

                          You don't have to modify the PHP file. You just have to edit the dimension of the voucher divs, trought the voucherprint.css file.

                          At line 12 you have:

                          .voucher {
                          	border-left: 1px solid #F4F4F4;
                          	border-right: 1px solid #F4F4F4;
                          	border-bottom: 1px solid #F4F4F4;
                          	page-break-inside: avoid;
                          	float: left;
                          	height: 134px;
                          	width: 206px;
                          	position: relative;
                          }
                          

                          Just edit the height and the width according to your needs. (you may also need to edit a little more css based on the new dimension).

                          Give it a try and let me know!

                          Ciao

                          Hi,

                          this is a simple and create mod! For me the css.changes won't take affect in printing. I chenged height and width as above, no change in size of the voucher print. any ideas?

                          1 Reply Last reply Reply Quote 0
                          • D
                            DanieleIT
                            last edited by Apr 18, 2017, 9:18 AM

                            @klm46:

                            Hi,

                            this is a simple and create mod! For me the css.changes won't take affect in printing. I chenged height and width as above, no change in size of the voucher print. any ideas?

                            Did you uploaded the css file to the server after changing it? Are you sure you are not loading a cached version of the css file? Try to clear cache in your browser first and check in the inspector if the width/height are changing.

                            Ciao

                            1 Reply Last reply Reply Quote 0
                            • K
                              klm46
                              last edited by Apr 25, 2017, 10:21 AM

                              Hi Daniel,

                              thanks for your answer. Yes i edited the file directly via ssh and got no browsercash running. I also saw that the printing was from browser to browser different. So i just did it with zooming in printing. Another thing for me would be great. Any chance to print an bar or qr-code as well?

                              1 Reply Last reply Reply Quote 0
                              • D
                                DanieleIT
                                last edited by Apr 25, 2017, 10:33 AM

                                Hi,
                                This looks very strange to me. The CSS is the only file that acts on the template. You should check again, as you may missing something.
                                For the barcode, check my previous post #18 and the jsfiddle.

                                1 Reply Last reply Reply Quote 0
                                • K
                                  klm46
                                  last edited by Apr 25, 2017, 11:29 AM

                                  for me the zooming function in printing is fine. i really tried this, and i saw the difference in printing-funktion per browser.

                                  regarding to the barcode…  http://jsfiddle.net/Idioblast/3j1mnwe3/

                                  which files do i have to edit. sorry for the stupid question, but i read the post and the fiddle but this not clear to me

                                  1 Reply Last reply Reply Quote 0
                                  • K
                                    klm46
                                    last edited by Apr 26, 2017, 8:51 AM

                                    i think the js-code is to put somewhere around here, but where exactly :/

                                    if ($printThis == 1) {
                                    						echo "".$voucherTitle."![Logo](voucherfiles/logo.png)".$voucherInfo."{$v}".$thisVoucherDuration."".$voucherExpiration.""; $i++;
                                    						if ($i == 21) {
                                    							echo "";
                                    							$i = 0;
                                    
                                    1 Reply Last reply Reply Quote 0
                                    • D
                                      DanieleIT
                                      last edited by Apr 30, 2017, 10:05 AM

                                      @klm46:

                                      for me the zooming function in printing is fine. i really tried this, and i saw the difference in printing-funktion per browser.

                                      regarding to the barcode…  http://jsfiddle.net/Idioblast/3j1mnwe3/

                                      which files do i have to edit. sorry for the stupid question, but i read the post and the fiddle but this not clear to me

                                      Ini the "services_captiveportal_vouchers_print.php" file, line 49, you'll find the opening tag, in the head just add a link to the js file (download: http://barcode-coder.com/js/jquery-barcode-last.min.js) and put in in the same folder as the .css file and others. Then add the javascript code you can fine in Jsfiddle at the end, before the closing body tag.

                                      1 Reply Last reply Reply Quote 0
                                      • K
                                        klm46
                                        last edited by May 8, 2017, 10:25 AM

                                        @DanieleIT:

                                        @klm46:

                                        for me the zooming function in printing is fine. i really tried this, and i saw the difference in printing-funktion per browser.

                                        regarding to the barcode…  http://jsfiddle.net/Idioblast/3j1mnwe3/

                                        which files do i have to edit. sorry for the stupid question, but i read the post and the fiddle but this not clear to me

                                        Ini the "services_captiveportal_vouchers_print.php" file, line 49, you'll find the opening tag, in the head just add a link to the js file (download: http://barcode-coder.com/js/jquery-barcode-last.min.js) and put in in the same folder as the .css file and others. Then add the javascript code you can fine in Jsfiddle at the end, before the closing body tag.

                                        Of which file?

                                        1 Reply Last reply Reply Quote 0
                                        • K
                                          klm46
                                          last edited by May 12, 2017, 11:50 AM

                                          Just if anybody else gets the problem. the barcode-part from js was not executed no matter where i put the code… i needed the following line in frint to be sure it will be executed:

                                          $(document).ready(function() {
                                          

                                          in context:

                                          1 Reply Last reply Reply Quote 0
                                          • First post
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.