Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <cffunction name="show_pdf_specs" access="public">
- <cfargument name="product_id" type="string" required="yes">
- <cfargument name="product_category_id" type="string" required="yes">
- <cfquery name="get_profile_id" datasource="#request.dsn#">
- SELECT product_category_id, product_category_specs_profile
- FROM dbo.products_categories
- WHERE (product_category_id = #product_category_id#)
- </cfquery>
- <cfif get_profile_id.product_category_specs_profile neq "">
- <cfquery name="show_product_specs" datasource="#request.dsn#">
- SELECT DISTINCT specs_id, specs_relation_id, profile_id, specs_content_product_id, specs_name, specs_content, specs_name_sp, specs_content_sp, specs_title, specs_relation_order
- FROM dbo.general_specs_table
- WHERE (profile_id = #get_profile_id.product_category_specs_profile#) AND (specs_content_product_id = #product_id#)
- ORDER BY specs_relation_order
- </cfquery>
- <table border="0" cellspacing="0" cellpadding="0">
- <cfset count = 0 />
- <cfset print = 1 />
- <cfoutput query="show_product_specs">
- <cfif specs_content eq "" and specs_title neq 1>
- <cfelse>
- <cfset count = count + 1 />
- <cfif print eq 1>
- <tr>
- </cfif>
- <cfif specs_title eq 1>
- <cfif findnocase('dimension',specs_name)>
- <cfset print = 0 />
- <cfelse>
- <cfset print = 1 />
- </cfif>
- <cfif print eq 1>
- <cfif count eq 1>
- <td width="300" valign="top" style="padding-bottom:3px;">
- <h3>#lang("specs_name")#</h3>
- </td>
- <cfelse>
- <td width="300" style="padding-top:10px;padding-bottom:3px;" valign="top">
- <h3>#lang("specs_name")#</h3>
- </td>
- </cfif>
- </cfif>
- <cfelse>
- <cfif print eq 1>
- <td width="300" valign="top" style="padding-bottom:3px;">
- #lang("specs_name")#
- </td>
- </cfif>
- </cfif>
- <cfif print eq 1>
- <td>
- #lang("specs_content")#
- </td>
- </cfif>
- <cfif print eq 1>
- </tr>
- </cfif>
- </cfif>
- </cfoutput>
- </table>
- </cfif>
- <cfif isdefined("debugg")><cfdump var="#get_profile_id#"></cfif>
- <cfif isdefined("debugg")><cfdump var="#show_product_specs#"></cfif>
- </cffunction>
- <cffunction name="show_pdf_dimensions" access="public">
- <cfargument name="product_id" type="string" required="yes">
- <cfargument name="product_category_id" type="string" required="yes">
- <cfquery name="get_profile_id" datasource="#request.dsn#">
- SELECT product_category_id, product_category_specs_profile
- FROM dbo.products_categories
- WHERE (product_category_id = #product_category_id#)
- </cfquery>
- <cfif get_profile_id.product_category_specs_profile neq "">
- <cfquery name="show_product_specs" datasource="#request.dsn#">
- SELECT DISTINCT specs_id, specs_relation_id, profile_id, specs_content_product_id, specs_name, specs_content, specs_name_sp, specs_content_sp, specs_title, specs_relation_order
- FROM dbo.general_specs_table
- WHERE (profile_id = #get_profile_id.product_category_specs_profile#) AND (specs_content_product_id = #product_id#)
- ORDER BY specs_relation_order
- </cfquery>
- <table border="0" cellspacing="0" cellpadding="0" style="display:none;">
- <cfset count = 0 />
- <cfset print = 0 />
- <cfoutput query="show_product_specs">
- <cfif specs_content eq "" and specs_title neq 1>
- <cfelse>
- <cfset count = count + 1 />
- <cfif specs_title eq 1>
- <cfif findnocase('dimension',specs_name)>
- <cfset print = 1 />
- <cfelse>
- <cfset print = 0 />
- </cfif>
- <cfif print eq 1>
- <cfif count eq 1>
- </table>
- <table border="0" cellspacing="0" cellpadding="0" style="float:left;margin-right:20px;display:block;">
- <tr>
- <td width="200" valign="top" style="padding-bottom:3px;">
- <h3 style="color:##ffffff;">#lang("specs_name")#</h3>
- </td>
- <cfelse>
- </table>
- <table border="0" cellspacing="0" cellpadding="0" style="float:left;margin-right:20px;display:block;">
- <tr>
- <td width="200" style="padding-top:10px;padding-bottom:3px;" valign="top">
- <h3 style="color:##ffffff;">#lang("specs_name")#</h3>
- </td>
- </cfif>
- </cfif>
- <cfelse>
- <cfif print eq 1>
- <tr>
- <td width="200" valign="top" style="padding-bottom:3px; color:##ffffff;">
- #lang("specs_name")#
- </td>
- </cfif>
- </cfif>
- <cfif print eq 1>
- <td style="color:##ffffff;">
- #lang("specs_content")#
- </td>
- </tr>
- </cfif>
- </cfif>
- </cfoutput>
- </cfif>
- <cfif isdefined("debugg")><cfdump var="#get_profile_id#"></cfif>
- <cfif isdefined("debugg")><cfdump var="#show_product_specs#"></cfif>
- </cffunction>
- <cfquery name="product_info" datasource="#request.dsn#">
- select * from view_product_images where product_id = #product_id#
- </cfquery>
- <cfoutput query="product_info">
- <cfdocument format="pdf" unit="cm" orientation="portrait" pagetype="letter" fontembed="no" margintop="0.2" marginbottom="0.2" marginleft="0" marginright="0">
- <style type="text/css">
- body,td,th {
- color: ##333;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 13px;
- }
- h1 {
- font-size:42px;
- color:##b2006b;
- font-weight:bold;
- margin:0;
- }
- h2 {
- font-size:28px;
- color:##b2006b;
- font-weight:normal;
- margin:0;
- }
- h3 {
- font-size:13px;
- color:##b2006b;
- font-weight:bold;
- margin:0;
- padding:0;
- text-transform:uppercase;
- }
- .specs {
- color:##333;
- }
- .footer {
- color:##FFF;
- background-color:##2d2b2c;
- width:80px;
- padding:3px;
- }
- </style>
- <div style="float:left;width:840px;">
- <table width="840" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <table width="840" cellpadding="0" cellspacing="0" style="background-color:##D7D8DA;">
- <tr>
- <td style="padding:40px 40px 55px 40px;">
- <div style="border-bottom:2px dashed ##b2006b;padding-bottom:14px;">
- <h1>#get_product_name(product_id)#</h1>
- <h2>#product_model#</h2>
- </div>
- </td>
- </tr>
- <tr>
- <td style="padding:0px 40px 100px 40px;">
- <table border="0" cellpadding="0" cellspacing="0" width="760">
- <tr>
- <td width="387" valign="top">
- <div style="width:384px;background-color:##ffffff;border:2px solid ##b2006b;height:475px;text-align:center;display:table-cell;vertical-align:middle;">
- <img src="#product_path_images#thumbnail.jpg" />
- </div>
- </td>
- <td width="373" valign="top">
- <div style="width:349px;padding-left:24px;">
- #show_pdf_specs(product_id,product_category_id)#
- </div>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <table width="840" cellpadding="0" cellspacing="0" style="background-color:##444444;">
- <tr>
- <td style="padding:20px 200px 20px 40px; color:##ffffff;">
- #show_pdf_dimensions(product_id,product_category_id)#
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </div>
- </cfdocument>
- </cfoutput>
Add Comment
Please, Sign In to add comment