massiws,
Do you want to send me a copy to info@nubuilder.com and I'll take a look?
Steven
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Print data from mash subform
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact:
Re: Print data from mash subform
massiws,
When the print button runs all carriage returns are (for various reasons) being removed from Before Browse.
So because you started with a comment, everything got commented out and no php got run.
To make it work I have just closed off each comment.
Steven
When the print button runs all carriage returns are (for various reasons) being removed from Before Browse.
So because you started with a comment, everything got commented out and no php got run.
To make it work I have just closed off each comment.
Code: Select all
/* Create a temp table with all appointments NOT-CLOSED and add a column with technician names */
$sql = "CREATE TABLE #browseTable#";
$sql .= " SELECT * FROM appointment INNER JOIN (request, appointment_status, client)";
$sql .= " ON (app_req_id = req_id AND app_aps_id = aps_id AND req_cli_id = cli_id)";
$sql .= " WHERE app_aps_id <> '1504808820c931' AND app_aps_id <> '1504808787a1a9'";
nuDebug('run1-> '.$sql);
nuRunQuery($sql);
/* Add a column to temp table*/
$sql = "ALTER TABLE #browseTable# ADD tecnici VARCHAR(250) NOT NULL";
/*nuDebug('run2-> '.$sql);*/
nuRunQuery($sql);
/* Work on temp table*/
$sql = "SELECT * FROM #browseTable#";
/*nuDebug('run3-> '.$sql);*/
$rs = nuRunQuery($sql);
/* get technicians related to each appointment*/
while ($row = db_fetch_object($rs)) {
$appID = $row->app_id; /* get appointment ID*/
$tecnici = getTechnician($appID); /* get technician from DB*/
$tecnici = $tecnici[0]; /* get only names*/
/* Update temp table with technician names*/
$sql = "UPDATE #browseTable# SET tecnici = '".$tecnici."' WHERE app_id = '".$appID."'";
/*nuDebug('run4-> '.$sql);*/
nuRunQuery($sql);
}
Steven
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact:
Re: Print data from mash subform
Steven,
it works!
I suggest to mention this procedure in related wiki pages.
Thank you.
it works!
I suggest to mention this procedure in related wiki pages.
Thank you.
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact: