You are here: Re: cross platform problem - advice needed « All PHP « IT news, forums, messages
Re: cross platform problem - advice needed

Posted by Gleep on 07/31/06 16:39

Unless it's absolutley neccesary, don't bother giving this much contorl to users for a report.
Really think if is't worth the hassle.

I suggest give the users maybe 3 or 4 templates to pick from, possibly show a picture of example
report they pick the template then select and the data is 'replaced' with your template. Here is a
example of what I do.

first make your report templates - make it elaborate as needed with css whatever...
this is just one simple sample

save this as template1.html

<html>
<head></head>
<body>
Thank you for signing up, %%name%%! <br>
Company: %%companyName%% <br>
Email: %%email%% <br>
Phone: %%phone%% <p>
Event: %%title%%, %%grpdate%% <p>
Description: <br> %%data%% <p>
Time & Location: %%time%%, %%location%% <p>
Content goes here: %%content%% <p>
Sincerely,<br>
The Team<p>
</body></html>


on another page give them a choice to select a template and do a content replacement...

// after a user selects a template and submits form here is code replacement example...
if (isset($_POST["submit"]){
$report = $_POST['report'];
...... blah blah other code here as needed
// at this point generate the content variables with query
$name = $data['name'];
$companyName = $data['companyName'];
$password = $data['password'];
$email = $data['email'];
$phone = $data['phone'];
$data = $data['data'];

if($report=='1') $message = implode(file("template1.html"));
if($report=='2') $message = implode(file("template2.html"));
if($report=='3') $message = implode(file("template3.html"));

$message = str_replace("%%companyName%%", $companyName, $message);
$message = str_replace("%%name%%", $name, $message);
$message = str_replace("%%password%%", $password, $message );
$message = str_replace("%%phone%%", $phone, $message );
$message = str_replace("%%data%%", $data, $message );
}


the above is just an example to follow. From there you can email the entire doc, display on
screen, or make it a pdf doc look into html 2 pdf at sourgeforge

Note you don't have to use %%somevalue%% it can be anything
~somevalue~


Good Luck


On Mon, 31 Jul 2006 13:55:33 GMT, "Ian Davies" <ian.dandav@virgin.net> wrote:

>Hello
>I would appreciate some help from someone who has knowledge of working with
>css, php javascript and how they interact.
>Ive been working on a task for the last few days and have started to hit a
>brick wall. I need general advice on whether I m tackling the problem the
>correct way and some solutions for my current problems
>
>Ive posted my project below where ive detailed the current problems im
>having
>http://www.iddsoftware.co.uk/test.php
>
>in short im trying to allow my users to take their records from my database
>and arrange them dynamically on a web page into custom reports. which they
>can them print directly or download into something like Word
>
>Hope you can help as that brick wall is looming
>
>Ian
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация