Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $filename = scandir(__DIR__ . DIRECTORY_SEPARATOR . 'files/', 1);
- define(FAILIK, __DIR__ . DIRECTORY_SEPARATOR . 'files/' . $filename[0]);
- //echo FAILIK;
- $db = array();
- $file = file(FAILIK);
- unset($file[0]);
- $last = count($file);
- unset($file[$last]);
- //echo $last;
- foreach ($file as $line) {
- $buf = explode(",", trim($line));
- $db[$buf[0]] = $buf;
- }
- //var_dump($db);
- //utm_source,Clicks,"LP Views","LP Clicks","LP CTR",Leads,"Offer CVR","LP CVR",EPC,CPC,Rev.,Cost,P/L,ROI
- if (isset($_POST['SUBMIT'])) {
- foreach ($db as $parametr => $stats) {
- if ($stats[2] >= $_POST['clicks'] and ((($stats[5] * $_POST['pay']) - ($stats[2] * $_POST['cpc'])) / ($stats[2] * $_POST['cpc']) * 100 ) <= $_POST['roi'])
- $vuvod[$parametr] = $stats;
- }
- }
- else {
- foreach ($db as $parametr => $stats) {
- $vuvod[$parametr] = $stats;
- }
- }
- //сортировка
- uasort($parametr, 'cmp');
- function cmp ($a, $b) {
- if ($a[2] == b[2]) {
- return 0;
- }
- return ($a[2] < b[2]) ? -1: 1;
- }
- //сортировка
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <title>Найди минусовые ПАБЫ ТЕЛЕГА</title>
- <!-- Latest compiled and minified CSS -->
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
- </head>
- <body>
- <br/>
- <br/>
- <div style=" width: 500px; margin: 20px auto">
- <form action="work.php" method="post" name="filtr">
- <p>
- <label for="textfield">CPC </label>
- <input type="text" name="cpc" value="<?php echo $_POST['cpc'];?>" id="textfield"/>
- </p>
- <p><label for="textfield">CLICK/PARAM</label>
- <input type="text" name="clicks" id="textfield" value="<?php echo $_POST['clicks'];?>"/></p>
- <p><label for="textfield">PAYOUT</label>
- <input type="text" name="pay" value="<?php echo $_POST['pay'];?>" id="textfield"/></p>
- <p><label for="textfield">ROI</label>
- <input type="text" name="roi" value="<?php echo $_POST['roi'];?>" id=</p>
- <p>
- <input name="SUBMIT" type="submit" value="Фильтровать"/>
- </form>
- </div>
- <br/>
- <br/>
- <!-- utm_source,Clicks,"LP Views","LP Clicks","LP CTR",Leads,"Offer CVR","LP CVR",EPC,CPC,Rev.,Cost,P/L,ROI -->
- <div style=" width: 800px; margin: 20px auto">
- <?php echo $_POST['cpc'] * $stats[2] ;?>
- <div class="table-responsive">
- <table class="table table-bordered">
- <thead>
- <tr>
- <th>utm_PARAM</th>
- <th>Clicks</th>
- <th>Leads</th>
- <th>Rev</th>
- <th>Cost</th>
- <th>P/L</th>
- <th>ROI</th>
- </tr>
- </thead>
- <tbody>
- <?php foreach ($vuvod as $parametr => $stats) { ?>
- <tr>
- <th><?php echo $parametr; ?></th>
- <th><?php echo $stats[2]; ?></th>
- <th><?php echo $stats[5]; ?></th>
- <th><?php echo $stats[5] * $_POST['pay']; ?></th>
- <th><?php echo $stats[2] * $_POST['cpc']; ?></th>
- <th><?php echo ($stats[5] * $_POST['pay']) - ($stats[2] * $_POST['cpc']); ?></th>
- <th><?php echo (($stats[5] * $_POST['pay']) - ($stats[2] * $_POST['cpc'])) / ($stats[2] * $_POST['cpc']) * 100; ?></th>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement