CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Output from CCS to XML

Print topic Send  topic

Author Message
amfonline

Posts: 7
Posted: 04/30/2007, 6:11 AM

I need to create a file containing the following XML from my CCS form using a MySQL database. When the user clicks a "generate graphs" button, I will then open an html page with an embedded graph using this xml data. The variables are bolded for ease of understanding. I need to find out how to start - where do I include this in my form, how do I use php to get my output to look like this, etc. Yes, I am pretty new to this part of the process, I am very used to databases and database design though.

general example tables etc. The VALUES in the xml are summary from the SQL based on the criteria the user has filtered for. Let's say this is a search form.
host: dev_machine
user: sess_user
password: pword
table: lean_data
fields: customer, production_line, date_time_effective, good pieces

I tried to keep this basic - just enough to get started. I have a ton of these I want to do, I just need help getting going on it.

<?xml version="1.0" encoding="utf-8" ?>
- <graph>
<general_settings bg_color="FFFFFF" show_background_side="1" background_side_color="F0E7E2" floor_color="F0E7E2" />
<header text="Production by Line and Customer" font="Verdana" color="000000" size="18" />
<subheader text="From 4/1/2007 through 4/30/2007" font="Verdana" color="000000" size="15" />
<legend_popup font="Verdana" bgcolor="FFFFE3" font_size="10" />
<Xheaders rotate="0" color="000000" size="10" title="Production Line" title_color="000000" />
<Yheaders color="000000" size="10" title="Good Pieces" title_rotate="90" title_color="000000" />
<grid groove="1" grid_width="550" grid_height="225" grid_color="000000" grid_alpha="40" grid_thickness="1" />
<bars view_value="1" width="40" thickness="15" space="3" alpha="100" pieces_grow_bar="30" />
- <data>
- <categorie name="Line 1">
<subcategorie name="DCX" value="12525" color="084CB3" />
<subcategorie name="Ford" value="13250" color="67C209" alpha="100" />
<subcategorie name="GM" value="4500" color="FFA60C" />
<subcategorie name="Toyota" value="1500" color="FF0000" />
</categorie>
- <categorie name="Line 2">
<subcategorie name="DCX" value="1525" color="084CB3" />
<subcategorie name="Ford" value="14550" color="67C209" alpha="100" />
<subcategorie name="Toyota" value="10500" color="FF0000" />
</categorie>
- <categorie name="Line 3">
<subcategorie name="DCX" value="10900" color="084CB3" />
<subcategorie name="GM" value="14500" color="FFA60C" />
<subcategorie name="Toyota" value="1500" color="FF0000" />
</categorie>
- <categorie name="Line 4">
<subcategorie name="Ford" value="8249" color="67C209" alpha="100" />
<subcategorie name="GM" value="7250" color="FFA60C" />
<subcategorie name="Toyota" value="18495" color="FF0000" />
</categorie>
</data>
</graph>

// end of code

TIA
Angela.
View profile  Send private message
lwismanuel


Posts: 39
Posted: 05/01/2007, 9:04 AM

Build the form to retrieve the data from the database, then go to the html view and remove all the html tags (except for the labels generated by the wizard. e.g. {label1}).
Then recreate the template just like below:

Quote :
<?xml version="1.0" encoding="utf-8" ?>
- <graph>
<general_settings bg_color="FFFFFF" show_background_side="1" background_side_color="F0E7E2" floor_color="F0E7E2" />
<header text="Production by Line and Customer" font="Verdana" color="000000" size="18" />
<subheader text="From {start_date} through {end_date}" font="Verdana" color="000000" size="15" />
<legend_popup font="Verdana" bgcolor="FFFFE3" font_size="10" />
<Xheaders rotate="0" color="000000" size="10" title="Production Line" title_color="000000" />
<Yheaders color="000000" size="10" title="Good Pieces" title_rotate="90" title_color="000000" />
<grid groove="1" grid_width="550" grid_height="225" grid_color="000000" grid_alpha="40" grid_thickness="1" />
<bars view_value="1" width="40" thickness="15" space="3" alpha="100" pieces_grow_bar="30" />
- <data>
- <categorie name="{Line_no}">
<subcategorie name="{Maker}" value="{Value}" color="084CB3" />
<subcategorie name="{Maker}" value="{Value}" color="67C209" alpha="100" />
<subcategorie name="{Maker}" value="{Value}" color="FFA60C" />
<subcategorie name="{Maker}" value="{Value}" color="FF0000" />
</categorie>
- <categorie name="{Line_no}">
<subcategorie name="{Maker}" value="{Value}" color="084CB3" />
<subcategorie name="{Maker}" value="{Value}" color="67C209" alpha="100" />
<subcategorie name="{Maker}" value="{Value}" color="FF0000" />
</categorie>
- <categorie name="{Line_no}">
<subcategorie name="{Maker}" value="{Value}" color="084CB3" />
<subcategorie name="{Maker}" value="{Value}" color="FFA60C" />
<subcategorie name="{Maker}" value="{Value}" color="FF0000" />
</categorie>
- <categorie name="{Line_no}">
<subcategorie name="{Maker}" value="{Value}" color="67C209" alpha="100" />
<subcategorie name="{Maker}" value="{Value}" color="FFA60C" />
<subcategorie name="{Maker}" value="{Value}" color="FF0000" />
</categorie>
</data>
</graph>

