@ -201,6 +201,7 @@ function refreshToken($vars, $refreshToken) {
setcookie('access_token', $jsonAuth['access_token'], time() + $jsonAuth['expires_in'], "/");
setcookie('refresh_token', $jsonAuth['refresh_token'], time() + (86400 * 90), "/");
header('Location: /');
die();
}
}
@ -330,17 +331,6 @@ if ($isLoggedIn && $_POST) {
border-bottom: 1px solid var(--color-primary);
}
.hours {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin-bottom: 20px;
}
.hour {
white-space: nowrap;
}
.actions {
display: flex;
justify-content: center;
@ -357,6 +347,24 @@ if ($isLoggedIn && $_POST) {
cursor: pointer;
}
.info {
color: var(--message-color);
font-size: 0.9rem;
font-style: italic;
}
<?php if ( $isLoggedIn ) : ?>
.hours {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin-bottom: 20px;
}
.hour {
white-space: nowrap;
}
.hour label {
padding: 10px;
cursor: pointer;
@ -376,34 +384,23 @@ if ($isLoggedIn && $_POST) {
background-color: var(--btn-bg-color);
color: var(--btn-color);
}
.info {
color: var(--message-color);
font-size: 0.9rem;
font-style: italic;
}
<?php endif ; ?>
< / style >
< / head >
< body >
< div class = "container" >
<?php if ( ! $isLoggedIn ) : ?>
<?php if ( $message ) : ?>
< div class = "message" > <? = $message ?> </ div >
<?php endif ; ?>
<?php if ( $message ) : ?> < div class = "message" > <? = $message ?> </ div > <?php endif ; ?>
< div class = "actions" >
< a href = " <? = $vars [ 'AUTHORIZE_URL' ]; ?> ?response_type=code&client_id= <? = $vars [ 'CLIENT_ID' ] ?> &scope= <? = urlencode ( $vars [ 'SCOPES' ]) ?> "
class="button">Log in now< / a >
< a href = " <? = $vars [ 'AUTHORIZE_URL' ]; ?> ?response_type=code&client_id= <? = $vars [ 'CLIENT_ID' ] ?> &scope= <? = urlencode ( $vars [ 'SCOPES' ]) ?> " class = "button" > Log in now</ a >
< / div >
<?php else : ?>
< form action = "" method = "post" class = "update_form" >
<?php if ( $message ) : ?>
< div class = "message" > <? = $message ?> </ div >
<?php endif ; ?>
< form action = "" method = "post" >
<?php if ( $message ) : ?> < div class = "message" > <? = $message ?> </ div > <?php endif ; ?>
< div class = "hours" >
<?php foreach ( $times as $key => $value ) : ?>
< span class = "hour <?php if ( $key == $selectedHour ) : ?> selected <?php endif ; ?> " >
< input type = "radio" id = "hour <? = $key ?> " name = "hour"
value="<? = $key ?> "<?php if ( $key == $selectedHour ) : ?> checked<?php endif ; ?> >
< input type = "radio" id = "hour <? = $key ?> " name = "hour" value = " <? = $key ?> " <?php if ( $key == $selectedHour ) : ?> checked <?php endif ; ?> >
< label for = "hour <? = $key ?> " title = " <? = $value ?> " > <? = $value ?> </ label >
< / span >
<?php endforeach ; ?>
@ -415,7 +412,7 @@ if ($isLoggedIn && $_POST) {
< p > Logged in as <? = $customerName ?> . < a href = "?logout" class = "logout" > Log out</ a ></ p >
<?php endif ; ?>
< p class = "info" > This site is not affiliated with Electric Kiwi. It uses Electric Kiwi's API to
update your hour of power. None of your personal information is retained or shared.
update your hour of power. None of your personal information is retained or shared.< br / >
< a href = "https://git.peterson.nz/damian/HourChanger" > Source code< / a >
< / p >
< / div >