コード例 #1
0
 public function renew()
 {
     //echo  "in";
     $data = file_get_contents($this->url);
     $data = json_decode($data, true);
     //pr($data);
     foreach ($data['results'] as $r) {
         $store = new StorePortal();
         $store->getByID($r['No']);
         if ($store->Site == "") {
             $store->load = 0;
         }
         $store->fill($r);
         //pr($store);
         echo $store->Site . " : " . $store->save() . "<br>";
         //exit();
     }
 }
コード例 #2
0
    public function loadStore()
    {
        $no = isset($_GET['no']) ? addslashes($_GET['no']) : die('No Nomor');
        $site = isset($_GET['site']) ? addslashes($_GET['site']) : die('No Nomor');
        $st = new StorePortal();
        $st->getByID($no);
        ?>

		<script>
			var site = "<?php 
        echo $st->Site;
        ?>
";
			var storeName = "<?php 
        echo $st->STORE_NAME;
        ?>
";
			var email = "<?php 
        echo $st->Email;
        ?>
";
			var phone = "<?php 
        echo $st->PHONE;
        ?>
";

			var info = "";
			if (site)
				info = info + site;
			if (storeName)
				info = info + "<br/>" + storeName;
			if (email)
				info = info + "<br/>" + email;
			if (phone)
				info = info + "<br/>" + phone;
			addMarker(<?php 
        echo $st->Latitude;
        ?>
, <?php 
        echo $st->Longitude;
        ?>
, info);
		</script>

		<table class="table">
			<tr>
				<td><?php 
        echo Lang::t("ID");
        ?>
</td>
				<td><?php 
        echo $st->Site;
        ?>
</td>
			</tr>
			<tr>
				<td><?php 
        echo Lang::t("Store Name");
        ?>
</td>
				<td><?php 
        echo $st->STORE_NAME;
        ?>
</td>
			</tr>
			<tr>
				<td><?php 
        echo Lang::t("Code");
        ?>
</td>
				<td><?php 
        echo $st->CODE_SHORT;
        ?>
</td>
			</tr>
			<tr>
				<td><?php 
        echo Lang::t("Area");
        ?>
</td>
				<td><?php 
        echo $st->AREA;
        ?>
</td>
			</tr>
			<tr>
				<td><?php 
        echo Lang::t("Email");
        ?>
</td>
				<td><?php 
        echo $st->Email;
        ?>
</td>
			</tr>
			<tr>
				<td><?php 
        echo Lang::t("Phone");
        ?>
</td>
				<td><?php 
        echo $st->PHONE;
        ?>
</td>
			</tr>
			<tr>
				<td><?php 
        echo Lang::t("Concept");
        ?>
</td>
				<td><?php 
        echo $st->Concept;
        ?>
</td>
			</tr>
			<tr>
				<td><?php 
        echo Lang::t("Sales Class");
        ?>
</td>
				<td><?php 
        echo $st->STORE_SALES_CLASS;
        ?>
</td>
			</tr>
			<tr>
				<td><?php 
        echo Lang::t("AM");
        ?>
</td>
				<td><?php 
        echo $st->AM;
        ?>
</td>
			</tr>
			<tr>
				<td><?php 
        echo Lang::t("ROM");
        ?>
</td>
				<td><?php 
        echo $st->ROM;
        ?>
</td>
			</tr>
			<tr>
				<td><?php 
        echo Lang::t("Store Manager");
        ?>
</td>
				<td><?php 
        echo $st->store_manager;
        ?>
</td>
			</tr>
			<tr>
				<td><?php 
        echo Lang::t("Store Type");
        ?>
</td>
				<td><?php 
        echo $st->store_type;
        ?>
</td>
			</tr>
			<tr>
				<td><?php 
        echo Lang::t("Address");
        ?>
</td>
				<td><?php 
        echo $st->Address;
        ?>
</td>
			</tr>
			<tr>
				<td><?php 
        echo Lang::t("Open Date");
        ?>
</td>
				<td><?php 
        echo $st->open_date;
        ?>
</td>
			</tr>
		</table>
	<?php 
    }