public function actionCreateAdditionalCharge() { if (!isset($_GET['shipperId'])) { throw new Exception('Shipper id not provided'); } $shipperId = $_GET['shipperId']; $s = new ShippingPriceAdditional(); $s->shipperId = $shipperId; $s->name = $_POST['ShippingPriceAdditional']['name']; $s->date = Helpers::formateDateToDb($_POST['ShippingPriceAdditional']['date']); $s->note = $_POST['ShippingPriceAdditional']['note']; $s->price = $_POST['ShippingPriceAdditional']['price']; $s->save(); Yii::app()->user->setFlash('success', 'Price inserted'); $this->redirect(Yii::app()->createUrl('shipper/oceanTrade', array('shipperId' => $shipperId))); }
</th> <th> Date until </th> <th> Note </th> <th> </th> </tr> </thead> <tbody> <?php if ($shipper->id) { $additionals = ShippingPriceAdditional::model()->findAll(array('condition' => 'shipperId = ' . $shipper->id)); } ?> <?php if ($shipper->id) { foreach ($additionals as $add) { ?> <tr> <td> <input name="ShippingPriceAdditional[<?php echo $shipper->id; ?> ][<?php echo $add->id; ?> ][name]" type="text" value="<?php