Hmmm, what you request is not that easy because it may require a few work to be done. Open the core/common/PIREPData.class.php file and find this:
public static function deleteField($id) {
$sql = 'DELETE FROM ' . TABLE_PREFIX . 'pirepfields WHERE fieldid=' . $id;
$res = DB::query($sql);
if (DB::errno() != 0) return false;
return true;
//TODO: delete all of the field values!
//$sql = 'DELETE FROM '.TABLE_PREFIX.'
}
after this, add the following part of code:
public static function getSumByField($pilotid, $field) {
$