コード例 #1
0
 public static function getCityFromPropID($prop)
 {
     $lm = new LokasiIndoModel();
     $arr = $lm->getWhere("lokasi_propinsi='{$prop}' and lokasi_kecamatan=0 and lokasi_kelurahan=0 and lokasi_kabupatenkota!=0 order by lokasi_nama");
     return $arr;
 }
コード例 #2
0
    public function getCity()
    {
        $prop = addslashes($_POST['prop']);
        $arr = LokasiIndoModel::getCityFromPropID($prop);
        //pr($prop);
        //pr($arr);
        $sudah = array();
        ?>
<option value=""></option><?php 
        foreach ($arr as $loc) {
            //hilangkan kota dan kabupaten
            $new = str_replace("KOTA", "", $loc->lokasi_nama);
            $new = str_replace("KABUPATEN", "", $new);
            $new = ucwords(trim(rtrim(strtolower($new))));
            if (!in_array($new, $sudah)) {
                $sudah[] = $new;
                ?>
            <option value="<?php 
                echo $new;
                ?>
"><?php 
                echo $new;
                ?>
</option>    
            <?php 
            }
        }
        die;
    }
コード例 #3
0
    public function details()
    {
        $po = addslashes($_GET['po']);
        if ($po < 1 || $po == "") {
            die("Hacking Attempt");
        }
        $CartModel = new CartModel();
        $CartModel->getByID($po);
        if (!Role::hasRole('admin')) {
            if (Account::getMyID() != $CartModel->userid) {
                die('Hacking Attempt');
            }
        }
        ?>

<html>
<head>
	<meta charset="UTF-8">
	<title>PO Nr.<?php 
        echo $CartModel->po_id;
        ?>
</title>


	<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'
	      name='viewport'>
	<link href="<?php 
        echo _SPPATH;
        echo _THEMEPATH;
        ?>
/css/bootstrap.min.css"
	      rel="stylesheet">
	<link rel="icon"
	      type="image/png"
	      href="<?php 
        echo _SPPATH;
        ?>
kcfinder/favicon.ico" />
	<!--set all paths as javascript-->

	<script src="<?php 
        echo _SPPATH;
        ?>
js/jquery-1.11.1.js"></script>

	<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
	<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
	<!--[if lt IE 9]>
	<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
	<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
	<![endif]-->
	<?php 
        //load default css
        Mold::theme("css");
        //PortalTemplate::headercss();
        ?>
	<style>
		<?php 
        //load custon css
        echo ThemeReg::mod("custom_css", "", "text");
        ?>
                .order_detail{
                    padding-bottom: 5px;
                    font-size: 15px;
                    text-align: right;
                }
                .rp{
                    text-align: right
                }
                h3{
                    padding-top:30px;
                }
	</style>
</head>
<body>
 <div id="holderall"
     class="container">
	<div id="lw_content"></div>

	<div id="content_utama">

		<h1 class="beli" style="text-align: center; padding-bottom: 30px;">
                    <img src="<?php 
        echo _SPPATH;
        ?>
images/belicom-trans.png" height="40px" align="absmiddle"> &nbsp;
                    PO Nr.<?php 
        echo $CartModel->po_id;
        ?>
</h1>
<div class="col-md-8 col-md-offset-2 ">
    <div class="bb" style="padding-left: 30px; padding-right: 30px; padding-bottom: 30px;">

        <div class="order_detail">
            Order ID : <?php 
        echo $CartModel->po_id;
        ?>
        </div>
         <div class="order_detail">
             Order Date : <?php 
        echo indonesian_date($CartModel->po_date);
        ?>
        </div>


        <table class="table table-bordered">
            <thead>
                <tr>
                    <th>Nr.</th>
                    <th>Items</th>
                    <th>Qty</th>
                    <th>Harga</th>
                </tr>
            </thead>

                    <?php 
        $nr = 0;
        $arrbulk = json_decode($CartModel->po_pesanan_bulk);
        foreach ($arrbulk as $bulk) {
            $nr++;
            $ids = $bulk->id;
            $qty = $bulk->qty;
            $imp = explode(",", $ids);
            ?>
<tr>
                                <td><?php 
            echo $nr;
            ?>
</td>
                                <td><?php 
            $hargabulk = 0;
            foreach ($imp as $prod_id) {
                $p = new ProdModel();
                $p->getByID($prod_id);
                echo $p->prod_name . "<br>";
                $hargabulk += $p->prod_bulk_price;
            }
            ?>
                                </td>
                                <td><?php 
            echo $qty;
            ?>
</td>
                                <td class="rp">Rp.<?php 
            echo rupiah($hargabulk * $qty);
            ?>
</td>
                            </tr>
                               <?php 
        }
        $arrretail = json_decode($CartModel->po_pesanan_retail);
        //pr($arrretail);
        foreach ($arrretail as $bulk) {
            $nr++;
            $ids = $bulk->id;
            $qty = $bulk->qty;
            $p = new ProdModel();
            $p->getByID($ids);
            ?>
                            <tr>
                                <td><?php 
            echo $nr;
            ?>
</td>
                                <td><?php 
            echo $p->prod_name;
            ?>
                                </td>
                                <td><?php 
            echo $qty;
            ?>
</td>
                                <td class="rp">Rp.<?php 
            echo rupiah($p->prod_satuan_price * $qty);
            ?>
</td>
                            </tr>
                               <?php 
        }
        ?>

                            <tr>
                                <td colspan="3">

                                </td>
                                <td class="rp">Rp.<?php 
        echo rupiah($CartModel->total_goodcost);
        ?>
</td>
                            </tr>
                            <tr>
                                <td colspan="3">
                                    Shipping Cost (JNE <?php 
        echo strtoupper($CartModel->jne_type);
        ?>
)
                                </td>
                                <td class="rp">Rp.<?php 
        echo rupiah($CartModel->total_shipcost);
        ?>
</td>
                            </tr>
                            <tr>
                                <td colspan="3">
                                    Total Cost
                                </td>
                                <td class="rp">Rp.<?php 
        echo rupiah($CartModel->total_cost);
        ?>
</td>
                            </tr>
        </table>
        <h3>Penerima</h3>
        <table class="table table-bordered">
            <tr>
                <td>Nama</td>
                <td><?php 
        echo $CartModel->po_name;
        ?>
</td>
            </tr>
            <tr>
                <td>HP</td>
                <td><?php 
        echo $CartModel->po_mobile;
        ?>
</td>
            </tr>
            <tr>
                <td>Alamat</td>
                <td><?php 
        echo $CartModel->po_address;
        ?>
</td>
            </tr>

            <tr>
                <td>Kota</td>
                <td><?php 
        echo $CartModel->city;
        ?>
</td>
            </tr>
            <tr>
                <td>Propinsi</td>
                <td><?php 
        $prop = $CartModel->prop;
        $lok = new LokasiIndoModel();
        $arrp = $lok->getWhere("lokasi_propinsi='{$prop}' and lokasi_kabupatenkota=0 and lokasi_kecamatan=0 and lokasi_kelurahan=0");
        echo $arrp[0]->lokasi_nama;
        ?>
</td>
            </tr>
        </table>
        <h3>Pengirim</h3>
        <table class="table table-bordered">
            <tr>
                <td>Nama</td>
                <td><?php 
        echo $CartModel->pengirim_name;
        ?>
</td>
            </tr>
            <tr>
                <td>HP</td>
                <td><?php 
        echo $CartModel->pengirim_mobile;
        ?>
</td>
            </tr>

        </table>
    </div>


</div>
<div class="clearfix"></div>
	</div>
</div>

    </body>
</html>


         <?php 
    }