473,734 Members | 2,806 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cross platform problem - advice needed

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
Jul 31 '06 #1
28 1947
Ian Davies 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
Javascript ain't my strong point, so I will just think about php and css.

First of all you should have some default starting points, as you already
have. Store those into variables, as $xh1=40;, you will also need to check if
the page has been updated or show for the first time, you can add the

<input name="updated" type="hidden" value="1">

to your form

in your php you will need to make a check something like

if($_REQUEST['updated']==1) {
$xh1=$_REQUEST['xh1'];
} else {
$xh1=40;
}

Then you have your inputs in html

<input name="xh1" class="BodyText " value="<?PHP echo $xh1;>" size="1" type="text">

You should include the css code that handles the location of the text in the
php file, and with usage of php in the same manner that in the input tag, you
will dynamically change the coordinates in the css/style part of the code.

//Aho
Jul 31 '06 #2
Ian Davies wrote:
I would appreciate some help from someone who has knowledge of working with
css, php javascript and how they interact.
They don't - or at least they shouldn't. As far as possible, keep them
separate -- life will be easier that way.

Avoid JavaScript. Just not needed, or useful.

Start by writing SQL to collect the data you're after. Doesn't need to
be done through the web yet, you can easily do this through a SQL
client tool.

Spew your report's content out crudely into some sort of text editor
(maybe copy-and-paste through the SQL client). Now make it into a HTML
document. Don't worry too much looks as yet, just get all the content
you need represented as good clean HTML with meaningful markup and no
attempt at presentation. You don't even need all the data - just a
page or so. Don't be afraid to include data you don't want to appear,
such as repeated header values for each section - we can always hide
them with CSS later.

Now add CSS. Take your boring pure HTML document and add a stylesheet
to it. Revise the HTML as needed, such as by adding classes to get the
presentation control you need. Classes such as "odd" and "even" are
well worth having on rows, even if you're not yet sure you need them.
Then do some little extras with a print media stylesheet to make sure
it prints well (text sizes in points, maybe some extra headers,
page-break-after: avoid; should already be in there).

Your report should now look and print perfectly. Work on it until it
does.

Only then, convert the HTML document to PHP that calls the SQL. You
should now have a dynamic document with live data and perfect
formatting. Make sure you call .HTMLEncode() where needed, in case
there are entity refeferences etc. needed between database and HTML.
Check that it works and debug as needed.

Jul 31 '06 #3
Ian Davies wrote:
Hello
I would appreciate some help from someone who has knowledge of working with
css, php javascript and how they interact.
PHP doesn't interact with either CSS or Javascript. To PHP, CSS and
Javascript are just strings being written out as part of the web page,
just as they HTML is. To CSS and Javascript, PHP doesn't exist, since
they operate only within the browser, and the browser only knows what's
on the HTML page it has been sent, and nothing about the programming
used to generate and send that page.

