Skip to content
Snippets Groups Projects
Commit 4e44450a authored by nathaniacalista01's avatar nathaniacalista01
Browse files

fix : few bugs

parent e2ea4a31
Branches
Tags
No related merge requests found
......@@ -16,6 +16,7 @@
</soap:Envelope>';
$headers = array(
"Content-Type: text/xml;charset=\"utf-8\"",
'Content-Length: ' .strlen($request_param),
);
$url = $_ENV["SOAP_URL"];
$ch = curl_init();
......@@ -25,11 +26,10 @@
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
// if($response === FALSE){
// var_dump("Gagal request");
// }
// var_dump($response);
return $this->view('profile','index',["premium_status" => $response]);
curl_close($ch);
$temp = str_replace('<?xml version=\'1.0\' encoding=\'UTF-8\'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:getPremiumStatusResponse xmlns:ns2="http://service.LMS.com/"><return>',"",$response);
$temp2 = str_replace('</return></ns2:getPremiumStatusResponse></S:Body></S:Envelope>',"",$temp);
return $this->view('profile','index',["premium_status" => $temp2]);
}
}
?>
\ No newline at end of file
......@@ -138,8 +138,10 @@
<button type='button' onclick='toggle()' class='edit-button' id='profile-button'>Edit</button>
</div>
<div>
<?php if (($data["premium_status"] === 'REJECTED' || $data["premium_status"] === "NOT PREMIUM") && $thisUser["user_role"] === "STUDENT"){ ?>
<button id="subscribe-button" type="button" class="edit-button" ><a href="/api/subscribe/subscribe.php">Subscribe</a></button>
<?php
if($thisUser["user_role"] === "STUDENT" &&($data['premium_status'] === "NOT PREMIUM" || $data["premium_status" === "REJECTED"])){
?>
<button id="subscribe-button" type="button" class="edit-button" ><a href="/api/subscribe/subscribe.php">Subscribe</a></button>
<?php } ?>
</div>
</form>
......
......@@ -158,6 +158,11 @@ a {
font-size: var(--normal-font-size);
}
.edit-button a{
text-decoration: none;
color: white;
}
.change-buttons {
display: flex;
margin: 3px;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment