public function Row($data) { $nb = 0; for ($i = 0; $i < count($data); $i++) { $nb = max($nb, $this->NbLines($this->widths[$i], $data[$i])); } //$h=5*$nb; $h = $this->AltoLinea * $nb; $this->CheckPageBreak($h); for ($i = 0; $i < count($data); $i++) { $w = $this->widths[$i]; $a = isset($this->aligns[$i]) ? $this->aligns[$i] : 'L'; $x = $this->GetX(); $y = $this->GetY(); if ($this->DibujaFondo and $i == 0) { $sAlt = $this->AltoLinea; $this->Rect($x, $y, $this->w - 10, $sAlt, "F"); } if ($this->itemsFormat > 0) { if (in_array($i, $this->arrayIndexFormat)) { $data[$i] = toMoney(floatval($data[$i])); } } if ($this->formatUTF8) { $str = utf8_decode($data[$i]); //$str = removeAccents($data[$i]); $this->MultiCell($w, $this->AltoLinea, trim($str), 0, $a, $this->DibujaFondoTexto); } else { $this->MultiCell($w, $this->AltoLinea, trim($data[$i]), 0, $a, false); } $this->SetXY($x + $w, $y); } $this->Ln($h); }
echo toMoney($item5 * 40); ?> </td> </tr> <tr> <th> "Temporary" Workarounds <br> <p>Who are you kidding?</p> </th> <td><?php echo $item6; ?> </td> <td>$21.00</td> <td><?php echo toMoney($item6 * 21); ?> </td> </tr> <tr> <th colspan="2" class="text-center">Shipping & Handling</th> <td><?php echo $shippingMethod; ?> </td> <td><?php echo $shippingCost; ?> </td> </tr> <tr>
/** * @param int $value * @return float */ function toPositiveMoney($value) { return abs(toMoney($value)); }
// phone number // we want the user to know they can click this - so put an ARROW in the cell echo '<td rowspan="2" style="text-align: center; border-left: none;" class="contactCell"><a class="btn btn-primary" href="' . $pageURL . 'contact/' . $type . '/' . $customer->UID . '/"><i class="icon-chevron-right icon-white"></i></a></td>'; echo '</tr>'; echo '<tr><td colspan="2" style="border-top: none; border-right: none; padding-top: 0px;"><span class="btn btn-mini">' . str_replace(' ', ' ', $customer->Addresses[0]->Phone1) . '</span>'; // // lets not show this for the employee if ($type != 'employee') { // lets get the balance if ($customer->CurrentBalance < 0) { // if it's lets than $0 show it as orange - use the bootstrap WARNING label $balanceBadge = 'label-warning'; } elseif ($customer->CurrentBalance > 0) { // if it's lets than $0 show it as green - use the bootstrap SUCCESS label $balanceBadge = 'label-success'; } echo '<div class="pull-right">Balance: <span class="label label-large ' . $balanceBadge . '">' . toMoney($customer->CurrentBalance) . '</span></div>'; } // end if employee echo '</td></tr>'; } ?> </tbody> </table> </div> <!-- end row-fluid --> </div> <!-- end container-fluid --> <!-- clean up divs --> </div> <div id="push"></div> <!-- ensure footer is on bototm of page -->
public function testAddNewIncome() { $tags = $this->createTags(); $transaction = ['date' => Carbon::today()->format('d/m/Y'), 'name' => 'Morrisons', 'value' => 1200]; $this->visitTransactionsPage()->type($transaction['date'], 'date')->type($transaction['name'], 'name')->type(toMoney($transaction['value']), 'value')->type($tags[0]->id, 'tag_id')->check('income')->press('Add')->seePageIsTransactions()->seeInElement('.alert-success', 'Transaction created successfully')->seeTransactionIsDisplayed($transaction['date'], $transaction['name'], $transaction['value']); }
if (!isset($_SESSION["cart_array"]) || count($_SESSION["cart_array"]) < 1) { $status['cart_empty_err'] = "Your shopping cart is empty"; } else { // Start the For Each loop $i = 0; foreach ($_SESSION["cart_array"] as $each_item) { $item_id = $each_item['item_id']; $sql = myQuery("SELECT * FROM products WHERE product_id=:product_id LIMIT 1", array(':product_id' => $item_id), $conn); $res = $sql->fetchAll(PDO::FETCH_ASSOC); foreach ($res as $row) { $product_name = $row["product_name"]; $price = $row["unit_price"]; $details = $row["product_description"]; } $pricetotal = $price * $each_item['quantity']; toMoney($pricetotal); $cartTotal = $pricetotal + $cartTotal; toMoney($price); $singleItem = array('item_id' => $item_id, 'product_name' => $product_name, 'details' => $details, 'price' => $price, 'item_index' => $i, 'quantity' => $each_item['quantity'], 'pricetotal' => $pricetotal, 'cartTotal' => $cartTotal); array_push($cartOutput, $singleItem); $i++; } toMoney($cartTotal); } ?> <?php include "directory_from_customer.php"; include "../views/header.view.php"; include "../views/customer/cart.view.php"; include "../views/footer.view.php";
private function Iprimir_Liquidaciones($posY1, $sumY1, $EXID) { $ReturnSQL = ObtenerSQL_ReporteLiquidaciones(); $ReturnSQL = utf8_decode($ReturnSQL); $params[":EXID"] = $EXID; $sql = $ReturnSQL; global $conn; $stmt = DBExecSql($conn, $sql, $params); $rowLiqCount = DBGetRecordCount($stmt); if ($rowLiqCount > 0) { $posX1 = 12; $this->SetX($this->margenDerecho); $this->SetTextColor(0, 0, 0); $this->SetFontAlignGeneralLiquidaciones(); $this->SetFont('Arial', 'B', 9); $Newrow = array_values($this->arrayTitulosLiquidacion); $this->Row($Newrow); $this->LineaSepara(); $sumaImporte = 0; while ($row = DBGetQuery($stmt, 1, false)) { // EscribirLogTxt1("datos row text", htmlentities(implode(',' , $row) , ENT_QUOTES) ); $this->SetX($this->margenDerecho); $this->SetTextColor(0, 0, 0); $this->SetFontAlignGeneralLiquidaciones(); $this->SetFont('Arial', '', 6); $this->SetFormatUTF8(true); $this->SetFormatCell(array(5), 2, '$ '); $Newrow = array_values($row); $this->Row($Newrow); $this->LineaSepara(); $sumaImporte = $sumaImporte + floatval($row['IMPORTE']); } $posY1 = $this->GetY(); //$posY1 += $sumY1; $this->SetXY($posX1, $posY1); $posX1 = 100; $this->ImprimeCelda($posX1, $posY1, 'Total', '', 0, 1, 0, 9); $posX1 = 125; $psumaImporte = toMoney($sumaImporte); $this->SetXY($posX1, $posY1); $this->SetFont('Arial', 'I', 8); $this->Cell(100, 5, $psumaImporte . ' ', 0, 0, 'L'); } }