forked from pus2inbo2ts/mmubee-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmsAccountEnquiry.php
executable file
·72 lines (52 loc) · 2.48 KB
/
cmsAccountEnquiry.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
include 'config.php';
checkActive();
//https://cms.mmu.edu.my/psc/csprd/EMPLOYEE/HRMS/c/N_SELF_SERVICE.N_SM_EXAMSLIP_PNL.GBL
$arr = loginCms($sid, $cpw);
$cookie = implode(';', $arr['cookie']);
$html = get('https://cms.mmu.edu.my/psc/csprd/EMPLOYEE/HRMS/c/SA_LEARNER_SERVICES.N_SSF_ACNT_SUMMARY.GBL?Page=N_SSF_ACNT_SUMMARY&Action=U', $cookie);
preg_match_all("/<span class='PSEDITBOX_DISPONLY' id='N_CUST_SS_DRVD_ACCOUNT_BALANCE'>(.*)<\/span>/Us", $html, $balance);
preg_match_all("/<DIV id='win0divDERIVED_SSF_MSG_SSF_MSG_LONG3'>(.*)<\/DIV>/Us", $html, $nobalance);
//$newHtml = str_replace("<img src=/cs/csprd/cache/BULLET_2.JPG width='4' height='4' alt='' title='' class='PSSTATICIMAGE' />", "",$content[1][0]);
// print_r($newHtml);
//print_r($subjectCode);
// ok(array('html'=>$newHtml));
/*
$cookie = implode(';', $arr['cookie']);
$html = get('https://cms.mmu.edu.my/psc/csprd/EMPLOYEE/HRMS/c/SA_LEARNER_SERVICES.N_SSF_ACT_ACTIVITY.GBL?Page=N_SSF_ACNT_ACTVTY&Action=U', $cookie);
preg_match_all("/<span class='PSEDITBOX_DISPONLY' id='N_SR_AT_PCT_WRK_DESCR1\\\$\d*'>(.*)<\/span>/Us", $html, $component);
// preg_match_all("/<span class='PSEDITBOX_DISPONLY' id='N_SR_AT_PCT_WRK_DESCR\\\$\d*'>(.*)<\/span>/Us", $html, $name);
// preg_match_all("/<span class='PSEDITBOX_DISPONLY' id='N_SR_AT_PCT_WRK_N_CURR_ATTND\\\$\d*'>(.*)<\/span>/Us", $html, $attendance);
// preg_match_all("/<span class='PSEDITBOX_DISPONLY' id='N_SR_AT_PCT_WRK_N_ATTND_PERC\\\$\d*'>(.*)<\/span>/Us", $html, $barring);*/
$html = '<style type="text/css">.item-body h2{ margin-top: 0px; margin-bottom: 7px; } .card .item{ min-height:0; }</style>';
if(isset($balance[1][0])){
$html .= <<<html
<div class="card" style="margin-top:20px;">
<div class="item item-text-wrap item-body">
Your current balance is : <br />
<span style="color:#e74c3c;">RM {$balance[1][0]}</span>
<br />
<p>(after adjusting advance payments)</p>
</div>
</div>
html;
}else if(isset($nobalance[1][0])){
$html .= <<<html
<div class="card" style="margin-top:20px;">
<div class="item item-text-wrap item-body">
<span style="color:#16a085">{$nobalance[1][0]}</span>
</div>
</div>
html;
}else{
$html .= <<<html
<div class="card" style="margin-top:20px;">
<div class="item item-text-wrap item-body">
<span style="color:#e74c3c">Error. Processing raw data failed. </span><br />
<span style="font-size:13px">Please try again later or contact the developer.</span>
</div>
</div>
html;
}
ok(array('html'=>$html));
?>