<?php
include('config.php');
include('fungsi.php');

$query = mysqli_query($con,"SELECT * FROM akunn WHERE id=1");
	        $check = mysqli_fetch_array($query,MYSQLI_NUM);
	        if (isset($check[0])) {
				$urlhost =$check[4];
    	        $emailhost = $check[5];
    	        $passhost = $check[6];
    	        $namal = $check[10];
    	        $port = $check[11];
    	        $catkaki = $check[15];
    	        $telegram_id = $check[16];
    	        $secret_token = $check[17];
	        } 

$querywa = mysqli_query($con,"SELECT * FROM wacs order by rand()");
	        $checkwa = mysqli_fetch_array($querywa,MYSQLI_NUM);
	        if (isset($checkwa[0])) {
				$namal =$checkwa[1];
    	        $thp = $checkwa[2];
	        }else{
	            $namal = $namal;
	            $thp = $check[7];
	        } 
	        
	    $thp =substr($thp, 1,12);
        $thp = $kodenegara.''.$thp;
        
	        $link1 ='https://api.whatsapp.com/send?phone='.$thp.'&text=halo%20pak/ibu%20'.$namal.'%20saya%20mau%20konsultasi'; 
	        
	        echo "<script language='JavaScript'>document.location='$link1'</script>";

?>