@ HTML programmers

hawkish

VIP Member
VIP Member
Joined
Apr 9, 2007
Messages
2,996
Reaction score
203
Location
SSH [email protected]
I have a problem with price ticketing software that I use for the shop I work in - heres the issue. all tickets are filled out online then printed in the shop from a webpage, the trouble is that there is designs on the ticket paper and the current html layout prints over the picture making prices unreadable. I have managed to do the following to get them how I want them.
I save the webpage to my desktop, then right click and select edit. Once notepad opens up I open the "replace" tool using ctrl+H. then I replace all "our" with a blank box to delete all mention of that word, I then replace all "price."(with the full stop) with "NOW" and finally "right" to "left" - after that I save the changes, open the webpage and the layout is perfect to print.

Does anyone know how to create a script that can take the original saved webpage and make all of these changes automatically? im looking for something that all the staff can do

thanks in advance
 
thanks for your reply - making the font bigger will not help as it will still be over the picture on the ticket cards - changing the value from right to left moves the price well out of the way of the pics
 
I'm guessing that the PHP source (Is it even PHP?) that generates the price form needs edited to cope with those changes, if you don't have access to the source you could either :

1) Install a greasemonkey script to auto correct the page.
2) Use some sort of perl/py script to strip out the html bits into plain text making it readable.
 
I got some simple vb which could be used to help automate what you have been doing manually. Obviously for something you can maintain, just create it using office vba (vb language behind office), if u got msaccess its even better.

could give it a go if your interested,
 
I'm guessing that the PHP source (Is it even PHP?) that generates the price form needs edited to cope with those changes, if you don't have access to the source you could either :

1) Install a greasemonkey script to auto correct the page.
2) Use some sort of perl/py script to strip out the html bits into plain text making it readable.

Ill have a look at that thanks mate although I dont understand any of it - Im well out of my depth!

I got some simple vb which could be used to help automate what you have been doing manually. Obviously for something you can maintain, just create it using office vba (vb language behind office), if u got msaccess its even better.

could give it a go if your interested,

That sounds great mate - what will you need from me?
 
you could do this with regular expressions and f open in php.

do you have php enabled server ?

give me the webpage location and I will do this for you :)
 
without looking at the code this will do what you want but also some principles will need to be met, this will also not work instantly without me looking at the code in the page if you want to keep it private PM me the location and i will make sure it works :) it might work though if its a html page that you want to change ?

PHP:
You don't have permission to view the code content. Log in or register now.
 
Last edited:
Doubt that will work considering because the url is not static? That code would most likely have to be in the actual source where the page gets generated.

Do we even know if its a PHP script thats generating the page? lol
 
That sounds great mate - what will you need from me?

I am going to paste sample code which is sample excel vba. Im not sure you have MSAccess installed so I did it to work in Excel. Usually everyone who has msoffice has Excel installed.

I went by these rules here. So reading this

all "our" with a blank box to delete all mention of that word, I then replace all "price."(with the full stop) with "NOW" and finally "right" to "left

You want to replace

our with nowt
price. with NOW
right with left


How to use in excel - open up excel, hit ALT-F11, click on Modules then Module1 (on the left hand side where it lists SheetNames) and paste this into the blank space on the right hand side. Note, if you dont see it, you can right click on the left hand side, select Insert then Module (see screenshot attached)


Code:
You don't have permission to view the code content. Log in or register now.


Now just click anywhere and hit F5 or easier still, from the main excel window, click on Tools/Macro then Macros and this should bring up your list of macros including this one CodeForHawkish. You then select that and hit run.

The above example loads up cricinfo and saves local copy in c:\temp called updatedfile. You change this according to your needs.
 
Just had a look its a dynamic page that is loaded from drop down menu's

This will need some more thought, I will have a better look when i get back from work.

QUESTION :)
Is that your site of is that where you goto hawkish ?
 
Last edited:
Just had a look its a dynamic page that is loaded from drop down menu's

This will need some more thought, I will have a better look when i get back from work.

QUESTION :)
Is that your site of is that where you goto hawkish ?

Mickie, where is this site? is it internal only? u got a copy of the page?
 
Regular expressions and this copy and replace lark isn't the right way to go. You will have to edit the source file which outputs the HTML to fit around the ticket printout size OR remove the $vars from the HTML output instead of putting in '.' and what-have-you... should be simple, in theory...
 
maidenbeats, I agree with you but based on what hawkish was doing, I assumed this was an app already built and would require someone to come in and change the code and this might not be possible hence just trying to automate what is manually done.
 
maidenbeats, I agree with you but based on what hawkish was doing, I assumed this was an app already built and would require someone to come in and change the code and this might not be possible hence just trying to automate what is manually done.

If its in PHP/ASP the source can be edited easily, someone should have ftp access to get the src.

When you have the src you can add a button alongside the generated page called "print mode" that takes the data sticks it in a string and outputs it as plain text ready for printing.. tada.
 
Hi guys - sorry for late reply, it was manic yesterday!

Just had a look its a dynamic page that is loaded from drop down menu's

This will need some more thought, I will have a better look when i get back from work.

QUESTION :)
Is that your site of is that where you goto hawkish ?

The site is not mine, it is run by the parent company for us franchises.



If its in PHP/ASP the source can be edited easily, someone should have ftp access to get the src.

When you have the src you can add a button alongside the generated page called "print mode" that takes the data sticks it in a string and outputs it as plain text ready for printing.. tada.

It does have an ftp server but I dont know and wont be given the login as it is hosted by a large corporate company and we are only given access for ticket printing on the html bit.
 
Hi guys - sorry for late reply, it was manic yesterday!



The site is not mine, it is run by the parent company for us franchises.





It does have an ftp server but I dont know and wont be given the login as it is hosted by a large corporate company and we are only given access for ticket printing on the html bit.

Then surely it's their problem and they should have a system inplace to accomadate different ticket sizes etc, or should be supplying you with the information about how big your tickets should be!!!
 
To be honest i cannot manipulate it without running a script on there servers.

But I agree with madeinbeats you should be able to customize your tickets ?

I will keep thinking though and see what i can come up with but i think the EXCELL method might be the best.... but copying and pasting the code direct ?
 
Back
Top