예제 #1
0
파일: Sale.php 프로젝트: adsavin/bswshop
    echo Yii::t('lang', 'sum');
    ?>
</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php 
    $i = 1;
    $countRow = 0;
    $sumTotal = 0;
    ?>
                                        <?php 
    foreach ($lastBillSaleDetails as $lastBillSaleDetail) {
        ?>
                                            <?php 
        $productSerial = ProductSerial::model()->findByAttributes(array('product_code' => $lastBillSaleDetail->bill_sale_detail_barcode));
        $total = $lastBillSaleDetail->bill_sale_detail_price * $lastBillSaleDetail->bill_sale_detail_qty;
        $countRow++;
        $sumTotal += $total;
        ?>
                                            <tr>
                                                <td style="text-align: right"><?php 
        echo $i++;
        ?>
</td>
                                                <td><?php 
        echo $lastBillSaleDetail->bill_sale_detail_barcode;
        ?>
</td>
                                                <td><?php 
        echo @$productSerial->serial_no;
예제 #2
0
 public function actionRepair()
 {
     $this->checkLogin();
     $params = @$_POST;
     if (!empty($_POST)) {
         // search
         $search = Util::input($_POST['search_code']);
         if (empty($search)) {
             $search = Util::input($_GET['serial_code']);
         }
         // productSerial
         $productSerial = ProductSerial::model()->findByAttributes(array('serial_no' => $search));
         if (!empty($productSerial)) {
             $product = Product::model()->findByAttributes(array('product_code' => $productSerial->product_code));
             $params['product'] = $product;
             $params['productSerial'] = $productSerial;
         }
         // repair history
         $criteria = new CDbCriteria();
         $criteria->compare('serial_no', Util::input($_POST['search_code']));
         $criteria->order = 'repair_id DESC';
         $repairs = new CActiveDataProvider('Repair');
         $repairs->setCriteria($criteria);
         $params['repairs'] = $repairs;
     }
     $this->render('//Basic/Repair', $params);
 }