SearchSearch   ProfileProfile   Log inLog in   RegisterRegister 

Slip Printing to A4
Goto page 1, 2  Next
 
Post new topic   Reply to topic    FirstSpot Forum Index -> Pre-sales Support Forum
View previous topic :: View next topic  
Author Message
scottyp



Joined: 12 Jan 2009
Posts: 18

PostPosted: Mon Jan 12, 2009 11:47 pm    
Post subject: Slip Printing to A4

Is it possible to print the bulk usernames and passwords to A4 paper?

Thanks! Very Happy
Back to top
alan
Forum facilitator


Joined: 26 Sep 2003
Posts: 4435

PostPosted: Tue Jan 13, 2009 4:08 am    
Post subject:

See http://patronsoft.com/forum/viewtopic.php?t=2335
_________________
~ Patronsoft Limited ~
Back to top
scottyp



Joined: 12 Jan 2009
Posts: 18

PostPosted: Tue Jan 13, 2009 12:21 pm    
Post subject:

Thanks again Alan.

That isn't really what I am after though, as coffee shop owners aren't really very good at dealing with .csv files etc. Very Happy

You mentioned in this post a while back that I found:
http://www.patronsoft.com/forum/viewtopic.php?t=2069&highlight=slip+different

- that this may be something you would look at - have you had a chance to further investigate this?

Also, I am looking at having a solution based on your '3rd network Topology', but with completely unrelated businesses at the end of each network segment connecting back across a WAN. As such, I want the staff at each site (which is a unique business) to generate and print their own Bulk Tickets, with the 'Header' and 'Footer' text reflecting their business name etc. This needs to be as simple as possible.

I intend to give each site an operator login that only allows them to see the "bulk Account' page for this purpose - perfect so far in FirstSpot.

My question is - is there a way to pre-populate the 'Header' and 'Footer text fields on the Bulk Accounts page, based on the operator account that is logging in to create them at the time.

IE. Operator code 'AAA' for 'CAFE One' logs in, and the Header and FOoter are already filled out with (eg.)'Welcome to Cafe One' etc (Based on a 'one time' config that was setup perhaps when the operator account was created?) - not long after Someone at 'Cafe Two' logs in with their operator code 'BBB' to create a Bulk set of slips, and the page pre-populates the Header and footer fields with 'Welcome to Cafe Two' etc.

Actually, if the Bulk Slip text could be defined during operator account creation, then also a pre-configured 'default' 'Plan' as a selection would be fantastic too.

With this functionality, and the A4 printing ability, FirstSpot with fulfill my requirements 100% Cool

Thanks again Alan.
Back to top
dominic
Forum facilitator


Joined: 23 Oct 2007
Posts: 103

PostPosted: Wed Jan 14, 2009 11:40 am    
Post subject:

First, you need to make copies of slip.php in FirstSpot\cfgmgr (e.g. slip1.php for Cafe One and slip2.php for Cafe Two).

Then, open settingok.php and search for "slip.php" (not include the two outer "), replace the line with the following:
Code:
if ($_SESSION["operator"] == 'AAA') {
   include_once("slip1.php");
} else if ($_SESSION["operator"] == 'BBB')
   include_once("slip2.php");
} else {
   include_once("slip.php");
}


For every slipX.php, search for ""+pTitle+"" (not include the two outer "). This is the header string variable. Replace it with your title, e.g. "Welcome to Cafe One" (not include the two outer ").
Search for ""+pEnd+"" (not include the two outer "). This is the footer string variable. Replace it with the text you prefer.
Back to top
scottyp



Joined: 12 Jan 2009
Posts: 18

PostPosted: Wed Jan 14, 2009 8:16 pm    
Post subject:

Fantastic!

Thanks very much Very Happy
Back to top
scottyp



Joined: 12 Jan 2009
Posts: 18

PostPosted: Thu Jan 15, 2009 12:35 am    
Post subject:

Dominic - I assume it is in the same .php file that I can remove a couple of the lines, such as 'Account will bind to first login MAC address' and 'Real IP address will be assigned' ?
And can I also modify the 'Prefix' based on the Opertor that is logged in?

Thanks again for your time.
Back to top
scottyp



Joined: 12 Jan 2009
Posts: 18

PostPosted: Thu Jan 15, 2009 12:44 am    
Post subject:

Hi Dominic,
I have added that code into the various .php files, but when I log in as the user, it simply (still) displays the last text that was used in the Title and End fields.

I'm wondering if the syntax is the issue - are the } characters 'remarks', which should be on their own line?

Since I made the changes, if I try to reset the Users password, when I hit the 'Save' button, I get a 'Parse Error' in the settingOK.php file on line 3819

I am only using MS Notepad to edit the .php files.

Cheers.
Scott
Back to top
dominic
Forum facilitator


Joined: 23 Oct 2007
Posts: 103

PostPosted: Thu Jan 15, 2009 2:43 am    
Post subject:

It's okay. The title and ending shown in Configuration Manager will be ignored if you use the special operator accounts to make the slips.

Sorry, I missed one {. Here're the correct codes.
Code:
if ($_SESSION["operator"] == 'AAA') {
   include_once("slip1.php");
} else if ($_SESSION["operator"] == 'BBB') {
   include_once("slip2.php");
} else {
   include_once("slip.php");
}
Back to top
dominic
Forum facilitator


Joined: 23 Oct 2007
Posts: 103

PostPosted: Thu Jan 15, 2009 3:53 am    
Post subject:

Remove the lines "Account will bind to first login MAC address" and "Real IP address will be assigned"
In every slipX.php, search for "Bind to first login MAC". Put // at the beginning of the following 3 lines.
You'll see the next line is "//Real IP address mapping". Put // at the beginning of the following 3 lines again.

Modify Prefix based on different operators
Open settingok.php and search for "prefix = '';" (2 single quotes before ;). Add the following codes after that line (assume prefix for Cafe One is aaa and bbb for Cafe Two).
Code:
if ($_SESSION["operator"] == 'AAA') {
    $prefix = 'aaa';
} else if ($_SESSION["operator"] == 'BBB') {
    $prefix = 'bbb';
}
Back to top
scottyp



Joined: 12 Jan 2009
Posts: 18

PostPosted: Fri Jan 16, 2009 5:35 am    
Post subject:

Thanks for your futher help Dominic.

Unfortunately, once I made all those changes and logged into the config. manager, I had the following issues:

1) The prefix, Slip Title and Slip ending were still simply seemingly 'Cached' from the last Slips I printed.

2) When I tried to print a new set of slips, it gave the following 4 error lines briefly on the screen (And then show the slip 'Preview' screen OK)

