// Include prepend.inc to load Qcodo
require '../includes/prepend.inc.php';
/* if you DO NOT have "includes/" in your include_path */
// require('prepend.inc.php');				/* if you DO have "includes/" in your include_path */
// Include the classfile for ShippingAccountListFormBase
require __FORMBASE_CLASSES__ . '/ShippingAccountListFormBase.class.php';
// Security check for ALLOW_REMOTE_ADMIN
// To allow access REGARDLESS of ALLOW_REMOTE_ADMIN, simply remove the line below
QApplication::CheckRemoteAdmin();
/**
 * This is a quick-and-dirty draft form object to do the List All functionality
 * of the ShippingAccount class.  It extends from the code-generated
 * abstract ShippingAccountListFormBase class.
 *
 * Any display customizations and presentation-tier logic can be implemented
 * here by overriding existing or implementing new methods, properties and variables.
 *
 * Additional qform control objects can also be defined and used here, as well.
 * 
 * @package My Application
 * @subpackage FormDraftObjects
 * 
 */
class ShippingAccountListForm extends ShippingAccountListFormBase
{
}
// Go ahead and run this form object to generate the page and event handlers, using
// generated/shipping_account_list.tpl.php as the included HTML template file
ShippingAccountListForm::Run('ShippingAccountListForm', 'generated/shipping_account_list.tpl.php');
    }
    // Create/Setup the Save button
    // Sets the Shipping/Receiving Company setting in the AdminSetting table
    protected function btnSave_Click()
    {
        $intCompanyId = $this->lstCompany->SelectedValue;
        $objCompany = Company::Load($intCompanyId);
        // Altered $TracmorSettings __set() method so that just setting a value will save it in the database.
        QApplication::$TracmorSettings->CompanyId = $intCompanyId;
        QApplication::$TracmorSettings->PackingListTerms = $this->txtPackingListTerms->Text;
        QApplication::$TracmorSettings->AutodetectTrackingNumbers = $this->chkAutoDetectTrackingNumbers->Checked;
        QApplication::$TracmorSettings->ReceiveToLastLocation = $this->chkReceiveToLastLocation->Checked;
        QApplication::$TracmorSettings->CustomShipmentNumbers = (string) $this->chkCustomShipmentNumbers->Checked;
        QApplication::$TracmorSettings->CustomReceiptNumbers = (string) $this->chkCustomReceiptNumbers->Checked;
        // Show saved notification
        $this->pnlSaveNotification->Display = true;
    }
    // Erase the 'Saved' warning if a new company is selected
    protected function lstCompany_Change()
    {
        $this->lstCompany->Warning = "";
    }
    protected function btnNewCourier_Click()
    {
        QApplication::Redirect('courier_edit.php');
    }
}
// Go ahead and run this form object to generate the page and event handlers, using
// generated/shipping_account_edit.php.inc as the included HTML template file
ShippingAccountListForm::Run('ShippingAccountListForm', __DOCROOT__ . __SUBDIRECTORY__ . '/admin/shipping_account_list.tpl.php');