当前位置: 首页>>代码示例>>PHP>>正文


PHP Tax::searchVat方法代码示例

本文整理汇总了PHP中Tax::searchVat方法的典型用法代码示例。如果您正苦于以下问题:PHP Tax::searchVat方法的具体用法?PHP Tax::searchVat怎么用?PHP Tax::searchVat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tax的用法示例。


在下文中一共展示了Tax::searchVat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionUpdate

    public function actionUpdate()
    {
        $taxModel = new Tax();
        $id = $_POST['id'];
        //doc id
        $chkPage = $_POST['pagechk'];
        $quantity = $_POST['quantity'];
        //doc id
        $getCurrency = Yii::app()->params['adminCurrency'];
        $output = '';
        //check the existing quantity from db, if that quanityt is avalibale which is posted by user
        $getQuantity = "SELECT instock from reward where id = {$id}";
        $getQtyValueDB = Yii::app()->db->createCommand($getQuantity)->queryRow();
        if ($getQtyValueDB['instock'] < $quantity) {
            $output .= '<div id="AjFlash" class="flash-success" style="color:red">You cannot order more than instock.</div>';
        }
        if (array_key_exists($id, $_SESSION['items'])) {
            //update the quantity
            $_SESSION['items'][$id]['quantity'] = $quantity;
        } else {
            if ($id != '') {
                //add
                //$_SESSION['cart_quantity'][$id]=$quantity;
                $_SESSION['items'][$id]['quantity'] = $quantity;
            }
        }
        if ($chkPage == 'checkout') {
            $output .= '<h3>Confirm Order</h3>
                      
                          <div class="cart-info">';
        } else {
            $output .= '<h1 class="heading1"><span class="maintext"> Shopping Cart</span><span class="subtext"> All items in your  Shopping Cart</span></h1>
                    
                        <div class="cart-info" >';
        }
        $output .= '
                     <table class="table table-striped table-bordered" >
                        <tr>
                          <th class="image">Image</th>
                          <th class="name">Product Name</th>
                          <th class="quantity">Qty</th>
                        
                          <th class="price">Unit Price</th>
                          <th class="total">Total</th>
                         
                        </tr>';
        if (count($_SESSION['items']) > 0) {
            // get the product ids
            $ids = "";
            foreach ($_SESSION['items'] as $key => $data) {
                $price = $data['price'];
                $id = $data['id'];
                $title = $data['title'];
                $img = $data['image'];
                $quantity = $data['quantity'];
                $total_price = $data['price'] * $data['quantity'];
                $subTotal += $total_price;
                $total_price_final = number_format((double) $total_price, 2, '.', '');
                $output .= '<tr>
                          <td class="image"><a href="' . Yii::app()->request->baseUrl . '/index.php?r=reward/view&id=' . $id . '"><img title="product" alt="product" src="' . Yii::app()->request->baseUrl . '/images/reward/' . $id . '/' . $img . '" height="50" width="50"></a></td>
                          <td  class="name"><a href="' . Yii::app()->request->baseUrl . '/index.php?r=reward/view&id=' . $id . '">' . $title . '</a></td>
                          <td class="quantity">
                            <div id="flash' . $id . '"></div>
                            <input type="text" size="1" value="' . $quantity . '" name="quantity' . $id . '" id="quantity' . $id . '" class="span1"><br/>
                            <input type="submit" value="Update" class="quantity_submit" id="' . $id . '"> | <input type="submit" value="Delete" class="delete_submit" id="' . $id . '">
                            
                           
                           </td> <td class="price">' . $getCurrency . '' . $price . '</td>
                           <td class="total">' . $getCurrency . '' . $total_price_final . '</td>
                        </tr>';
            }
        } else {
            $output .= '<tr><td colspan="5" ><p align="center">Shopping cart is empty.</p></td></tr>';
        }
        $output .= '</table>';
        $output .= '</div>';
        if (count($_SESSION['items']) > 0) {
            $subTotalFinal = number_format((double) $subTotal, 2, '.', '');
            /*$tax = $taxModel->searchTax();
              $findTaxAmt = ($subTotalFinal*($tax/100));
              $findTaxAmtFinal = number_format((float)$findTaxAmt, 2, '.', '');
              
              $vat = $taxModel->searchVat();
              $findVatAmt = ($subTotalFinal*($vat/100));
              $findVatAmtFinal =number_format((float)$findVatAmt, 2, '.', '');*/
            $grandTotal = $subTotalFinal;
            $grandTotalFinal = number_format((double) $grandTotal, 2, '.', '');
            $_SESSION['grandTotalFinal'] = $grandTotalFinal;
            if ($chkPage == 'checkout') {
                $output .= '<div class="row">';
            } else {
                $output .= '<div class="container">';
            }
            $output .= '<div class="pull-right">
                        <div class="span4 pull-right">
                          <table class="table table-striped table-bordered ">
                            <tr>
                              <td><span class="extra bold">Sub-Total :</span></td>
                              <td><span class="bold">' . $getCurrency . '' . $subTotalFinal . '</span></td>
                            </tr>
//.........这里部分代码省略.........
开发者ID:Gameonn,项目名称:JS_API,代码行数:101,代码来源:ShoppingCartController-29thoct.php


注:本文中的Tax::searchVat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。