Notice: Undefined Index; Operator in E:\Program Files\Firstspot\cfgmgr\settingOK.php on line 3667
The the same on line 3669, 3813 abd 3815.

I feel like we're getting close, but not quiet there Smile

Thanks again.
Back to top
dominic
Forum facilitator


Joined: 23 Oct 2007
Posts: 103

PostPosted: Fri Jan 16, 2009 6:20 am    
Post subject:

Seems you wrongly typed "operator" as "Operator" in those 4 lines...
Back to top
scottyp



Joined: 12 Jan 2009
Posts: 18

PostPosted: Fri Jan 16, 2009 6:27 am    
Post subject:

Hi Dominic - that wasn't a cut and paste - it flashes up too quick for that. I had to use a video recorder to record the errors, then pause it ad manually type the errors for you! Very Happy

I've just re-run the error/test and the O in operator in the error line is lowercase, and when I check the php file, it is lowercase there too.

Any other ideas?

P.S. I have pasted the code in exactly as it appears on the forum here, carraige returns and all.

Cheers
Back to top
dominic
Forum facilitator


Joined: 23 Oct 2007
Posts: 103

PostPosted: Fri Jan 16, 2009 11:42 am    
Post subject:

Somehow the session variable "operator" was not found, but I didn't face this during my test.

Try clearing the browser cache, closing the browser before testing again.

If the same problem still occurs, please post clearly your steps to reproduce the problem and the code modifications here exactly.
Back to top
scottyp



Joined: 12 Jan 2009
Posts: 18

PostPosted: Sat Jan 17, 2009 2:19 am    
Post subject:

Hi Dominic.
I tried deleting temp internet files, history etc.etc. from IE 7, then restarted it - but no luck Sad

So, here's what I have done/am doing to get to where I am with this problem:

Here are the main points of my config. on the FirstSpot server-
1) I have ticked the 'Allow Config Manager access from WiFi HotSpot', as this is how I need it to be setup when in production.

2) I have created two new Operators - 'CafeOne' and 'CafeTwo', with a password of 'password' and ONLY the 'Bulk Accounts' option ticked for access.

3) I have created a new 'Plan' in 'Plans' called '15 Minute', which has all settings as default except that I have selected 'Conditions to Suspend this account' with 'When Airtime is used up' set to 15 mins.

When I log in to http://"firstspotserverIPPrivateNIC":5787, I get the login page no worries (I am doing this from a laptop which is on the wireless segment 'external' to the Firstspot server in my test setup(To simulate how I want it to happen when in production).

If I enter 'CafeOne' or 'CafeTwo', with the password, I get sent straight to the 'Bulk Accounts' page now worries, BUT,
- the prefix is always set to 'user'
- the 'Slip Printing Format' is always set to whatever the last set of Slips printed were set to.
-If the 'Slip Printing Format' is set to 'New', the Slip Title and Ending are always set to whatever the previously 'saved' and printed set of Slips were entered as.

Here is the code I changed in the settingok.php file(Along with the previous and following 6 lines for clarity):

$msg = "Number of accounts requested: $rounds<br>";
$msg .= "Number of accounts created: $success_count<br>";
$msg .= "$extra_msg<br>";
$message = "$msg Bulk create account Action Completed.";
$saved = 'true';
$errorlog = '';

