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

fix : few bugs

parent e2ea4a31
No related merge requests found
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
</soap:Envelope>'; </soap:Envelope>';
$headers = array( $headers = array(
"Content-Type: text/xml;charset=\"utf-8\"", "Content-Type: text/xml;charset=\"utf-8\"",
'Content-Length: ' .strlen($request_param),
); );
$url = $_ENV["SOAP_URL"]; $url = $_ENV["SOAP_URL"];
$ch = curl_init(); $ch = curl_init();
...@@ -25,11 +26,10 @@ ...@@ -25,11 +26,10 @@
curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch); $response = curl_exec($ch);
// if($response === FALSE){ curl_close($ch);
// var_dump("Gagal request"); $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);
// var_dump($response); return $this->view('profile','index',["premium_status" => $temp2]);
return $this->view('profile','index',["premium_status" => $response]);
} }
} }
?> ?>
\ No newline at end of file
...@@ -138,8 +138,10 @@ ...@@ -138,8 +138,10 @@
<button type='button' onclick='toggle()' class='edit-button' id='profile-button'>Edit</button> <button type='button' onclick='toggle()' class='edit-button' id='profile-button'>Edit</button>
</div> </div>
<div> <div>
<?php if (($data["premium_status"] === 'REJECTED' || $data["premium_status"] === "NOT PREMIUM") && $thisUser["user_role"] === "STUDENT"){ ?> <?php
<button id="subscribe-button" type="button" class="edit-button" ><a href="/api/subscribe/subscribe.php">Subscribe</a></button> 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 } ?> <?php } ?>
</div> </div>
</form> </form>
......
...@@ -158,6 +158,11 @@ a { ...@@ -158,6 +158,11 @@ a {
font-size: var(--normal-font-size); font-size: var(--normal-font-size);
} }
.edit-button a{
text-decoration: none;
color: white;
}
.change-buttons { .change-buttons {
display: flex; display: flex;
margin: 3px; 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