Guest User

Untitled

a guest
Jul 19th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.16 KB | None | 0 0
  1. <?php
  2.  
  3. class SuitOrder extends Page {
  4. static $db = array(
  5. "Measurements" => "Text"
  6. );
  7.  
  8.  
  9.  
  10. function getCMSFields() {
  11. $fields = parent::getCMSFields();
  12. $fields->addFieldToTab('Root.Content.Main', new
  13. TextField('Measurements'), 'Content');
  14. return $fields;
  15.  
  16. }
  17. }
  18. class SuitOrder_Controller extends Page_Controller {
  19.  
  20.  
  21. function SuitOrderForm() {
  22.  
  23. // Create fields
  24. $fields = new FieldSet(
  25.  
  26.  
  27. new FieldGroup(
  28.  
  29. new HeaderField('Personal Information'),
  30.  
  31. new TextField('Name'),
  32. new TextField('Address'),
  33. new TextField('Email'),
  34. new TextField('Phone'),
  35. new TextField('Age'),
  36. new TextField('Height (cm)'),
  37. new TextField('Weight (kg)'),
  38. new TextField('FABRIC CODE')
  39. ),
  40.  
  41.  
  42. new FieldGroup(
  43.  
  44. new HeaderField ('Style Information'),
  45. new OptionsetField('Lapel', 'Lapel Style', array(
  46. 'Notch (Most Popular)' => 'Notch (Most Popular)',
  47. 'Peak' => 'Peak')),
  48.  
  49. new OptionsetField('Buttons', 'Buttons', array(
  50. 'One' => 'One',
  51. 'Two (Most Popular)' => 'Two (Most Popular)',
  52. 'Three' => 'Three')),
  53.  
  54. new OptionsetField('Vents', 'Vents', array(
  55. 'None' => 'None',
  56. 'Single' => 'Single',
  57. 'Double (Most Popular)' => 'Double (Most Popular)')),
  58.  
  59. new OptionsetField('Cuffs', 'Cuffs', array(
  60. 'Yes' => 'Yes',
  61. 'No (Most Popular)' => 'No (Most Popular)')),
  62.  
  63. new OptionsetField('WaistCoat', 'Add Waist Coat? (Additional
  64. $120)', array(
  65. 'Yes' => 'Yes',
  66. 'No (Most Popular)' => 'No (Most Popular)')),
  67.  
  68. new TextAreaField('StylePrefs','Additional Style Preferences:')
  69.  
  70. ),
  71.  
  72.  
  73. new FieldGroup(
  74. new HeaderField('Measurements'),
  75. new LiteralField('Measurements', $this->Measurements),
  76.  
  77. new LiteralField('shouldertitle','<h3>Full Shoulder</h3>'),
  78. new LiteralField('shoulderimg','<img class="measurements"
  79. src="../1.jpg"/>'),
  80. new LiteralField('shoulderdesc','<p>Measure back at its widest
  81. portion. This is the length between your shoulders.</p>'),
  82. new TextField('shoulder','Size (in CM)'),
  83.  
  84.  
  85. new LiteralField('sleevetitle','<h3>Sleeve Length</h3>'),
  86. new LiteralField('sleeveimg','<img class="measurements" src="../2.jpg"/>'),
  87. new LiteralField('sleevedesc','<p>Measure from shoulder seam to
  88. the beginning of your wrist (base of thumb). Now add 3cm to this
  89. measurement.</p>'),
  90. new TextField('sleeve','Size (in CM)'),
  91.  
  92.  
  93. new LiteralField('chesttitle','<h3>Chest</h3>'),
  94. new LiteralField('chestimg','<img class="measurements" src="../3.jpg"/>'),
  95. new LiteralField('chestdesc','<p>Breathe out, take a small breath
  96. in and measure around chest (under armpits) at nipple level. Keep a
  97. finger under the measuring tape </p>'),
  98. new TextField('chest','Size (in CM)')
  99.  
  100.  
  101.  
  102.  
  103. new LiteralField('stomachtitle','<h3>Stomach</h3>'),
  104. new LiteralField('stomachimg','<img class="measurements"
  105. src="../4.jpg"/>'),
  106. new LiteralField('stomachdesc','<p>Breathe out, take a small
  107. breath in and measure around stomach line at its fullest point,
  108. keeping one finger under the measuring tape. </p>'),
  109. new TextField('stomach','Size (in CM)')
  110. ),
  111. new FieldGroup(
  112.  
  113.  
  114. new LiteralField('jackettitle','<h3>Jacket Length</h3>'),
  115. new LiteralField('jacketimg','<img class="measurements"
  116. src="../5.1.jpg"/>'),
  117. new LiteralField('jacketdesc','<p>Measure from the highest point
  118. of the shoulders (next to the collar) straight down to the level of
  119. the tip of your thumb. This is international Jacket Length. </p>'),
  120. new TextField('jacket','Size (in CM)'),
  121.  
  122.  
  123. new LiteralField('necktitle','<h3>Neck</h3>'),
  124. new LiteralField('neckimg','<img class="measurements" src="../6.jpg"/>'),
  125. new LiteralField('neckdesc','<p>Measure around neck at the point
  126. where your collar would be, keeping one finger under the measuring
  127. tape. </p>'),
  128. new TextField('neck','Size (in CM)'),
  129.  
  130. new LiteralField('fronttitle','<h3>Front</h3>'),
  131. new LiteralField('frontimg','<img class="measurements"
  132. src="../7.1.jpg"/>'),
  133. new LiteralField('frontdesc','<p>Measure from top armpit angle to
  134. other armpit angled across your chest.</p>'),
  135. new TextField('front','Size (in CM)'),
  136.  
  137. new LiteralField('backtitle','<h3>Back</h3>'),
  138. new LiteralField('backimg','<img class="measurements" src="../8.1.jpg"/>'),
  139. new LiteralField('backdesc','<p>Measure from top armpit angle to
  140. other armpit angle across your back. </p>'),
  141. new TextField('back','Size (in CM)')
  142. ),
  143.  
  144. new FieldGroup(
  145. new LiteralField('waisttitle','<h3>Waist</h3>'),
  146. new LiteralField('waistimg','<img class="measurements"
  147. src="../9.2.jpg"/>'),
  148. new LiteralField('waistdesc','<p>Relax your stomach and measure
  149. around your Waist Line where you would normally wear your pants. (belt
  150. line)</p>'),
  151. new TextField('waist','Size (in CM)'),
  152.  
  153. new LiteralField('hipstitle','<h3>Hips</h3>'),
  154. new LiteralField('hipsimg','<img class="measurements" src="../10.jpg"/>'),
  155. new LiteralField('hipsdesc','<p>Measure around your hips at
  156. widest point of your buttocks. Don’t pull measuring tape too tight.
  157. </p>'),
  158. new TextField('hips','Size (in CM)'),
  159.  
  160.  
  161. new LiteralField('crotchtitle','<h3>Crotch</h3>'),
  162. new LiteralField('crotchimg','<img class="measurements"
  163. src="../11.jpg"/>'),
  164. new LiteralField('crotchdesc','<p> Measure from the top of belt
  165. line at the front, under crotch and up to top of belt line at the
  166. back. This is where the crotch of your pants will be so make sure the
  167. measuring tape is at a comfortable length. </p>'),
  168. new TextField('crotch','Size (in CM)'),
  169.  
  170.  
  171. new LiteralField('trousertitle','<h3>Trouser Length</h3>'),
  172. new LiteralField('trouserimg','<img class="measurements"
  173. src="../12.jpg"/>'),
  174. new LiteralField('trouserdesc','<p>Measure from top of waistband
  175. where you would normally wear your pants to the bottom of your shoe
  176. heel. </p>'),
  177. new TextField('trouser','Size (in CM)'))
  178.  
  179. new FieldGroup(
  180.  
  181. new LiteralField('thightitle','<h3>Thigh</h3>'),
  182. new LiteralField('thighimg','<img class="measurements"
  183. src="../13.1.jpg"/>'),
  184. new LiteralField('thighdesc','<p>Measure circumference of thigh
  185. at the biggest point. </p>'),
  186. new TextField('thigh','Size (in CM)'),
  187.  
  188.  
  189. new LiteralField('kneetitle','<h3>Knee</h3>'),
  190. new LiteralField('kneeimg','<img class="measurements"
  191. src="../14.1.jpg"/>'),
  192. new LiteralField('kneedesc','<p>Measure circumference of knee.</p>'),
  193. new TextField('knee','Size (in CM)'),
  194.  
  195.  
  196. new LiteralField('cufftitle','<h3>Cuff</h3>'),
  197. new LiteralField('cuffimg','<img class="measurements" src="../15.jpg"/>'),
  198. new LiteralField('cuffdesc','<p>Please enter:</br>- 44cm for
  199. regular cut</br>- 49cm+ for boot leg cut</p>'),
  200. new TextField('cuff','Size (in CM)'))
  201.  
  202. new FieldGroup(
  203. new OptionsetField('ShoulderStyle', 'Please Select Your
  204. Shoulder Style', array(
  205. 'Sloping' => 'Sloping',
  206. 'Regular' => 'Regular',
  207. 'Square' => 'Square')),
  208.  
  209.  
  210. new OptionsetField('Posture', 'Posture', array(
  211. 'Normal' => 'Normal',
  212. 'Erect' => 'Erect',
  213. 'Forward Stoop' => 'Forward Stoop',
  214. 'Forward Stomach' => 'Forward Stomach',
  215. 'Stout' => 'Stout'))
  216. )
  217. );
  218.  
  219.  
  220.  
  221. // Create actions
  222. $actions = new FieldSet(
  223. new FormAction('doSuitOrder', 'Submit')
  224. );
  225.  
  226. return new Form($this, 'SuitOrderForm', $fields, $actions);
  227. }
  228.  
  229. function doSuitOrder($data, $form) {
  230. $submission = new SuitOrderSubmission();
  231. $form->saveInto($submission);
  232. $submission->write();
  233.  
  234. Director::redirectBack();
  235.  
  236.  
  237.  
  238. }
  239.  
  240. }
Add Comment
Please, Sign In to add comment