<?php require '../../boot.php'; list($cmd, $update_count_date) = $argv; #process all supporters that have not been processed $unprocessed__source_supporters = $DB->query("SELECT * FROM supporter WHERE source_processed != 1"); if ($unprocessed_supporters->num_rows > 0) { while ($unprocessed_supporter_arr = $unprocessed_supporters->fetch_assoc()) { $supporter = new Supporter($unprocessed_supporter_arr); $supporter->process_source(); $supporter->db_update(); $supporter->data['key'] = $supporter->data['supporter_KEY']; //$dia->save('supporter', $supporter->data); } } # GEO CODE everyone that is not geo coded $unvalidated_supporters = $DB->query("SELECT * FROM supporter WHERE data__geo_coded != 1'"); if ($unvalidated_supporters->num_rows > 0) { while ($unvalidated_supporter_arr = $unvalidated_supporters->fetch_assoc()) { $supporter = new Supporter($unvalidated_supporter_arr); $supporter->geovalidate(); $supporter->db_update(); $supporter->data['key'] = $supporter->data['supporter_KEY']; //$dia->save('supporter', $supporter->data); } } #update counts $last_modified_condition = "Last_Modified >= '" . $update_count_date . "'"; update_counts('supporter_action', 'updateActionCounts', $last_modified_condition); update_counts('donation', 'updateDonationCounts', $last_modified_condition); update_counts('email', 'updateEmailCounts', $last_modified_condition);