@@ -104,7 +104,9 @@ |
||
104 | 104 | $attrNum = $attr[strlen($attr)-1]; |
105 | 105 | foreach(['a', 'b', 'c'] as $l) { |
106 | 106 | $attr = "answer_{$attrNum}{$l}"; |
107 | - if($model->$attr) return true; |
|
107 | + if($model->$attr) { |
|
108 | + return true; |
|
109 | + } |
|
108 | 110 | } |
109 | 111 | return false; |
110 | 112 | }; |
@@ -148,12 +148,12 @@ |
||
148 | 148 | foreach($this->behaviorToAnswers($behavior_id) as $answer_letter => $answer) { |
149 | 149 | $question_id = \common\models\Question::$TYPES[$answer_letter]; |
150 | 150 | array_push($answers, [ |
151 | - 'behavior_id' => $user_bhvr->behavior_id, |
|
152 | - 'category_id' => $user_bhvr->category_id, |
|
153 | - 'user_bhvr_id' => $user_bhvr->id, |
|
154 | - 'question_id' => $question_id, |
|
155 | - 'answer' => $answer, |
|
156 | - ]); |
|
151 | + 'behavior_id' => $user_bhvr->behavior_id, |
|
152 | + 'category_id' => $user_bhvr->category_id, |
|
153 | + 'user_bhvr_id' => $user_bhvr->id, |
|
154 | + 'question_id' => $question_id, |
|
155 | + 'answer' => $answer, |
|
156 | + ]); |
|
157 | 157 | } |
158 | 158 | } |
159 | 159 | return $answers; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | public function __construct(QuestionInterface $question, |
54 | 54 | $config = []) { |
55 | - $this->question = $question; |
|
55 | + $this->question = $question; |
|
56 | 56 | parent::__construct($config); |
57 | 57 | } |
58 | 58 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | 'whenClient' => "function(attribute, value) { return false; }", // lame, but acceptable |
71 | 71 | "message" => "You must select a behavior your responses apply to."], |
72 | 72 | |
73 | - [['answer_1a','answer_1b','answer_1c','answer_2a','answer_2b','answer_2c','answer_3a','answer_3b','answer_3c','answer_4a','answer_4b','answer_4c','answer_5a', 'answer_5b','answer_5c','answer_6a', 'answer_6b','answer_6c','answer_7a','answer_7b','answer_7c'], 'safe'] |
|
73 | + [['answer_1a', 'answer_1b', 'answer_1c', 'answer_2a', 'answer_2b', 'answer_2c', 'answer_3a', 'answer_3b', 'answer_3c', 'answer_4a', 'answer_4b', 'answer_4c', 'answer_5a', 'answer_5b', 'answer_5c', 'answer_6a', 'answer_6b', 'answer_6c', 'answer_7a', 'answer_7b', 'answer_7c'], 'safe'] |
|
74 | 74 | ]; |
75 | 75 | } |
76 | 76 | |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | |
89 | 89 | public function getBhvrValidator() { |
90 | 90 | return function($model, $attr) { |
91 | - $attrNum = $attr[strlen($attr)-1]; |
|
92 | - foreach(['a', 'b', 'c'] as $l) { |
|
91 | + $attrNum = $attr[strlen($attr) - 1]; |
|
92 | + foreach (['a', 'b', 'c'] as $l) { |
|
93 | 93 | $attr = "answer_{$attrNum}{$l}"; |
94 | - if($model->$attr) return true; |
|
94 | + if ($model->$attr) return true; |
|
95 | 95 | } |
96 | 96 | return false; |
97 | 97 | }; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | public function getPrefixProps($prefix) { |
124 | 124 | return array_filter(get_object_vars($this), function($v, $k) use($prefix) { |
125 | - if(strpos($k, $prefix) === 0 && strlen($v)) { |
|
125 | + if (strpos($k, $prefix) === 0 && strlen($v)) { |
|
126 | 126 | return true; |
127 | 127 | } |
128 | 128 | }, ARRAY_FILTER_USE_BOTH); |
@@ -140,9 +140,9 @@ discard block |
||
140 | 140 | public function getAnswers($bhvrs) { |
141 | 141 | $answers = []; |
142 | 142 | $user_bhvrs = array_combine($this->getUserBehaviorProps(), $bhvrs); |
143 | - foreach($user_bhvrs as $property => $user_bhvr) { |
|
143 | + foreach ($user_bhvrs as $property => $user_bhvr) { |
|
144 | 144 | $behavior_id = intval(substr($property, -1, 1)); |
145 | - foreach($this->behaviorToAnswers($behavior_id) as $answer_letter => $answer) { |
|
145 | + foreach ($this->behaviorToAnswers($behavior_id) as $answer_letter => $answer) { |
|
146 | 146 | $question_id = \common\models\Question::$TYPES[$answer_letter]; |
147 | 147 | array_push($answers, [ |
148 | 148 | 'behavior_id' => $user_bhvr->behavior_id, |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | public function saveAnswers(int $user_id, array $bhvrs) { |
160 | 160 | $result = true; |
161 | 161 | |
162 | - foreach($this->getAnswers($bhvrs) as $answer) { |
|
162 | + foreach ($this->getAnswers($bhvrs) as $answer) { |
|
163 | 163 | $model = Yii::$container->get(\common\interfaces\QuestionInterface::class); |
164 | 164 | $model->user_id = $user_id; |
165 | 165 | $model->behavior_id = $answer['behavior_id']; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $model->date = new Expression("now()::timestamp"); |
169 | 169 | $model->question = $answer['question_id']; |
170 | 170 | $model->answer = $answer['answer']; |
171 | - if(!$model->save()) { |
|
171 | + if (!$model->save()) { |
|
172 | 172 | $result = false; |
173 | 173 | } |
174 | 174 | } |
@@ -7,12 +7,12 @@ |
||
7 | 7 | set_include_path(get_include_path().':'.__DIR__); |
8 | 8 | if(file_exists($root.$path)) |
9 | 9 | { |
10 | - if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') |
|
11 | - $path = rtrim($path,'/').'/index.php'; |
|
12 | - if(strpos($path,'.php') === false) return false; |
|
13 | - else { |
|
14 | - chdir(dirname($root.$path)); |
|
15 | - require_once $root.$path; |
|
16 | - } |
|
10 | + if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') |
|
11 | + $path = rtrim($path,'/').'/index.php'; |
|
12 | + if(strpos($path,'.php') === false) return false; |
|
13 | + else { |
|
14 | + chdir(dirname($root.$path)); |
|
15 | + require_once $root.$path; |
|
16 | + } |
|
17 | 17 | }else include_once 'index.php'; |
18 | 18 | ?> |
@@ -3,16 +3,16 @@ |
||
3 | 3 | header("Access-Control-Allow-Origin: *"); |
4 | 4 | $root = $_SERVER['DOCUMENT_ROOT']; |
5 | 5 | chdir($root); |
6 | -$path = '/'.ltrim(parse_url($_SERVER['REQUEST_URI'])['path'],'/'); |
|
7 | -set_include_path(get_include_path().':'.__DIR__); |
|
8 | -if(file_exists($root.$path)) |
|
6 | +$path = '/' . ltrim(parse_url($_SERVER['REQUEST_URI'])['path'], '/'); |
|
7 | +set_include_path(get_include_path() . ':' . __DIR__); |
|
8 | +if (file_exists($root . $path)) |
|
9 | 9 | { |
10 | - if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') |
|
11 | - $path = rtrim($path,'/').'/index.php'; |
|
12 | - if(strpos($path,'.php') === false) return false; |
|
10 | + if (is_dir($root . $path) && substr($path, strlen($path) - 1, 1) !== '/') |
|
11 | + $path = rtrim($path, '/') . '/index.php'; |
|
12 | + if (strpos($path, '.php') === false) return false; |
|
13 | 13 | else { |
14 | - chdir(dirname($root.$path)); |
|
15 | - require_once $root.$path; |
|
14 | + chdir(dirname($root . $path)); |
|
15 | + require_once $root . $path; |
|
16 | 16 | } |
17 | -}else include_once 'index.php'; |
|
17 | +} else include_once 'index.php'; |
|
18 | 18 | ?> |
@@ -7,12 +7,16 @@ |
||
7 | 7 | set_include_path(get_include_path().':'.__DIR__); |
8 | 8 | if(file_exists($root.$path)) |
9 | 9 | { |
10 | - if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') |
|
11 | - $path = rtrim($path,'/').'/index.php'; |
|
12 | - if(strpos($path,'.php') === false) return false; |
|
13 | - else { |
|
10 | + if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') { |
|
11 | + $path = rtrim($path,'/').'/index.php'; |
|
12 | + } |
|
13 | + if(strpos($path,'.php') === false) { |
|
14 | + return false; |
|
15 | + } else { |
|
14 | 16 | chdir(dirname($root.$path)); |
15 | 17 | require_once $root.$path; |
16 | 18 | } |
17 | -}else include_once 'index.php'; |
|
19 | +} else { |
|
20 | + include_once 'index.php'; |
|
21 | +} |
|
18 | 22 | ?> |
@@ -20,7 +20,7 @@ |
||
20 | 20 | { |
21 | 21 | use _generated\UnitTesterActions; |
22 | 22 | |
23 | - /** |
|
24 | - * Define custom actions here |
|
25 | - */ |
|
23 | + /** |
|
24 | + * Define custom actions here |
|
25 | + */ |
|
26 | 26 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | expect('getCategories should return an array of 7 categories', $this->assertEquals(count($behaviors), 7)); |
22 | 22 | |
23 | - foreach($behaviors as $behavior) { |
|
23 | + foreach ($behaviors as $behavior) { |
|
24 | 24 | expect('this behavior to have a "name" key', $this->assertArrayHasKey('name', $behavior)); |
25 | 25 | expect('this behavior to have a "behavior_count" key', $this->assertArrayHasKey('behavior_count', $behavior)); |
26 | 26 | expect('this behavior to have a "category_id" key', $this->assertArrayHasKey('category_id', $behavior)); |
@@ -48,7 +48,7 @@ |
||
48 | 48 | // check that the desired_email is not already the email of another user |
49 | 49 | $user = $this->user->findByEmail($this->desired_email); |
50 | 50 | // if it is, we do nothing and return true, don't leak the data |
51 | - if(!$user) { |
|
51 | + if (!$user) { |
|
52 | 52 | $this->user->desired_email = $this->desired_email; |
53 | 53 | $this->user->generateChangeEmailToken(); |
54 | 54 | $this->user->save(); |
@@ -14,103 +14,103 @@ discard block |
||
14 | 14 | class Behavior extends \yii\base\BaseObject implements BehaviorInterface |
15 | 15 | { |
16 | 16 | public static $behaviors = [ |
17 | - ['id' => 1, 'name' => 'no current secrets', 'category_id' => 1], |
|
18 | - ['id' => 2, 'name' => 'resolving problems', 'category_id' => 1], |
|
19 | - ['id' => 3, 'name' => 'identifying fears and feelings', 'category_id' => 1], |
|
20 | - ['id' => 4, 'name' => 'keeping commitments to meetings, prayer, family, church, people, goals, and self', 'category_id' => 1], |
|
21 | - ['id' => 5, 'name' => 'being open', 'category_id' => 1], |
|
22 | - ['id' => 6, 'name' => 'being honest', 'category_id' => 1], |
|
23 | - ['id' => 7, 'name' => 'making eye contact', 'category_id' => 1], |
|
24 | - ['id' => 8, 'name' => 'reaching out to others', 'category_id' => 1], |
|
25 | - ['id' => 9, 'name' => 'increasing in relationships with God and others', 'category_id' => 1], |
|
26 | - ['id' => 10, 'name' => 'accountability', 'category_id' => 1], |
|
27 | - ['id' => 11, 'name' => 'secrets', 'category_id' => 2], |
|
28 | - ['id' => 12, 'name' => 'bored', 'category_id' => 2], |
|
29 | - ['id' => 13, 'name' => 'less time/energy for God, meetings, and church', 'category_id' => 2], |
|
30 | - ['id' => 14, 'name' => 'avoiding support and accountability towards people', 'category_id' => 2], |
|
31 | - ['id' => 15, 'name' => 'superficial conversations', 'category_id' => 2], |
|
32 | - ['id' => 16, 'name' => 'sarcasm', 'category_id' => 2], |
|
33 | - ['id' => 17, 'name' => 'isolating yourself', 'category_id' => 2], |
|
34 | - ['id' => 18, 'name' => 'changes in goals', 'category_id' => 2], |
|
35 | - ['id' => 19, 'name' => 'flirting', 'category_id' => 2], |
|
36 | - ['id' => 20, 'name' => 'obsessed with relationships', 'category_id' => 2], |
|
37 | - ['id' => 21, 'name' => 'breaking promises/commitments', 'category_id' => 2], |
|
38 | - ['id' => 22, 'name' => 'neglecting family', 'category_id' => 2], |
|
39 | - ['id' => 23, 'name' => 'preoccupation with material things, television, or entertainment', 'category_id' => 2], |
|
40 | - ['id' => 24, 'name' => 'procrastination', 'category_id' => 2], |
|
41 | - ['id' => 25, 'name' => 'lying', 'category_id' => 2], |
|
42 | - ['id' => 26, 'name' => 'over-confidence', 'category_id' => 2], |
|
43 | - ['id' => 27, 'name' => 'hiding money', 'category_id' => 2], |
|
44 | - ['id' => 28, 'name' => 'worry', 'category_id' => 3], |
|
45 | - ['id' => 29, 'name' => 'using profanity', 'category_id' => 3], |
|
46 | - ['id' => 30, 'name' => 'being fearful', 'category_id' => 3], |
|
47 | - ['id' => 31, 'name' => 'being resentful', 'category_id' => 3], |
|
48 | - ['id' => 32, 'name' => 'replaying old, negative thoughts', 'category_id' => 3], |
|
49 | - ['id' => 33, 'name' => 'perfectionism', 'category_id' => 3], |
|
50 | - ['id' => 34, 'name' => 'judging others\' motives', 'category_id' => 3], |
|
51 | - ['id' => 35, 'name' => 'making goals and lists you can\'t complete', 'category_id' => 3], |
|
52 | - ['id' => 36, 'name' => 'poor planning', 'category_id' => 3], |
|
53 | - ['id' => 37, 'name' => 'mind reading', 'category_id' => 3], |
|
54 | - ['id' => 38, 'name' => 'fantasy', 'category_id' => 3], |
|
55 | - ['id' => 41, 'name' => 'co-dependent rescuing', 'category_id' => 3], |
|
56 | - ['id' => 42, 'name' => 'sleep problems', 'category_id' => 3], |
|
57 | - ['id' => 43, 'name' => 'trouble concentrating', 'category_id' => 3], |
|
58 | - ['id' => 44, 'name' => 'seeking/creating drama', 'category_id' => 3], |
|
59 | - ['id' => 45, 'name' => 'gossip', 'category_id' => 3], |
|
60 | - ['id' => 46, 'name' => 'using over-the-counter medication for pain, sleep, and weight control', 'category_id' => 3], |
|
61 | - ['id' => 47, 'name' => 'super busy', 'category_id' => 4], |
|
62 | - ['id' => 48, 'name' => 'workaholic', 'category_id' => 4], |
|
63 | - ['id' => 49, 'name' => 'can\'t relax', 'category_id' => 4], |
|
64 | - ['id' => 50, 'name' => 'driving too fast', 'category_id' => 4], |
|
65 | - ['id' => 51, 'name' => 'avoiding slowing down', 'category_id' => 4], |
|
66 | - ['id' => 52, 'name' => 'feeling driven', 'category_id' => 4], |
|
67 | - ['id' => 53, 'name' => 'in a hurry', 'category_id' => 4], |
|
68 | - ['id' => 54, 'name' => 'can\'t turn off thoughts', 'category_id' => 4], |
|
69 | - ['id' => 55, 'name' => 'skipping meals', 'category_id' => 4], |
|
70 | - ['id' => 56, 'name' => 'binge eating (usually at night)', 'category_id' => 4], |
|
71 | - ['id' => 57, 'name' => 'overspending', 'category_id' => 4], |
|
72 | - ['id' => 58, 'name' => 'can\'t identify own feelings/needs', 'category_id' => 4], |
|
73 | - ['id' => 59, 'name' => 'repetitive, negative thoughts', 'category_id' => 4], |
|
74 | - ['id' => 60, 'name' => 'irritable', 'category_id' => 4], |
|
75 | - ['id' => 61, 'name' => 'making excuses for "having to do it all"', 'category_id' => 4], |
|
76 | - ['id' => 62, 'name' => 'dramatic mood swings', 'category_id' => 4], |
|
77 | - ['id' => 63, 'name' => 'lust', 'category_id' => 4], |
|
78 | - ['id' => 64, 'name' => 'too much caffeine', 'category_id' => 4], |
|
79 | - ['id' => 65, 'name' => 'over exercising', 'category_id' => 4], |
|
80 | - ['id' => 66, 'name' => 'nervousness', 'category_id' => 4], |
|
81 | - ['id' => 67, 'name' => 'difficulty being alone or with people', 'category_id' => 4], |
|
82 | - ['id' => 68, 'name' => 'difficulty listening to others', 'category_id' => 4], |
|
83 | - ['id' => 69, 'name' => 'avoiding support', 'category_id' => 4], |
|
84 | - ['id' => 70, 'name' => 'procrastination causing crises in money, work, or relationships', 'category_id' => 5], |
|
85 | - ['id' => 71, 'name' => 'sarcasm', 'category_id' => 5], |
|
86 | - ['id' => 72, 'name' => 'black and white, all or nothing thinking', 'category_id' => 5], |
|
87 | - ['id' => 73, 'name' => 'feeling that no one understands', 'category_id' => 5], |
|
88 | - ['id' => 74, 'name' => 'overreacting', 'category_id' => 5], |
|
89 | - ['id' => 75, 'name' => 'road rage', 'category_id' => 5], |
|
90 | - ['id' => 76, 'name' => 'constant resentments', 'category_id' => 5], |
|
91 | - ['id' => 77, 'name' => 'pushing others away', 'category_id' => 5], |
|
92 | - ['id' => 78, 'name' => 'increased isolation', 'category_id' => 5], |
|
93 | - ['id' => 79, 'name' => 'blaming', 'category_id' => 5], |
|
94 | - ['id' => 80, 'name' => 'self pity', 'category_id' => 5], |
|
95 | - ['id' => 81, 'name' => 'arguing', 'category_id' => 5], |
|
96 | - ['id' => 82, 'name' => 'irrationality', 'category_id' => 5], |
|
97 | - ['id' => 83, 'name' => 'can\'t handle criticism', 'category_id' => 5], |
|
98 | - ['id' => 84, 'name' => 'defensive', 'category_id' => 5], |
|
99 | - ['id' => 85, 'name' => 'people are avoiding you', 'category_id' => 5], |
|
100 | - ['id' => 86, 'name' => 'having to be right', 'category_id' => 5], |
|
101 | - ['id' => 87, 'name' => 'digestive problems', 'category_id' => 5], |
|
102 | - ['id' => 88, 'name' => 'headaches', 'category_id' => 5], |
|
103 | - ['id' => 89, 'name' => 'obsessive (stuck) thoughts', 'category_id' => 5], |
|
104 | - ['id' => 90, 'name' => 'can\'t forgive', 'category_id' => 5], |
|
105 | - ['id' => 91, 'name' => 'feeling grandiose (superior)', 'category_id' => 5], |
|
106 | - ['id' => 92, 'name' => 'intimidation', 'category_id' => 5], |
|
107 | - ['id' => 93, 'name' => 'feeling aggressive', 'category_id' => 5], |
|
108 | - ['id' => 94, 'name' => 'depressed', 'category_id' => 6], |
|
109 | - ['id' => 95, 'name' => 'panicked', 'category_id' => 6], |
|
110 | - ['id' => 96, 'name' => 'confused', 'category_id' => 6], |
|
111 | - ['id' => 97, 'name' => 'hopeless', 'category_id' => 6], |
|
112 | - ['id' => 98, 'name' => 'sleeping too much or too little', 'category_id' => 6], |
|
113 | - ['id' => 99, 'name' => 'can\'t cope', 'category_id' => 6], |
|
17 | + ['id' => 1, 'name' => 'no current secrets', 'category_id' => 1], |
|
18 | + ['id' => 2, 'name' => 'resolving problems', 'category_id' => 1], |
|
19 | + ['id' => 3, 'name' => 'identifying fears and feelings', 'category_id' => 1], |
|
20 | + ['id' => 4, 'name' => 'keeping commitments to meetings, prayer, family, church, people, goals, and self', 'category_id' => 1], |
|
21 | + ['id' => 5, 'name' => 'being open', 'category_id' => 1], |
|
22 | + ['id' => 6, 'name' => 'being honest', 'category_id' => 1], |
|
23 | + ['id' => 7, 'name' => 'making eye contact', 'category_id' => 1], |
|
24 | + ['id' => 8, 'name' => 'reaching out to others', 'category_id' => 1], |
|
25 | + ['id' => 9, 'name' => 'increasing in relationships with God and others', 'category_id' => 1], |
|
26 | + ['id' => 10, 'name' => 'accountability', 'category_id' => 1], |
|
27 | + ['id' => 11, 'name' => 'secrets', 'category_id' => 2], |
|
28 | + ['id' => 12, 'name' => 'bored', 'category_id' => 2], |
|
29 | + ['id' => 13, 'name' => 'less time/energy for God, meetings, and church', 'category_id' => 2], |
|
30 | + ['id' => 14, 'name' => 'avoiding support and accountability towards people', 'category_id' => 2], |
|
31 | + ['id' => 15, 'name' => 'superficial conversations', 'category_id' => 2], |
|
32 | + ['id' => 16, 'name' => 'sarcasm', 'category_id' => 2], |
|
33 | + ['id' => 17, 'name' => 'isolating yourself', 'category_id' => 2], |
|
34 | + ['id' => 18, 'name' => 'changes in goals', 'category_id' => 2], |
|
35 | + ['id' => 19, 'name' => 'flirting', 'category_id' => 2], |
|
36 | + ['id' => 20, 'name' => 'obsessed with relationships', 'category_id' => 2], |
|
37 | + ['id' => 21, 'name' => 'breaking promises/commitments', 'category_id' => 2], |
|
38 | + ['id' => 22, 'name' => 'neglecting family', 'category_id' => 2], |
|
39 | + ['id' => 23, 'name' => 'preoccupation with material things, television, or entertainment', 'category_id' => 2], |
|
40 | + ['id' => 24, 'name' => 'procrastination', 'category_id' => 2], |
|
41 | + ['id' => 25, 'name' => 'lying', 'category_id' => 2], |
|
42 | + ['id' => 26, 'name' => 'over-confidence', 'category_id' => 2], |
|
43 | + ['id' => 27, 'name' => 'hiding money', 'category_id' => 2], |
|
44 | + ['id' => 28, 'name' => 'worry', 'category_id' => 3], |
|
45 | + ['id' => 29, 'name' => 'using profanity', 'category_id' => 3], |
|
46 | + ['id' => 30, 'name' => 'being fearful', 'category_id' => 3], |
|
47 | + ['id' => 31, 'name' => 'being resentful', 'category_id' => 3], |
|
48 | + ['id' => 32, 'name' => 'replaying old, negative thoughts', 'category_id' => 3], |
|
49 | + ['id' => 33, 'name' => 'perfectionism', 'category_id' => 3], |
|
50 | + ['id' => 34, 'name' => 'judging others\' motives', 'category_id' => 3], |
|
51 | + ['id' => 35, 'name' => 'making goals and lists you can\'t complete', 'category_id' => 3], |
|
52 | + ['id' => 36, 'name' => 'poor planning', 'category_id' => 3], |
|
53 | + ['id' => 37, 'name' => 'mind reading', 'category_id' => 3], |
|
54 | + ['id' => 38, 'name' => 'fantasy', 'category_id' => 3], |
|
55 | + ['id' => 41, 'name' => 'co-dependent rescuing', 'category_id' => 3], |
|
56 | + ['id' => 42, 'name' => 'sleep problems', 'category_id' => 3], |
|
57 | + ['id' => 43, 'name' => 'trouble concentrating', 'category_id' => 3], |
|
58 | + ['id' => 44, 'name' => 'seeking/creating drama', 'category_id' => 3], |
|
59 | + ['id' => 45, 'name' => 'gossip', 'category_id' => 3], |
|
60 | + ['id' => 46, 'name' => 'using over-the-counter medication for pain, sleep, and weight control', 'category_id' => 3], |
|
61 | + ['id' => 47, 'name' => 'super busy', 'category_id' => 4], |
|
62 | + ['id' => 48, 'name' => 'workaholic', 'category_id' => 4], |
|
63 | + ['id' => 49, 'name' => 'can\'t relax', 'category_id' => 4], |
|
64 | + ['id' => 50, 'name' => 'driving too fast', 'category_id' => 4], |
|
65 | + ['id' => 51, 'name' => 'avoiding slowing down', 'category_id' => 4], |
|
66 | + ['id' => 52, 'name' => 'feeling driven', 'category_id' => 4], |
|
67 | + ['id' => 53, 'name' => 'in a hurry', 'category_id' => 4], |
|
68 | + ['id' => 54, 'name' => 'can\'t turn off thoughts', 'category_id' => 4], |
|
69 | + ['id' => 55, 'name' => 'skipping meals', 'category_id' => 4], |
|
70 | + ['id' => 56, 'name' => 'binge eating (usually at night)', 'category_id' => 4], |
|
71 | + ['id' => 57, 'name' => 'overspending', 'category_id' => 4], |
|
72 | + ['id' => 58, 'name' => 'can\'t identify own feelings/needs', 'category_id' => 4], |
|
73 | + ['id' => 59, 'name' => 'repetitive, negative thoughts', 'category_id' => 4], |
|
74 | + ['id' => 60, 'name' => 'irritable', 'category_id' => 4], |
|
75 | + ['id' => 61, 'name' => 'making excuses for "having to do it all"', 'category_id' => 4], |
|
76 | + ['id' => 62, 'name' => 'dramatic mood swings', 'category_id' => 4], |
|
77 | + ['id' => 63, 'name' => 'lust', 'category_id' => 4], |
|
78 | + ['id' => 64, 'name' => 'too much caffeine', 'category_id' => 4], |
|
79 | + ['id' => 65, 'name' => 'over exercising', 'category_id' => 4], |
|
80 | + ['id' => 66, 'name' => 'nervousness', 'category_id' => 4], |
|
81 | + ['id' => 67, 'name' => 'difficulty being alone or with people', 'category_id' => 4], |
|
82 | + ['id' => 68, 'name' => 'difficulty listening to others', 'category_id' => 4], |
|
83 | + ['id' => 69, 'name' => 'avoiding support', 'category_id' => 4], |
|
84 | + ['id' => 70, 'name' => 'procrastination causing crises in money, work, or relationships', 'category_id' => 5], |
|
85 | + ['id' => 71, 'name' => 'sarcasm', 'category_id' => 5], |
|
86 | + ['id' => 72, 'name' => 'black and white, all or nothing thinking', 'category_id' => 5], |
|
87 | + ['id' => 73, 'name' => 'feeling that no one understands', 'category_id' => 5], |
|
88 | + ['id' => 74, 'name' => 'overreacting', 'category_id' => 5], |
|
89 | + ['id' => 75, 'name' => 'road rage', 'category_id' => 5], |
|
90 | + ['id' => 76, 'name' => 'constant resentments', 'category_id' => 5], |
|
91 | + ['id' => 77, 'name' => 'pushing others away', 'category_id' => 5], |
|
92 | + ['id' => 78, 'name' => 'increased isolation', 'category_id' => 5], |
|
93 | + ['id' => 79, 'name' => 'blaming', 'category_id' => 5], |
|
94 | + ['id' => 80, 'name' => 'self pity', 'category_id' => 5], |
|
95 | + ['id' => 81, 'name' => 'arguing', 'category_id' => 5], |
|
96 | + ['id' => 82, 'name' => 'irrationality', 'category_id' => 5], |
|
97 | + ['id' => 83, 'name' => 'can\'t handle criticism', 'category_id' => 5], |
|
98 | + ['id' => 84, 'name' => 'defensive', 'category_id' => 5], |
|
99 | + ['id' => 85, 'name' => 'people are avoiding you', 'category_id' => 5], |
|
100 | + ['id' => 86, 'name' => 'having to be right', 'category_id' => 5], |
|
101 | + ['id' => 87, 'name' => 'digestive problems', 'category_id' => 5], |
|
102 | + ['id' => 88, 'name' => 'headaches', 'category_id' => 5], |
|
103 | + ['id' => 89, 'name' => 'obsessive (stuck) thoughts', 'category_id' => 5], |
|
104 | + ['id' => 90, 'name' => 'can\'t forgive', 'category_id' => 5], |
|
105 | + ['id' => 91, 'name' => 'feeling grandiose (superior)', 'category_id' => 5], |
|
106 | + ['id' => 92, 'name' => 'intimidation', 'category_id' => 5], |
|
107 | + ['id' => 93, 'name' => 'feeling aggressive', 'category_id' => 5], |
|
108 | + ['id' => 94, 'name' => 'depressed', 'category_id' => 6], |
|
109 | + ['id' => 95, 'name' => 'panicked', 'category_id' => 6], |
|
110 | + ['id' => 96, 'name' => 'confused', 'category_id' => 6], |
|
111 | + ['id' => 97, 'name' => 'hopeless', 'category_id' => 6], |
|
112 | + ['id' => 98, 'name' => 'sleeping too much or too little', 'category_id' => 6], |
|
113 | + ['id' => 99, 'name' => 'can\'t cope', 'category_id' => 6], |
|
114 | 114 | ['id' => 100, 'name' => 'overwhelmed', 'category_id' => 6], |
115 | 115 | ['id' => 101, 'name' => 'crying for "no reason"', 'category_id' => 6], |
116 | 116 | ['id' => 102, 'name' => 'can\'t think', 'category_id' => 6], |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | public function getCategories() { |
181 | 181 | $bhvrs_by_cat = AH::index(self::$behaviors, null, 'category_id'); |
182 | 182 | $cats = AH::index(\common\models\Category::$categories, "id"); |
183 | - foreach($cats as $id => &$cat) { |
|
183 | + foreach ($cats as $id => &$cat) { |
|
184 | 184 | $cat['behavior_count'] = count($bhvrs_by_cat[$id]); // add count of behaviors |
185 | 185 | $cat['category_id'] = $cat['id']; // rename id to category_id |
186 | 186 | unset($cat['id']); |
@@ -57,7 +57,7 @@ |
||
57 | 57 | <?= $form->field($model, 'subject') ?> |
58 | 58 | <?= $form->field($model, 'body')->textArea(['rows' => 6]) ?> |
59 | 59 | |
60 | - <?php if(Yii::$app->user->isGuest) { |
|
60 | + <?php if (Yii::$app->user->isGuest) { |
|
61 | 61 | // only show captcha if user is not logged in |
62 | 62 | print $form->field($model, 'verifyCode')->widget(Captcha::class, [ |
63 | 63 | 'template' => '<div class="row"><div class="col-md-4">{image}</div><div class="col-md-8">{input}</div></div>', |
@@ -22,11 +22,11 @@ |
||
22 | 22 | <div class="col-md-6 col-md-offset-3"> |
23 | 23 | <h1>Sign up</h1> |
24 | 24 | <?php $form = ActiveForm::begin([ |
25 | - 'id' => 'form-signup', |
|
26 | - 'enableClientValidation' => true, |
|
25 | + 'id' => 'form-signup', |
|
26 | + 'enableClientValidation' => true, |
|
27 | 27 | 'enableAjaxValidation' => false, |
28 | 28 | 'options' => [ 'validateOnSubmit' => true ] |
29 | - ]); ?> |
|
29 | + ]); ?> |
|
30 | 30 | <?= $form->field($model, 'email', ['inputTemplate' => '<div class="input-group"><span class="input-group-addon">@</span>{input}</div>'])->input('email') ?> |
31 | 31 | <?= $form->field($model, 'password', ['inputTemplate' => '<div class="input-group">{input}<span class="input-group-btn"><button id="password-toggle" class="btn btn-default" type="button">Show</button></span></div>'])->passwordInput() ?> |
32 | 32 | <?= $form->field($model, 'timezone')->dropDownList(array_combine($timezones, $timezones)); ?> |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | 'id' => 'form-signup', |
27 | 27 | 'enableClientValidation' => true, |
28 | 28 | 'enableAjaxValidation' => false, |
29 | - 'options' => [ 'validateOnSubmit' => true ] |
|
29 | + 'options' => ['validateOnSubmit' => true] |
|
30 | 30 | ]); ?> |
31 | 31 | <?= $form->field($model, 'email', ['inputTemplate' => '<div class="input-group"><span class="input-group-addon">@</span>{input}</div>'])->input('email') ?> |
32 | 32 | <?= $form->field($model, 'password', ['inputTemplate' => '<div class="input-group">{input}<span class="input-group-btn"><button id="password-toggle" class="btn btn-default" type="button">Show</button></span></div>'])->passwordInput() ?> |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | 'template' => '<div class="row"><div class="col-md-5">{image}</div><div class="col-md-6 col-md-offset-1">{input}</div></div>', |
36 | 36 | ]) ?> |
37 | 37 | <?= $form->field($model, 'send_email')->checkbox(['disabled'=>true]) ?> |
38 | - <div id='send_email_fields' <?php if(!$model->send_email) { ?>style="display: none;"<?php } ?>> |
|
38 | + <div id='send_email_fields' <?php if (!$model->send_email) { ?>style="display: none;"<?php } ?>> |
|
39 | 39 | <?= $form->field($model, 'email_category')->dropdownList(Category::getCategories(), ['data-toggle' => 'tooltip', 'data-placement' => 'left', 'data-trigger' => 'hover', 'data-delay' => '{"show": 500, "hide": 100}', 'title' => 'Want to send an email with every check-in? Try setting this to "Restoration"']) ?> |
40 | 40 | <?= $form->field($model, 'partner_email1')->input('email') ?> |
41 | 41 | <?= $form->field($model, 'partner_email2')->input('email') ?> |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | $exception = Yii::$app->errorHandler->exception; |
17 | 17 | |
18 | -if($exception instanceof \yii\web\NotFoundHttpException): |
|
18 | +if ($exception instanceof \yii\web\NotFoundHttpException): |
|
19 | 19 | $this->title = "The Faster Scale App | Page Not Found"; |
20 | 20 | ?> |
21 | 21 | |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | <p>Otherwise, please ensure your attempted url is correct.</p> |
26 | 26 | |
27 | 27 | <?php |
28 | -elseif($exception instanceof \yii\web\ServerErrorHttpException): |
|
28 | +elseif ($exception instanceof \yii\web\ServerErrorHttpException): |
|
29 | 29 | $this->title = "The Faster Scale App | Oops"; |
30 | 30 | ?> |
31 | 31 |
@@ -33,7 +33,8 @@ discard block |
||
33 | 33 | <div class="alert alert-danger"><?= nl2br(Html::encode($name)) ?></div> |
34 | 34 | <p>Well this is embarrassing...we're having an error on our side. So sorry for the annoyance. If you'd like to help, please send us a message on our <a href='<?=Url::to(['site/contact'])?>'>contact form</a>.</p> |
35 | 35 | |
36 | -<?php else: ?> |
|
36 | +<?php else { |
|
37 | + : ?> |
|
37 | 38 | |
38 | 39 | <div class="site-error"> |
39 | 40 | <h1><?= Html::encode($name) ?></h1> |
@@ -41,4 +42,6 @@ discard block |
||
41 | 42 | <p>The above error occurred while the Web server was processing your request.</p> |
42 | 43 | <p>Please contact us if you think this is a server error. Thank you.</p> |
43 | 44 | </div> |
44 | -<?php endif; ?> |
|
45 | +<?php endif; |
|
46 | +} |
|
47 | +?> |