Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class SuitOrder extends Page {
- static $db = array(
- "Measurements" => "Text"
- );
- function getCMSFields() {
- $fields = parent::getCMSFields();
- $fields->addFieldToTab('Root.Content.Main', new
- TextField('Measurements'), 'Content');
- return $fields;
- }
- }
- class SuitOrder_Controller extends Page_Controller {
- function SuitOrderForm() {
- // Create fields
- $fields = new FieldSet(
- new FieldGroup(
- new HeaderField('Personal Information'),
- new TextField('Name'),
- new TextField('Address'),
- new TextField('Email'),
- new TextField('Phone'),
- new TextField('Age'),
- new TextField('Height (cm)'),
- new TextField('Weight (kg)'),
- new TextField('FABRIC CODE')
- ),
- new FieldGroup(
- new HeaderField ('Style Information'),
- new OptionsetField('Lapel', 'Lapel Style', array(
- 'Notch (Most Popular)' => 'Notch (Most Popular)',
- 'Peak' => 'Peak')),
- new OptionsetField('Buttons', 'Buttons', array(
- 'One' => 'One',
- 'Two (Most Popular)' => 'Two (Most Popular)',
- 'Three' => 'Three')),
- new OptionsetField('Vents', 'Vents', array(
- 'None' => 'None',
- 'Single' => 'Single',
- 'Double (Most Popular)' => 'Double (Most Popular)')),
- new OptionsetField('Cuffs', 'Cuffs', array(
- 'Yes' => 'Yes',
- 'No (Most Popular)' => 'No (Most Popular)')),
- new OptionsetField('WaistCoat', 'Add Waist Coat? (Additional
- $120)', array(
- 'Yes' => 'Yes',
- 'No (Most Popular)' => 'No (Most Popular)')),
- new TextAreaField('StylePrefs','Additional Style Preferences:')
- ),
- new FieldGroup(
- new HeaderField('Measurements'),
- new LiteralField('Measurements', $this->Measurements),
- new LiteralField('shouldertitle','<h3>Full Shoulder</h3>'),
- new LiteralField('shoulderimg','<img class="measurements"
- src="../1.jpg"/>'),
- new LiteralField('shoulderdesc','<p>Measure back at its widest
- portion. This is the length between your shoulders.</p>'),
- new TextField('shoulder','Size (in CM)'),
- new LiteralField('sleevetitle','<h3>Sleeve Length</h3>'),
- new LiteralField('sleeveimg','<img class="measurements" src="../2.jpg"/>'),
- new LiteralField('sleevedesc','<p>Measure from shoulder seam to
- the beginning of your wrist (base of thumb). Now add 3cm to this
- measurement.</p>'),
- new TextField('sleeve','Size (in CM)'),
- new LiteralField('chesttitle','<h3>Chest</h3>'),
- new LiteralField('chestimg','<img class="measurements" src="../3.jpg"/>'),
- new LiteralField('chestdesc','<p>Breathe out, take a small breath
- in and measure around chest (under armpits) at nipple level. Keep a
- finger under the measuring tape </p>'),
- new TextField('chest','Size (in CM)')
- new LiteralField('stomachtitle','<h3>Stomach</h3>'),
- new LiteralField('stomachimg','<img class="measurements"
- src="../4.jpg"/>'),
- new LiteralField('stomachdesc','<p>Breathe out, take a small
- breath in and measure around stomach line at its fullest point,
- keeping one finger under the measuring tape. </p>'),
- new TextField('stomach','Size (in CM)')
- ),
- new FieldGroup(
- new LiteralField('jackettitle','<h3>Jacket Length</h3>'),
- new LiteralField('jacketimg','<img class="measurements"
- src="../5.1.jpg"/>'),
- new LiteralField('jacketdesc','<p>Measure from the highest point
- of the shoulders (next to the collar) straight down to the level of
- the tip of your thumb. This is international Jacket Length. </p>'),
- new TextField('jacket','Size (in CM)'),
- new LiteralField('necktitle','<h3>Neck</h3>'),
- new LiteralField('neckimg','<img class="measurements" src="../6.jpg"/>'),
- new LiteralField('neckdesc','<p>Measure around neck at the point
- where your collar would be, keeping one finger under the measuring
- tape. </p>'),
- new TextField('neck','Size (in CM)'),
- new LiteralField('fronttitle','<h3>Front</h3>'),
- new LiteralField('frontimg','<img class="measurements"
- src="../7.1.jpg"/>'),
- new LiteralField('frontdesc','<p>Measure from top armpit angle to
- other armpit angled across your chest.</p>'),
- new TextField('front','Size (in CM)'),
- new LiteralField('backtitle','<h3>Back</h3>'),
- new LiteralField('backimg','<img class="measurements" src="../8.1.jpg"/>'),
- new LiteralField('backdesc','<p>Measure from top armpit angle to
- other armpit angle across your back. </p>'),
- new TextField('back','Size (in CM)')
- ),
- new FieldGroup(
- new LiteralField('waisttitle','<h3>Waist</h3>'),
- new LiteralField('waistimg','<img class="measurements"
- src="../9.2.jpg"/>'),
- new LiteralField('waistdesc','<p>Relax your stomach and measure
- around your Waist Line where you would normally wear your pants. (belt
- line)</p>'),
- new TextField('waist','Size (in CM)'),
- new LiteralField('hipstitle','<h3>Hips</h3>'),
- new LiteralField('hipsimg','<img class="measurements" src="../10.jpg"/>'),
- new LiteralField('hipsdesc','<p>Measure around your hips at
- widest point of your buttocks. Don’t pull measuring tape too tight.
- </p>'),
- new TextField('hips','Size (in CM)'),
- new LiteralField('crotchtitle','<h3>Crotch</h3>'),
- new LiteralField('crotchimg','<img class="measurements"
- src="../11.jpg"/>'),
- new LiteralField('crotchdesc','<p> Measure from the top of belt
- line at the front, under crotch and up to top of belt line at the
- back. This is where the crotch of your pants will be so make sure the
- measuring tape is at a comfortable length. </p>'),
- new TextField('crotch','Size (in CM)'),
- new LiteralField('trousertitle','<h3>Trouser Length</h3>'),
- new LiteralField('trouserimg','<img class="measurements"
- src="../12.jpg"/>'),
- new LiteralField('trouserdesc','<p>Measure from top of waistband
- where you would normally wear your pants to the bottom of your shoe
- heel. </p>'),
- new TextField('trouser','Size (in CM)'))
- new FieldGroup(
- new LiteralField('thightitle','<h3>Thigh</h3>'),
- new LiteralField('thighimg','<img class="measurements"
- src="../13.1.jpg"/>'),
- new LiteralField('thighdesc','<p>Measure circumference of thigh
- at the biggest point. </p>'),
- new TextField('thigh','Size (in CM)'),
- new LiteralField('kneetitle','<h3>Knee</h3>'),
- new LiteralField('kneeimg','<img class="measurements"
- src="../14.1.jpg"/>'),
- new LiteralField('kneedesc','<p>Measure circumference of knee.</p>'),
- new TextField('knee','Size (in CM)'),
- new LiteralField('cufftitle','<h3>Cuff</h3>'),
- new LiteralField('cuffimg','<img class="measurements" src="../15.jpg"/>'),
- new LiteralField('cuffdesc','<p>Please enter:</br>- 44cm for
- regular cut</br>- 49cm+ for boot leg cut</p>'),
- new TextField('cuff','Size (in CM)'))
- new FieldGroup(
- new OptionsetField('ShoulderStyle', 'Please Select Your
- Shoulder Style', array(
- 'Sloping' => 'Sloping',
- 'Regular' => 'Regular',
- 'Square' => 'Square')),
- new OptionsetField('Posture', 'Posture', array(
- 'Normal' => 'Normal',
- 'Erect' => 'Erect',
- 'Forward Stoop' => 'Forward Stoop',
- 'Forward Stomach' => 'Forward Stomach',
- 'Stout' => 'Stout'))
- )
- );
- // Create actions
- $actions = new FieldSet(
- new FormAction('doSuitOrder', 'Submit')
- );
- return new Form($this, 'SuitOrderForm', $fields, $actions);
- }
- function doSuitOrder($data, $form) {
- $submission = new SuitOrderSubmission();
- $form->saveInto($submission);
- $submission->write();
- Director::redirectBack();
- }
- }
Add Comment
Please, Sign In to add comment