Skip to content

Commit

Permalink
Hide the Export function when there are no records (locations, ticket…
Browse files Browse the repository at this point in the history
…s, vendors)
  • Loading branch information
wrongecho committed Aug 30, 2024
1 parent 8ddb450 commit cf322b1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
14 changes: 8 additions & 6 deletions client_locations.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#importLocationModal">
<i class="fa fa-fw fa-upload mr-2"></i>Import
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#exportLocationModal">
<i class="fa fa-fw fa-download mr-2"></i>Export
</a>
<?php if ($num_rows[0] > 0) { ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#exportLocationModal">
<i class="fa fa-fw fa-download mr-2"></i>Export
</a>
<?php } ?>
</div>
</div>
</div>
Expand Down Expand Up @@ -95,7 +97,7 @@

<div class="col-md-6">
<div class="btn-group float-right">
<a href="?client_id=<?php echo $client_id; ?>&archived=<?php if($archived == 1){ echo 0; } else { echo 1; } ?>"
<a href="?client_id=<?php echo $client_id; ?>&archived=<?php if($archived == 1){ echo 0; } else { echo 1; } ?>"
class="btn btn-<?php if($archived == 1){ echo "primary"; } else { echo "default"; } ?>">
<i class="fa fa-fw fa-archive mr-2"></i>Archived
</a>
Expand Down Expand Up @@ -265,7 +267,7 @@ class="btn btn-<?php if($archived == 1){ echo "primary"; } else { echo "default"
<i class="fas fa-fw fa-archive mr-2"></i>Archive
</a>
<?php } ?>

<?php } ?>
</div>
</div>
Expand Down
10 changes: 6 additions & 4 deletions client_tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#addTicketFromTemplateModal">
<i class="fa fa-fw fa-plus mr-2"></i>From Template
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#exportTicketModal">
<i class="fa fa-fw fa-download mr-2"></i>Export
</a>
<?php if ($num_rows[0] > 0) { ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#exportTicketModal">
<i class="fa fa-fw fa-download mr-2"></i>Export
</a>
<?php } ?>
</div>
</div>
</div>
Expand Down
20 changes: 11 additions & 9 deletions client_vendors.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#addVendorFromTemplateModal">
<i class="fa fa-fw fa-puzzle-piece mr-2"></i>Create from Template
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#exportVendorModal">
<i class="fa fa-fw fa-download mr-2"></i>Export
</a>
<?php if ($num_rows[0] > 0) { ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#exportVendorModal">
<i class="fa fa-fw fa-download mr-2"></i>Export
</a>
<?php } ?>
</div>
</div>
</div>
Expand All @@ -62,7 +64,7 @@

<div class="col-md-8">
<div class="btn-group float-right">
<a href="?client_id=<?php echo $client_id; ?>&archived=<?php if($archived == 1){ echo 0; } else { echo 1; } ?>"
<a href="?client_id=<?php echo $client_id; ?>&archived=<?php if($archived == 1){ echo 0; } else { echo 1; } ?>"
class="btn btn-<?php if($archived == 1){ echo "primary"; } else { echo "default"; } ?>">
<i class="fa fa-fw fa-archive mr-2"></i>Archived
</a>
Expand Down Expand Up @@ -137,13 +139,13 @@ class="btn btn-<?php if($archived == 1){ echo "primary"; } else { echo "default"
$vendor_created_at = nullable_htmlentities($row['vendor_created_at']);
$vendor_archived_at = nullable_htmlentities($row['vendor_archived_at']);
$vendor_template_id = intval($row['vendor_template_id']);

if (empty($vendor_website)) {
$vendor_website_display = "-";
} else {
$vendor_website_display = "<button class='btn btn-sm clipboardjs' data-clipboard-text='$vendor_website'><i class='far fa-copy text-secondary'></i></button><a href='https://$vendor_website' target='_blank'><i class='fa fa-external-link-alt text-secondary'></i></a>";
}

?>
<tr>
<td class="pr-0">
Expand All @@ -161,7 +163,7 @@ class="btn btn-<?php if($archived == 1){ echo "primary"; } else { echo "default"
</div>
</div>
</a>

</td>
<td>
<?php
Expand Down Expand Up @@ -231,7 +233,7 @@ class="btn btn-<?php if($archived == 1){ echo "primary"; } else { echo "default"
</div>
</div>

<script src="js/bulk_actions.js"></script>
<script src="js/bulk_actions.js"></script>

<?php
require_once "vendor_add_modal.php";
Expand Down

0 comments on commit cf322b1

Please sign in to comment.