Exemple #1
0
 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)));
 }
Exemple #2
0
					</th>
					<th>
						Date until
					</th>
					<th>
						Note
					</th>
					<th>
						&nbsp;
					</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