pmodname != PMODNAME) exit('Ewrong_pmod'); $prodir = '/srv/http/toj/center/pro/'; $redir = file_get_contents($prodir.$proid.'/redirect'); if($redir) { $ret = new stdClass(); $ret->redirect = intval($redir); exit(json_encode($ret)); } $ret = new stdClass(); $mfile = file_get_contents($prodir.$proid.'/multiset'); $multiset = json_decode($mfile); $main_cont = file_get_contents($prodir.$proid.'/public/main_content'); $ret->main_content = $main_cont; $ret->pro = array(); $ret->proname = $multiset->proname; foreach($multiset->prolist as $spro) { $apro = new stdClass(); $apro->proid = $spro->proid; $apro->score = $spro->score; $apro->partname = $spro->partname; $apro->content = file_get_contents($prodir.$apro->proid.'/public/content'); $setting = get_set($prodir.$apro->proid.'/'); $apro->timelimit = $setting->timelimit; $apro->memlimit = $setting->memlimit; $apro->partition = new stdClass(); $apro->partition->count = $setting->count; $apro->partition->score = $setting->score; array_push($ret->pro, $apro); } echo(json_encode($ret)); db_close($sqlc); ?>