public function getServerUrl() { if (!$this->_serverUrl) { $upgradeForm = new UpgradeForm(); $upgradeForm->getSetting(); if (isset($upgradeForm->serverUrl) && $upgradeForm->serverUrl) { $this->_serverUrl = $upgradeForm->serverUrl; } else { $this->_serverUrl = $this->defaultServerUrl; } } return $this->_serverUrl; }
<?php include_once '../../../_includes/framework.php'; require_login(); if (!isset($form)) { $id = @$_GET['id']; $id or die("<p>Error, no attendee id.</p>"); $form = new UpgradeForm(["id" => $id]); } $current_level = RegistrationLevel::find_by_db_name($form->attendee->admission_level); $upgrades = RegistrationUpgrade::from_with_prices($form->attendee->admission_level); ?> <input type="hidden" name="id" value="<?php echo $id; ?> "> <div class="text-center"> <h2><?php echo $form->attendee->display_name(); ?> </h2> <?php if ($form->attendee->vendor()) { ?> <h4 class="text-muted"><?php echo $form->attendee->vendor()->display_name(); ?> </h4> <?php }
/** * Execute upgrade. */ function installUpgrade() { $this->validate(); $this->setupTemplate(); $installForm = new UpgradeForm(); $installForm->readInputData(); if ($installForm->validate()) { $installForm->execute(); } else { $installForm->display(); } }
<?php include_once '../../../_includes/framework.php'; require_login(); $id = @$_POST['id']; $id or die("<p>Error, no attendee id.</p>"); $attendee = Attendee::find($id); $attendee or die("<p>No attendee with (ID={$id})"); $return_url = @$_POST['return_url'] ?: "/admin/index.php"; $form = new UpgradeForm($_POST); if ($form->valid()) { $form->save(); # Kind of a bad hack but it works. ?> <script> window.location = "<?php echo $return_url; ?> "; </script> <?php } else { include "../forms/upgrade-form.php"; }