@@ -18,11 +18,11 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | public function login($all_data) |
| 20 | 20 | { |
| 21 | - if(isset($all_data["url"])) $url = $all_data["url"]; else throw new Exception("url is not exist in all_data"); |
|
| 22 | - if(isset($all_data["data"])) $data = $all_data["data"]; else throw new Exception("data is not exist in all_data"); |
|
| 23 | - if(isset($all_data["oj"])) $oj = $all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 24 | - if(isset($all_data["ret"])) $ret = $all_data["ret"]; else $ret = 'false'; |
|
| 25 | - if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default"; |
|
| 21 | + if (isset($all_data["url"])) $url=$all_data["url"]; else throw new Exception("url is not exist in all_data"); |
|
| 22 | + if (isset($all_data["data"])) $data=$all_data["data"]; else throw new Exception("data is not exist in all_data"); |
|
| 23 | + if (isset($all_data["oj"])) $oj=$all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 24 | + if (isset($all_data["ret"])) $ret=$all_data["ret"]; else $ret='false'; |
|
| 25 | + if (isset($all_data["handle"])) $handle=$all_data["handle"]; else $handle="default"; |
|
| 26 | 26 | |
| 27 | 27 | $datapost=curl_init(); |
| 28 | 28 | $headers=array("Expect:"); |
@@ -54,12 +54,12 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | public function grab_page($all_data) |
| 56 | 56 | { |
| 57 | - if(isset($all_data["site"])) $site = $all_data["site"]; else throw new Exception("site is not exist in all_data"); |
|
| 58 | - if(isset($all_data["oj"])) $oj = $all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 59 | - if(isset($all_data["headers"])) $headers = $all_data["headers"]; else $headers = []; |
|
| 60 | - if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default"; |
|
| 61 | - if(isset($all_data["follow"])) $follow = $all_data["follow"]; else $follow = false; |
|
| 62 | - if(isset($all_data["vcid"])) $vcid = $all_data["vcid"]."_"; else $vcid = ""; |
|
| 57 | + if (isset($all_data["site"])) $site=$all_data["site"]; else throw new Exception("site is not exist in all_data"); |
|
| 58 | + if (isset($all_data["oj"])) $oj=$all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 59 | + if (isset($all_data["headers"])) $headers=$all_data["headers"]; else $headers=[]; |
|
| 60 | + if (isset($all_data["handle"])) $handle=$all_data["handle"]; else $handle="default"; |
|
| 61 | + if (isset($all_data["follow"])) $follow=$all_data["follow"]; else $follow=false; |
|
| 62 | + if (isset($all_data["vcid"])) $vcid=$all_data["vcid"]."_"; else $vcid=""; |
|
| 63 | 63 | |
| 64 | 64 | $handle=urlencode($handle); |
| 65 | 65 | |
@@ -86,16 +86,16 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | public function post_data($all_data) |
| 88 | 88 | { |
| 89 | - if(isset($all_data["site"])) $site = $all_data["site"]; else throw new Exception("site is not exist in all_data"); |
|
| 90 | - if(isset($all_data["data"])) $data = $all_data["data"]; else throw new Exception("data is not exist in all_data"); |
|
| 91 | - if(isset($all_data["oj"])) $oj = $all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 92 | - if(isset($all_data["ret"])) $ret = $all_data["ret"]; else $ret = false; |
|
| 93 | - if(isset($all_data["follow"])) $follow = $all_data["follow"]; else $follow = true; |
|
| 94 | - if(isset($all_data["returnHeader"])) $returnHeader = $all_data["returnHeader"]; else $returnHeader = true; |
|
| 95 | - if(isset($all_data["postJson"])) $postJson = $all_data["postJson"]; else $postJson = false; |
|
| 96 | - if(isset($all_data["extraHeaders"])) $extraHeaders = $all_data["extraHeaders"]; else $extraHeaders = []; |
|
| 97 | - if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default"; |
|
| 98 | - if(isset($all_data["vcid"])) $vcid = $all_data["vcid"]."_"; else $vcid = ""; |
|
| 89 | + if (isset($all_data["site"])) $site=$all_data["site"]; else throw new Exception("site is not exist in all_data"); |
|
| 90 | + if (isset($all_data["data"])) $data=$all_data["data"]; else throw new Exception("data is not exist in all_data"); |
|
| 91 | + if (isset($all_data["oj"])) $oj=$all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 92 | + if (isset($all_data["ret"])) $ret=$all_data["ret"]; else $ret=false; |
|
| 93 | + if (isset($all_data["follow"])) $follow=$all_data["follow"]; else $follow=true; |
|
| 94 | + if (isset($all_data["returnHeader"])) $returnHeader=$all_data["returnHeader"]; else $returnHeader=true; |
|
| 95 | + if (isset($all_data["postJson"])) $postJson=$all_data["postJson"]; else $postJson=false; |
|
| 96 | + if (isset($all_data["extraHeaders"])) $extraHeaders=$all_data["extraHeaders"]; else $extraHeaders=[]; |
|
| 97 | + if (isset($all_data["handle"])) $handle=$all_data["handle"]; else $handle="default"; |
|
| 98 | + if (isset($all_data["vcid"])) $vcid=$all_data["vcid"]."_"; else $vcid=""; |
|
| 99 | 99 | |
| 100 | 100 | $handle=urlencode($handle); |
| 101 | 101 | |
@@ -18,11 +18,31 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | public function login($all_data) |
| 20 | 20 | { |
| 21 | - if(isset($all_data["url"])) $url = $all_data["url"]; else throw new Exception("url is not exist in all_data"); |
|
| 22 | - if(isset($all_data["data"])) $data = $all_data["data"]; else throw new Exception("data is not exist in all_data"); |
|
| 23 | - if(isset($all_data["oj"])) $oj = $all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 24 | - if(isset($all_data["ret"])) $ret = $all_data["ret"]; else $ret = 'false'; |
|
| 25 | - if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default"; |
|
| 21 | + if(isset($all_data["url"])) { |
|
| 22 | + $url = $all_data["url"]; |
|
| 23 | + } else { |
|
| 24 | + throw new Exception("url is not exist in all_data"); |
|
| 25 | + } |
|
| 26 | + if(isset($all_data["data"])) { |
|
| 27 | + $data = $all_data["data"]; |
|
| 28 | + } else { |
|
| 29 | + throw new Exception("data is not exist in all_data"); |
|
| 30 | + } |
|
| 31 | + if(isset($all_data["oj"])) { |
|
| 32 | + $oj = $all_data["oj"]; |
|
| 33 | + } else { |
|
| 34 | + throw new Exception("oj is not exist in all_data"); |
|
| 35 | + } |
|
| 36 | + if(isset($all_data["ret"])) { |
|
| 37 | + $ret = $all_data["ret"]; |
|
| 38 | + } else { |
|
| 39 | + $ret = 'false'; |
|
| 40 | + } |
|
| 41 | + if(isset($all_data["handle"])) { |
|
| 42 | + $handle = $all_data["handle"]; |
|
| 43 | + } else { |
|
| 44 | + $handle = "default"; |
|
| 45 | + } |
|
| 26 | 46 | |
| 27 | 47 | $datapost=curl_init(); |
| 28 | 48 | $headers=array("Expect:"); |
@@ -54,12 +74,36 @@ discard block |
||
| 54 | 74 | |
| 55 | 75 | public function grab_page($all_data) |
| 56 | 76 | { |
| 57 | - if(isset($all_data["site"])) $site = $all_data["site"]; else throw new Exception("site is not exist in all_data"); |
|
| 58 | - if(isset($all_data["oj"])) $oj = $all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 59 | - if(isset($all_data["headers"])) $headers = $all_data["headers"]; else $headers = []; |
|
| 60 | - if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default"; |
|
| 61 | - if(isset($all_data["follow"])) $follow = $all_data["follow"]; else $follow = false; |
|
| 62 | - if(isset($all_data["vcid"])) $vcid = $all_data["vcid"]."_"; else $vcid = ""; |
|
| 77 | + if(isset($all_data["site"])) { |
|
| 78 | + $site = $all_data["site"]; |
|
| 79 | + } else { |
|
| 80 | + throw new Exception("site is not exist in all_data"); |
|
| 81 | + } |
|
| 82 | + if(isset($all_data["oj"])) { |
|
| 83 | + $oj = $all_data["oj"]; |
|
| 84 | + } else { |
|
| 85 | + throw new Exception("oj is not exist in all_data"); |
|
| 86 | + } |
|
| 87 | + if(isset($all_data["headers"])) { |
|
| 88 | + $headers = $all_data["headers"]; |
|
| 89 | + } else { |
|
| 90 | + $headers = []; |
|
| 91 | + } |
|
| 92 | + if(isset($all_data["handle"])) { |
|
| 93 | + $handle = $all_data["handle"]; |
|
| 94 | + } else { |
|
| 95 | + $handle = "default"; |
|
| 96 | + } |
|
| 97 | + if(isset($all_data["follow"])) { |
|
| 98 | + $follow = $all_data["follow"]; |
|
| 99 | + } else { |
|
| 100 | + $follow = false; |
|
| 101 | + } |
|
| 102 | + if(isset($all_data["vcid"])) { |
|
| 103 | + $vcid = $all_data["vcid"]."_"; |
|
| 104 | + } else { |
|
| 105 | + $vcid = ""; |
|
| 106 | + } |
|
| 63 | 107 | |
| 64 | 108 | $handle=urlencode($handle); |
| 65 | 109 | |
@@ -86,16 +130,56 @@ discard block |
||
| 86 | 130 | |
| 87 | 131 | public function post_data($all_data) |
| 88 | 132 | { |
| 89 | - if(isset($all_data["site"])) $site = $all_data["site"]; else throw new Exception("site is not exist in all_data"); |
|
| 90 | - if(isset($all_data["data"])) $data = $all_data["data"]; else throw new Exception("data is not exist in all_data"); |
|
| 91 | - if(isset($all_data["oj"])) $oj = $all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 92 | - if(isset($all_data["ret"])) $ret = $all_data["ret"]; else $ret = false; |
|
| 93 | - if(isset($all_data["follow"])) $follow = $all_data["follow"]; else $follow = true; |
|
| 94 | - if(isset($all_data["returnHeader"])) $returnHeader = $all_data["returnHeader"]; else $returnHeader = true; |
|
| 95 | - if(isset($all_data["postJson"])) $postJson = $all_data["postJson"]; else $postJson = false; |
|
| 96 | - if(isset($all_data["extraHeaders"])) $extraHeaders = $all_data["extraHeaders"]; else $extraHeaders = []; |
|
| 97 | - if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default"; |
|
| 98 | - if(isset($all_data["vcid"])) $vcid = $all_data["vcid"]."_"; else $vcid = ""; |
|
| 133 | + if(isset($all_data["site"])) { |
|
| 134 | + $site = $all_data["site"]; |
|
| 135 | + } else { |
|
| 136 | + throw new Exception("site is not exist in all_data"); |
|
| 137 | + } |
|
| 138 | + if(isset($all_data["data"])) { |
|
| 139 | + $data = $all_data["data"]; |
|
| 140 | + } else { |
|
| 141 | + throw new Exception("data is not exist in all_data"); |
|
| 142 | + } |
|
| 143 | + if(isset($all_data["oj"])) { |
|
| 144 | + $oj = $all_data["oj"]; |
|
| 145 | + } else { |
|
| 146 | + throw new Exception("oj is not exist in all_data"); |
|
| 147 | + } |
|
| 148 | + if(isset($all_data["ret"])) { |
|
| 149 | + $ret = $all_data["ret"]; |
|
| 150 | + } else { |
|
| 151 | + $ret = false; |
|
| 152 | + } |
|
| 153 | + if(isset($all_data["follow"])) { |
|
| 154 | + $follow = $all_data["follow"]; |
|
| 155 | + } else { |
|
| 156 | + $follow = true; |
|
| 157 | + } |
|
| 158 | + if(isset($all_data["returnHeader"])) { |
|
| 159 | + $returnHeader = $all_data["returnHeader"]; |
|
| 160 | + } else { |
|
| 161 | + $returnHeader = true; |
|
| 162 | + } |
|
| 163 | + if(isset($all_data["postJson"])) { |
|
| 164 | + $postJson = $all_data["postJson"]; |
|
| 165 | + } else { |
|
| 166 | + $postJson = false; |
|
| 167 | + } |
|
| 168 | + if(isset($all_data["extraHeaders"])) { |
|
| 169 | + $extraHeaders = $all_data["extraHeaders"]; |
|
| 170 | + } else { |
|
| 171 | + $extraHeaders = []; |
|
| 172 | + } |
|
| 173 | + if(isset($all_data["handle"])) { |
|
| 174 | + $handle = $all_data["handle"]; |
|
| 175 | + } else { |
|
| 176 | + $handle = "default"; |
|
| 177 | + } |
|
| 178 | + if(isset($all_data["vcid"])) { |
|
| 179 | + $vcid = $all_data["vcid"]."_"; |
|
| 180 | + } else { |
|
| 181 | + $vcid = ""; |
|
| 182 | + } |
|
| 99 | 183 | |
| 100 | 184 | $handle=urlencode($handle); |
| 101 | 185 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | $contestModel=new ContestModel(); |
| 25 | 25 | $verified=$contestModel->isVerified($cid); |
| 26 | 26 | $clearance=$contestModel->judgeClearance($cid, Auth::user()->id); |
| 27 | - if ($clearance <= 2) { |
|
| 27 | + if ($clearance<=2) { |
|
| 28 | 28 | return Redirect::route('contest_detail', ['cid' => $cid]); |
| 29 | 29 | } |
| 30 | 30 | $contest_name=$contestModel->contestName($cid); |
@@ -52,30 +52,30 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | $contestModel=new ContestModel(); |
| 54 | 54 | $clearance=$contestModel->judgeClearance($cid, Auth::user()->id); |
| 55 | - if ($clearance <= 2) { |
|
| 55 | + if ($clearance<=2) { |
|
| 56 | 56 | return Redirect::route('contest_detail', ['cid' => $cid]); |
| 57 | 57 | } |
| 58 | 58 | $account=$contestModel->getContestAccount($cid); |
| 59 | - if($account==null){ |
|
| 60 | - return ; |
|
| 61 | - }else{ |
|
| 59 | + if ($account==null) { |
|
| 60 | + return; |
|
| 61 | + } else { |
|
| 62 | 62 | $AccountExport=new AccountExport($account); |
| 63 | 63 | $filename="ContestAccount$cid"; |
| 64 | 64 | return Excel::download($AccountExport, $filename.'.xlsx'); |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - public function refreshContestRank($cid){ |
|
| 68 | + public function refreshContestRank($cid) { |
|
| 69 | 69 | $contestModel=new ContestModel(); |
| 70 | 70 | $clearance=$contestModel->judgeClearance($cid, Auth::user()->id); |
| 71 | - if ($clearance <= 2) { |
|
| 71 | + if ($clearance<=2) { |
|
| 72 | 72 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 73 | 73 | } |
| 74 | 74 | $contestRankRaw=$contestModel->contestRankCache($cid); |
| 75 | 75 | Cache::tags(['contest', 'rank'])->put($cid, $contestRankRaw); |
| 76 | 76 | Cache::tags(['contest', 'rank'])->put("contestAdmin$cid", $contestRankRaw); |
| 77 | 77 | $end_time=strtotime(DB::table("contest")->where(["cid"=>$cid])->select("end_time")->first()["end_time"]); |
| 78 | - if(time() > strtotime($end_time)){ |
|
| 78 | + if (time()>strtotime($end_time)) { |
|
| 79 | 79 | $contestModel->storeContestRankInMySQL($cid, $contestRankRaw); |
| 80 | 80 | } |
| 81 | 81 | return Redirect::route('contest.rank', ['cid' => $cid]); |
@@ -34,10 +34,10 @@ discard block |
||
| 34 | 34 | $contestModel=new ContestModel(); |
| 35 | 35 | $clearance=$contestModel->judgeClearance($cid, Auth::user()->id); |
| 36 | 36 | $basicInfo=$contestModel->basic($cid); |
| 37 | - if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
|
| 38 | - if($clearance == 3){ |
|
| 37 | + if (!$clearance || time()<strtotime($basicInfo['begin_time'])) { |
|
| 38 | + if ($clearance==3) { |
|
| 39 | 39 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 40 | - }else{ |
|
| 40 | + } else { |
|
| 41 | 41 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -80,10 +80,10 @@ discard block |
||
| 80 | 80 | $accountModel=new AccountModel(); |
| 81 | 81 | $clearance=$contestModel->judgeClearance($cid, Auth::user()->id); |
| 82 | 82 | $basicInfo=$contestModel->basic($cid); |
| 83 | - if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
|
| 84 | - if($clearance == 3){ |
|
| 83 | + if (!$clearance || time()<strtotime($basicInfo['begin_time'])) { |
|
| 84 | + if ($clearance==3) { |
|
| 85 | 85 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 86 | - }else{ |
|
| 86 | + } else { |
|
| 87 | 87 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | ]; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - $editor_left_width = $accountModel->getExtra(Auth::user()->id, 'editor_left_width'); |
|
| 119 | - if(empty($editor_left_width)) $editor_left_width='40'; |
|
| 118 | + $editor_left_width=$accountModel->getExtra(Auth::user()->id, 'editor_left_width'); |
|
| 119 | + if (empty($editor_left_width)) $editor_left_width='40'; |
|
| 120 | 120 | |
| 121 | 121 | return view('contest.board.editor', [ |
| 122 | 122 | 'page_title'=>"Problem Detail", |
@@ -150,10 +150,10 @@ discard block |
||
| 150 | 150 | $contestModel=new ContestModel(); |
| 151 | 151 | $clearance=$contestModel->judgeClearance($cid, Auth::user()->id); |
| 152 | 152 | $basicInfo=$contestModel->basic($cid); |
| 153 | - if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
|
| 154 | - if($clearance == 3){ |
|
| 153 | + if (!$clearance || time()<strtotime($basicInfo['begin_time'])) { |
|
| 154 | + if ($clearance==3) { |
|
| 155 | 155 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 156 | - }else{ |
|
| 156 | + } else { |
|
| 157 | 157 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 158 | 158 | } |
| 159 | 159 | } |
@@ -165,14 +165,14 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | // To determine the ranking |
| 167 | 167 | foreach ($contestRank as $i => &$r) { |
| 168 | - if($i != 0) { |
|
| 169 | - if($r['score'] == $contestRank[$i-1]['score'] && $r['penalty'] == $contestRank[$i-1]['penalty']){ |
|
| 170 | - $r['rank'] = $contestRank[$i-1]['rank']; |
|
| 171 | - }else{ |
|
| 172 | - $r['rank'] = $i + 1; |
|
| 168 | + if ($i!=0) { |
|
| 169 | + if ($r['score']==$contestRank[$i-1]['score'] && $r['penalty']==$contestRank[$i-1]['penalty']) { |
|
| 170 | + $r['rank']=$contestRank[$i-1]['rank']; |
|
| 171 | + } else { |
|
| 172 | + $r['rank']=$i+1; |
|
| 173 | 173 | } |
| 174 | - }else{ |
|
| 175 | - $r['rank'] = 1; |
|
| 174 | + } else { |
|
| 175 | + $r['rank']=1; |
|
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | $rankFrozen=$contestModel->isFrozen($cid); |
@@ -209,10 +209,10 @@ discard block |
||
| 209 | 209 | $contestModel=new ContestModel(); |
| 210 | 210 | $clearance=$contestModel->judgeClearance($cid, Auth::user()->id); |
| 211 | 211 | $basicInfo=$contestModel->basic($cid); |
| 212 | - if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
|
| 213 | - if($clearance == 3){ |
|
| 212 | + if (!$clearance || time()<strtotime($basicInfo['begin_time'])) { |
|
| 213 | + if ($clearance==3) { |
|
| 214 | 214 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 215 | - }else{ |
|
| 215 | + } else { |
|
| 216 | 216 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 217 | 217 | } |
| 218 | 218 | } |
@@ -247,10 +247,10 @@ discard block |
||
| 247 | 247 | $contestModel=new ContestModel(); |
| 248 | 248 | $clearance=$contestModel->judgeClearance($cid, Auth::user()->id); |
| 249 | 249 | $basicInfo=$contestModel->basic($cid); |
| 250 | - if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
|
| 251 | - if($clearance == 3){ |
|
| 250 | + if (!$clearance || time()<strtotime($basicInfo['begin_time'])) { |
|
| 251 | + if ($clearance==3) { |
|
| 252 | 252 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 253 | - }else{ |
|
| 253 | + } else { |
|
| 254 | 254 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 255 | 255 | } |
| 256 | 256 | } |
@@ -282,10 +282,10 @@ discard block |
||
| 282 | 282 | $contestModel=new ContestModel(); |
| 283 | 283 | $clearance=$contestModel->judgeClearance($cid, Auth::user()->id); |
| 284 | 284 | $basicInfo=$contestModel->basic($cid); |
| 285 | - if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
|
| 286 | - if($clearance == 3){ |
|
| 285 | + if (!$clearance || time()<strtotime($basicInfo['begin_time'])) { |
|
| 286 | + if ($clearance==3) { |
|
| 287 | 287 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 288 | - }else{ |
|
| 288 | + } else { |
|
| 289 | 289 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 290 | 290 | } |
| 291 | 291 | } |
@@ -303,14 +303,14 @@ discard block |
||
| 303 | 303 | ]); |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | - public function analysis($cid){ |
|
| 306 | + public function analysis($cid) { |
|
| 307 | 307 | $contestModel=new ContestModel(); |
| 308 | 308 | $clearance=$contestModel->judgeClearance($cid, Auth::user()->id); |
| 309 | 309 | $basicInfo=$contestModel->basic($cid); |
| 310 | - if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
|
| 311 | - if($clearance == 3){ |
|
| 310 | + if (!$clearance || time()<strtotime($basicInfo['begin_time'])) { |
|
| 311 | + if ($clearance==3) { |
|
| 312 | 312 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 313 | - }else{ |
|
| 313 | + } else { |
|
| 314 | 314 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 315 | 315 | } |
| 316 | 316 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
| 38 | 38 | if($clearance == 3){ |
| 39 | 39 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 40 | - }else{ |
|
| 40 | + } else{ |
|
| 41 | 41 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
| 84 | 84 | if($clearance == 3){ |
| 85 | 85 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 86 | - }else{ |
|
| 86 | + } else{ |
|
| 87 | 87 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -116,7 +116,9 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $editor_left_width = $accountModel->getExtra(Auth::user()->id, 'editor_left_width'); |
| 119 | - if(empty($editor_left_width)) $editor_left_width='40'; |
|
| 119 | + if(empty($editor_left_width)) { |
|
| 120 | + $editor_left_width='40'; |
|
| 121 | + } |
|
| 120 | 122 | |
| 121 | 123 | return view('contest.board.editor', [ |
| 122 | 124 | 'page_title'=>"Problem Detail", |
@@ -153,7 +155,7 @@ discard block |
||
| 153 | 155 | if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
| 154 | 156 | if($clearance == 3){ |
| 155 | 157 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 156 | - }else{ |
|
| 158 | + } else{ |
|
| 157 | 159 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 158 | 160 | } |
| 159 | 161 | } |
@@ -168,10 +170,10 @@ discard block |
||
| 168 | 170 | if($i != 0) { |
| 169 | 171 | if($r['score'] == $contestRank[$i-1]['score'] && $r['penalty'] == $contestRank[$i-1]['penalty']){ |
| 170 | 172 | $r['rank'] = $contestRank[$i-1]['rank']; |
| 171 | - }else{ |
|
| 173 | + } else{ |
|
| 172 | 174 | $r['rank'] = $i + 1; |
| 173 | 175 | } |
| 174 | - }else{ |
|
| 176 | + } else{ |
|
| 175 | 177 | $r['rank'] = 1; |
| 176 | 178 | } |
| 177 | 179 | } |
@@ -212,7 +214,7 @@ discard block |
||
| 212 | 214 | if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
| 213 | 215 | if($clearance == 3){ |
| 214 | 216 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 215 | - }else{ |
|
| 217 | + } else{ |
|
| 216 | 218 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 217 | 219 | } |
| 218 | 220 | } |
@@ -250,7 +252,7 @@ discard block |
||
| 250 | 252 | if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
| 251 | 253 | if($clearance == 3){ |
| 252 | 254 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 253 | - }else{ |
|
| 255 | + } else{ |
|
| 254 | 256 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 255 | 257 | } |
| 256 | 258 | } |
@@ -285,7 +287,7 @@ discard block |
||
| 285 | 287 | if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
| 286 | 288 | if($clearance == 3){ |
| 287 | 289 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 288 | - }else{ |
|
| 290 | + } else{ |
|
| 289 | 291 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 290 | 292 | } |
| 291 | 293 | } |
@@ -310,7 +312,7 @@ discard block |
||
| 310 | 312 | if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
| 311 | 313 | if($clearance == 3){ |
| 312 | 314 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 313 | - }else{ |
|
| 315 | + } else{ |
|
| 314 | 316 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 315 | 317 | } |
| 316 | 318 | } |