Subversion Repositories wpShopGermany4

Rev

Rev 7807 | Rev 7811 | 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
 
7809 daniel 13
	try {
14
 
15
		$oAbo = wpsg_abo::getFromOrderAndProduct($view['oOrder']->getId(), $oOrderProduct->getId());
16
 
17
		?>
7807 daniel 18
 
7809 daniel 19
		<?php echo wpsg_drawForm_AdminboxStart($oOrderProduct->getProduct()->getProductName()); ?>
7804 daniel 20
 
7809 daniel 21
			<?php $tExpire = strtotime($this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', Array($_REQUEST['edit_id'], $oOrderProduct->getProductKey()))); ?>
22
			<?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())); ?>
23
 
24
			<script>
25
 
26
				moment.locale('de');
27
 
28
				jQuery('#wpsg_mod_abo_duration').editable({
29
					type: 'combodate',
30
					display: function(value) {
31
 
32
						jQuery(this).html(value.format('DD.MM.YYYY HH:mm:ss'));
33
 
34
					},
35
					success: function(response, newValue) {
36
 
37
						jQuery.ajax({
38
							url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_abo&subaction=admin_inlineEdit&noheader=1',
39
							data: {
40
								field: 'duration',
41
								product_key: '<?php echo $oOrderProduct->getProductKey(); ?>',
42
								order_id: '<?php echo $view['oOrder']->getId() ?>',
43
								date: newValue.format()
44
							},
45
							success: function(response) {
46
 
47
								jQuery('.wpsg_abo_state').attr("class", "col-sm-6 wpsg_abo_state_class_" + response.state)
48
 
49
							}
50
						})
51
 
52
					},
53
					format: 'DD.MM.YYYY HH:mm:ss',
54
					viewformat: 'DD.MM.YYYY HH:mm:ss',
55
					template: 'D MMM YYYY  HH:mm:ss',
56
					combodate: {
57
						minYear: 2000,
58
						maxYear: <?php echo (intval(date('Y')) + 1); ?>,
59
						minuteStep: 1
60
					}
61
				});
62
 
63
			</script>
64
 
65
			<?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'))); ?>
66
			<?php
67
 
68
				$strURL = $this->callMod('wpsg_mod_abo', 'getRebuyLink', [$view['oOrder']->getId(), $oOrderProduct->getProductKey()]);
69
				$strURL = '<a href="'.$strURL.'">'.$strURL.'</a>';
70
 
71
				echo wpsg_drawForm_Text(__('URL für den Kauf einer Verlängerung', 'wpsg'), $strURL);
72
 
73
			?>
74
 
75
			<?php echo wpsg_drawForm_TextStart(); ?>
7804 daniel 76
 
7809 daniel 77
				<?php $abo_product_status = $this->callMod('wpsg_mod_abo', 'getAboProductStatus', Array($_REQUEST['edit_id'], $oOrderProduct->getProductKey())); ?>
78
 
79
				<?php if ($abo_product_status['status'] === wpsg_mod_abo::STATUS_ACTIVE) { ?>
7804 daniel 80
 
7809 daniel 81
					<?php echo __('Aktiv', 'wpsg'); ?>
82
 
83
					&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;]
84
 
85
				<?php } else if ($abo_product_status['status'] === wpsg_mod_abo::STATUS_STOPPED) { ?>
86
 
87
					<?php echo __('Inaktiv', 'wpsg'); ?>
7807 daniel 88
 
7809 daniel 89
					&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;]
7807 daniel 90
 
7809 daniel 91
				<?php } ?>
92
 
93
			<?php echo wpsg_drawForm_TextEnd(__('Verlängerung')); ?>
94
 
95
		<?php echo wpsg_drawForm_AdminboxEnd(); ?>
96
 
97
	<?php } catch (\Exception $e) { ?>
6830 daniel 98
 
7809 daniel 99
        <?php echo wpsg_drawForm_AdminboxStart($oOrderProduct->getProduct()->getProductName()); ?>
100
 
101
			<p><?php echo __('Abo wurde gelöscht.', 'wpsg'); ?></p>
102
 
103
		<?php echo wpsg_drawForm_AdminboxEnd(); ?>
104
 
105
	<?php } ?>
6830 daniel 106
 
107
<?php } ?>