CumulusClips - Forums
Add in Total Report (Total video views and total views of a single video)
I think, it will be good if on the dashboard, Admin can see, the total number of views of all videos and also total number of views of a single video, this is good when advertisers want to know your numbers
Comments
/cc-core/system/FILENAME.php
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
width: 1024px
}
</style>
</head>
<body>
<?php
$servername = "SERVERNAME";
$username = "USERNAME";
$password = "PASSWORD";
$dbname = "DATABASENAME";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT title,views,description FROM videos WHERE 1\n ORDER BY videos.views DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "<table><tr><th><h2>Title</th><th><h2>Views</th><th><h2>Description</h2></th></tr>";
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr><td><center>".$row["title"]."</td><td><center>".$row["views"]."</td><td>".$row["description"]."</td></tr>";
}
echo "</table></center>";
} else {
echo "0 results";
}
$conn->close();
?>