Ask a Question related to Coldfusion Database Access, Design and Development.
-
alexreyenga #1
In over my head
I had somone start a site for me and now I'm trying to finish it. The site
currently deals with apointments and work orders for my computer repair
business. I'm trying to add functionality for dealing with inventory that will
be sold to clients on site. I just feel like im going about things wrong. I
need somone to help me lay out an overview plan on how to add this
functionality into the site and then I need a mentor on how to implement
advanced functions. To give an idea on what I am able to do, I did create this
page that will print out invoices. For security, I have removed all the
usernames and passwords listed.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<title>PC Doctor Invoice</title>
<cfparam name="Cookie.AccessLevel" default="0">
<cfquery name="getmenu" datasource="" username="" password="">
SELECT *
FROM Menu
<cfif #Cookie.AccessLevel# eq "0">
WHERE AccessLevel = 0
<cfelse>
WHERE AccessLevel between 0 and <cfoutput>#Cookie.AccessLevel#</cfoutput>
</cfif>
</cfquery>
<cfquery name="getservicecall" datasource="" username="" password="">
SELECT *
FROM ServiceCalls
WHERE ServiceCalls.ServiceCallID = #URL.ServiceCallID#
</cfquery>
<cfquery name="gettech" datasource="bapcdr" username="r" password="">
SELECT *
FROM Technicians
WHERE TechID = #getservicecall.TechID#
</cfquery>
<cfquery name="getby" datasource="bapcdr" username="" password="">
SELECT *
FROM Technicians
WHERE TechID = #getservicecall.OrderTakenBy#
</cfquery>
<cfquery name="getcustomer" datasource="bapcdr" username="" password="">
SELECT *
FROM Customers
WHERE CustomerID = #getservicecall.CustomerID#
</cfquery>
<cfif Cookie.AccessLevel greater than "5">
<cfdocument format="pdf"
pagetype="letter"
marginleft = "0.0"
marginright = "0.0"
marginbottom = "0.0"
fontembed="yes"
margintop="0.0"
backgroundvisible="yes"<style type="text/css">body {>
background-image: url([url]http://www.voicecrystal.com/art/invoice4-4.gif);[/url]
}
</style>
<cfset total.mat = 0>
<cfset total.misc = 0>
<cfset tax = 0>
<cfset subtotal = 0>
<cfset grand.total = 0>
<cfset esc = 0>
<cfset x = 90>
<cfset gsc.daor = getservicecall.DateOrdered>
<cfset gsc.tl = getservicecall.TotalLabor>
<cfset gsc.ec = getservicecall.EmergencyCall>
<cfset y = getservicecall.TotalLabor * x>
if (getservicecall.EmergencyCall("No")) cfset z = 0;
if (getservicecall.EmergencyCall("Yes")) cfset esc =
getservicecall.TotalLabor;
<cfset esc2 = esc * 120>
<cfset total.labor = y + esc2>
<cfset grand.total = subtotal + tax + total.misc + total.mat + total.labor>
<table width="660" border="0" cellpadding="2" cellspacing="1">
<!--DWLayoutTable-->
<cfoutput query="getservicecall">
<tr>
<td width="1"> </td>
<td width="55%" height="23"> </td>
<td width="1"> </td>
<td width="10"> </td>
<td colspan="3"> </td>
</tr>
<tr>
<td> </td>
<td height="31"> </td>
<td> </td>
<td valign="bottom"><div align="right" class="style3">
<div align="right">#gettech.FirstName# #gettech.LastName#</div>
</div></td>
<td colspan="3" valign="bottom"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td colspan="3"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td><!--DWLayoutEmptyCell--> </td>
<td><div align="center"> </div></td>
<td><!--DWLayoutEmptyCell--> </td>
<td><div align="right"></div></td>
<td colspan="3"><div align="center"></div></td>
</tr>
<tr>
<td><!--DWLayoutEmptyCell--> </td>
<td><div align="center"> </div></td>
<td><!--DWLayoutEmptyCell--> </td>
<td><div align="right"></div></td>
<td colspan="3"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="27"><!--DWLayoutEmptyCell--> </td>
<td><div align="center"> </div></td>
<td><!--DWLayoutEmptyCell--> </td>
<td valign="top"><div align="center">#DateFormat(gsc.daor,
"mm/dd/yyyy")#</div></td>
<td colspan="3" valign="top"><div align="left">#getby.FirstName#
#getby.LastName#</div></td>
</tr>
<tr>
<td><!--DWLayoutEmptyCell--> </td>
<td><div align="center">#getcustomer.FirstName# <cfif
#getcustomer.LastName# is NOT "N/A">#getcustomer.LastName#</cfif> </div></td>
<td><!--DWLayoutEmptyCell--> </td>
<td><div align="center">#getservicecall.JobPhone#</div></td>
<td colspan="3"><div
align="left">#getservicecall.CustomerOrderNumber#</div></td>
</tr>
<tr>
<td><!--DWLayoutEmptyCell--> </td>
<td height="26"><div align="center">#getcustomer.Address1#</div></td>
<td><!--DWLayoutEmptyCell--> </td>
<td valign="bottom" nowrap><div align="right">#getcustomer.City#
</div></td>
<td colspan="3" valign="bottom" nowrap><div align="left">
#getcustomer.ZipCode#</div></td>
</tr>
<tr>
<td valign="top"><!--DWLayoutEmptyCell--> </td>
<td height="26" valign="top"><div align="center">ApptTime:
#getservicecall.ApptTime# </div></td>
<td valign="top"><!--DWLayoutEmptyCell--> </td>
<td> </td>
<td colspan="3" valign="bottom"><div
align="left">#DateFormat(getservicecall.StartDate, "mm/dd/yyyy")#</div></td>
</tr>
<tr>
<td><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td nowrap><div align="left"></div></td>
<td colspan="3" nowrap><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td><!--DWLayoutEmptyCell--> </td>
<td height="23"><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td nowrap><!--DWLayoutEmptyCell--> </td>
<td colspan="3" nowrap><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td><!--DWLayoutEmptyCell--> </td>
<td height="23"><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td nowrap><!--DWLayoutEmptyCell--> </td>
<td colspan="3" nowrap><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td rowspan="2" valign="top"><!--DWLayoutEmptyCell--> </td>
<td rowspan="2" valign="top">#getservicecall.TechNotes#</td>
<td rowspan="2" valign="top"><!--DWLayoutEmptyCell--> </td>
<td height="178" colspan="4"
valign="top">#getservicecall.WorkDescription#</td>
</tr>
<tr><td height="92"> </td>
<td width="10" colspan="2"><!--DWLayoutEmptyCell--> </td>
<td width="5"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td><!--DWLayoutEmptyCell--> </td>
<td height="23"><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td><div align="right"></div> <div align="right"></div></td>
<td> <div align="left">#gsc.tl#</div></td>
<td><div align="right">#NumberFormat(y, '___________.__')#</div></td>
<td><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td><div align="right"></div> <div align="right"></div></td>
<td><div align="left">#esc#</div></td>
<td><div align="right">#NumberFormat(esc2, '________.__')#</div></td>
<td><!--DWLayoutEmptyCell--> </td>
</tr><tr>
<td><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td><div align="left">EmergencyCall: #gsc.ec#</div></td>
<td colspan="2"> </td>
<td> </td>
</tr>
<tr>
<td><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td colspan="2"><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td colspan="2"><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td valign="top"><!--DWLayoutEmptyCell--> </td>
<td height="34" valign="top">Status: #getservicecall.Status#</td>
<td valign="top"><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td colspan="2"><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td><!--DWLayoutEmptyCell--> </td>
<td><div align="center">#getcustomer.FirstName#
#getcustomer.LastName#</div></td>
<td><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td colspan="2"><div align="right">#NumberFormat(total.labor,
'________.__')#</div></td>
<td><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td><!--DWLayoutEmptyCell--> </td>
<td height="26" valign="bottom"><div
align="center">#DateFormat(getservicecall.DateOrde red, "mm/dd/yyyy")#</div></td>
<td><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td colspan="2" valign="bottom"><div
align="right">#NumberFormat(total.mat, '________.__')#</div></td>
<td><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td><!--DWLayoutEmptyCell--> </td>
<td height="28"><div
align="center">#DateFormat(getservicecall.DateComp leted,
"mm/dd/yyyy")#</div></td>
<td><!--DWLayoutEmptyCell--> </td>
<td><!--DWLayoutEmptyCell--> </td>
<td colspan="2"><div align="right">#NumberFormat(total.misc,
'________.__')#</div></td>
<td><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td><!--DWLayout
alexreyenga Guest
-
head do
:confused; Can neone tell me why this isn't working in mx..........it shows this ! ;" ?> got a feeling the escaping isn't right but it's so... -
Write into <HEAD></HEAD> section?
Is it possible to write into HEAD section, for example to write out a LINK tag? -
[PHP-DEV] [PHP-CVS] cvs: php-src / NEWS /ext/standard basic_functions.c head.c head.h
> As Andi might say: "Why not call this http_headers()?" :) As you can probably guess, my answer to your first question is your second... -
Using Head Tags
may have something to do with the 5 refresh tags there, the first of which is <meta http-equiv="Refresh"... -
Injecting code into the <head></head> section
Hi All, I have a web user control that, among other things, provides Print this page, and Email this page functionality I have this script that... -
MikerRoo #2
Re: In over my head
Hi ?Alex?
If this is business or time critical, you should hire somebody and/or purchase
an off-the shelf system and customize it as needed.
If the above don't apply, then buy one of Ben Forta's excellent books -- it
should get you up to speed nicely.
This site has code and tutorials:
[url]http://www.macromedia.com/cfusion/exchange/index.cfm[/url]
have code and whole applications for free -- or dirt cheap.
Good luck,
-- MikeR
MikerRoo Guest
-
alexreyenga #3
Re: In over my head
Thanks for the advice Mike. I have already revieved some help from here on the
forums where they logged in thru PCAnywhere and helped me with a Updating
Database issue I was having. I think that I I can continue getting help like
this from people from these forums, I could pull this off. So if you, or anyone
else would like to offer me assistance, you can email me at [email]bapcdr@covad.net[/email]
(my email auto checks every 60 seconds), or PM me here, or Message me on ICQ at
834250. Or, heck, you can even call me on my business line at 925-681-0502.
Alex
alexreyenga Guest



Reply With Quote

