コード例 #1
0
        $section->name = $_POST['name'];
        $section->comments = $_POST['comments'];
        $section->about = $_POST['about'];
        $section->pending = $_POST['pending'];
        $section->enabled = $_POST['enabled'];
        $section->sectionname = $_POST['sectionname'];
        $section->schoolid = $_POST['schoolid'];
        $section->update();
        $log = new Log($session->user_id, $clientip, "WEB", "UPDATED SECTION: " . $_POST['id']);
        $log->create();
    } else {
        if ($_POST['oper'] == 'del') {
            $section = Section::get_by_id($_POST['id']);
            $school = School::get_by_id($section->schoolid);
            $batch = Batch::get_by_id($section->batchid);
            SectionUser::delete_all_by_sectionid($section->id);
            $section->delete();
            $log = new Log($session->user_id, $clientip, "WEB", "DELETED SECTION: " . $_POST['id']);
            $log->create();
        }
    }
}
function rrmdir($dir)
{
    foreach (glob($dir . '/*') as $file) {
        if (is_dir($file)) {
            rrmdir($file);
        } else {
            unlink($file);
        }
    }