</div> <!-- /#sidebar-wrapper --> <!-- Page Content --> <div id="page-content-wrapper"> <div class="container-fluid"> <h1>Bitcoin Jukebox</h1> <h3>Step 1: Read QR code with your mobile phone.</h3> <h3>Step 2: Order songs you like.</h3> <h3>Step 3: Pay them with bitcoin.</h3> <img src="data:image/png; <?php $renderer = new \BaconQrCode\Renderer\Image\Png(); $renderer->setHeight(240); $renderer->setWidth(240); $renderer->setMargin(5); $writer = new \BaconQrCode\Writer($renderer); $isLocalhost = $_SERVER['SERVER_NAME'] == 'localhost' || \Nette\Utils\Strings::startsWith($_SERVER['SERVER_NAME'], '192.168'); $url = $isLocalhost ? getHostByName(getHostName()) . '/bitcoinJukebox/adminAndMobile' : 'http://jukebox.paralelnipolis.cz/'; echo "base64," . base64_encode($writer->writeString($url)); ?> " class="qr-image" alt="QR code link to order page"> </div> </div> <!-- /#page-content-wrapper --> </div> <!-- /#wrapper --> <?php $connected = @fsockopen("www.google.com", 80) != false;
/** * Generate the URL for the Google Charts API to make the QR code * To use in an image tag: * * '<img src="data:image/png;base64,'.base64_encode($data).'"/> * * @param string $holder Account identifier (email, username, etc) * @param string $name Name of the application * @param integer $size Height x Width in pixels of the resulting image */ public function generateQrImage($holder, $name, $size = 30) { $data = 'otpauth://totp/' . $name . ':' . $holder . '?secret=' . $this->getInitKey(); $renderer = new \BaconQrCode\Renderer\Image\Png(); $renderer->setMargin(0)->setHeight($size)->setWidth($size); $writer = new \BaconQrCode\Writer($renderer); return $writer->writeString($data); }