|
1
|
|
|
<h1><?php e(t('Online payments')); ?></h1> |
|
2
|
|
|
|
|
3
|
|
|
<?php if (!$onlinepayment->isProviderSet()) : ?> |
|
4
|
|
|
|
|
5
|
|
|
<p>For at bruge onlinebetalinger, skal du have valgt en udbyder. <a href="choose_provider.php">V�lg udbyder</a>.</p> |
|
6
|
|
|
|
|
7
|
|
|
<?php elseif (!$onlinepayment->isSettingsSet()) : ?> |
|
8
|
|
|
|
|
9
|
|
|
<p>For at bruge onlinebetalinger, skal du have sat nogle indstillinger. <a href="settings.php">S�t indstillinger</a>.</p> |
|
10
|
|
|
|
|
11
|
|
|
|
|
12
|
|
|
<?php elseif (!$onlinepayment->isFilledIn()) : ?> |
|
13
|
|
|
<p>Der er ikke oprettet nogen betalinger.</p> |
|
14
|
|
|
<?php else : ?> |
|
15
|
|
|
|
|
16
|
|
|
|
|
17
|
|
|
<fieldset class="hide_on_print"> |
|
18
|
|
|
<legend><?php e(t('Search')); ?></legend> |
|
19
|
|
|
<form method="get" action="<?php e(url(null)); ?>"> |
|
20
|
|
|
<label><?php e(t('Text')); ?> |
|
21
|
|
|
<input type="text" name="text" value="<?php e($onlinepayment->getDBQuery()->getFilter("text")); ?>" /> |
|
22
|
|
|
</label> |
|
23
|
|
|
<label><?php e(t('Status')); ?> |
|
24
|
|
|
<select name="status"> |
|
25
|
|
|
<option value="-1"><?php e(t('All')); ?></option> |
|
26
|
|
|
<?php |
|
27
|
|
|
$status_types = OnlinePayment::getStatusTypes(); |
|
28
|
|
|
for ($i = 1, $max = count($status_types); $i < $max; $i++) { |
|
29
|
|
|
?> |
|
30
|
|
|
<option value="<?php e($i); ?>" <?php if ($onlinepayment->getDBQuery()->getFilter("status") == $i) { |
|
31
|
|
|
echo ' selected="selected"'; |
|
32
|
|
|
}?>><?php e(t($status_types[$i])); ?></option> |
|
33
|
|
|
<?php |
|
34
|
|
|
} |
|
35
|
|
|
?> |
|
36
|
|
|
</select> |
|
37
|
|
|
</label> |
|
38
|
|
|
<label><?php e(t('From date')); ?> |
|
39
|
|
|
<input type="text" name="from_date" id="date-from" value="<?php e($onlinepayment->getDBQuery()->getFilter("from_date")); ?>" /> <span id="calender"></span> |
|
40
|
|
|
</label> |
|
41
|
|
|
<label><?php e(t('To date')); ?> |
|
42
|
|
|
<input type="text" name="to_date" value="<?php e($onlinepayment->getDBQuery()->getFilter("to_date")); ?>" /> |
|
43
|
|
|
</label> |
|
44
|
|
|
<span> |
|
45
|
|
|
<input type="submit" value="<?php e(t('Search')); ?>" /> |
|
46
|
|
|
</span> |
|
47
|
|
|
</form> |
|
48
|
|
|
</fieldset> |
|
49
|
|
|
|
|
50
|
|
|
<table class="stripe"> |
|
51
|
|
|
<caption><?php e(t('Online payments')); ?></caption> |
|
52
|
|
|
<thead> |
|
53
|
|
|
<tr> |
|
54
|
|
|
<th><?php e(t('Date')); ?></th> |
|
55
|
|
|
<th><?php e(t('Transaction number')); ?></th> |
|
56
|
|
|
<th><?php e(t('Related to')); ?></th> |
|
57
|
|
|
<th><?php e(t('Amount')); ?></th> |
|
58
|
|
|
<th><?php e(t('Status')); ?></th> |
|
59
|
|
|
</tr> |
|
60
|
|
|
</thead> |
|
61
|
|
|
<tbody> |
|
62
|
|
|
<?php |
|
63
|
|
|
$saldo = 0; |
|
64
|
|
|
foreach ($payments as $payment) { |
|
65
|
|
|
?> |
|
66
|
|
|
<tr id="p<?php e($payment["id"]); ?>" <?php if (!empty($_GET['from_id']) and $_GET['from_id'] == $payment["id"]) { |
|
|
|
|
|
|
67
|
|
|
echo ' class="fade"'; |
|
68
|
|
|
} ?>> |
|
69
|
|
|
<td><?php e($payment["dk_date_created"]); ?></td> |
|
70
|
|
|
<td><a href="<?php e(url($payment['id'])); ?>"> |
|
71
|
|
|
<?php |
|
72
|
|
|
if ($payment["transaction_number"] == "") { |
|
73
|
|
|
e("Ej angivet"); |
|
74
|
|
|
} else { |
|
75
|
|
|
e($payment["transaction_number"]); |
|
76
|
|
|
} |
|
77
|
|
|
?></a> |
|
78
|
|
|
</td> |
|
79
|
|
|
<td> |
|
80
|
|
|
<?php |
|
81
|
|
|
switch ($payment['belong_to']) { |
|
82
|
|
View Code Duplication |
case "invoice": |
|
83
|
|
|
if ($kernel->user->hasModuleAccess('invoice')) { |
|
84
|
|
|
$debtor_module = $kernel->useModule('debtor'); |
|
85
|
|
|
print("<a href=\"".$debtor_module->getPath().$payment['belong_to'] . '/list/' . $payment['belong_to_id']."\">Faktura</a>"); |
|
86
|
|
|
} else { |
|
87
|
|
|
e("Faktura"); |
|
88
|
|
|
} |
|
89
|
|
|
break; |
|
90
|
|
View Code Duplication |
case "order": |
|
91
|
|
|
if ($kernel->user->hasModuleAccess('order')) { |
|
92
|
|
|
$debtor_module = $kernel->useModule('debtor'); |
|
93
|
|
|
print("<a href=\"".$debtor_module->getPath().$payment['belong_to'] . '/list/' . $payment['belong_to_id']."\">Ordre</a>"); |
|
94
|
|
|
} else { |
|
95
|
|
|
e("Ordre"); |
|
96
|
|
|
} |
|
97
|
|
|
break; |
|
98
|
|
|
default: |
|
99
|
|
|
e("Ingen"); |
|
100
|
|
|
} |
|
101
|
|
|
?> |
|
102
|
|
|
</td> |
|
103
|
|
|
<td class="amount"> |
|
104
|
|
|
<?php |
|
105
|
|
View Code Duplication |
if ($payment['currency'] && is_object($payment['currency'])) { |
|
106
|
|
|
e($payment['currency']->getType()->getIsoCode().' '); |
|
107
|
|
|
} elseif ($kernel->intranet->hasModuleAccess('currency')) { |
|
108
|
|
|
e('DKK '); |
|
109
|
|
|
} |
|
110
|
|
|
|
|
111
|
|
|
e($payment["dk_amount"]); ?></td> |
|
112
|
|
|
<td> |
|
113
|
|
|
<?php |
|
114
|
|
|
if ($payment["status"] == 'captured') { |
|
115
|
|
|
$saldo += $payment["amount"]; |
|
116
|
|
|
} |
|
117
|
|
|
|
|
118
|
|
|
e(t($payment["status"])); |
|
119
|
|
|
|
|
120
|
|
|
if ($payment['user_transaction_status_translated'] != "") { |
|
121
|
|
|
e(" (".$payment['user_transaction_status_translated']); |
|
122
|
|
|
if ($payment['pbs_status'] != '' && $payment['pbs_status'] != '000') { |
|
123
|
|
|
e(": ".$payment['pbs_status']); |
|
124
|
|
|
} |
|
125
|
|
|
e(")"); |
|
126
|
|
|
} elseif ($payment['status'] == 'authorized') { |
|
127
|
|
|
print(" (Ikke <acronym title=\"Betaling kan f�rst h�ves n�r faktura er sendt\">h�vet</acronym>)"); |
|
128
|
|
|
} |
|
129
|
|
|
?> |
|
130
|
|
|
</td> |
|
131
|
|
|
|
|
132
|
|
|
</tr> |
|
133
|
|
|
<?php |
|
134
|
|
|
} |
|
135
|
|
|
?> |
|
136
|
|
|
</tbody> |
|
137
|
|
|
</table> |
|
138
|
|
|
|
|
139
|
|
|
<p><strong><?php e(t('Total captured on the search')); ?>: </strong> <?php e($saldo); ?></p> |
|
140
|
|
|
<?php endif; ?> |
PHP has two types of connecting operators (logical operators, and boolean operators):
and&&or||The difference between these is the order in which they are executed. In most cases, you would want to use a boolean operator like
&&, or||.Let’s take a look at a few examples:
Logical Operators are used for Control-Flow
One case where you explicitly want to use logical operators is for control-flow such as this:
Since
dieintroduces problems of its own, f.e. it makes our code hardly testable, and prevents any kind of more sophisticated error handling; you probably do not want to use this in real-world code. Unfortunately, logical operators cannot be combined withthrowat this point:These limitations lead to logical operators rarely being of use in current PHP code.