public function beforeSave() { if (empty($this->path)) { $mainMenu = SnapUtil::config('general/site.default_menu'); $MI = MenuItem::model()->findByAttributes(array('menu_id' => $mainMenu, 'content_id' => $this->id)); if ($MI && !empty($this->id)) { $this->path = $MI->createPath(); } else { $this->path = '/' . $this->type . '/' . $this->title; } } $this->path = SnapFormat::slugify($this->path); return parent::beforeSave(); }
?> <td class="value <?php echo $retail > $DateBox->box_price ? 'red' : ''; ?> "><?php echo SnapFormat::currency($retail); ?> </td> <?php } ?> <?php } ?> <td class="value"><strong><?php echo SnapFormat::currency(BoxItem::dateRetail($SelectedDeliveryDate->id)); ?> </strong></td> <td></td> </tr> </tfoot> </table> <?php $this->endWidget(); ?> </div> <div id="customers" class="tab-pane"> <?php $this->beginWidget('bootstrap.widgets.BsPanel'); ?>
} else { ?> <?php echo CHtml::image($this->createUrl('boxSize/image')); ?> <?php } ?> </div> </div> <div class="large-8 columns"> <h3><?php echo CHtml::encode($Box->BoxSize->box_size_name); ?> Box <br /><span class="each"><?php echo SnapFormat::currency($Box->box_price); ?> ea.<span></h3> <?php if (!$pastDeadline) { ?> <div class="row"> <div class="large-6 columns"> <?php echo CHtml::dropDownList('boxes[' . $Box->box_id . ']', $quantity, UserBox::$quantityOptions); ?> </div> <div class="large-6 columns"> <?php echo CHtml::submitButton('Update', array('class' => 'button tiny')); ?>
if (!$pastDeadline) { ?> <div class="row"> <div class="large-6 columns"> <?php echo $form->dropDownList($data, 'quantity', Inventory::$quantityOptions, array('name' => 'extras[' . $data->id . ']')); ?> </div> <div class="large-6 columns"> <?php echo CHtml::submitButton('Update', array('class' => 'button tiny')); ?> </div> </div> <?php } else { ?> <span class="quantity"><strong>Qty:</strong> <?php echo $data->quantity; ?> </span> <?php } ?> <span class="price"><strong>Price:</strong> <?php echo CHtml::encode(SnapFormat::currency($data->total)); ?> </span> </div> </div> </div>
</div> <?php if (!empty($data->description)) { ?> <span class="description"><?php echo $data->description; ?> </span> <?php } ?> <span class="price"> <?php echo CHtml::encode(SnapFormat::currency($data->item_sales_price)); ?> (<?php echo $data->unit_label; ?> ) </span> <?php echo $data->getQuantityInput($form, null, 1); ?> <?php echo CHtml::submitButton('Add to cart', array('class' => 'btn btn-default btn-xs', 'name' => 'add_to_cart')); ?> <?php $this->endWidget();
<?php echo $this->renderPartial('../orderItem/_view_cart', array('data' => $SP, 'form' => $form)); ?> <?php } ?> </div> <div class="inner"> <div class="row"> <div class="col-xs-8"> <strong>Total:</strong> </div> <div class="price-col col-xs-4"> <strong><?php echo SnapFormat::currency($BoxoCart->total); ?> </strong> </div> </div> </div> <?php echo CHtml::submitButton('Update Cart', array('class' => 'btn btn-sm btn-default pull-left', 'name' => 'update_cart')); ?> <?php echo !$cartEmpty ? CHtml::submitButton('Checkout', array('class' => 'btn btn-sm btn-success pull-right', 'name' => 'checkout')) : ''; ?> <?php } else {
<?php /* @var $this UserLocationController */ /* @var $model UserLocation */ ?> <h1>Orders</h1> <?php if (Yii::app()->request->getParam('fromToday', 1) == 0) { ?> <?php echo CHtml::link('View From Today', array('user/orders', 'id' => $User->id, 'fromToday' => 1), array('class' => 'button small')); } else { ?> <?php echo CHtml::link('View All', array('user/orders', 'id' => $User->id, 'fromToday' => 0), array('class' => 'button small')); } ?> <p>Your current balance is <?php echo SnapFormat::currency($User->balance); ?> </p> <?php $this->widget('zii.widgets.CListView', array('dataProvider' => $ordersDP, 'itemView' => '_order_view')); ?>
<?php /* @var $this MenuItemController */ /* @var $data MenuItem */ ?> <div class="alert alert-<?php echo $data->level == 'error' ? 'danger' : $data->level; ?> "> <strong><?php echo $data->level; ?> - <?php echo $data->category; ?> </strong> - <span class="date"><?php echo SnapFormat::datetime($data->logtime); ?> </span><br /> <p> </p> <pre><?php echo $data->message; ?> </pre> </div>
public function createPath() { $path = SnapFormat::slugify($this->title); $Parent = $this->Parent; while ($Parent) { $path = SnapFormat::slugify($Parent->title) . '/' . $path; $Parent = $Parent->Parent; } return '/' . $path; }
?> </td> <td><?php echo SnapFormat::currency($bal); ?> </td> </tr> <?php } ?> <?php } ?> </tbody> <tfoot> <tr> <td></td> <td></td> <td><?php echo SnapFormat::currency($total); ?> </td> </tr> </tfoot> </table> <?php $this->endWidget(); ?> </div> </div>
echo $model->name; ?> </h1> </div> <div class="large-12 columns"> <div class="panel"> <?php echo CHtml::link('List', array('supplierProduct/index'), array('class' => 'button small')); ?> <?php echo CHtml::link('Create', array('supplierProduct/create'), array('class' => 'button small')); ?> <?php echo CHtml::link('Update', array('supplierProduct/update', 'id' => $model->id), array('class' => 'button small')); ?> <?php echo CHtml::link('Delete', array('supplierProduct/delete', 'id' => $model->id), array('class' => 'button small')); ?> <?php echo CHtml::link('Manage', array('supplierProduct/admin'), array('class' => 'button small')); ?> </div> </div> <div class="large-12 columns"> <?php $this->widget('zii.widgets.CDetailView', array('data' => $model, 'cssFile' => '', 'attributes' => array('Supplier.name', 'name', 'value', 'unit', array('name' => 'available_from', 'value' => SnapFormat::getMonthName($model->available_from)), array('name' => 'available_to', 'value' => SnapFormat::getMonthName($model->available_to))))); ?> </div> </div>
<div class="col-md-6"> <?php $this->beginWidget('bootstrap.widgets.BsPanel', array('title' => 'Recent Activity', 'titleTag' => 'h1', 'type' => BsHtml::PANEL_TYPE_INFO)); ?> <?php foreach ($RecentActivity as $Log) { ?> <p class="alert alert-<?php echo $Log->level == 'error' ? 'danger' : $Log->level; ?> "> <strong><?php echo $Log->category; ?> </strong> - <span class="date"><?php echo SnapFormat::datetime($Log->logtime); ?> </span><br /> <?php echo $Log->message; ?> <p> <?php } ?> <?php $this->endWidget(); ?> </div> </div>
public function getTotal_box_price() { $price = $this->Box->box_price * $this->quantity; return SnapFormat::currency($price); }
public function getLocation_and_delivery() { return $this->location_name . ' (' . SnapFormat::currency($this->location_delivery_value) . ')'; }
<div class="col-sm-2"> <?php echo SnapFormat::datetime($data->payment_date, 'short'); ?> </div> <div class="col-sm-6"> <?php echo CHtml::encode($data->payment_note); ?> </div> <div class="col-sm-1"> <?php echo CHtml::encode($data->payment_type); ?> </div> <div class="col-sm-1 text-right"> <?php echo $data->payment_value > 0 ? SnapFormat::currency($data->payment_value) : ''; ?> </div> <div class="col-sm-1 text-right"> <?php echo $data->payment_value < 0 ? SnapFormat::currency(abs($data->payment_value)) : ''; ?> </div> <div class="col-sm-1 text-right"> <?php echo SnapFormat::currency($data->balance_at_date); ?> </div> </div>
<?php $dds = $Location->getDeliveryDays(); ?> <div class="alert alert-info"> This order is for delivery on <strong><?php echo SnapFormat::date($DeliveryDate->date, 'full'); ?> </strong> at <strong><?php echo $Location->location_name; ?> </strong> </div> <?php /* if(count($dds) > 1): ?> <div class="alert alert-warning"> This location has a delivery run <strong><?php echo count($dds) ?></strong> times a week on <?php $lastDay = array_pop($dds); ?> <?php echo implode(', ', $dds); ?> and <?php echo $lastDay ?> </div> <?php endif; */
public function formatCurrency($value) { return SnapFormat::currency($value); }
$before = $BoxoCart->getBoxBefore($ddId, $data); ?> <div class="row text-danger before"> <div class="col-xs-1 quantity"> <?php echo $before->quantity; ?> </div> <div class="col-xs-5"> <h3><?php echo CHtml::encode($Box->BoxSize->box_size_label); ?> </h3> <span class="price item-price"> <?php echo SnapFormat::currency($Box->box_price); ?> ea. </span> </div> <div class="col-xs-4 price-col pull-right"> <span class="price sub-total"><?php echo CHtml::encode(SnapFormat::currency($before->total_price)); ?> </span> </div> </div> <?php } ?> </div>
} ?> <?php foreach ($BoxoCart->getDeliveryDates(true) as $DD) { if ($BoxoCart->getTotalForDate($DD) == 0) { continue; } ?> <option value="<?php echo $BoxoCart->getTotalForDate($DD); ?> "><?php echo SnapFormat::date($DD->date, 'full'); ?> (<?php echo SnapFormat::currency($BoxoCart->getTotalForDate($DD)); ?> )</option> <?php } ?> </select> </div> </div> <div class="form-group"> <?php echo CHtml::link('Confirm Purchase', array('shop/confirmOrder'), array('class' => 'btn btn-primary pull-right', 'id' => 'btn-confirm-purchase', 'style' => 'display:none')); ?> <input type="submit" value="Confirm Purchase" class="btn btn-primary pull-right" id="btn-purchase-paypal" style="display:none" /> </div>
public function getDelivery_date_formatted() { return SnapFormat::date($this->delivery_date); }
public function getOrderDate($days) { //$minDays = SnapUtil::config('boxomatic/minimumAdvancePayment'); $days -= 7; // minus 1 week $NextDate = $this->getNextDeliveryDate($days); return $NextDate ? SnapFormat::date($NextDate->date, 'full') : 'Error!'; }
public function actionConfirmOrder() { $BoxoCart = new BoxoCart(); $minDays = SnapUtil::config('boxomatic/minimumAdvancePayment'); $nextTotal = $BoxoCart->getNextTotal($minDays); if ($nextTotal !== 0) { Yii::app()->user->setFlash('danger', 'You must add at least <strong>' . SnapFormat::currency($nextTotal) . '</strong> to your account to do this.'); } else { $BoxoCart = new BoxoCart(); $BoxoCart->confirmOrder(); Yii::app()->user->setFlash('success', 'Your order has been updated.'); } $this->redirect(array('/shop/checkout')); }
/** * */ public function actionRefund($custBox) { $CustBox = UserBox::model()->findByPk($custBox); if ($CustBox) { $Payment = new UserPayment(); $Payment->payment_value = 1 * ($CustBox->Box->box_price + $CustBox->delivery_cost); //make price a negative value for payment table $Payment->payment_type = 'CREDIT'; $Payment->payment_date = new CDbExpression('NOW()'); $Payment->user_id = $CustBox->user_id; $Payment->staff_id = Yii::app()->user->id; $note = 'REFUND FOR: 1 x ' . $CustBox->Box->BoxSize->box_size_name . ' Box @ ' . SnapFormat::currency($CustBox->Box->box_price); $tmpDel = (double) $CustBox->delivery_cost; if (!empty($tmpDel)) { $note .= ' + ' . SnapFormat::currency($tmpDel) . ' delivery'; } $Payment->payment_note = $note; $Payment->save(); $CustBox->delete(); Yii::app()->user->setFlash('success', "Customer box has been excluded for delivery and refunded."); } else { Yii::app()->user->setFlash('success', "Could not find the given Customer Box"); } $this->redirect(array('userBoxes', 'date' => $CustBox->Box->delivery_date_id)); }
echo CHtml::encode($product->name); ?> </h3> <span class="price item-price"> <?php echo SnapFormat::currency($product->item_sales_price); ?> (<?php echo $product->unit_label; ?> ) </span> </div> <div class="col-xs-4 price-col pull-right"> <span class="price sub-total"><?php echo CHtml::encode(SnapFormat::currency($data->total)); ?> </span> </div> </div> <div class="row"> <div class="col-md-9 col-md-offset-3"> <span class="available-until"> Available until: <?php echo SnapFormat::date($product->customer_available_to); ?> </span> </div> </div> </div>
public function getFormatted_date() { return SnapFormat::dayOfYear($this->date); }
</tr> </thead> <tbody> <tr> <td class='boxes'><?php echo SnapFormat::currency($Customer->totalBoxesByDeliveryDate($DeliveryDate->id)); ?> </td> <td class='extras'>?</td> <td class='delivery'><?php echo SnapFormat::currency($Customer->totalDeliveryByDeliveryDate($DeliveryDate->id)); ?> </td> <td class='total'> <strong><?php echo SnapFormat::currency($Customer->totalByDeliveryDate($DeliveryDate->id)); ?> </strong> <?php if (Yii::app()->user->shadow_id) { ?> <?php echo CHtml::link('update', array('deliveryDate/updateUserBoxes', 'date_id' => $DeliveryDate->id, 'cust_id' => $Customer->user_id), array('class' => 'button small')); ?> <?php } ?> </td> </tr> </tbody> </table>
foreach ($Orders as $Order) { $DD = $Order->DeliveryDate; $Location = $Order->Location; ?> <div class="panel panel-default"> <a class="panel-heading" data-toggle="collapse" data-parent="#checkout-cart" href="#collapse-<?php echo $DD->id; ?> "> <h3> <?php echo SnapFormat::date($DD->date, 'full'); ?> <span class="pull-right"> <?php echo SnapFormat::currency($Order->total); ?> <span class="glyphicon"></span> </span> </h3> </a> <div id="collapse-<?php echo $DD->id; ?> " class="panel-collapse collapse"> <div class="panel-body"> <div class="row"> <div class="col-md-6"> <p>Delivery to: <strong><?php echo $Location->location_name; ?>
</div> </div> </div> <hr /> <?php echo $form->dateFieldControlGroup($model, 'delivery_date'); ?> <?php echo $form->textFieldControlGroup($model, 'other_costs'); ?> <div class="form-group"> <div class="col-md-10 col-md-offset-2"> <?php echo SnapFormat::currency($model->total); ?> </div> </div> <?php echo $form->textAreaControlGroup($model, 'order_notes'); ?> </div> <?php echo $this->renderPartial('//layouts/_form_sidebar'); ?> <?php $this->endWidget();
<p>Your pickup/delivery location is <?php echo $UserBox->delivery_location; ?> .</p> <p>Your <?php echo Yii::app()->name; ?> account has been debited <?php echo SnapFormat::currency($UserBox->Box->box_price + $UserBox->delivery_cost); ?> </p> <p>Your current balance is <?php echo SnapFormat::currency($Customer->balance - $UserBox->Box->box_price + $UserBox->delivery_cost); ?> </p> <h3>Managing your <?php echo Yii::app()->name; ?> account</h3> <p>You can check your account status, add credit and view previous orders at: <a href="<?php echo $this->createAbsoluteUrl('/'); ?> "><?php echo $this->createAbsoluteUrl('/'); ?>
<div class="panel"> <h3><?php echo CHtml::link(SnapFormat::date($data->DeliveryDate->date), array('/shop/default/index', 'date' => $data->delivery_date_id)); ?> </h3> <ul class="no-bullet"> <li> Order Total: <?php echo SnapFormat::currency($data->User->totalByDeliveryDate($data->delivery_date_id)); ?> </li> <li> <?php echo $data->getAttributeLabel('status'); ?> : <?php echo CHtml::encode($data->status_text); ?> </li> </ul> </div>