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  <?php /*
43  <div class="row quantity">
44  <?php echo $form->textField($model,'quantity',array('class'=>'positiveNumbersOnly', 'autocomplete' => 'off', 'maxlength'=>3)); ?>
45  <?php echo $form->error($model,'quantity'); ?>
46  </div>
47 */ ?>
48  <div class="row">
49  <?php echo $form->hiddenField($model,'title'); ?>
50  <?php echo $form->hiddenField($model,'price'); ?>
51  <?php echo $form->hiddenField($model,'admin_email'); ?>
52  <?php echo $form->hiddenField($model,'item_id'); ?>
53  <?php echo $form->hiddenField($model,'page_id'); ?>
54  <?php echo $form->hiddenField($model,'item_referrer'); ?>
55  <?php echo CHtml::hiddenField('shoppingcart_link',$this->shoppingcart_link); ?>
56  <?php echo CHtml::hiddenField('checksum',$checksum); ?>
57  </div>
58 <?php /*
59  <div class="row added_alert">&nbsp;
60  <span class="alert">
61  <?php echo ShoppingcartModule::t('Successfully added'); ?>
62  </span>
63  </div>
64 */ ?>
65  <?php echo CHtml::submitButton(ShoppingcartModule::t('Order'),array('class'=>'toCart')); ?>
66 
67  <?php /*
68  AJAX
69 
70  echo CHtml::ajaxButton ("To order",
71  Yii::app()->createUrl('shoppingcart/cart/toCart'),
72  array('update' => '#itemList','type'=>'POST'),array('class'=>'toCart','type'=>'submit'));
73  **/
74  ?>
75 
76 </div>
77 
78 <?php $this->endWidget(); ?>
79 
80 <script>
81  var shoppingcart_alert = false;
82  jQuery(function($){
83  if(shoppingcart_alert) return;
84  shoppingcart_alert = true;
85 
86  var id = window.location.hash;
87  if(id != ''){
88  item = $(id);
89  message = $(item).find('.alert');
90  $(message).show().delay(2000).fadeOut(1500);
91  }
92  });
93 
94 </script>