@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | $this->title = "The Faster Scale App | $name"; |
| 14 | 14 | $code = $exception->statusCode; |
| 15 | 15 | |
| 16 | -if($code === 404): |
|
| 16 | +if ($code === 404): |
|
| 17 | 17 | $this->title = "The Faster Scale App | Page Not Found"; |
| 18 | 18 | ?> |
| 19 | 19 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | <p>Otherwise, please ensure your attempted url is correct.</p> |
| 24 | 24 | |
| 25 | 25 | <?php |
| 26 | -elseif($code >= 500 && $code < 600): |
|
| 26 | +elseif ($code >= 500 && $code < 600): |
|
| 27 | 27 | $this->title = "The Faster Scale App | Oops"; |
| 28 | 28 | ?> |
| 29 | 29 | <h1>It's not you. It's us.</h1> |
@@ -30,7 +30,8 @@ discard block |
||
| 30 | 30 | <div class="alert alert-danger"><?= nl2br(Html::encode($name)) ?></div> |
| 31 | 31 | <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> |
| 32 | 32 | |
| 33 | -<?php else: ?> |
|
| 33 | +<?php else { |
|
| 34 | + : ?> |
|
| 34 | 35 | |
| 35 | 36 | <div class="site-error"> |
| 36 | 37 | <h1><?= Html::encode($name) ?></h1> |
@@ -38,4 +39,6 @@ discard block |
||
| 38 | 39 | <p>The above error occurred while the Web server was processing your request.</p> |
| 39 | 40 | <p>Please contact us if you think this is a server error. Thank you.</p> |
| 40 | 41 | </div> |
| 41 | -<?php endif; ?> |
|
| 42 | +<?php endif; |
|
| 43 | +} |
|
| 44 | +?> |
|
@@ -22,11 +22,11 @@ |
||
| 22 | 22 | <div class="row"> |
| 23 | 23 | <div class="col-md-5"> |
| 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)); ?> |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | 'id' => 'form-signup', |
| 26 | 26 | 'enableClientValidation' => true, |
| 27 | 27 | 'enableAjaxValidation' => false, |
| 28 | - 'options' => [ 'validateOnSubmit' => true ] |
|
| 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() ?> |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | 'template' => '<div class="row"><div class="col-md-5">{image}</div><div class="col-md-6 col-md-offset-1">{input}</div></div>', |
| 35 | 35 | ]) ?> |
| 36 | 36 | <?= $form->field($model, 'send_email')->checkbox(['disabled'=>true]) ?> |
| 37 | - <div id='email_threshold_fields' <?php if(!$model->send_email) { ?>style="display: none;"<?php } ?>> |
|
| 37 | + <div id='email_threshold_fields' <?php if (!$model->send_email) { ?>style="display: none;"<?php } ?>> |
|
| 38 | 38 | <?= $form->field($model, 'email_threshold', ['template' => '{label}<div class="row"><div class="col-md-3">{input}</div><div class="col-md-9"><p class="bg-info text-center" style="margin: 5px 0px;">We recommend starting with 30</p></div></div>{error}'])->textInput(['class'=>'form-control'])->input('number', ['min' => 0, 'max' => 100]) ?> |
| 39 | 39 | <?= $form->field($model, 'partner_email1')->input('email') ?> |
| 40 | 40 | <?= $form->field($model, 'partner_email2')->input('email') ?> |
@@ -13,8 +13,8 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | site\assets\AppAsset::register($this); |
| 15 | 15 | |
| 16 | -if($hash = Utility::getRevHash()) { |
|
| 17 | - $rev_link = '<a href="'.Utility::getGithubRevUrl().'">'.Utility::getRevHash().'</a>'; |
|
| 16 | +if ($hash = Utility::getRevHash()) { |
|
| 17 | + $rev_link = '<a href="' . Utility::getGithubRevUrl() . '">' . Utility::getRevHash() . '</a>'; |
|
| 18 | 18 | } else $rev_link = 'DEVELOPMENT'; |
| 19 | 19 | |
| 20 | 20 | ?> |
@@ -15,7 +15,9 @@ |
||
| 15 | 15 | |
| 16 | 16 | if($hash = Utility::getRevHash()) { |
| 17 | 17 | $rev_link = '<a href="'.Utility::getGithubRevUrl().'">'.Utility::getRevHash().'</a>'; |
| 18 | -} else $rev_link = 'DEVELOPMENT'; |
|
| 18 | +} else { |
|
| 19 | + $rev_link = 'DEVELOPMENT'; |
|
| 20 | +} |
|
| 19 | 21 | |
| 20 | 22 | ?> |
| 21 | 23 | <?php $this->beginPage() ?> |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | print $form |
| 41 | 41 | ->field($model, "behaviors{$category['id']}") |
| 42 | 42 | ->checkboxList($behaviors, |
| 43 | - ['data-toggle' => 'buttons', 'item' => "checkboxItemTemplate"]); |
|
| 43 | + ['data-toggle' => 'buttons', 'item' => "checkboxItemTemplate"]); |
|
| 44 | 44 | } |
| 45 | 45 | print Html::submitButton('Submit', ['class' => 'btn btn-success']); |
| 46 | 46 | ActiveForm::end(); |
@@ -10,8 +10,7 @@ discard block |
||
| 10 | 10 | $this->title = "The Faster Scale App | Check-in"; |
| 11 | 11 | |
| 12 | 12 | function checkboxItemTemplate($index, $label, $name, $checked, $value) { |
| 13 | - return Html::checkbox |
|
| 14 | - ( |
|
| 13 | + return Html::checkbox( |
|
| 15 | 14 | $name, |
| 16 | 15 | $checked, |
| 17 | 16 | [ |
@@ -35,7 +34,7 @@ discard block |
||
| 35 | 34 | 'options' => ['class' => 'form-horizontal'], |
| 36 | 35 | ]); |
| 37 | 36 | |
| 38 | -foreach($categories as $category) { |
|
| 37 | +foreach ($categories as $category) { |
|
| 39 | 38 | $behaviors = AH::map($behaviorsList[$category['id']], 'id', 'name'); |
| 40 | 39 | print $form |
| 41 | 40 | ->field($model, "behaviors{$category['id']}") |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | print $form |
| 93 | 93 | ->field($model, "behaviors{$category['id']}") |
| 94 | 94 | ->checkboxList($behaviors, |
| 95 | - ['item' => "checkboxItemTemplate"]); |
|
| 95 | + ['item' => "checkboxItemTemplate"]); |
|
| 96 | 96 | } |
| 97 | 97 | ActiveForm::end(); |
| 98 | 98 | |
@@ -41,10 +41,10 @@ |
||
| 41 | 41 | |
| 42 | 42 | <?php |
| 43 | 43 | switch(true) { |
| 44 | - case ($score < 30): |
|
| 45 | - $alert_level = "success"; |
|
| 46 | - $alert_msg = "You're doing well! Keep on doing whatever it is you're doing!"; |
|
| 47 | - break; |
|
| 44 | + case ($score < 30): |
|
| 45 | + $alert_level = "success"; |
|
| 46 | + $alert_msg = "You're doing well! Keep on doing whatever it is you're doing!"; |
|
| 47 | + break; |
|
| 48 | 48 | |
| 49 | 49 | case ($score < 40): |
| 50 | 50 | $alert_level = "info"; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $plus_week = $time->alterLocalDate($actual_date, "+1 week"); |
| 28 | 28 | |
| 29 | 29 | $pie_data = []; |
| 30 | -if($answer_pie) { |
|
| 30 | +if ($answer_pie) { |
|
| 31 | 31 | $values = array_map('intval', array_column($answer_pie, "count")); |
| 32 | 32 | $labels = array_column($answer_pie, "name"); |
| 33 | 33 | $colors = array_column($answer_pie, "color"); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | </div> |
| 65 | 65 | |
| 66 | 66 | <?php |
| 67 | - switch(true) { |
|
| 67 | + switch (true) { |
|
| 68 | 68 | case ($score < 30): |
| 69 | 69 | $alert_level = "success"; |
| 70 | 70 | $alert_msg = "You're doing well! Keep on doing whatever it is you're doing!"; |
@@ -96,15 +96,15 @@ discard block |
||
| 96 | 96 | </div> |
| 97 | 97 | </div> |
| 98 | 98 | |
| 99 | - <?php if($questions) { |
|
| 100 | - foreach($questions as $behavior_id => $behavior_questions) { |
|
| 99 | + <?php if ($questions) { |
|
| 100 | + foreach ($questions as $behavior_id => $behavior_questions) { |
|
| 101 | 101 | print "<div class='well well-sm'>"; |
| 102 | 102 | print "<button type='button' class='btn btn-primary' disabled='disabled'>{$behavior_questions['question']['title']}</button>"; |
| 103 | 103 | print "<div class='row'>"; |
| 104 | - foreach($behavior_questions['answers'] as $question) { |
|
| 104 | + foreach ($behavior_questions['answers'] as $question) { |
|
| 105 | 105 | print "<div class='col-md-4'>"; |
| 106 | 106 | print "<p><strong>{$question['title']}</strong></p>"; |
| 107 | - print "<p>".Html::encode($question['answer'])."</p>"; |
|
| 107 | + print "<p>" . Html::encode($question['answer']) . "</p>"; |
|
| 108 | 108 | print "</div>"; |
| 109 | 109 | } |
| 110 | 110 | print "</div></div>"; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | 'options' => ['class' => 'form-horizontal'], |
| 117 | 117 | ]); |
| 118 | 118 | |
| 119 | - foreach($categories as $category) { |
|
| 119 | + foreach ($categories as $category) { |
|
| 120 | 120 | $behaviors = AH::map($behaviorsList[$category['id']], 'id', 'name'); |
| 121 | 121 | print $form |
| 122 | 122 | ->field($model, "behaviors{$category['id']}") |
@@ -12,9 +12,9 @@ |
||
| 12 | 12 | $name, |
| 13 | 13 | $checked, |
| 14 | 14 | ['value' => $value, |
| 15 | - 'label' => $label, |
|
| 16 | - 'container' => false, |
|
| 17 | - 'labelOptions' => [ 'class' => $checked |
|
| 15 | + 'label' => $label, |
|
| 16 | + 'container' => false, |
|
| 17 | + 'labelOptions' => [ 'class' => $checked |
|
| 18 | 18 | ? 'btn btn-info active' |
| 19 | 19 | : 'btn btn-info'], |
| 20 | 20 | ]); |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | ['value' => $value, |
| 15 | 15 | 'label' => $label, |
| 16 | 16 | 'container' => false, |
| 17 | - 'labelOptions' => [ 'class' => $checked |
|
| 17 | + 'labelOptions' => ['class' => $checked |
|
| 18 | 18 | ? 'btn btn-info active' |
| 19 | 19 | : 'btn btn-info'], |
| 20 | 20 | ]); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | 'id' => 'checkin-form', |
| 33 | 33 | ]); |
| 34 | 34 | |
| 35 | -foreach($categories as $category_id => $category_name) { |
|
| 35 | +foreach ($categories as $category_id => $category_name) { |
|
| 36 | 36 | print $form->field($model, "user_behavior_id{$category_id}")->radioList($behaviors[$category_id], ['class' => "btn-group", 'data-toggle' => 'buttons', 'item'=>"radioItemTemplate"]); |
| 37 | 37 | print $form->field($model, "answer_{$category_id}a")->textarea()->label("How does it affect me? How do I act and feel?"); |
| 38 | 38 | print $form->field($model, "answer_{$category_id}b")->textarea()->label("How does it affect the important people in my life?"); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | public function setBehaviors($behaviors) { |
| 67 | 67 | foreach($behaviors as $category_id => $category_data) { |
| 68 | 68 | $attribute = "behaviors$category_id"; |
| 69 | - $this->$attribute = []; |
|
| 69 | + $this->$attribute = []; |
|
| 70 | 70 | foreach($category_data['behaviors'] as $behavior) { |
| 71 | 71 | $this->{$attribute}[] = $behavior['id']; |
| 72 | 72 | } |
@@ -85,12 +85,12 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | public function compileBehaviors() { |
| 87 | 87 | $behaviors = array_merge((array)$this->behaviors1, |
| 88 | - (array)$this->behaviors2, |
|
| 89 | - (array)$this->behaviors3, |
|
| 90 | - (array)$this->behaviors4, |
|
| 91 | - (array)$this->behaviors5, |
|
| 92 | - (array)$this->behaviors6, |
|
| 93 | - (array)$this->behaviors7); |
|
| 88 | + (array)$this->behaviors2, |
|
| 89 | + (array)$this->behaviors3, |
|
| 90 | + (array)$this->behaviors4, |
|
| 91 | + (array)$this->behaviors5, |
|
| 92 | + (array)$this->behaviors6, |
|
| 93 | + (array)$this->behaviors7); |
|
| 94 | 94 | |
| 95 | 95 | return array_filter($behaviors); // strip out false values |
| 96 | 96 | } |
@@ -64,10 +64,10 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | public function setBehaviors($behaviors) { |
| 67 | - foreach($behaviors as $category_id => $category_data) { |
|
| 67 | + foreach ($behaviors as $category_id => $category_data) { |
|
| 68 | 68 | $attribute = "behaviors$category_id"; |
| 69 | 69 | $this->$attribute = []; |
| 70 | - foreach($category_data['behaviors'] as $behavior) { |
|
| 70 | + foreach ($category_data['behaviors'] as $behavior) { |
|
| 71 | 71 | $this->{$attribute}[] = $behavior['id']; |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | public function validateBehaviors($attribute, $params) { |
| 77 | 77 | if (!$this->hasErrors()) { |
| 78 | - foreach($this->$attribute as $behavior) { |
|
| 79 | - if(!is_numeric($behavior)) { |
|
| 78 | + foreach ($this->$attribute as $behavior) { |
|
| 79 | + if (!is_numeric($behavior)) { |
|
| 80 | 80 | $this->addError($attribute, 'One of your behaviors is not an integer!'); |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -110,12 +110,12 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | public function save() { |
| 113 | - if(empty($this->compiled_behaviors)) { |
|
| 113 | + if (empty($this->compiled_behaviors)) { |
|
| 114 | 114 | $this->commpiled_behaviors = $this->compileBehaviors(); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | $rows = []; |
| 118 | - foreach($this->compiled_behaviors as $behavior_id) { |
|
| 118 | + foreach ($this->compiled_behaviors as $behavior_id) { |
|
| 119 | 119 | $temp = [ |
| 120 | 120 | Yii::$app->user->id, |
| 121 | 121 | (int)$behavior_id, |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | return Yii::$app->mailer->compose() |
| 57 | 57 | ->setTo($email) |
| 58 | 58 | ->setFrom([$this->email => $this->name]) |
| 59 | - ->setSubject("[FSA Contact] ".$this->subject) |
|
| 59 | + ->setSubject("[FSA Contact] " . $this->subject) |
|
| 60 | 60 | ->setTextBody($this->body) |
| 61 | 61 | ->send(); |
| 62 | 62 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | public function signup() { |
| 97 | 97 | $user = $this->user->findByEmail($this->email); |
| 98 | - if(!$user) { |
|
| 98 | + if (!$user) { |
|
| 99 | 99 | // this is a brand new user |
| 100 | 100 | $this->user = $this->setFields($this->user); |
| 101 | 101 | $this->user->save(); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * this is a user that for whatever reason is trying to sign up again |
| 110 | 110 | * with the same email address. |
| 111 | 111 | */ |
| 112 | - if(!$user->isTokenConfirmed()) { |
|
| 112 | + if (!$user->isTokenConfirmed()) { |
|
| 113 | 113 | /* |
| 114 | 114 | * they've never verified their account. We don't care if their |
| 115 | 115 | * verification token is current or expired. We're resetting their |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $user->generateAuthKey(); |
| 137 | 137 | $user->generateVerifyEmailToken(); |
| 138 | 138 | |
| 139 | - if($this->send_email) { |
|
| 139 | + if ($this->send_email) { |
|
| 140 | 140 | $user->email_threshold = $this->email_threshold; |
| 141 | 141 | $user->partner_email1 = $this->partner_email1; |
| 142 | 142 | $user->partner_email2 = $this->partner_email2; |