Hi, it would be great to have a field in views that shows if the signup user has paid for the event or not.

Comments

chrislabeard’s picture

This seemed to do the trick for me I tried using just the function but couldn't ever get it to work, this probly isn't the best way to do it either but its working for me now.

<?php

$nid = $row->nid;
$anon = $data->signup_log_anon_mail . $data->mail;
$email = $anon;
$num_rows = db_result(db_query("SELECT COUNT(*) FROM {signup_pay} WHERE uid = 0 AND nid = %d AND mail = '%s'", $nid, $email));
if ($num_rows) {
    print 'Paid';
} else {
    print 'Not Paid';
}
?>
chrislabeard’s picture

Okay I lied I thought that I could just use the email address for both but it doesn't seem to work if a user has a UID.

chrislabeard’s picture

<?php
$user = $row->uid;
$nid = $row->nid;
$anon = $data->signup_log_anon_mail . $data->mail;
$email = $anon;
$num_rows = db_result(db_query("SELECT COUNT(*) FROM {signup_pay} WHERE uid = %d AND nid = %d AND mail = '%s'", $user, $nid, $email));
if ($num_rows) {
    print 'Paid';
} else {
    print 'Not Paid';
}
?>