if ( $slip_enable)
if ($_SESSION["operator"] == 'CafeOne') {
include_once("slipcafeone.php");
} else if ($_SESSION["operator"] == 'CafeTwo') {
include_once("slipcafetwo.php");
} else {
include_once("slip.php");
}

}
// printing
else if (isset($save_print)&&($save_print=='true'))
{
$cat = 'print';

// get post data

Also, here is the changes I made in the settingok.php file for the Prefix setting( again with a couple of lines which I didn't modify preceding and following the modified code if that helps.)

// init posted parms
if (!isset($prefix))
$prefix = '';
if ($_SESSION["operator"] == 'CafeOne') {
$prefix = 'cafeone';
} else if ($_SESSION["operator"] == 'CafeTwo') {
$prefix = 'cafetwo';

}
if (!isset($middle_digits_start) || ($middle_digits_start == ''))
$middle_digits_start=1;

Finally, here is the code I changed in the slipcafeone.php file as per your instructions earlier (and I did the same in the slipcafetwo.php file):

For the Title:-

// add page break at the beginning if this item is not 1st item in a page, and don't print page break if only 1 user is displayed per page
if ($users_per_page != 1 && ($user_count % $users_per_page != 1) ) {
echo 'contents = contents + "<div></div>\n";';
echo 'contents += "<div>\n"; ';
echo 'contents += " Page break <hr></hr>\n"; ';
echo 'contents += "</div>\n"; ';
}



?>
contents = contents + "<table>\n\n<tr>\n<td><font>&nbsp;"Welcome to Cafe One"</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>\n";
contents = contents + "\n\n<tr>\n<td>";
contents = contents + "<FIELDSET><LEGEND><font><get_cm_var></font></LEGEND>";
contents = contents + "<table>\n\n<tr>\n<td><font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<get_cm_var><font>" + "<user_info>" + "</font></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>\n";
contents = contents + "\n<tr><td><font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<get_cm_var><font>" + "<user_info>" + "</font></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>";
contents = contents + "</table></FIELDSET></td></tr>";


And the Ending--------------------------------------------------------------------------------------------------------------------

if ($num_pages>1){
echo 'contents += "<div>\n"; ';
echo "contents += '<table><tr><td><fieldset>Page '; ";
for ($i=1; $i</a>


// contents = contents + "<table>\n\n<tr>\n<td><font>&nbsp;"We hope you enjoyed your visit"</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>\n";
contents = contents + "<table>\n\n";
contents = contents + "\n\n<tr>\n<td><div><input>\n&nbsp;&nbsp;<input>\n&nbsp;&nbsp; <input></div></td>\n</tr>\n\n";
contents = contents + "</table>\n";
contents = contents + "</body>\n</html>";


Finally, here is the MAC and Real IP changes I also made in slipcafeone.php:

//Bind to first login MAC
//if(isset($user_info['macmap'])) {
//echo "contents = contents + \"\\n\\n<tr><td><font><strong>•</strong>&nbsp;".$lang['setcfg_users_popup_slip_macmap']."</font></td></tr>\";";
//}
//Real IP address mapping
//if(isset($user_info['ipmap'])) {
//echo "contents = contents + \"\\n\\n<tr><td><font><strong>•</strong>&nbsp;".$lang['setcfg_users_popup_slip_ipmap']."</font></td></tr>\";";
//}


I hope this helps Smile
Back to top
dominic
Forum facilitator


Joined: 23 Oct 2007
Posts: 103

PostPosted: Mon Jan 19, 2009 4:06 am    
Post subject:

Problems are found in your modifications in slipcafexxx.php.

Replace the whole line with title "Welcome to Cafe One" with this.
Code:
contents = contents + "<table>\n\n<tr>\n<td><font>&nbsp;Welcome to Cafe One</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>\n";


Also, the endling line to be modified is not the one you've done with. The correct one should be about 20 lines upper.
Please find out the line shown in red and replace with the line in the following code section. For the original line you modified, just ignore it.

}
// Recurring Monday Tuesday..
if(isset($user_info['recurring1'])) {
echo "contents = contents + \"\\n\\n<tr><td><font><strong>•</strong>&nbsp;".$lang['setcfg_users_popup_slip_recurring1']." ".$user_info['recurring1']." ".$lang['setcfg_users_popup_slip_recurring2']."</font></td></tr>\";";
echo "contents = contents + \"\\n\\n<tr><td><font>&nbsp;".$user_info['days_str']."</font></td></tr>\";";
}

echo 'contents += "<tr>\n<td><font>&nbsp;"+pEnd+"</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>\n";';
echo 'contents = contents + "</table>\n\n";';

} // for each user
echo 'contents += "</div>\n";'; // close the last page of <div>

if ($num_pages>1){
echo 'contents += "<div>\n"; ';
echo "contents += '<table><tr><td><fieldset>Page '; ";

Code:
echo 'contents += "<tr>\n<td><font>&nbsp;We hope you enjoyed your visit</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>\n";';


Once again, the fields Prefix, Slip Title and Slip Ending will no longer be referred when creating accounts using the operators Cafexxx. Please ignore them.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    FirstSpot Forum Index -> Pre-sales Support Forum All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group