Guest User

Untitled

a guest
Oct 15th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <cffunction name="show_pdf_specs" access="public">
  2.   <cfargument name="product_id" type="string" required="yes">
  3.   <cfargument name="product_category_id" type="string" required="yes">
  4.   <cfquery name="get_profile_id" datasource="#request.dsn#">
  5.     SELECT     product_category_id, product_category_specs_profile
  6.     FROM       dbo.products_categories
  7.     WHERE     (product_category_id = #product_category_id#)
  8.   </cfquery>
  9.   <cfif get_profile_id.product_category_specs_profile neq "">
  10.     <cfquery name="show_product_specs" datasource="#request.dsn#">
  11.       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
  12.       FROM         dbo.general_specs_table
  13.       WHERE     (profile_id = #get_profile_id.product_category_specs_profile#) AND (specs_content_product_id = #product_id#)
  14.       ORDER BY specs_relation_order
  15.     </cfquery>
  16.     <table border="0" cellspacing="0" cellpadding="0">
  17.     <cfset count = 0 />
  18.     <cfset print = 1 />
  19.     <cfoutput query="show_product_specs">
  20.       <cfif specs_content eq "" and specs_title neq 1>
  21.       <cfelse>
  22.       <cfset count = count + 1 />
  23.         <cfif print eq 1>
  24.             <tr>
  25.         </cfif>
  26.         <cfif specs_title eq 1>
  27.             <cfif findnocase('dimension',specs_name)>
  28.                 <cfset print = 0 />
  29.             <cfelse>
  30.                 <cfset print = 1 />
  31.             </cfif>
  32.             <cfif print eq 1>
  33.                 <cfif count eq 1>
  34.                     <td width="300" valign="top" style="padding-bottom:3px;">
  35.                         <h3>#lang("specs_name")#</h3>
  36.                     </td>
  37.                 <cfelse>
  38.                     <td width="300" style="padding-top:10px;padding-bottom:3px;" valign="top">
  39.                         <h3>#lang("specs_name")#</h3>
  40.                     </td>
  41.                 </cfif>
  42.             </cfif>
  43.         <cfelse>
  44.             <cfif print eq 1>
  45.                 <td width="300" valign="top" style="padding-bottom:3px;">
  46.                     #lang("specs_name")#
  47.                 </td>
  48.             </cfif>
  49.         </cfif>
  50.         <cfif print eq 1>
  51.             <td>
  52.                 #lang("specs_content")#
  53.             </td>
  54.         </cfif>
  55.       <cfif print eq 1>
  56.         </tr>
  57.       </cfif>
  58.       </cfif>
  59.     </cfoutput>
  60.     </table>
  61.   </cfif>
  62. <cfif isdefined("debugg")><cfdump var="#get_profile_id#"></cfif>
  63. <cfif isdefined("debugg")><cfdump var="#show_product_specs#"></cfif>
  64. </cffunction>
  65.  
  66. <cffunction name="show_pdf_dimensions" access="public">
  67.   <cfargument name="product_id" type="string" required="yes">
  68.   <cfargument name="product_category_id" type="string" required="yes">
  69.   <cfquery name="get_profile_id" datasource="#request.dsn#">
  70.     SELECT     product_category_id, product_category_specs_profile
  71.     FROM       dbo.products_categories
  72.     WHERE     (product_category_id = #product_category_id#)
  73.   </cfquery>
  74.   <cfif get_profile_id.product_category_specs_profile neq "">
  75.     <cfquery name="show_product_specs" datasource="#request.dsn#">
  76.       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
  77.       FROM         dbo.general_specs_table
  78.       WHERE     (profile_id = #get_profile_id.product_category_specs_profile#) AND (specs_content_product_id = #product_id#)
  79.       ORDER BY specs_relation_order
  80.     </cfquery>
  81.     <table border="0" cellspacing="0" cellpadding="0" style="display:none;">
  82.     <cfset count = 0 />
  83.     <cfset print = 0 />
  84.     <cfoutput query="show_product_specs">
  85.         <cfif specs_content eq "" and specs_title neq 1>
  86.  
  87.         <cfelse>
  88.             <cfset count = count + 1 />
  89.             <cfif specs_title eq 1>
  90.                 <cfif findnocase('dimension',specs_name)>
  91.                     <cfset print = 1 />
  92.                 <cfelse>
  93.                     <cfset print = 0 />
  94.                 </cfif>
  95.                 <cfif print eq 1>
  96.                     <cfif count eq 1>
  97.                         </table>
  98.                         <table border="0" cellspacing="0" cellpadding="0" style="float:left;margin-right:20px;display:block;">
  99.                         <tr>
  100.                             <td width="200" valign="top" style="padding-bottom:3px;">
  101.                                 <h3 style="color:##ffffff;">#lang("specs_name")#</h3>
  102.                             </td>
  103.                     <cfelse>
  104.                         </table>
  105.                         <table border="0" cellspacing="0" cellpadding="0" style="float:left;margin-right:20px;display:block;">
  106.                         <tr>
  107.                             <td width="200" style="padding-top:10px;padding-bottom:3px;" valign="top">
  108.                                 <h3 style="color:##ffffff;">#lang("specs_name")#</h3>
  109.                             </td>
  110.                     </cfif>
  111.                 </cfif>
  112.             <cfelse>
  113.                 <cfif print eq 1>
  114.                     <tr>
  115.                         <td width="200" valign="top" style="padding-bottom:3px; color:##ffffff;">
  116.                             #lang("specs_name")#
  117.                         </td>
  118.                 </cfif>
  119.             </cfif>
  120.             <cfif print eq 1>
  121.                     <td style="color:##ffffff;">
  122.                         #lang("specs_content")#
  123.                     </td>
  124.                 </tr>
  125.             </cfif>
  126.         </cfif>
  127.     </cfoutput>
  128.    
  129.   </cfif>
  130. <cfif isdefined("debugg")><cfdump var="#get_profile_id#"></cfif>
  131. <cfif isdefined("debugg")><cfdump var="#show_product_specs#"></cfif>
  132. </cffunction>
  133.  
  134.  
  135. <cfquery name="product_info" datasource="#request.dsn#">
  136.     select * from view_product_images where product_id = #product_id#
  137. </cfquery>
  138.  
  139. <cfoutput query="product_info">
  140.     <cfdocument format="pdf" unit="cm" orientation="portrait" pagetype="letter" fontembed="no" margintop="0.2" marginbottom="0.2" marginleft="0" marginright="0">
  141.     <style type="text/css">
  142.         body,td,th {
  143.             color: ##333;
  144.             font-family: Arial, Helvetica, sans-serif;
  145.             font-size: 13px;
  146.         }
  147.  
  148.         h1 {
  149.             font-size:42px;
  150.             color:##b2006b;
  151.             font-weight:bold;
  152.             margin:0;
  153.         }
  154.         h2 {
  155.             font-size:28px;
  156.             color:##b2006b;
  157.             font-weight:normal;
  158.             margin:0;
  159.         }
  160.         h3 {
  161.             font-size:13px;
  162.             color:##b2006b;
  163.             font-weight:bold;
  164.             margin:0;
  165.             padding:0;
  166.             text-transform:uppercase;
  167.         }
  168.         .specs {
  169.             color:##333;
  170.         }
  171.         .footer {
  172.             color:##FFF;
  173.             background-color:##2d2b2c;
  174.             width:80px;
  175.             padding:3px;
  176.         }      
  177.     </style>
  178.  
  179.     <div style="float:left;width:840px;">
  180.         <table width="840" border="0" cellpadding="0" cellspacing="0"> 
  181.             <tr>
  182.                 <td>
  183.                     <table width="840" cellpadding="0" cellspacing="0" style="background-color:##D7D8DA;">
  184.                         <tr>
  185.                             <td style="padding:40px 40px 55px 40px;">
  186.                                 <div style="border-bottom:2px dashed ##b2006b;padding-bottom:14px;">
  187.                                     <h1>#get_product_name(product_id)#</h1>
  188.                                     <h2>#product_model#</h2>
  189.                                 </div>
  190.                             </td>
  191.                         </tr>
  192.                         <tr>
  193.                             <td  style="padding:0px 40px 100px 40px;">
  194.                                 <table border="0" cellpadding="0" cellspacing="0" width="760">
  195.                                     <tr>
  196.                                         <td width="387" valign="top">
  197.                                             <div style="width:384px;background-color:##ffffff;border:2px solid ##b2006b;height:475px;text-align:center;display:table-cell;vertical-align:middle;">
  198.                                                 <img src="#product_path_images#thumbnail.jpg" />
  199.                                             </div>
  200.                                         </td>
  201.                                         <td width="373" valign="top">
  202.                                             <div style="width:349px;padding-left:24px;">
  203.                                                 #show_pdf_specs(product_id,product_category_id)#
  204.                                             </div>
  205.                                         </td>
  206.                                     </tr>
  207.                                 </table>
  208.                             </td>
  209.                         </tr>
  210.                     </table>
  211.                     <table width="840" cellpadding="0" cellspacing="0" style="background-color:##444444;">
  212.                         <tr>
  213.                             <td style="padding:20px 200px 20px 40px; color:##ffffff;">
  214.                                 #show_pdf_dimensions(product_id,product_category_id)#
  215.                             </td>
  216.                         </tr>
  217.                     </table>
  218.                 </td>      
  219.             </tr>
  220.         </table>
  221.     </div>
  222.     </cfdocument>
  223. </cfoutput>
Add Comment
Please, Sign In to add comment