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