Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class ShirtOrder extends Page {
- static $db = array(
- "Measurements" => "Text"
- );
- function getCMSFields() {
- $fields = parent::getCMSFields();
- $fields->addFieldToTab('Root.Content.Main', new
- TextField('Measurements'), 'Content');
- return $fields;
- }
- }
- class ShirtOrder_Controller extends Page_Controller {
- function ShirtOrderForm() {
- // Create fields
- $fields = new FieldSet(
- new LiteralField('nav','<div class="nav"><a id="prev2" href="#">Prev</a> <a id="next2" href="#">Next</a></div>'),
- new LiteralField('wrapper','<div id="fieldswrapper">'),
- new LiteralField('info','<div id="info">'),
- new FieldGroup(
- new HeaderField('Personal Information'),
- new TextField('<h3>Name</h3>'),
- new TextAreaField('<h3>Address</h3>'),
- new TextField('<h3>Email</h3>'),
- new TextField('<h3>Phone</h3>'),
- new TextField('<h3>Age</h3>'),
- new TextField('Height','<h3>Height (cm)</h3>'),
- new TextField('Weight','<h3>Weight (kg)</h3>'),
- new TextField('FABRICCODE','<h3>Fabric Code</h3>')
- ),
- new LiteralField('close_info','</div>'),
- new LiteralField('style','<div id="style">'),
- new FieldGroup(
- new HeaderField ('Style Information'),
- new OptionsetField('Collar', '<h3>Collar<h3>', array(
- 'Classic' => 'Classic',
- 'Oriental' => 'Oriental',
- 'Cocktail' => 'Cocktail')),
- new OptionsetField('Pockets', '<h3>Pockets</h3>', array(
- 'None' => 'None',
- 'One' => 'One',
- 'Two' => 'Two')),
- new OptionsetField('Cuffs', '<h3>Cuffs</h3>', array(
- 'Single button square' => 'Single button square',
- 'Single button round' => 'Single button round',
- 'Double button square' => 'Double button square',
- 'Double button round' => 'Double button round',
- 'French Cuff (for cufflinks)' => 'French Cuff (for cufflinks)')),
- new LiteralField('monogram','<div id="monogram">'),
- new OptionsetField('Monogram', '<h3>Monogram</h3>', array(
- 'No' => 'No','<p>If YES, 3 characters you wish to
- appear on cuff (3 characters max):</p>')),
- new TextField('MonogramText',''),
- new LiteralField('monogram_close','</div>'),
- new OptionsetField('WhiteCollarCuffs', '<h3>White Collar/Cuffs:</h3>', array(
- 'No (Normal)' => 'No (Normal)',
- 'Yes' => 'Yes <p>(your chosen fabric for shirt colour
- but with white collar/cuffs)</p>')),
- new TextAreaField('StylePrefs','<h3>Additional Style Preferences:</h3>')
- ),
- new LiteralField('close_style','</div>'),
- new FieldGroup(
- new LiteralField('formbox','<div class="formbox">'),
- 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('formbox_close','</div>'),
- new LiteralField('formbox','<div class="formbox">'),
- 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('formbox_close','</div>'),
- new LiteralField('formbox','<div class="formbox">'),
- 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('formbox_close','</div>')
- ),
- new FieldGroup(
- new LiteralField('formbox','<div class="formbox">'),
- 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 LiteralField('formbox_close','</div>'),
- new LiteralField('formbox','<div class="formbox">'),
- new LiteralField('shirttitle','<h3>Shirt Length</h3>'),
- new LiteralField('shirtimg','<img class="measurements"
- src="../5.1.jpg"/>'),
- new LiteralField('shirtdesc','<p>Measure from the highest point
- of the shoulders (next to the collar) straight down to the level of
- the tip of your thumb.</p>'),
- new TextField('ShirtLength','Size (in CM)'),
- new LiteralField('formbox_close','</div>'),
- new LiteralField('formbox','<div class="formbox">'),
- 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('formbox_close','</div>')
- ),
- New FieldGroup(
- new LiteralField('formbox','<div class="formbox">'),
- 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('formbox_close','</div>'),
- new LiteralField('formbox','<div class="formbox">'),
- 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 LiteralField('formbox_close','</div>'),
- new LiteralField('formbox','<div class="formbox">'),
- new OptionsetField('ShoulderStyle', '<h3>Please Select Your
- Shoulder Style</h3>', array(
- 'Sloping' => 'Sloping',
- 'Regular' => 'Regular',
- 'Square' => 'Square')),
- new OptionsetField('Posture', '<h3>Posture</h3>', array(
- 'Normal' => 'Normal',
- 'Erect' => 'Erect',
- 'Forward Stoop' => 'Forward Stoop',
- 'Forward Stomach' => 'Forward Stomach',
- 'Stout' => 'Stout')),
- new LiteralField('formbox_close','</div>'),
- new LiteralField('wrapper_close','</div>')
- )
- );
- // Create actions
- function doShirtOrder($data, $form) {
- $submission = new ShirtOrderSubmission();
- $form->saveInto($submission);
- $submission->write();
- Director::redirectBack();
- }
- }
Add Comment
Please, Sign In to add comment