{"action":"created","comment":{"url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/pulls/comments/65835284","id":65835284,"diff_hunk":"@@ -21,45 +21,53 @@ public function do_upload()\n        $new_name = date(\"YmdHis\").\"\".rand(0,9);\n        $config['file_name'] = $new_name;\n        $this->upload->initialize($config);\n+\n        if ( ! $this->upload->do_upload('file'))\n        {\n             $error = array('error' => $this->upload->display_errors());\n-            $str=str_replace('\\.','',$error['error']);\n-            $str=str_replace('</p>','',$str);\n-            $str=str_replace('<p>','',$str);\n-            $str='{\"status\" : \"'.$str.'\"}';\n-            echo $str;\n-            //session_start();\n-            //echo $_SESSION['id'];\n-            //$this->load->view('upload_form', $error);\n+            $errorStr=str_replace('\\.','',$error['error']);\n+            $errorStr=str_replace('</p>','',$errorStr);\n+            $errorStr=str_replace('<p>','',$errorStr);\n+            $errorArray=array(\"status\" => $errorStr);\n+            echo json_encode($errorArray);\n+            return true;\n        }\n        else\n        {\n            session_start();\n \n            if(empty($_SESSION['id']))\n            {\n-                $str=\"not login\";\n-                $str='{\"status\" : \"'.$str.'\"}';\n-                echo $str;\n-                return false;\n+               $statusArray = array(\"status\" => \"not login\" );\n+               echo json_encode($statusArray);\n+               return false;\n            }","path":"backend/application/controllers/api/v1/Upload.php","position":null,"original_position":36,"commit_id":"6a75f96dec09b68871a222febb7b18c6970e0b72","original_commit_id":"6a75f96dec09b68871a222febb7b18c6970e0b72","user":{"login":"PolarBearAndrew","id":8358609,"avatar_url":"https://avatars.githubusercontent.com/u/8358609?v=3","gravatar_id":"","url":"https://api.github.com/users/PolarBearAndrew","html_url":"https://github.com/PolarBearAndrew","followers_url":"https://api.github.com/users/PolarBearAndrew/followers","following_url":"https://api.github.com/users/PolarBearAndrew/following{/other_user}","gists_url":"https://api.github.com/users/PolarBearAndrew/gists{/gist_id}","starred_url":"https://api.github.com/users/PolarBearAndrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolarBearAndrew/subscriptions","organizations_url":"https://api.github.com/users/PolarBearAndrew/orgs","repos_url":"https://api.github.com/users/PolarBearAndrew/repos","events_url":"https://api.github.com/users/PolarBearAndrew/events{/privacy}","received_events_url":"https://api.github.com/users/PolarBearAndrew/received_events","type":"User","site_admin":false},"body":"這圖片是一個 `工具形式` 的 API\r\n有可能在任何地方被用到","created_at":"2016-06-06T03:59:25Z","updated_at":"2016-06-06T03:59:25Z","html_url":"https://github.com/PolarBearAndrew/FE-HealthManager/pull/65#discussion_r65835284","pull_request_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/pulls/65","_links":{"self":{"href":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/pulls/comments/65835284"},"html":{"href":"https://github.com/PolarBearAndrew/FE-HealthManager/pull/65#discussion_r65835284"},"pull_request":{"href":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/pulls/65"}}},"pull_request":{"url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/pulls/65","id":72628022,"html_url":"https://github.com/PolarBearAndrew/FE-HealthManager/pull/65","diff_url":"https://github.com/PolarBearAndrew/FE-HealthManager/pull/65.diff","patch_url":"https://github.com/PolarBearAndrew/FE-HealthManager/pull/65.patch","issue_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/issues/65","number":65,"state":"open","locked":false,"title":"20160605 2024 zhong add Delete API fix other pro","user":{"login":"chzhonge","id":13866602,"avatar_url":"https://avatars.githubusercontent.com/u/13866602?v=3","gravatar_id":"","url":"https://api.github.com/users/chzhonge","html_url":"https://github.com/chzhonge","followers_url":"https://api.github.com/users/chzhonge/followers","following_url":"https://api.github.com/users/chzhonge/following{/other_user}","gists_url":"https://api.github.com/users/chzhonge/gists{/gist_id}","starred_url":"https://api.github.com/users/chzhonge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chzhonge/subscriptions","organizations_url":"https://api.github.com/users/chzhonge/orgs","repos_url":"https://api.github.com/users/chzhonge/repos","events_url":"https://api.github.com/users/chzhonge/events{/privacy}","received_events_url":"https://api.github.com/users/chzhonge/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-05T12:24:14Z","updated_at":"2016-06-06T03:59:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"50f9b27846c3425afa7bb22eff2214c54f9fcfb0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/pulls/65/commits","review_comments_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/pulls/65/comments","review_comment_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/issues/65/comments","statuses_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/statuses/6a75f96dec09b68871a222febb7b18c6970e0b72","head":{"label":"PolarBearAndrew:20160605_0317_zhong","ref":"20160605_0317_zhong","sha":"6a75f96dec09b68871a222febb7b18c6970e0b72","user":{"login":"PolarBearAndrew","id":8358609,"avatar_url":"https://avatars.githubusercontent.com/u/8358609?v=3","gravatar_id":"","url":"https://api.github.com/users/PolarBearAndrew","html_url":"https://github.com/PolarBearAndrew","followers_url":"https://api.github.com/users/PolarBearAndrew/followers","following_url":"https://api.github.com/users/PolarBearAndrew/following{/other_user}","gists_url":"https://api.github.com/users/PolarBearAndrew/gists{/gist_id}","starred_url":"https://api.github.com/users/PolarBearAndrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolarBearAndrew/subscriptions","organizations_url":"https://api.github.com/users/PolarBearAndrew/orgs","repos_url":"https://api.github.com/users/PolarBearAndrew/repos","events_url":"https://api.github.com/users/PolarBearAndrew/events{/privacy}","received_events_url":"https://api.github.com/users/PolarBearAndrew/received_events","type":"User","site_admin":false},"repo":{"id":60064654,"name":"FE-HealthManager","full_name":"PolarBearAndrew/FE-HealthManager","owner":{"login":"PolarBearAndrew","id":8358609,"avatar_url":"https://avatars.githubusercontent.com/u/8358609?v=3","gravatar_id":"","url":"https://api.github.com/users/PolarBearAndrew","html_url":"https://github.com/PolarBearAndrew","followers_url":"https://api.github.com/users/PolarBearAndrew/followers","following_url":"https://api.github.com/users/PolarBearAndrew/following{/other_user}","gists_url":"https://api.github.com/users/PolarBearAndrew/gists{/gist_id}","starred_url":"https://api.github.com/users/PolarBearAndrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolarBearAndrew/subscriptions","organizations_url":"https://api.github.com/users/PolarBearAndrew/orgs","repos_url":"https://api.github.com/users/PolarBearAndrew/repos","events_url":"https://api.github.com/users/PolarBearAndrew/events{/privacy}","received_events_url":"https://api.github.com/users/PolarBearAndrew/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PolarBearAndrew/FE-HealthManager","description":"亞東醫院,  健康管理系統","fork":false,"url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager","forks_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/forks","keys_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/teams","hooks_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/hooks","issue_events_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/issues/events{/number}","events_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/events","assignees_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/assignees{/user}","branches_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/branches{/branch}","tags_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/tags","blobs_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/git/refs{/sha}","trees_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/statuses/{sha}","languages_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/languages","stargazers_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/stargazers","contributors_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/contributors","subscribers_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/subscribers","subscription_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/subscription","commits_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/commits{/sha}","git_commits_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/git/commits{/sha}","comments_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/comments{/number}","issue_comment_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/issues/comments{/number}","contents_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/contents/{+path}","compare_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/merges","archive_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/downloads","issues_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/issues{/number}","pulls_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/pulls{/number}","milestones_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/milestones{/number}","notifications_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/labels{/name}","releases_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/releases{/id}","deployments_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/deployments","created_at":"2016-05-31T06:43:57Z","updated_at":"2016-06-04T05:53:57Z","pushed_at":"2016-06-06T02:58:17Z","git_url":"git://github.com/PolarBearAndrew/FE-HealthManager.git","ssh_url":"git@github.com:PolarBearAndrew/FE-HealthManager.git","clone_url":"https://github.com/PolarBearAndrew/FE-HealthManager.git","svn_url":"https://github.com/PolarBearAndrew/FE-HealthManager","homepage":null,"size":2549,"stargazers_count":1,"watchers_count":1,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":1,"default_branch":"develop"}},"base":{"label":"PolarBearAndrew:develop","ref":"develop","sha":"40baf8ce129556424a2df7d7d4f3a7f1697a7225","user":{"login":"PolarBearAndrew","id":8358609,"avatar_url":"https://avatars.githubusercontent.com/u/8358609?v=3","gravatar_id":"","url":"https://api.github.com/users/PolarBearAndrew","html_url":"https://github.com/PolarBearAndrew","followers_url":"https://api.github.com/users/PolarBearAndrew/followers","following_url":"https://api.github.com/users/PolarBearAndrew/following{/other_user}","gists_url":"https://api.github.com/users/PolarBearAndrew/gists{/gist_id}","starred_url":"https://api.github.com/users/PolarBearAndrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolarBearAndrew/subscriptions","organizations_url":"https://api.github.com/users/PolarBearAndrew/orgs","repos_url":"https://api.github.com/users/PolarBearAndrew/repos","events_url":"https://api.github.com/users/PolarBearAndrew/events{/privacy}","received_events_url":"https://api.github.com/users/PolarBearAndrew/received_events","type":"User","site_admin":false},"repo":{"id":60064654,"name":"FE-HealthManager","full_name":"PolarBearAndrew/FE-HealthManager","owner":{"login":"PolarBearAndrew","id":8358609,"avatar_url":"https://avatars.githubusercontent.com/u/8358609?v=3","gravatar_id":"","url":"https://api.github.com/users/PolarBearAndrew","html_url":"https://github.com/PolarBearAndrew","followers_url":"https://api.github.com/users/PolarBearAndrew/followers","following_url":"https://api.github.com/users/PolarBearAndrew/following{/other_user}","gists_url":"https://api.github.com/users/PolarBearAndrew/gists{/gist_id}","starred_url":"https://api.github.com/users/PolarBearAndrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolarBearAndrew/subscriptions","organizations_url":"https://api.github.com/users/PolarBearAndrew/orgs","repos_url":"https://api.github.com/users/PolarBearAndrew/repos","events_url":"https://api.github.com/users/PolarBearAndrew/events{/privacy}","received_events_url":"https://api.github.com/users/PolarBearAndrew/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PolarBearAndrew/FE-HealthManager","description":"亞東醫院,  健康管理系統","fork":false,"url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager","forks_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/forks","keys_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/teams","hooks_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/hooks","issue_events_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/issues/events{/number}","events_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/events","assignees_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/assignees{/user}","branches_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/branches{/branch}","tags_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/tags","blobs_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/git/refs{/sha}","trees_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/statuses/{sha}","languages_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/languages","stargazers_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/stargazers","contributors_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/contributors","subscribers_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/subscribers","subscription_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/subscription","commits_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/commits{/sha}","git_commits_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/git/commits{/sha}","comments_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/comments{/number}","issue_comment_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/issues/comments{/number}","contents_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/contents/{+path}","compare_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/merges","archive_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/downloads","issues_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/issues{/number}","pulls_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/pulls{/number}","milestones_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/milestones{/number}","notifications_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/labels{/name}","releases_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/releases{/id}","deployments_url":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/deployments","created_at":"2016-05-31T06:43:57Z","updated_at":"2016-06-04T05:53:57Z","pushed_at":"2016-06-06T02:58:17Z","git_url":"git://github.com/PolarBearAndrew/FE-HealthManager.git","ssh_url":"git@github.com:PolarBearAndrew/FE-HealthManager.git","clone_url":"https://github.com/PolarBearAndrew/FE-HealthManager.git","svn_url":"https://github.com/PolarBearAndrew/FE-HealthManager","homepage":null,"size":2549,"stargazers_count":1,"watchers_count":1,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/pulls/65"},"html":{"href":"https://github.com/PolarBearAndrew/FE-HealthManager/pull/65"},"issue":{"href":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/issues/65"},"comments":{"href":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/PolarBearAndrew/FE-HealthManager/statuses/6a75f96dec09b68871a222febb7b18c6970e0b72"}}}}
{"actor":{"display_login":"PolarBearAndrew"}}