Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default 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">&nbsp;</td>
    <td width="55%" height="23">&nbsp;</td>
    <td width="1">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td height="31">&nbsp;</td>
    <td>&nbsp;</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-->&nbsp;</td>
    </tr>
    <tr>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td colspan="3"><!--DWLayoutEmptyCell-->&nbsp;</td>
    </tr>
    <tr>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><div align="center"> </div></td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><div align="right"></div></td>
    <td colspan="3"><div align="center"></div></td>
    </tr>
    <tr>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><div align="center"> </div></td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><div align="right"></div></td>
    <td colspan="3"><!--DWLayoutEmptyCell-->&nbsp;</td>
    </tr>
    <tr>
    <td height="27"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><div align="center"> </div></td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</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-->&nbsp;</td>
    <td><div align="center">#getcustomer.FirstName# <cfif
    #getcustomer.LastName# is NOT "N/A">#getcustomer.LastName#</cfif> </div></td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><div align="center">#getservicecall.JobPhone#</div></td>
    <td colspan="3"><div
    align="left">#getservicecall.CustomerOrderNumber#</div></td>
    </tr>
    <tr>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td height="26"><div align="center">#getcustomer.Address1#</div></td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</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-->&nbsp;</td>
    <td height="26" valign="top"><div align="center">ApptTime:
    #getservicecall.ApptTime# </div></td>
    <td valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="3" valign="bottom"><div
    align="left">#DateFormat(getservicecall.StartDate, "mm/dd/yyyy")#</div></td>
    </tr>
    <tr>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td nowrap><div align="left"></div></td>
    <td colspan="3" nowrap><!--DWLayoutEmptyCell-->&nbsp;</td>
    </tr>
    <tr>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td height="23"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td nowrap><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td colspan="3" nowrap><!--DWLayoutEmptyCell-->&nbsp;</td>
    </tr>
    <tr>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td height="23"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td nowrap><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td colspan="3" nowrap><!--DWLayoutEmptyCell-->&nbsp;</td>
    </tr>
    <tr>
    <td rowspan="2" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td rowspan="2" valign="top">#getservicecall.TechNotes#</td>
    <td rowspan="2" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td height="178" colspan="4"
    valign="top">#getservicecall.WorkDescription#</td>
    </tr>
    <tr><td height="92">&nbsp;</td>
    <td width="10" colspan="2"><!--DWLayoutEmptyCell-->&nbsp; </td>
    <td width="5"><!--DWLayoutEmptyCell-->&nbsp;</td>
    </tr>
    <tr>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td height="23"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</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-->&nbsp;</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</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-->&nbsp;</td>
    </tr><tr>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><div align="left">EmergencyCall: #gsc.ec#</div></td>
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td colspan="2"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    </tr>
    <tr>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td colspan="2"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    </tr>
    <tr>
    <td valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td height="34" valign="top">Status: #getservicecall.Status#</td>
    <td valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td colspan="2"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    </tr>
    <tr>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><div align="center">#getcustomer.FirstName#
    #getcustomer.LastName#</div></td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td colspan="2"><div align="right">#NumberFormat(total.labor,
    '________.__')#</div></td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    </tr>
    <tr>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td height="26" valign="bottom"><div
    align="center">#DateFormat(getservicecall.DateOrde red, "mm/dd/yyyy")#</div></td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td colspan="2" valign="bottom"><div
    align="right">#NumberFormat(total.mat, '________.__')#</div></td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    </tr>
    <tr>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td height="28"><div
    align="center">#DateFormat(getservicecall.DateComp leted,
    "mm/dd/yyyy")#</div></td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td colspan="2"><div align="right">#NumberFormat(total.misc,
    '________.__')#</div></td>
    <td><!--DWLayoutEmptyCell-->&nbsp;</td>
    </tr>
    <tr>
    <td><!--DWLayout
    alexreyenga Guest

  2. Similar Questions and Discussions

    1. 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...
    2. Write into <HEAD></HEAD> section?
      Is it possible to write into HEAD section, for example to write out a LINK tag?
    3. [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...
    4. Using Head Tags
      may have something to do with the 5 refresh tags there, the first of which is <meta http-equiv="Refresh"...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139