<?php
  class Donation extends CodonData {

    public static function findLogs($params, $count = '', $start = '') {
        $sql = 'SELECT l.*, p.*
				FROM ' . TABLE_PREFIX . 'adminlog l
				INNER JOIN ' . TABLE_PREFIX . 'pilots p ON l.pilotid = p.pilotid ';

        $ret = DB::get_results($sql);
        return $ret;
    }

    public static function add_entry($pilotid, $message, $amount) {
        $message = DB::escape($message);
        $pilotid = DB::escape($pilotid);
        $amount = DB::escape($amount);

        $sql = "INSERT INTO `icrewsystems_donations` (`id`, `pilotid`, `date`, `amount`, `message`)
        VALUES (NULL, '$pilotid', CURRENT_TIMESTAMP, '$amount', '$message')";

        return DB::query($sql);
    }

  }
?>
