<?php require_once 'lib/G3dDatabase.php'; require_once 'lib/G3dIO.php'; require_once 'lib/G3dVillageTable.php'; require_once 'lib/G3dWrapTable.php'; require_once 'lib/G3dDataTable.php'; require_once 'lib/G3dGidList.php'; $conf_file_path = $_SERVER['DOCUMENT_ROOT'] . '/../gis3d.conf'; $io = new G3dIO(); $db = new G3dDatabase(); $db->setupDatabaseByConfFile($conf_file_path); $wrap = new G3dWrapTable(); $db->connect(); $order = $io->get('postOrGet', 'order'); switch ($order) { case 'update': $id = $io->get('postOrGet', 'wrapId'); $gId = $io->get('postOrGet', 'gId'); $county = $io->get('postOrGet', 'county'); $town = $io->get('postOrGet', 'town'); $village = $io->get('postOrGet', 'village'); $data = $io->get('postOrGet', 'data'); $villageTable = new G3dVillageTable(); $id = $wrap->getWrapById($id, $db->pdo)->wrap_id; $village_gid = $villageTable->getVillageByGid($gId, $db->pdo); if ($id && null != $data) { if (!$village_gid && $county && $town && $village) { $village_gid = $villageTable->getGidByNames($county, $town, $village, $db->pdo); } if ($village_gid) {
<?php require_once 'lib/G3dDatabase.php'; require_once 'lib/G3dIO.php'; require_once 'lib/G3dVillageTable.php'; $conf_file_path = $_SERVER['DOCUMENT_ROOT'] . '/../gis3d.conf'; $io = new G3dIO(); $db = new G3dDatabase(); $db->setupDatabaseByConfFile($conf_file_path); $village = new G3dVillageTable(); $db->connect(); $set = $io->get('get', 'set'); $id = $io->get('get', 'id'); $fineness = $io->get('get', 'fineness'); if (NULL == $set) { if (NULL != $id) { if (32 == $fineness) { $data = $village->getModel3d32ById($id, $db->pdo); if (NULL == $data[0]->model) { $data = $village->getGeomById($id, $fineness, $db->pdo); } } else { $data = $village->getGeomById($id, $fineness, $db->pdo); } } else { $data = $village->getCentroids($db->pdo); } } else { if (32 == $fineness) { $model_string = json_encode($io->get('post', 'model')); $data = $village->updateModel3d32ById($id, $model_string, $db->pdo);
<?php require_once 'lib/G3dDatabase.php'; require_once 'lib/G3dIO.php'; require_once 'lib/G3dWrapTable.php'; $conf_file_path = $_SERVER['DOCUMENT_ROOT'] . '/../gis3d.conf'; $io = new G3dIO(); $db = new G3dDatabase(); $db->setupDatabaseByConfFile($conf_file_path); $wrap = new G3dWrapTable(); $db->connect(); $order = $io->get('postOrGet', 'order'); switch ($order) { case 'create': $owner = 'bill42362'; $owner_mail = $owner . '@gmail.com'; $email = $io->get('postOrGet', 'email'); $title = $io->get('postOrGet', 'title'); $description = $io->get('postOrGet', 'description'); $formula = $io->get('postOrGet', 'formula'); $creationMeta = $wrap->createWrap($email, $title, $description, null, $formula, $db->pdo); $creation = $wrap->getWrapById($creationMeta['wrap_id'], $db->pdo); if ($creation->wrap_id) { $message = array(); $message[0] = "wrap_id: " . $creationMeta['wrap_id']; $message[1] = "access_id: " . $creationMeta['access_id']; $message[0] = "email: " . $email; $message[0] = "title: " . $creation->title; $message[0] = "description: " . $creation->description; $message[1] = "formula: " . $creation->formula; $subject = "Gis3d receipt";