Subversion Repositories wpShopGermany4

Rev

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

Rev Author Line No. Line
1144 daniel 1
<?php
2
 
3
	/**
4
	 * Template für die Übersicht der Gutschein
5
	 */
6
 
7
?>
8
 
5753 daniel 9
<div class="wpsg_voucher" id="wpsg-bs">
5552 thomas 10
 
5753 daniel 11
    <nav class="navbar navbar-default">
1676 daniel 12
 
5552 thomas 13
		<div class="container-fluid">
14
			<div class="navbar-header">
15
				<a class="navbar-brand" href="#"><?php echo __('wpShopGermany', 'wpsg'); ?></a>
16
			</div>
5753 daniel 17
			<div class="collapse navbar-collapse" id="bs-customer-navbar-collapse-1">
5552 thomas 18
				<ul class="nav navbar-nav">
6133 thomas 19
					<li role="presentation" class="wpsg-voucher-tab-a active"><a href="#" onclick="return false;"><?php echo wpsg_translate(__("Gutscheinverwaltung (#1# Gutscheine)", "wpsg"), $this->view['countAll']); ?></a></li>
5753 daniel 20
					<li role="presentation" class="wpsg-voucher-tab-a wpsg_showhide_filter <?php echo (($this->view['hasFilter'])?'active':''); ?>" id="wpsg-voucher-tab-0"><a href="#" onclick="return false;"><span class="glyphicon glyphicon-search"></span><?php echo __("Suche", "wpsg"); ?></a></li>
21
                    <li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'add'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=add"><span class="glyphicon glyphicon-plus"></span><?php echo __("Hinzufügen", "wpsg"); ?></a></li>
5552 thomas 22
				</ul>
23
				<ul class="nav navbar-nav navbar-right">
5753 daniel 24
                    <li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'import'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=import&noheader=1"><span class="glyphicon glyphicon-import"></span><?php echo __("Import", "wpsg"); ?></a></li>
25
					<?php if (wpsg_isSizedArray($this->view['arData'])) { ?>
26
					<li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'export'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=export&noheader=1"><span class="glyphicon glyphicon-export"></span><?php echo __("Export", "wpsg"); ?></a></li>
27
					<?php } ?>
28
				</ul>
5552 thomas 29
			</div>
30
		</div>
5753 daniel 31
 
32
        <div class="wpsg-filter wpsg-customer-tab wpsg-voucher-tab-0 container-fluid form-horizontal" style="display:<?php echo (($this->view['hasFilter'] === true)?'block':'none'); ?>;">
33
            <div class="row">
5552 thomas 34
				<div class="col-lg-4">
35
					<form method="post" id="filter_form">
5753 daniel 36
 
37
						<input id="wpsg_seite" type="hidden" name="filter[page]" value="<?php echo @$this->view['page']; ?>" class="current-page" />
38
                        <input id="wpsg_order" type="hidden" name="filter[order]" value="<?php echo @$this->view['arFilter']['order']; ?>" />
39
						<input id="wpsg_ascdesc" type="hidden" name="filter[ascdesc]" value="<?php echo @$this->view['arFilter']['ascdesc']; ?>" />
40
 
41
						<?php echo wpsg_drawForm_Input('filter[s]', __('Suchfeld', 'wpsg'), wpsg_getStr($this->view['arFilter']['s'])); ?>
42
 
43
						<?php echo wpsg_drawForm_SubmitButton(__('Gutscheine suchen')); ?><br />
44
 
45
					</form>
5552 thomas 46
				</div>
5753 daniel 47
			</div>
48
        </div>
49
 
50
    </nav>
51
 
