Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
ItemWidget.php
1 <?php
2 /**
3  * Gentics Portal.Node PHP
4  * Author & Copyright (c) by Gentics Software GmbH
5  * sales@gentics.com
6  * http://www.gentics.com
7  * Licenses can be found in the LICENSE.txt file in the root-folder of this installation
8  * You must not use this software without a valid license agreement.
9  *
10  */
11 ?>
12 
13 <?php if(Yii::app()->user->hasFlash('itemAdded')): ?>
14 <div class="flash-success">
15  <?php echo Yii::app()->user->getFlash('itemAdded'); ?>
16 </div>
17 <?php endif; ?>
18 
19 <?php Yii::app()->controller->renderMail('shoppingcart.views.mail_templates.adminemail_template', 'asd', array('items' => array(),'user' => new User),true);
20  $form = $this->beginWidget('CActiveForm', array(
21  'id'=>'item-form-'.EncryptHelper::decrypt($model->item_id),
22  'focus'=>array($model,'title'),
23  'htmlOptions'=>array('class'=>'shop'),
24  'action'=>array('/shoppingcart/item/add')
25 ));
26 
27 ?>
28 
29 <div class="shoppingcart_item">
30 
31  <div class="row title">
32  <span>
33  <?php echo ShoppingcartModule::t($titleVisible); ?>
34  </span>
35  <span>
36  <?php echo Item::addCurrency($priceVisible); ?>
37  </span>
38  </div>
39 
40  <label for="count"><?php echo ShoppingcartModule::t('Quantity to add');?></label>
41  <?php echo $form->textField($model,'quantity',array('class'=>'positiveNumbersOnly', 'maxlength'=>3,'size'=>5)); ?>
42 
43  <div class="row">
44  <?php echo $form->hiddenField($model,'title'); ?>
45  <?php echo $form->hiddenField($model,'price'); ?>
46  <?php echo $form->hiddenField($model,'admin_email'); ?>
47  <?php echo $form->hiddenField($model,'item_id'); ?>
48  <?php echo $form->hiddenField($model,'page_id'); ?>
49  <?php echo $form->hiddenField($model,'item_referrer'); ?>
50  <?php echo CHtml::hiddenField('shoppingcart_link',$this->shoppingcart_link); ?>
51  <?php echo CHtml::hiddenField('checksum',$checksum); ?>
52  </div>
53 <?php /*
54  <div class="row added_alert">&nbsp;
55  <span class="alert">
56  <?php echo ShoppingcartModule::t('Successfully added'); ?>
57  </span>
58  </div>
59 */ ?>
60  <?php echo CHtml::submitButton(ShoppingcartModule::t('Order'),array('class'=>'toCart')); ?>
61 
62  <?php /*
63  AJAX
64 
65  echo CHtml::ajaxButton ("To order",
66  Yii::app()->createUrl('shoppingcart/cart/toCart'),
67  array('update' => '#itemList','type'=>'POST'),array('class'=>'toCart','type'=>'submit'));
68  **/
69  ?>
70 
71 </div>
72 
73 <?php $this->endWidget(); ?>
74 
75 <script>
76  var shoppingcart_alert = false;
77  jQuery(function($){
78  if(shoppingcart_alert) return;
79  shoppingcart_alert = true;
80 
81  var id = window.location.hash;
82  if(id != ''){
83  item = $(id);
84  message = $(item).find('.alert');
85  $(message).show().delay(2000).fadeOut(1500);
86  }
87  });
88 
89 </script>