By the way, please do not post questions to six different groups. It
isn't necessary and annoys people who read multiple groups. One or two
of these would probably have been sufficient.
Jul 31 '06 #4
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("t emplate1.html") );
if($report=='2' ) $message = implode(file("t emplate2.html") );
if($report=='3' ) $message = implode(file("t emplate3.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" <ia********@vir gin.netwrote:
>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
Jul 31 '06 #5
Some useful tips Gleep that I can use somewhere else
Unfortunately I do need this level of flexibility wher euser creates their
own report as there will be large variations between users.
Thanks for the feedback
"Gleep" <Gl***@Gleep.co mwrote in message
news:2u******** *************** *********@4ax.c om...
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("t emplate1.html") );
if($report=='2' ) $message = implode(file("t emplate2.html") );
if($report=='3' ) $message = implode(file("t emplate3.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" <ia********@vir gin.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

Jul 31 '06 #6
Thanks for your response Aho

First of all you should have some default starting points, as you already
have. Store those into variables, as $xh1=40;, you will also need to check
if
the page has been updated or show for the first time, you can add the

<input name="updated" type="hidden" value="1">

to your form

How will this value =1
remain. wont it disapear when the browser is closed. meaning that if the
user visits again it will not remember him? or have I missuderstood?

in your php you will need to make a check something like

if($_REQUEST['updated']==1) {
$xh1=$_REQUEST['xh1'];
} else {
$xh1=40;
}

Then you have your inputs in html

<input name="xh1" class="BodyText " value="<?PHP echo $xh1;>" size="1"
type="text">
>
You should include the css code that handles the location of the text in
the
php file, and with usage of php in the same manner that in the input tag,
you
will dynamically change the coordinates in the css/style part of the code.
This last bit sounds interesting, but Im not clear what you mean? Do you
know how to retreive the coordinates of the position the user dragged the
text to and put them in the text boxes? The drag bit of the code I used was
taken from elswhere and my java script isnt up to much. What I really whish
to do is to have the text boxes update continuously as te text is dragged so
that it is constantly displaying the new coordinated.

Jul 31 '06 #7
By the way, please do not post questions to six different groups. It

I know
but is wasnt a specific question so the greater the postings in relevant
groups would increase the chanceof a solution.

isn't necessary and annoys people who read multiple groups. One or two
They'll live :)



Jul 31 '06 #8
On Mon, 31 Jul 2006 09:39:40 -0700, Gleep <Gl***@Gleep.co mwrote:
>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>
Please don't do this.

1. The HTML markup is poor. No DTD and it's not even valid HTML.

2. There's no need to do this. Half-decent HTML and CSS will provide
just as much flexibility, without having to change the page generation
at all.

3. If you must use templating in HTML, then you can do better markers
than "%%title%%"
Jul 31 '06 #9
Ian Davies wrote:
>>By the way, please do not post questions to six different groups. It


I know
but is wasnt a specific question so the greater the postings in relevant
groups would increase the chanceof a solution.
>>isn't necessary and annoys people who read multiple groups. One or two


They'll live :)


But many of them won't answer your questions.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jul 31 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1843
by: Karsten | last post by:
Hi I'm a really a new with this cross platform development, so I have some dumb questions, which I hope you can help me with. If there is a better newsgroup for this question, please point me to it.
7
4841
by: Web Master | last post by:
Are there any good websites or books that deal with cross platform XML? I'd like to target Internet Explorer/Netscape Navigator 5 or later, as well as Opera, possibly konqueror on Linux as well. OT: I'm also looking for books and websites for cross platform XHTML and DHTML.
22
2467
by: Trammel | last post by:
Hi, I am here to request support from anyone that has idea's on cross-browser HTML (Mainly Firefox and IE). My personal website http://trammel.no-ip.info works fine on Firefox but IE decides to crush the left table (ingnoring that there is no breakable spaces). I tried using nowrap already and IE still forces a wrap of the text in the menu... thats why I tried using non-breaking spaces instead of normal ones... so there was nowhere to...
35
5506
by: Alex Martelli | last post by:
Having fixed a memory leak (not the leak of a Python reference, some other stuff I wasn't properly freeing in certain cases) in a C-coded extension I maintain, I need a way to test that the leak is indeed fixed. Being in a hurry, I originally used a q&d hack...: if sys.platform in ('linux2', 'darwin'): def _memsize(): """ this function tries to return a measurement of how much memory this process is consuming, in some arbitrary unit...
27
1251
by: Ian Davies | last post by:
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...
2
5575
by: maha | last post by:
Dear DB2 experts! I'm stuck with the following issue: from a customer I got a DB2 backup file, created on an AIX-32 machine that I cannot restore on my windows platform. I admit that I posses only limited knowledge on the administration side of DB2, but I have done a lot of research, without solving the problem. What I tried: For a regular RESTORE I would need a linux Big Endian machine
3
2092
by: techtonik | last post by:
Hello, everyb. Does anybody know simple cross-platform method of probing if executable binary is available and launching it. Problem no.1: test if executable file is available I'll take windows platform as the most relevant in this case. os.access() doesn't handle env PATHEXT and can't detect if a given path would be executable or not. Here "executable" means file that
12
3558
by: Acrobatic | last post by:
I'm trying to store user passwords in a MySQL database. I learned the hard way that using MySQL "DECODE" and "ENCODE" doesn't seem to work cross-platform, but if I encrypt on the server side with PHP's md5 function, will it work cross-platform (or cross-processor?) Thank you for any advice
12
2000
by: Tomás Ó hÉilidhe | last post by:
I don't know the first thing about cross-platform GUI programming, so I'd like to ask a few quick questions. Which library is best for someone who appreciates portable programming and correct efficient code, and who'd like the library to fit well with the C++ Standard Library? Also I'd like the library to work on as many platforms as possible (Windows, Linux, Mac, and even the new game consoles such as Playstation 3 and XBox 360 if...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9182
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.