/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded */ public function loadModel($id) { $model = Tax::model()->findByPk((int) $id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
?> <?php echo $form->textArea($model, 'description', array('rows' => 6, 'cols' => 50)); ?> <?php echo $form->error($model, 'description'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'tax_id'); ?> <?php echo $form->dropDownList($model, 'tax_id', CHtml::listData(Tax::model()->findAll(), 'id', 'title')); ?> <?php echo $form->error($model, 'tax_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'price'); ?> <?php echo $form->textField($model, 'price'); ?> <?php echo $form->error($model, 'price');
public function __get($strName) { switch ($strName) { case 'completed': return "nothing"; return $this->carts(array('scopes' => array('complete'))); case 'DatetimeCreated': return date(_xls_get_conf('DATE_FORMAT', 'Y-m-d'), strtotime($this->datetime_cre)); case 'cartitems': return $this->cartItems; case 'Length': return $this->GetLength(); case 'Height': return $this->GetHeight(); case 'Width': return $this->GetWidth(); case 'Weight': return $this->GetWeight(); case 'HasShippableGift': return $this->HasShippableGift(); case 'GiftAddress': return $this->GiftAddress(); case 'SubTotalTaxIncIfSet': QApplication::Log(E_USER_NOTICE, 'legacy', $strName); return $this->Subtotal; case 'tax1name': case 'tax1Name': return Tax::TaxByLsid(1); case 'tax2name': case 'tax2Name': return Tax::TaxByLsid(2); case 'tax3name': case 'tax3Name': return Tax::TaxByLsid(3); case 'tax4name': case 'tax4Name': return Tax::TaxByLsid(4); case 'tax5name': case 'tax5Name': return Tax::TaxByLsid(5); case 'tax_total': case 'TaxTotal': return round(round($this->tax1, 2) + round($this->tax2, 2) + round($this->tax3, 2) + round($this->tax4, 2) + round($this->tax5, 2), 2); case 'tax_code': if (isset($this->taxCode->code)) { return $this->taxCode->code; } else { return ''; } case 'payment': if (isset($this->payment)) { return parent::__get($strName); } else { return new CartPayment(); } case 'Taxes': $arrTaxes = Tax::model()->findAll(array('order' => 'id')); return array($arrTaxes[0]->tax => round($this->tax1, 2), $arrTaxes[1]->tax => round($this->tax2, 2), $arrTaxes[2]->tax => round($this->tax3, 2), $arrTaxes[3]->tax => round($this->tax4, 2), $arrTaxes[4]->tax => round($this->tax5, 2)); case 'Pending': return $this->GetPending(); case 'shipping_sell': if (isset($this->shipping->shipping_sell)) { return $this->shipping->getShippingSell(); } else { return 0; } default: return parent::__get($strName); } }
public static function LoadByLS($intId) { return Tax::model()->findByAttributes(array('lsid' => $intId)); }
/** * Tax List * * @param string $passkey * @return string * @throws SoapFault * @soap */ public function list_taxes($passkey) { self::check_passkey($passkey); $obj = Tax::model()->findAll(); return CJSON::encode($obj); }