require_once("vcl/vcl.inc.php"); //Includes use_unit("comctrls.inc.php"); use_unit("forms.inc.php"); use_unit("extctrls.inc.php"); use_unit("stdctrls.inc.php"); //Class definition class ncalc extends Page { public $Calculate = null; public $Image1 = null; public $Label25 = null; public $Label24 = null; public $Label23 = null; public $Label22 = null; public $LabeledEdit11 = null; public $LabeledEdit10 = null; public $LabeledEdit9 = null; public $LabeledEdit8 = null; public $LabeledEdit7 = null; public $ncomputingneeded = null; public $pcsneeded = null; public $Label21 = null; public $Label20 = null; public $Shape1 = null; public $Label19 = null; public $Label18 = null; public $Label17 = null; public $Label16 = null; public $Label15 = null; public $Label14 = null; public $Label13 = null; public $Label12 = null; public $Label11 = null; public $Label10 = null; public $Label9 = null; public $Label8 = null; public $Label7 = null; public $Label6 = null; public $Label5 = null; public $Label4 = null; public $LabeledEdit6 = null; public $LabeledEdit5 = null; public $LabeledEdit4 = null; public $LabeledEdit3 = null; public $LabeledEdit2 = null; public $LabeledEdit1 = null; public $Seats = null; public $Label3 = null; public $Label2 = null; public $Label1 = null; function ncalcBeforeShow($sender, $params) { $this->CalculateClick($sender, $params); } function CalculateClick($sender, $params) { $this->Label6->Caption = $this->Seats->Text * $this->LabeledEdit1->text; $this->pcsneeded->Caption = round($this->Seats->Text / $this->LabeledEdit6->text); $this->ncomputingneeded->Caption = $this->Seats->Text - $this->pcsneeded->Caption; $this->Label9->Caption = $this->pcsneeded->Caption * $this->LabeledEdit1->Text; $this->Label11->Caption = $this->LabeledEdit11->Text * $this->ncomputingneeded->Caption; $this->Label13->Caption = $this->ncomputingneeded->Caption * $this->LabeledEdit10->Text; $this->Label15->Caption = $this->ncomputingneeded->Caption * $this->LabeledEdit9->Text; $this->Label17->Caption = $this->ncomputingneeded->Caption * $this->LabeledEdit8->Text; $this->Label19->Caption = $this->Label9->Caption + $this->Label11->Caption + $this->Label13->Caption + $this->Label15->Caption + $this->Label17->Caption; $this->Label22->Caption = $this->Label6->Caption - $this->Label19->Caption; $this->Label24->Caption = round(($this->Label22->Caption / $this->Label6->Caption) * 100) . "%"; } function SeatsJSChange($sender, $params) { } } global $application; global $ncalc; //Creates the form $ncalc = new ncalc($application); //Read from resource file $ncalc->loadResource(__FILE__); //Shows the form $ncalc->show(); ?>