fin2@agn
BNI-PT
Man-PT
KasKecil
BCA 671
Man 709
Account Tree
db backup
eBook #1
eBook #2
eBook #3
Tax eBook #4
Color
Logout
Mutasi BNI PT
Mutasi Mandiri PT
Mutasi Mandiri 709
Mutasi Mandiri 202
Mutasi BCA 671
Mutasi BCA 471
Mutasi Jago
Action
Transaction
Journal
Report
FilePHP
Tes cURL [1]
Copy This
Save
folder
slug
param
method
body
remark
php
Copy
/home/u902783705/domains/azkapersada.com/public_html/sub/fin/
api/blog.php
<?php include_once "../db.php"; if(!isset($_GET['op'])) { $op=""; } else { $op=$_GET['op']; } if(!isset($_GET['token'])) { $token=""; } else { $token=$_GET['token']; } if(!isset($_GET['tab'])) { $tab=""; } else { $tab=$_GET['tab']; } if(!isset($_GET['id'])) { $id=0; } else { $id=$_GET['id']; } $key="TEQV2Db3tMKYCtIm8l7NtoU9Q12jshdfuerTGY"; if(!empty($token) && $token==$key) { switch($op) { case "last"; echo item_last($tab); break; case "get"; echo item_get($tab); break; case "update"; $udt=array( 'st_nodejs'=>1, ); Update($db,$tab,$udt,"id=".$id); $out['status']='success'; $out['info']='id: '.$id.' updated'; echo json_encode($out); break; default; //include "inc.gnews.php"; } } //echo "<pre>"; print_r($_GET); echo "</pre>"; function item_last($table) { global $db,$ar; $sql4 = "select id,title from ".$table." where st_imgdl=1 and img<>'' and st_nodejs=0 and st_edit=1 order by id desc limit 1"; //echo $sql4."<br>"; $res4 = mysqli_query($db, $sql4); $r1 = mysqli_fetch_assoc($res4); //echo "<pre>"; print_r($r1); echo "</pre>"; if(isset($r1['id']) && ($r1['id']>0)) { $dt['data']['id']=$r1['id']; $dt['data']['url']="https://cp.ipikn.blog/view.php?id=".$r1['id']; $dt['status']="success"; } else { $dt['status']="no data"; $dt['data']['id']=0; $dt['data']['url']=""; } return json_encode($dt); //echo "<pre>"; print_r($dt); echo "</pre>"; } function item_get($table) { global $db,$ar; $sql4 = "select id,title,url,summary,bodytext,tags,site from ".$table." where id=1611"; //$sql4 = "select id,title,url,summary,bodytext,tags,site from ".$table." where st_nodejs2=0 and img<>'' and st_edit=1 order by publish_at limit 1"; //echo $sql4."<br>"; $res4 = mysqli_query($db, $sql4); $r1 = mysqli_fetch_assoc($res4); //echo "<pre>"; print_r($r1); echo "</pre>"; if(isset($r1['id']) && ($r1['id']>0)) { //$dt['data']=$r1; $out2 = strip_tags($r1['bodytext'],['p']); $out3 = IGtext($out2); $tags = str_replace(", ", " #", $r1['tags']); $sum_char_tags=strlen($tags)+7; $sum_char_url=strlen($r1['url'])+7; $sum_char_body=strlen($out2); $sum_char_body_ig=strlen($out3); $length_body=2200-8-$sum_char_url-$sum_char_tags; if($sum_char_body_ig>$length_body) { $bodytext_ig=substr($out3,0,$length_body)."⁣⁣".$r1['url']."⁣⁣#".$tags.""; } else { $bodytext_ig=$out3."⁣⁣".$r1['url']."⁣⁣#".$tags.""; } $dt['data']['body_ig']=$bodytext_ig; $dt['data']['id']=$r1['id']; $dt['data']['url']=$r1['url']; $dt['data']['url_length']=$sum_char_url; $dt['data']['tags']=" #".$tags; $dt['data']['tags_length']=$sum_char_tags; $dt['data']['tags_body']=$sum_char_body; $dt['data']['bodytext']=substr($out2,0,$length_body); $dt['status']="success"; } else { $dt['status']="no data"; $dt['data']['id']=0; $dt['data']['url']=""; } return json_encode($dt); //echo "<pre>"; print_r($dt); echo "</pre>"; } ?>