Skip to content
This repository has been archived by the owner on Apr 24, 2019. It is now read-only.

Commit

Permalink
Added order and activation cross-referencing on Feedback page.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Hall committed May 3, 2011
1 parent 5275a04 commit 6034060
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
class.config.php

.DS_Store
67 changes: 66 additions & 1 deletion feedback-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@
$f->new = 0;
$f->update();
}

// Get related orders
$db = Database::getDatabase();
$email = $db->quote($f->email);
$orders = DBObject::glob('Order', 'SELECT * FROM shine_orders WHERE payer_email = ' . $email . ' ORDER BY dt DESC');

// Get related activations
$order_ids = array();
foreach($orders as $o)
$order_ids[] = $o->id;
$order_ids = implode(',', $order_ids);
$activations = DBObject::glob('Activation', "SELECT * FROM shine_activations WHERE (order_id IN ($order_ids)) OR (ip = '{$f->ip}') ORDER BY dt DESC");
?>
<?PHP include('inc/header.inc.php'); ?>

Expand Down Expand Up @@ -91,13 +103,66 @@
<input type="submit" name="btnNew" value="Mark as New" id="btnnew"/>
<input type="submit" name="btnDelete" value="Delete" id="btndelete" onclick="return confirm('Are you sure?');"/>
</p>
</form>
</form>

</div>
</div>
</div></div>
</div>
<div id="sidebar" class="yui-b">

<div class="block">
<div class="hd">
<h2>Related Orders</h2>
</div>
<div class="bd">
<table>
<thead>
<tr>
<td>Date</td>
<td>Name</td>
<td>App Name</td>
</tr>
</thead>
<tbody>
<?PHP foreach($orders as $o) : ?>
<tr>
<td><?PHP echo time2str($o->dt); ?></td>
<td><a href="order.php?id=<?PHP echo $o->id; ?>"><?PHP echo utf8_encode($o->first_name); ?> <?PHP echo utf8_encode($o->last_name); ?></a></td>
<td><?PHP echo $o->applicationName(); ?></td>
</tr>
<?PHP endforeach; ?>
</tbody>
</table>
</div>
</div>

<div class="block">
<div class="hd">
<h2>Related Activations</h2>
</div>
<div class="bd">
<table>
<thead>
<tr>
<td>Date</td>
<td>App Name</td>
<td>IP</td>
</tr>
</thead>
<tbody>
<?PHP foreach($activations as $a) : ?>
<tr>
<td><?PHP echo time2str($a->dt); ?></td>
<td><?PHP echo $a->applicationName(); ?></td>
<td><a href="activations.php?q=<?PHP echo $a->ip; ?>"><?PHP echo $a->ip; ?></a></td>
</tr>
<?PHP endforeach; ?>
</tbody>
</table>
</div>
</div>


</div>
</div>
Expand Down

0 comments on commit 6034060

Please sign in to comment.