Work on order form
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 11 Jul 2014 13:08:58 +0000 (09:08 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 11 Jul 2014 13:08:58 +0000 (09:08 -0400)
trying to get the quickform to work

index.php
static/9.phtml

index 0ed28ac..dd0e9e9 100644 (file)
--- a/index.php
+++ b/index.php
@@ -51,8 +51,9 @@ HTTP_Session2::useCookies(false);
 HTTP_Session2::start();
 
 if (isset($qfKeys) && !empty($qfKeys)) {
-    if (ctype_digit($_SESSION['_regWizard_container']['values']['page1']['catid'])) {
-        $catid = $_SESSION['_regWizard_container']['values']['page1']['catid'];
+//    var_dump($_REQUEST);exit;
+    if (ctype_digit($_SESSION['_Wizard_container']['values']['page1']['catid'])) {
+        $catid = $_SESSION['_Wizard_container']['values']['page1']['catid'];
     } elseif (ctype_digit($_REQUEST['catid'])) {
         $catid = $_REQUEST['catid'];
     }
index 2326739..e3e5c2a 100644 (file)
@@ -9,7 +9,7 @@ require_once 'HTML/QuickForm/Action/Jump.php';
 require_once 'HTML/QuickForm/Action/Display.php';
 
 // Start the session, form-page values will be kept there
-session_start();
+//session_start();
 
 //  Check to make sure the end date is the
 //  same as the start date or later in the year.
@@ -61,7 +61,7 @@ class PageBase extends HTML_QuickForm_Page
        function __construct($formName, $method = 'post', $target = 'index.php?catid=9', $attributes = null)
        {
                //$target = ($_POST['_qf_default'] == 'page2:next') ? $target . '&_qf_page2_display=true' : $target;
-               parent::__construct($formName, $method, BASE_URL . $target, $attributes);
+               parent::__construct($formName, $method, MEDIA_BASE_URL . $target, $attributes);
                $this->_validationType = 'server';
                $this->_partySize = array('' => '-- Select Size --') + range(0, 10);
        }
@@ -279,7 +279,7 @@ class PageThird extends PageBase
 
                $elements[] = array('type' => 'header',                 'req' => false, 'name' => 'header_rmv',                 'display' => 'Package Price Quote Request page 3 of 4');
                $elements[] = array('type' => 'static',                 'req' => false, 'name' => 'tos_rmv',                    'display' => 'Terms of Service:', 'opts' => $tos);
-               $elements[] = array('type' => 'static',                 'req' => false, 'name' => 'view_courses_rmv',   'display' => 'Click here to view course<br>desriptions and locations:', 'opts' => '<a id="viewCourses" target="_blank" href="'.BASE_URL.'courses-11/">View Courses</a>');
+               $elements[] = array('type' => 'static',                 'req' => false, 'name' => 'view_courses_rmv',   'display' => 'Click here to view course<br>desriptions and locations:', 'opts' => '<a id="viewCourses" target="_blank" href="'.MEDIA_BASE_URL.'courses-11/">View Courses</a>');
                $elements[] = array('type' => 'elementGrid',    'req' => false, 'name' => 'golfing',                    'display' => 'Golfing Preference:', 'opts' => array('actAsGroup' => false));
 
         $prevnext[] =& $this->createElement('submit',   $this->getButtonName('next'), 'Next step >>');
@@ -312,8 +312,8 @@ class PageThird extends PageBase
                                        $pmgolf[] =& $this->createElement('select',     "pmTeeTime$i",  null, $evening);
                                        $pmgolf[] =& $this->createElement('select',     "pmCourse$i",   null, $courses);
 
-                                       $source->addRow(&$amgolf, $calDate['date']);
-                                       $source->addRow(&$pmgolf, '&nbsp;');
+                                       $source->addRow($amgolf, $calDate['date']);
+                                       $source->addRow($pmgolf, '&nbsp;');
                                }
                        }
                }
@@ -490,8 +490,8 @@ class ActionProcess extends HTML_QuickForm_Action
 {
     function perform(&$page, $actionName)
     {
-               $return = $this->_getEntireForm(&$page);
-               if ($this->_process(&$page, $return)) {
+               $return = $this->_getEntireForm($page);
+               if ($this->_process($page, $return)) {
                        $return = "<p>The information below was successfully submitted</p>\n<pre>\n{$return}\n</pre>\n";
                        $return = "<p>Thank you for requesting a custom package price quote from Big Fore Golf.
                                                The lodging partner that you requested will receive your request and personally
@@ -770,7 +770,7 @@ class ActionProcess extends HTML_QuickForm_Action
        }
 }
 
-$wizard =& new HTML_QuickForm_Controller('Wizard');
+$wizard = new HTML_QuickForm_Controller('Wizard');
 $wizard->addPage(new PageFirst('page1'));
 $wizard->addPage(new PageSecond('page2'));
 $wizard->addPage(new PageThird('page3'));
@@ -779,4 +779,6 @@ $wizard->addPage(new PageFourth('page4'));
 $wizard->addAction('display', new ActionDisplay());
 $wizard->addAction('process', new ActionProcess());
 
-$pqForm = $wizard->run();
+echo $wizard->run();
+$form = '<pre>'.print_r($_SESSION, true).'</pre>';
+echo $form;