52
    <?php if ($this->view['pages'] > 1) { ?>
53
        <nav class="pagination_wrap">
54
            <ul class="pagination">
55
                <?php if ($this->view['arFilter']['page'] > 1) { ?>
56
                    <li><a onclick="return goPage(<?php echo $this->view['arFilter']['page'] - 1; ?>);" href="#" aria-label="<?php echo __('Vorherige Seite'); ?>"><span aria-hidden="true">&laquo;</span></a></li>
57
                <?php } ?>
58
                <?php for ($i = 1; $i <= $this->view['pages']; $i ++) { ?>
59
                    <li class="<?php echo (($i == $this->view['arFilter']['page'])?'active':''); ?>"><a onclick="return goPage(<?php echo $i; ?>);" href="#"><?php echo $i; ?></a></li>
60
                <?php } ?>
61
                <?php if ($this->view['arFilter']['page'] + 1 <= $this->view['pages']) { ?>
62
                    <li><a onclick="return goPage(<?php echo $this->view['arFilter']['page'] + 1; ?>);" href="#" aria-label="<?php echo __('Nächste Seite'); ?>"><span aria-hidden="true">&raquo;</span></a></li>
63
                <?php } ?>
64
            </ul>
65
        </nav>
66
	<?php } ?>
67
 
68
	<div class="wpsg_clear"></div>
69
 
1144 daniel 70
	<?php echo $this->writeBackendMessage(); ?>
1676 daniel 71
 
5753 daniel 72
	<div class="content">
1676 daniel 73
 
