Ejemplo n.º 1
0
 /**
  * Add a ranking. This will automatically call
  * CalculatePilotRanks() at the end
  */
 public static function addRank($title, $minhours, $imageurl, $payrate)
 {
     $minhours = intval($minhours);
     $payrate = floatval($payrate);
     $sql = "INSERT INTO " . TABLE_PREFIX . "ranks (rank, rankimage, minhours, payrate)\n\t\t\t\t\tVALUES('{$title}', '{$imageurl}', '{$minhours}', {$payrate})";
     $ret = DB::query($sql);
     if (DB::$errno == 1062) {
         self::$lasterror = 'This already exists';
         return false;
     }
     CodonCache::delete('all_ranks');
     self::CalculatePilotRanks();
     return true;
 }