public static function createConn() { $successful = false; if (!isset(self::$sdk) || !isset(self::$dynamodb)) { $accessKey = json_decode(file_get_contents(self::$dbAccessKeyFile)); self::$sdk = new Aws\Sdk(['region' => 'ap-northeast-1', 'version' => 'latest', 'credentials' => ['key' => $accessKey->{"key"}, 'secret' => $accessKey->{"secret"}]]); self::$dynamodb = self::$sdk->createDynamoDb(); } if (isset(self::$sdk) && isset(self::$dynamodb)) { $successful = true; } return $successful; }
<div style="height:40px"></div> <input type="button" value="Checkin" onclick="checkinrecords()" style="color:#ff0000"/> </form> <?php } else { $recordJSON = $_POST["records"]; $records = json_decode($recordJSON); $screenshot = $records->{"photo"}; $location = $records->{"location"}; $text = $records->{"text"}; date_default_timezone_set("Asia/Shanghai"); $currdate = date("Y-n-j G:i:s"); require_once "library.php"; $Records = new Records($location, $screenshot, $text, $currdate); $successfulStored = RecordsStore::store($Records); $_SESSION['Records'] = serialize($Records); ?> <table border = 0> <tr> <td><img alt="image generated from separate PHP" width="200" height="240" src="screenshot.php" /> </td> </tr> <tr> <td> <font color="purple"> <i> <div align="center"> <?php echo "\"" . $text . "\""; ?>
function showLocation(position) { var coords = position.coords; var latitude = position.coords.latitude; var longitude = position.coords.longitude; alert("Latitude : " + latitude + " Longitude: " + longitude); showBaiduMapLocation(position); } </script> </head> <body> <div align="center">YOUR RECENT (5) PORTRAITS</div> <?php require_once "library.php"; $records = RecordsStore::retrieve(); foreach ($records as $key => $record) { ?> <HR> <table border = 0 align="center"> <tr align="center"> <td> <img alt="image generated from JS (returned from PHP)" width="150" height="180" src="<?php echo $record->getPhotoBASE64(); ?> " /> </td> </tr> <tr> <td> <font color="purple">