Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Oct 18, 2024
1 parent 23430e5 commit 0800278
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 5 deletions.
15 changes: 15 additions & 0 deletions plugin/AD_Server/Objects/VastCampaignsLogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,4 +486,19 @@ public static function getEventType()

return $fullData;
}

public static function getExternalReferrer()
{
global $global;
$formats = '';
$values = [];

$sql = "SELECT distinct vcl.external_referrer
FROM vast_campaigns_logs vcl";
$res = sqlDAL::readSql($sql);
$fullData = sqlDAL::fetchAllAssoc($res);
sqlDAL::close($res);

return $fullData;
}
}
30 changes: 25 additions & 5 deletions plugin/AD_Server/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
$eventTypes[] = $value['type'];
}

$referrers = VastCampaignsLogs::getExternalReferrer();
$referrersTypes = [];
foreach ($referrers as $key => $value) {
if(!empty($value['external_referrer'])){
$referrersTypes[] = $value['external_referrer'];
}
}

?>
<div class="container-fluid">
<style>
Expand Down Expand Up @@ -70,7 +78,7 @@

<!-- Row for Campaign Type and Event Type Selection -->
<div class="row">
<div class="col-md-3 col-sm-6">
<div class="col-md-2 col-sm-6">
<div class="form-group">
<label for="campaign-type" class="control-label"><?php echo __('Select Campaign Source'); ?></label>
<select id="campaign-type" class="form-control">
Expand All @@ -83,7 +91,7 @@
</div>
</div>

<div class="col-md-3 col-sm-6">
<div class="col-md-2 col-sm-6">
<div class="form-group">
<label for="event-type" class="control-label"><?php echo __('Select Event Type'); ?></label>
<select id="event-type" class="form-control">
Expand All @@ -95,8 +103,20 @@
</div>
</div>

<div class="col-md-2 col-sm-6">
<div class="form-group">
<label for="referrer-type" class="control-label"><?php echo __('Select Referrer'); ?></label>
<select id="referrer-type" class="form-control">
<option value=""><?php echo __('All Referrers'); ?></option>
<?php foreach ($referrersTypes as $referrer) : ?>
<option value="<?= $referrer ?>"><?= $referrer ?></option>
<?php endforeach; ?>
</select>
</div>
</div>

<!-- Report Type Selection -->
<div class="col-md-3 col-sm-6">
<div class="col-md-2 col-sm-6">
<div class="form-group">
<label for="report-type" class="control-label"><?php echo __('Select Report Type'); ?></label>
<select id="report-type" class="form-control" required>
Expand All @@ -112,14 +132,14 @@
</div>

<!-- Video and User Select Containers (Hidden Initially) -->
<div class="col-md-3 col-sm-6" id="videos-select-container" style="display:none;">
<div class="col-md-4 col-sm-6" id="videos-select-container" style="display:none;">
<div class="form-group">
<label for="videos_id" class="control-label"><?php echo __('Select Video'); ?>:</label>
<?php $autoComplete = Layout::getVideoAutocomplete(0, 'videos_id'); ?>
</div>
</div>

<div class="col-md-3 col-sm-6" id="users-select-container" style="display:none;">
<div class="col-md-4 col-sm-6" id="users-select-container" style="display:none;">
<div class="form-group">
<label for="users_id" class="control-label"><?php echo __('Select User'); ?>:</label>
<?php $updateUserAutocomplete = Layout::getUserAutocomplete(0, 'users_id'); ?>
Expand Down

0 comments on commit 0800278

Please sign in to comment.