Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <center><h4>Сэтгэлийн үндэс нэвтрүүлэгийн хандив өргөсөн хүмүүсийн дансны хуулга </h4></center>
- <br/>
- <div class="row">
- <div class="col-md-10">
- <div class="progress">
- <div class="progress-bar" role="progressbar" aria-valuenow="123" aria-valuemin="0" aria-valuemax="870000000" style="width: 60%;">
- 60%
- </div>
- </div>
- </div>
- <div class="col-md-2">
- 120-н хүүхдийн цэцэрлэг /870 сая төгрөг/
- </div>
- </div>
- <div class="news_scroller_content">
- <table class="table">
- <tr>
- <th >Дансны дугаар</th>
- <th >Мөнгөн дүн</th>
- <th >Салбарын дугаар</th>
- <th >Журналын дугаар</th>
- <th >Гүйлгээ хийсэн огноо</th>
- <th >Гүйлгээний утга</th>
- <th >Гүйлгээний Төрөл</th>
- </tr>
- <?php
- $soapUrl = "https://e.statebank.mn/acntstatement/Statement.asmx"; // asmx URL of WSDL
- $soapUser = "MUONRT"; // username
- $soapPassword = "bXUvMjAyNzA="; // password
- // xml post structure
- $xml_post_string = '<?xml version="1.0" encoding="utf-8"?>
- <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
- <soap:Body>
- <AcntStatement xmlns="http://tempuri.org/">
- <UserName>MUONRT</UserName>
- <Pass>bXUvMjAyNzA=</Pass>
- <TxnDate>2016-03-20</TxnDate>
- <JrnlNo></JrnlNo>
- </AcntStatement>
- </soap:Body>
- </soap:Envelope>';
- $headers = array(
- "Content-type: text/xml;charset=\"utf-8\"",
- "Accept: text/xml",
- "Cache-Control: no-cache",
- "Pragma: no-cache",
- "Content-length: ".strlen($xml_post_string),
- ); //SOAPAction: your op URL
- // PHP cURL for https connection with auth
- try{
- $ch = curl_init();
- if (FALSE === $ch)
- throw new Exception('failed to initialize');
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_URL, $soapUrl);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_USERPWD, $soapUser.":".$soapPassword); // username and password - declared at the top of the doc
- curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
- curl_setopt($ch, CURLOPT_TIMEOUT, 400);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the SOAP request
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- //curl_setopt($ch, CURLOPT_TIMEOUT, 400);
- // converting
- $response = curl_exec($ch);
- if (FALSE === $response)
- throw new Exception(curl_error($ch), curl_errno($ch));
- // var_dump($response);die();
- curl_close($ch);
- }catch(Exception $e) {
- trigger_error(sprintf(
- 'Curl failed with error #%d: %s',
- $e->getCode(), $e->getMessage()), E_USER_ERROR);
- }
- // converting
- $response1 = str_replace("<soap:Body>","",$response);
- $response2 = str_replace("</soap:Body>","",$response1);
- // convertingc to XML
- $parser = simplexml_load_string($response2);
- $array = json_decode(json_encode((array)$parser), TRUE);
- foreach ($array as $acntStatementResponse) {
- foreach ($acntStatementResponse as $acntStatementResult) {
- $errCode = $acntStatementResult['ErrCode'];
- $errDesc = $acntStatementResult['ErrDesc'];
- if ($errCode==0){
- echo $errDesc;
- $allTrans = $acntStatementResult['Trans'];
- foreach ($allTrans as $transactions) {
- foreach ($transactions as $transaction) { ?>
- <tr>
- <td ><?php echo $transaction['AcntNo']?></td>
- <td ><?php echo $transaction['Amount']?></td>
- <td ><?php echo $transaction['Branch']?></td>
- <td ><?php echo $transaction['JournalNo']?></td>
- <td ><?php echo date("Y-m-d H:i:s",strtotime($transaction['TxnDate']))?></td>
- <td ><?php echo $transaction['TxnDesc']?></td>
- <td ><?php echo $transaction['TxnType']= 1 ? 'Орлого': 'Зарлага'?></td>
- </tr>
- <?php
- if($transaction['TxnType']==1) {
- $money = $money + $transaction['Amount'] ;
- } else {
- $money = $money - $transaction['Amount'] ;
- }
- ?>
- <?php } ?>
- <?php } ?>
- <?php } else {?>
- <?php echo $errDesc; ?>
- <?php } ?>
- <?php } ?>
- <?php } ?>
- </table>
- </div>
- <?php phpinfo() ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement