Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- date_default_timezone_set("Asia/Jakarta");
- require_once('lib/nusoap.php');
- require_once('koneksi.php');
- $WaktuAsli = date("Y-m-d");
- $Potong = explode('-',$WaktuAsli );
- $FormatEPG = $Potong[0].$Potong[1].$Potong[2];
- $Hapus = "truncate table epg";
- mysql_query($Hapus) or die(mysql_error());
- $client = new nusoap_client('http://118.97.88.27:81/TBISAPI/view/Epg.php');
- $result = $client->call('getSchedule', array('ChannelCode' => 'HBO', 'TglAwal' => $FormatEPG, 'TglAkhir' => $FormatEPG));
- echo "<pre>" , print_r($result, 1) , "</pre>";
- foreach($result as $row){
- $ChannelCode = $row['CHANNEL_CODE'];
- $ChannelName = $row['CHANNEL_NAME'];
- $ValidCN1 = strip_tags($ChannelName);
- $ValidCN2 = str_replace("'","",$ValidCN1);
- $TglMulai = $row['TGL_MULAI'];
- $WaktuMulai = $row['WAKTU_MULAI'];
- $FormatWM = date('Y-m-d G:i:s',strtotime($WaktuMulai));
- $WaktuAkhir = $row['WAKTU_AKHIR'];
- $FormatWA = date('Y-m-d G:i:s',strtotime($WaktuAkhir));
- $Judul = $row['JUDUL'];
- $ValidJudul1 = strip_tags($Judul);
- $ValidJudul2 = str_replace("'","",$ValidJudul1);
- $Sinopsis = $row['SINOPSIS'];
- $ValidSinopsis1 = strip_tags($Sinopsis);
- $ValidSinopsis2 = str_replace("'","",$ValidSinopsis1);
- $query = "INSERT INTO epg (channel_code,channel_name,tgl_mulai,waktu_mulai,waktu_akhir,judul,sinopsis)
- VALUES ('$ChannelCode','$ValidCN2','$TglMulai','$FormatWM','$FormatWA','$ValidJudul2','$ValidSinopsis2')";
- mysql_query($query) or die(mysql_error());
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement