added filter for sended emails
This commit is contained in:
@@ -102,7 +102,66 @@
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr><tr>
|
||||
</tr>
|
||||
|
||||
<!-- add new checkbox field here called "Verrechnet" and if $preorder->billed is not null or 0 show the unix date, also only show this when
|
||||
preordercampaign -> network_id -> network -> owner_id === 209
|
||||
|
||||
then show billed = timestamp (no input as the checkbox is the only thing that can be changed)
|
||||
also show billed_by
|
||||
|
||||
-->
|
||||
<?php if($preorder->campaign->network->owner_id === "209"): ?>
|
||||
<tr>
|
||||
<th>Verrechnet:</th>
|
||||
<td>
|
||||
<div class="flex items-center space-x-2">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="preorder-detail-billed-<?=$preorder->id?>"
|
||||
class="form-checkbox h-5 w-5 text-blue-600 rounded focus:ring-blue-500"
|
||||
<?=($preorder->billed) ? 'checked' : ''?>
|
||||
onchange="updatePreorderBilled(<?=$preorder->id?>, this.checked)"
|
||||
/>
|
||||
<label for="preorder-detail-billed-<?=$preorder->id?>" class="text-gray-700 mb-0">Verrechnet</label>
|
||||
</div>
|
||||
|
||||
<?php if($preorder->billed_by): ?>
|
||||
<div class="mt-2 text-sm text-gray-600" id="billed_text">Verrechnet durch: <?=(new User($preorder->billed_by))->name?> am <?=date("d.m.Y H:i", $preorder->billed)?> Uhr</div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<script>
|
||||
// console log if changed
|
||||
function updatePreorderBilled(preorderId, isChecked) {
|
||||
console.log("Updating billed status for preorder " + preorderId + ": " + (isChecked ? "checked" : "unchecked"));
|
||||
$.ajax({
|
||||
url: '<?=self::getUrl("Preorder", "Api")?>?do=updateBilled',
|
||||
type: 'POST',
|
||||
data: {
|
||||
do: 'updateBilled',
|
||||
id: preorderId,
|
||||
billed: isChecked ? 1 : 0
|
||||
},
|
||||
success: function(response) {
|
||||
console.log("Update successful:", response);
|
||||
if (isChecked) {
|
||||
$("#billed_text").html(`Verrechnet durch: ${response.result.billed_by_name} am ${response.result.billed_date} Uhr`);
|
||||
window.notify("success", "Preorder wurde als verrechnet markiert.");
|
||||
} else {
|
||||
$("#billed_text").html("");
|
||||
window.notify("success", "Preorder wurde als nicht verrechnet markiert.");
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error("Update failed:", error);
|
||||
window.notify("error", "Fehler beim Aktualisieren des Verrechnungsstatus: " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<th>Erstellt:</th>
|
||||
<td class="text-monospace"><?=date("d.m.Y H:i",$preorder->create)?> (<?=$preorder->creator->name?>)</td>
|
||||
</tr><tr>
|
||||
|
||||
Reference in New Issue
Block a user