Subversion Repositories wpShopGermany4

Rev

Rev 7804 | Rev 7809 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6830 daniel 1
<?php
2
 
3
    /**
4
     * Template für die Anzeige des Abo Statuses in der Hauptbestellung
5
     */
6
 
7804 daniel 7
    $view = $this->view['wpsg_mod_abo'];
6830 daniel 8
 
9
?>
7804 daniel 10
 
7807 daniel 11
<?php foreach ($this->view['arOrderedAboProducts'] as $oOrderProduct) {
6830 daniel 12
 
7807 daniel 13
    $oAbo = wpsg_abo::getFromOrderAndProduct($view['oOrder']->getId(), $oOrderProduct->getId());
14
 
15
	?>
16
 
6830 daniel 17
    <?php echo wpsg_drawForm_AdminboxStart($oOrderProduct->getProduct()->getProductName()); ?>
6834 daniel 18
 
7804 daniel 19
        <?php $tExpire = strtotime($this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', Array($_REQUEST['edit_id'], $oOrderProduct->getProductKey()))); ?>
7807 daniel 20
		<?php echo wpsg_drawForm_Text(__('Laufzeit', 'wpsg'), wpsg_formatTimestamp($tExpire), 'wpsg_mod_abo_duration', Array('class_content_wrap' => 'wpsg_abo_state wpsg_abo_state_class_'.$oAbo->getState())); ?>
7804 daniel 21
 
22
		<script>
6834 daniel 23
 
7804 daniel 24
            moment.locale('de');
25
 
26
            jQuery('#wpsg_mod_abo_duration').editable({
27
				type: 'combodate',
7807 daniel 28
                display: function(value) {
29
 
30
                    jQuery(this).html(value.format('DD.MM.YYYY HH:mm:ss'));
31
 
32
				},
7804 daniel 33
                success: function(response, newValue) {
34
 
35
					jQuery.ajax({
36
                        url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_abo&subaction=admin_inlineEdit&noheader=1',
37
						data: {
38
                            field: 'duration',
39
							product_key: '<?php echo $oOrderProduct->getProductKey(); ?>',
40
							order_id: '<?php echo $view['oOrder']->getId() ?>',
41
							date: newValue.format()
42
                        },
43
						success: function(response) {
7807 daniel 44
 
45
                            jQuery('.wpsg_abo_state').attr("class", "col-sm-6 wpsg_abo_state_class_" + response.state)
46
 
7804 daniel 47
						}
48
					})
49
 
50
                },
51
                format: 'DD.MM.YYYY HH:mm:ss',
52
                viewformat: 'DD.MM.YYYY HH:mm:ss',
53
                template: 'D MMM YYYY  HH:mm:ss',
54
                combodate: {
55
                    minYear: 2000,
56
                    maxYear: <?php echo (intval(date('Y')) + 1); ?>,
57
                    minuteStep: 1
58
                }
59
            });
60
 
61
		</script>
62
 
6834 daniel 63
        <?php echo wpsg_drawForm_Text(wpsg_translate(__('Preis (#1# Tage):', 'wpsg'), $oOrderProduct->getProduct()->wpsg_mod_abo_durration), wpsg_ff($oOrderProduct->getProduct()->wpsg_mod_abo_price, $this->get_option('wpsg_currency'))); ?>
7807 daniel 64
		<?php
65
 
66
			$strURL = $this->callMod('wpsg_mod_abo', 'getRebuyLink', [$view['oOrder']->getId(), $oOrderProduct->getProductKey()]);
67
			$strURL = '<a href="'.$strURL.'">'.$strURL.'</a>';
68
 
69
			echo wpsg_drawForm_Text(__('URL für den Kauf einer Verlängerung', 'wpsg'), $strURL);
70
 
71
		?>
6834 daniel 72
 
6830 daniel 73
        <?php echo wpsg_drawForm_TextStart(); ?>
6834 daniel 74
 
6830 daniel 75
            <?php $abo_product_status = $this->callMod('wpsg_mod_abo', 'getAboProductStatus', Array($_REQUEST['edit_id'], $oOrderProduct->getProductKey())); ?>
76
 
77
            <?php if ($abo_product_status['status'] === wpsg_mod_abo::STATUS_ACTIVE) { ?>
78
 
79
                <?php echo __('Aktiv', 'wpsg'); ?>
80
 
6834 daniel 81
                &nbsp;[&nbsp;<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_abo&edit_id=<?php echo $_REQUEST['edit_id'] ?>&product_key=<?php echo $oOrderProduct->getProductKey(); ?>&do=stop&noheader=1"><?php echo __('Deaktivieren'); ?></a>&nbsp;]
82
 
6830 daniel 83
            <?php } else if ($abo_product_status['status'] === wpsg_mod_abo::STATUS_STOPPED) { ?>
84
 
6834 daniel 85
                <?php echo __('Inaktiv', 'wpsg'); ?>
6830 daniel 86
 
6834 daniel 87
                &nbsp;[&nbsp;<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_abo&edit_id=<?php echo $_REQUEST['edit_id'] ?>&product_key=<?php echo $oOrderProduct->getProductKey(); ?>&do=run&noheader=1"><?php echo __('Aktivieren'); ?></a>&nbsp;]
6830 daniel 88
 
89
            <?php } ?>
90
 
91
        <?php echo wpsg_drawForm_TextEnd(__('Verlängerung')); ?>
6834 daniel 92
 
6830 daniel 93
    <?php echo wpsg_drawForm_AdminboxEnd(); ?>
94
 
95
<?php } ?>