app/Http/Controllers/HostingController.php
/**
     * Menampilkan User yang terdaftar di CWP
     */
Menampilkan User yang terdaftar di CWP
Menampilkan User yang terdaftar di CWP
public function showuser()
    {
        $ch = curl_init();
        $data = array("key" => "hallobro", "action" => 'list');
        $url = 'https://ta.poliwangi.ac.id:2304/v1/account';
        $headers = array();
        $headers[] = 'Content-Type: application/x-www-form-urlencoded';
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        $response = curl_exec($ch);
        $result = json_decode($response, true);
        curl_close($ch);
        $jumlahDataPerHal = 15;
        $jumlahData = count($result["msj"]);
        $jumlahHal = ceil($jumlahData / $jumlahDataPerHal);
        $halAktif = (isset($_GET["halaman"])) ? $_GET["halaman"] : 1;
        $awalData = ($jumlahDataPerHal * $halAktif) - $jumlahDataPerHal;
        $kondisi = $halAktif * 15;
        $nomor = $awalData + 1;
        return view('hosting.user', compact('result'), [
            'jumlahDataPerHal' => $jumlahDataPerHal,
            'jumlahData' => $jumlahData,
            'jumlahHal' => $jumlahHal,
            'halAktif' => $halAktif,
            'awalData' => $awalData,
            'kondisi' => $kondisi,
            'nomor' => $nomor
        ]);
    }
public function showuser ( ) { $ ch = curl_init ( ) ; $ data = array ( " key " => " hallobro " , " action " => 'list' ) ; $ url = 'https://ta.poliwangi.ac.id:2304/v1/account' ; $ headers = array ( ) ; $ headers [ ] = 'Content-Type: application/x-www-form-urlencoded' ; curl_setopt ( $ ch , CURLOPT_HTTPHEADER , $ headers ) ; curl_setopt ( $ ch , CURLOPT_URL , $ url ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , 1 ) ; curl_setopt ( $ ch , CURLOPT_POST , 1 ) ; curl_setopt ( $ ch , CURLOPT_POSTFIELDS , http_build_query ( $ data ) ) ; curl_setopt ( $ ch , CURLOPT_SSL_VERIFYHOST , FALSE ) ; curl_setopt ( $ ch , CURLOPT_SSL_VERIFYPEER , FALSE ) ; $ response = curl_exec ( $ ch ) ; $ result = json_decode ( $ response , true ) ; curl_close ( $ ch ) ; $ jumlahDataPerHal = 15 ; $ jumlahData = count ( $ result [ " msj " ] ) ; $ jumlahHal = ceil ( $ jumlahData / $ jumlahDataPerHal ) ; $ halAktif = ( isset ( $ _GET [ " halaman " ] ) ) ? $ _GET [ " halaman " ] : 1 ; $ awalData = ( $ jumlahDataPerHal * $ halAktif ) - $ jumlahDataPerHal ; $ kondisi = $ halAktif * 15 ; $ nomor = $ awalData + 1 ; return view ( 'hosting.user' , compact ( 'result' ) , [ 'jumlahDataPerHal' => $ jumlahDataPerHal , 'jumlahData' => $ jumlahData , 'jumlahHal' => $ jumlahHal , 'halAktif' => $ halAktif , 'awalData' => $ awalData , 'kondisi' => $ kondisi , 'nomor' => $ nomor ] ) ; }
Menampilkan User yang terdaftar di CWP
Menampilkan User yang terdaftar di CWP
// dd($halAktif);