5753 daniel 74
        <?php if (is_array($this->view['arData']) && sizeof($this->view['arData']) > 0) { ?>
1924 daniel 75
 
5753 daniel 76
            <form method="POST" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=index&noheader=1">
77
                <table class="table wpsg-table-order table-bordered table-hover table-striped wpsg-table-customer">
78
                    <thead>
79
                        <tr>
80
                            <th class="col_checkbox"><input type="checkbox" onclick="jQuery('.col_set_checkbox').each(function() { jQuery(this).prop('checked', !jQuery(this).prop('checked')); } );" /></th>
81
                            <th class="wpsg_order col_code" data-order="code"><?php echo __("Code", 'wpsg'); ?></th>
82
                            <th class="wpsg_order col_start" data-order="start_date"><?php echo __("Start", 'wpsg'); ?></th>
83
                            <th class="wpsg_order col_end" data-order="end_date"><?php echo __("Ende", 'wpsg'); ?></th>
84
                            <th class="wpsg_order col_value" data-order="value"><?php echo __("Wert", 'wpsg'); ?></th>
85
                            <th class="wpsg_order col_status" data-order="status"><?php echo __("Status", 'wpsg'); ?></th>
86
                        </tr>
87
                    </thead>
88
                    <tbody>
89
                        <?php foreach ($this->view['arData'] as $oVoucher) { ?>
90
                        <tr>
91
                            <td class="col_checkbox">
92
 
93
                                <input class="col_set_checkbox" value="<?php echo $oVoucher->id; ?>" name="wpsg_multido[]" type="checkbox" />
94
 
95
                            </td>
96
                            <td class="col_code"><?php echo $oVoucher->code; ?></td>
97
                            <td class="col_start"><?php echo wpsg_formatTimestamp($oVoucher->start_date); ?></td>
98
                            <td class="col_end"><?php echo wpsg_formatTimestamp($oVoucher->end_date); ?></td>
99
                            <td class="col_value"><?php
100
 
101
                                if ($oVoucher->calc_typ == 'w') echo wpsg_ff($oVoucher->value, $this->get_option('wpsg_currency'));
102
                                else if ($oVoucher->calc_typ == 'p') echo wpsg_ff($oVoucher->value, '%');
103
 
104
                            ?></td>
105
                            <td class="col_status">
106
 
107
                                <?php $comment = $oVoucher->comment; if (wpsg_isSizedString($comment)) { ?>
6005 hartmut 108
                                <a title="<?php echo __("Kommentar (Admin): ", "wpsg").htmlspecialchars($comment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign admincomment" href="#"></a>
5753 daniel 109
                                <?php } ?>
110
 
111
                                <?php echo $oVoucher->getStatusLabel(); ?>
112
 
113
                                <?php $used = $oVoucher->getUsed(); if (wpsg_isSizedInt($used)) { ?>
114
                                <?php echo wpsg_translate(__('#1# mal benutzt.', 'wpsg'), $used); ?>
115
                                <?php } ?>
116
 
117
                                <?php if ($oVoucher->multi === '1') { ?>
118
                                <span title="<?php echo __('Mehrfach benutzbar', 'wpsg'); ?>">&nbsp;[M]</span>
119
                                <?php } ?>
120
 
121
                            </td>
122
                        </tr>
123
                        <?php } ?>
124
                    </tbody>
125
                </table>
126
 
127
                 <div class="alignleft actions">
128
 
129
                    <input onclick="if (!confirm('<?php echo __('Sind Sie sich sicher?', 'wpsg'); ?>')) return false;" type="submit" value="<?php echo __('Markierte Gutscheine löschen', 'wpsg'); ?>" class="button-secondary action" id="doaction" name="submit-multidelete" />
130
 
131
                </div>
132
 
133
            </div>
134
 
135
            <?php if ($this->view['pages'] > 1) { ?>
136
                <nav class="pagination_wrap pagination_wrap_bottom">
137
                    <ul class="pagination">
138
                        <?php if ($this->view['arFilter']['page'] > 1) { ?>
139
                            <li><a onclick="return goPage(<?php echo $this->view['arFilter']['page'] - 1; ?>);" href="#" aria-label="<?php echo __('Vorherige Seite'); ?>"><span aria-hidden="true">&laquo;</span></a></li>
140
                        <?php } ?>
141
                        <?php for ($i = 1; $i <= $this->view['pages']; $i ++) { ?>
142
                            <li class="<?php echo (($i == $this->view['arFilter']['page'])?'active':''); ?>"><a onclick="return goPage(<?php echo $i; ?>);" href="#"><?php echo $i; ?></a></li>
143
                        <?php } ?>
144
                        <?php if ($this->view['arFilter']['page'] + 1 <= $this->view['pages']) { ?>
145
                            <li><a onclick="return goPage(<?php echo $this->view['arFilter']['page'] + 1; ?>);" href="#" aria-label="<?php echo __('Nächste Seite'); ?>"><span aria-hidden="true">&raquo;</span></a></li>
146
                        <?php } ?>
147
                    </ul>
148
                </nav>
149
            <?php } ?>
150
 
151
        <?php } else { ?>
152
 
153
            <?php echo wpsg_drawForm_AdminboxStart(); ?>
154
    		<?php echo __('Keine Gutscheine in der Datenbank.', 'wpsg'); ?>
155
            <?php echo wpsg_drawForm_AdminboxEnd(); ?>
156
 
157
        <?php } ?>
158
 
159
    </div>
160
 
1599 daniel 161
</div>
162
 
1676 daniel 163
<script type="text/javascript">/* <![CDATA[ */
1599 daniel 164
 
5753 daniel 165
    <?php if (wpsg_isSizedString($this->view['arFilter']['order']) && wpsg_isSizedString($this->view['arFilter']['ascdesc'])) { ?>
166
    jQuery('th[data-order="<?php echo $this->view['arFilter']['order']; ?>"]').addClass('wpsg_order_<?php echo strtolower($this->view['arFilter']['ascdesc']); ?>');
167
    <?php } ?>
168
 
169
	function goPage(page)
1599 daniel 170
	{
171
 
6152 thomas 172
		//if (page <= 0 || page == <?php echo $this->view['arFilter']['page']; ?> || page > <?php echo $this->view['pages']; ?>) return;
1599 daniel 173
 
5753 daniel 174
		jQuery('#wpsg_seite').val(page);
175
		jQuery('#filter_form').submit();
1599 daniel 176
 
5753 daniel 177
		return false;
178
 
179
	} // function goPage(page)
180
 
181
 
1676 daniel 182
/* ]]> */</script>