Make sure that the encoding is utf-8 for that page.
View profile  Send private message
amfonline

Posts: 7
Posted: 05/01/2007, 2:44 PM

Thank you very much for the response. I would have spent more time trying to work through it if I didn't have such a tight deadline (model due tomorrow).

I do have a question, though - were is the output to file name?

Thanks again,
Angela.

Quote lwismanuel:
Build the form to retrieve the data from the database, then go to the html view and remove all the html tags (except for the labels generated by the wizard. e.g. {label1}).
Then recreate the template just like below:

Quote :
<?xml version="1.0" encoding="utf-8" ?>
- <graph>
<general_settings bg_color="FFFFFF" show_background_side="1" background_side_color="F0E7E2" floor_color="F0E7E2" />
<header text="Production by Line and Customer" font="Verdana" color="000000" size="18" />
<subheader text="From {start_date} through {end_date}" font="Verdana" color="000000" size="15" />
<legend_popup font="Verdana" bgcolor="FFFFE3" font_size="10" />
<Xheaders rotate="0" color="000000" size="10" title="Production Line" title_color="000000" />
<Yheaders color="000000" size="10" title="Good Pieces" title_rotate="90" title_color="000000" />
<grid groove="1" grid_width="550" grid_height="225" grid_color="000000" grid_alpha="40" grid_thickness="1" />
<bars view_value="1" width="40" thickness="15" space="3" alpha="100" pieces_grow_bar="30" />
- <data>
- <categorie name="{Line_no}">
<subcategorie name="{Maker}" value="{Value}" color="084CB3" />
<subcategorie name="{Maker}" value="{Value}" color="67C209" alpha="100" />
<subcategorie name="{Maker}" value="{Value}" color="FFA60C" />
<subcategorie name="{Maker}" value="{Value}" color="FF0000" />
</categorie>
- <categorie name="{Line_no}">
<subcategorie name="{Maker}" value="{Value}" color="084CB3" />
<subcategorie name="{Maker}" value="{Value}" color="67C209" alpha="100" />
<subcategorie name="{Maker}" value="{Value}" color="FF0000" />
</categorie>
- <categorie name="{Line_no}">
<subcategorie name="{Maker}" value="{Value}" color="084CB3" />
<subcategorie name="{Maker}" value="{Value}" color="FFA60C" />
<subcategorie name="{Maker}" value="{Value}" color="FF0000" />
</categorie>
- <categorie name="{Line_no}">
<subcategorie name="{Maker}" value="{Value}" color="67C209" alpha="100" />
<subcategorie name="{Maker}" value="{Value}" color="FFA60C" />
<subcategorie name="{Maker}" value="{Value}" color="FF0000" />
</categorie>
</data>
</graph>

Make sure that the encoding is utf-8 for that page.
View profile  Send private message
cclooksgood

Posts: 48
Posted: 07/17/2007, 2:27 PM

Did this work? I need to do the samething...>Flash file expecting xml file.....XML file looks like this....

<gallery>
<!-- The line below sets the path to the folder where the images are stored -->
<setup path="images/">
<!-- The the following lines are used to customize the look of the gallery -->
<imgWidth>470</imgWidth>
<imgHeight>300</imgHeight>
<thumbWidth>50</thumbWidth>
<thumbHeight>40</thumbHeight>
<transitionType>fade</transitionType>
<thumbnailRows>3</thumbnailRows>
<thumbPosition>bottom</thumbPosition>
<captionPosition>top</captionPosition>
<showControls>true</showControls>
</setup>
<!-- The following lines set the names of your images and thumbnails -->
<item>
<thumb>t6.jpg</thumb>
<img>6.jpg</img>
<caption>Giraffe! - Easily add captions using the event method and an XML file!</caption>
</item>
<item>
<thumb>t12.jpg</thumb>
<img>12.jpg</img>
<caption>A pair of parrots, click the large image to learn more</caption>
</item>
<item>
<thumb>t11.jpg</thumb>
<img>11.jpg</img>
<caption>Playing pandas, click the large image to learn more</caption>
</item>
<item>
<thumb>t2.jpg</thumb>
<img>2.jpg</img>
<caption>Monkey</caption>
</item>
<item>
<thumb>t15.jpg</thumb>
<img>15.jpg</img>
<caption>Spider</caption>
</item>
<item>
<thumb>t3.jpg</thumb>
<img>3.jpg</img>
<caption>Butterflies</caption>
</item>
<item>
<thumb>t4.jpg</thumb>
<img>4.jpg</img>
<caption>One Camel, two humps.</caption>
</item>

<item>
<thumb>t5.jpg</thumb>
<img>5.jpg</img>
<caption>Lying Lion</caption>
</item>
<item>
<thumb>t1.jpg</thumb>
<img>1.jpg</img>
<caption>More monkeys</caption>
</item>
<item>
<thumb>t7.jpg</thumb>
<img>7.jpg</img>
<caption>A goat ate my shoe</caption>
</item>

<item>
<thumb>t8.jpg</thumb>
<img>8.jpg</img>
<caption>A horse of course</caption>
</item>
<item>
<thumb>t9.jpg</thumb>
<img>9.jpg</img>
<caption>Shoe Fly!</caption>
</item>
<item>
<thumb>t10.jpg</thumb>
<img>10.jpg</img>
<caption>Where did I leave my iPod?</caption>
</item>
</gallery>


I store both the img and thumb path......
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.