Esempio n. 1
0
         echo '2';
     } elseif (!$row[uid]) {
         echo '4';
     }
     break;
 case "detail":
     //处理详细资料
     dealDetailInfo();
     break;
 case "life_state":
     //生活状态
     lifeState();
     break;
 case "interest":
     //兴趣爱好
     interest();
     break;
     //note 上传照片
 //note 上传照片
 case "upload":
     //***************************
     material_photo_upload();
     break;
 case "show":
     //*********************************
     material_photo_show();
     break;
 case "music":
     material_music();
     break;
 case "del":
<?php

/*This file calculates interest at the begining of each month. To change when
 *interest is calculated, change the cron jobs schedual.
 */
require 'rules.php';
//Connect to database
$db = "accounts";
$conn = connRTServer($db);
//Acquire information
$sql = "SELECT accNum FROM accounts;";
$result = $conn->query($sql);
//Calculate interest for every account
for ($i = 0; $i < $result->num_rows; $i++) {
    $account = $result->fetch_row();
    interest($account[0]);
}
//Clears avg account balance
$clear = "UPDATE accounts SET avgTotal = 0, lastInt = 0;";
$conn->query($clear);
//Reset days passed since interest calculated value
$reset = "ALTER TABLE accounts ALTER lastInt SET DEFAULT 0;";
$conn->query($reset);
$conn->close();