"youhyunjo@daum.net"); $ch = curl_init("https://us-central1-berryou-bd05a.cloudfunctions.net/getReward"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($uidData)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "charset = utf-8", "Content-Length: " . strlen(json_encode($uidData)))); $result = curl_exec($ch); curl_close($ch); $datas = json_decode($result, 1); if (count($datas) > 0) { $items = ""; $summary = ""; foreach ($datas as $data) { if ($data['name'] != 'summary') { $subtotal = $data['amount'] * $data['fee']; $items .= ''.$data['memo'].''.number_format((int)$data['amount']).' 원'.round((float)$data['fee'] * 100 ).' %'.number_format((int)$subtotal).' 원'; } else { $summary = $data; } } $rewardtotal = (int)$summary['amount']+(int)$summary['pay']; $html = '

총   금액 '.number_format((int)$rewardtotal).' 원
지불금액 '.number_format((int)$summary['pay']).' 원
정산금액 '.number_format((int)$summary['amount']).' 원

상세 내역

'; $html .= $items.'
내용 판매금액 비율 금액
'; $fcontent = $html; } else { $fcontent .= '

저작권 내역이 없습니다.

'; } echo $fcontent; ?>