• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP price函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中price函数的典型用法代码示例。如果您正苦于以下问题:PHP price函数的具体用法?PHP price怎么用?PHP price使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: getAllProjectByStatus

	/**
	 * Return all leads grouped by status
	 *
	 * @param  int             $limit Limit results
	 * @return array|int       Array with value or -1 if error
	 * @throws Exception
	 */
	function getAllProjectByStatus($limit = 5)
	{
		global $conf, $user, $langs;

		$datay = array ();

		$sql = "SELECT";
		$sql .= " SUM(t.opp_amount), t.fk_opp_status, cls.code, cls.label";
		$sql .= " FROM " . MAIN_DB_PREFIX . "projet as t, ".MAIN_DB_PREFIX."c_lead_status as cls";
		$sql .= $this->buildWhere();
		$sql .= " AND t.fk_opp_status = cls.rowid";
		$sql .= " AND t.fk_statut <> 0";     // We want historic also, so all projects
		$sql .= " GROUP BY t.fk_opp_status, cls.code, cls.label";

		$result = array ();
		$res = array ();

		dol_syslog(get_class($this) . '::' . __METHOD__ . "", LOG_DEBUG);
		$resql = $this->db->query($sql);
		if ($resql) {
			$num = $this->db->num_rows($resql);
			$i = 0;
			$other = 0;
			while ( $i < $num ) {
				$row = $this->db->fetch_row($resql);
				if ($i < $limit || $num == $limit)
				{
				    $label = (($langs->trans("OppStatus".$row[2]) != "OppStatus".$row[2]) ? $langs->trans("OppStatus".$row[2]) : $row[2]);
					$result[$i] = array(
						$label. ' (' . price(price2num($row[0], 'MT'), 1, $langs, 1, -1, -1, $conf->currency) . ')',
						$row[0]
					);
				}
				else
					$other += $row[1];
				$i++;
			}
			if ($num > $limit)
				$result[$i] = array (
						$langs->transnoentitiesnoconv("Other"),
						$other
				);
			$this->db->free($resql);
		} else {
			$this->error = "Error " . $this->db->lasterror();
			dol_syslog(get_class($this) . '::' . __METHOD__ . ' ' . $this->error, LOG_ERR);
			return -1;
		}

		return $result;
	}
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:58,代码来源:projectstats.class.php


示例2: loadBox

 /**
  * Load data into info_box_contents array to show array later.
  *
  * @param int $max of records to load
  *
  * @return void
  */
 public function loadBox($max = 5)
 {
     global $conf, $user, $langs, $db;
     $this->max = $max;
     dol_include_once('/lead/class/lead.class.php');
     $lead = new Lead($db);
     $lead->fetch_all('DESC', 't.date_closure', $max, 0, array('t.date_closure<' => dol_now()));
     $text = $langs->trans("LeadLate", $max);
     $this->info_box_head = array('text' => $text, 'limit' => dol_strlen($text));
     $i = 0;
     foreach ($lead->lines as $line) {
         // FIXME: line is an array, not an object
         $line->fetch_thirdparty();
         // Ref
         $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => dol_buildpath('/lead/lead/card.php', 1) . '?id=' . $line->id);
         $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $line->ref, 'url' => dol_buildpath('/lead/lead/card.php', 1) . '?id=' . $line->id);
         $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"', 'logo' => 'company', 'url' => DOL_URL_ROOT . "/comm/fiche.php?socid=" . $line->fk_soc);
         $this->info_box_contents[$i][3] = array('td' => 'align="left"', 'text' => dol_trunc($line->thirdparty->name, 40), 'url' => DOL_URL_ROOT . "/comm/fiche.php?socid=" . $line->fk_soc);
         // Amount Guess
         $this->info_box_contents[$i][4] = array('td' => 'align="left"', 'text' => price($line->amount_prosp, 'HTML') . $langs->getCurrencySymbol($conf->currency));
         // Amount real
         $this->info_box_contents[$i][5] = array('td' => 'align="left"', 'text' => $line->getRealAmount() . $langs->getCurrencySymbol($conf->currency));
         $i++;
     }
 }
开发者ID:ndrosis,项目名称:lead,代码行数:32,代码来源:box_lead.php


示例3: pt

function pt ($db, $sql, $date) {
  global $bc;

  $result = $db->query($sql);
  if ($result) {
    $num = $db->num_rows($result);
    $i = 0; $total = 0 ;
    print "<TABLE border=\"1\" width=\"100%\">";
    print "<TR class=\"liste_titre\">";
    print "<TD width=\"60%\">$date</TD>";
    print "<TD align=\"right\">Montant</TD>";
    print "<td>&nbsp;</td>\n";
    print "</TR>\n";
    $var=True;
    while ($i < $num) {
      $obj = $db->fetch_object($result);
      $var=!$var;
      print "<TR $bc[$var]>";
      print "<TD>$obj->dm</TD>\n";
      print "<TD align=\"right\">".price($obj->amount)."</TD><td>&nbsp;</td>\n";
      print "</TR>\n";

      $total = $total + $obj->amount;

      $i++;
    }
    print "<tr><td align=\"right\">".$langs->trans("TotalHT").":</td><td align=\"right\"><b>".price($total)."</b></td><td>".$langs->trans("Currency".$conf->monnaie)."</td></tr>";

    print "</table>";
    $db->free();
  }
}
开发者ID:remyyounes,项目名称:dolibarr,代码行数:32,代码来源:tva.php


示例4: pt

/**
 * print function
 *
 * @param   DoliDB $db          Database
 * @param   string $sql     sql
 * @param   string $date    date
 * @return  void
 */
function pt($db, $sql, $date)
{
    global $conf, $bc, $langs;
    $result = $db->query($sql);
    if ($result) {
        $num = $db->num_rows($result);
        $i = 0;
        $total = 0;
        print '<table class="noborder" width="100%">';
        print '<tr class="liste_titre">';
        print '<td class="nowrap" width="60%">' . $date . '</td>';
        print '<td align="right">' . $langs->trans("Amount") . '</td>';
        print '<td>&nbsp;</td>' . "\n";
        print "</tr>\n";
        $var = True;
        while ($i < $num) {
            $obj = $db->fetch_object($result);
            $var = !$var;
            print '<tr ' . $bc[$var] . '>';
            print '<td class="nowrap">' . $obj->dm . "</td>\n";
            $total = $total + $obj->mm;
            print '<td class="nowrap" align="right">' . price($obj->mm) . "</td><td >&nbsp;</td>\n";
            print "</tr>\n";
            $i++;
        }
        print '<tr class="liste_total"><td align="right">' . $langs->trans("Total") . " :</td><td class=\"nowrap\" align=\"right\"><b>" . price($total) . "</b></td><td>&nbsp;</td></tr>";
        print "</table>";
        $db->free($result);
    } else {
        dol_print_error($db);
    }
}
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:40,代码来源:index.php


示例5: ydf_excel

 public function ydf_excel($date = NULL)
 {
     header("Content-Type: text/html; charset=gb2312");
     if ($date == NULL) {
         $date = date('Y-m-d');
     }
     $orders = $this->get_ydf_order($date);
     $head = array('Sales Record Number', 'Buyer Fullname', 'Buyer Company', 'Buyer Address 1', 'Buyer Address 2', 'Buyer City', 'Buyer State', 'Buyer Zip', 'Buyer Phone Number', 'Buyer Country', 'Custom Label', 'Description EN', 'Description CN', 'HS Code', 'Quantity', 'Sale Price', 'Country of Manufacture', 'Mark', 'weight', 'Length', 'Width', 'Height', 'Shipping Service', 'Shipping Service Name', 'Track Number');
     foreach ($orders as $order) {
         $skus = explode(',', $order->sku_str);
         $qties = explode(',', $order->qty_str);
         $shipping_method = shipping_method($order->is_register);
         //echo $order->id."<br>";
         $count = count($skus);
         $product_name = '';
         $product_name_en = '';
         $qty = 0;
         $weight = 0;
         $rmb = price($this->order_model->calc_currency($order->currency, $order->gross));
         for ($i = 0; $i < $count; $i++) {
             if ($i == 0) {
                 $product_name .= iconv("UTF-8", "GB2312//IGNORE", get_product_name($skus[$i]));
                 $product_name_en .= iconv("UTF-8", "GB2312//IGNORE", get_product_name_en($skus[$i]));
             }
             $qty += $qties[$i];
             $weight += get_weight_by_sku($skus[$i]) * $skus[$i];
         }
         $shipping_method_name_cn = iconv("UTF-8", "GB2312//IGNORE", $shipping_method->name_cn);
         $data[] = array($order->id, $order->name, " ", $order->address_line_1, $order->address_line_2, $order->town_city, $order->state_province, $order->zip_code, $order->contact_phone_number, $order->country, $skus[0], $product_name_en, $product_name, " ", $qty, $rmb, " ", " ", $weight, " ", " ", " ", $shipping_method->ydf_code, $shipping_method_name_cn, $order->track_number);
     }
     $this->excel->array_to_excel($data, $head, 'ydf_list_' . $date);
 }
开发者ID:ohjack,项目名称:mallerp_standard,代码行数:32,代码来源:api.php


示例6: toArray

 public function toArray()
 {
     $results = [];
     foreach ($this->getShipments() as $shipment) {
         foreach ($this->getMethods($shipment->address) as $rate) {
             $results[] = ['label' => $rate['title'] . ' - ' . price($rate['price']), 'name' => 'method', 'value' => $rate['code']];
         }
     }
     return $results;
 }
开发者ID:BryceHappy,项目名称:lavender,代码行数:10,代码来源:ShipmentMethods.php


示例7: select_element

 /**
  * Build Select List of element associable to a businesscase
  *
  * @param string $tablename To parse
  * @param Lead $lead The lead
  * @param string $htmlname Name of the component
  *
  * @return string HTML select list of element
  */
 function select_element($tablename, $lead, $htmlname = 'elementselect')
 {
     global $langs, $conf;
     switch ($tablename) {
         case "facture":
             $sql = "SELECT rowid, facnumber as ref, total as total_ht, date_valid as date_element";
             break;
         case "contrat":
             $sql = "SELECT rowid, ref as ref, 0 as total_ht, date_contrat as date_element";
             break;
         case "commande":
             $sql = "SELECT rowid, ref as ref, total_ht as total_ht, date_commande as date_element";
             break;
         default:
             $sql = "SELECT rowid, ref, total_ht, datep as date_element";
             break;
     }
     $sql .= " FROM " . MAIN_DB_PREFIX . $tablename;
     //TODO Fix sourcetype can be different from tablename (exemple project/projet)
     $sql .= " WHERE rowid NOT IN (SELECT fk_source FROM " . MAIN_DB_PREFIX . "element_element WHERE targettype='" . $lead->element . "' AND sourcetype='" . $tablename . "')";
     // Manage filter
     /*if (count($filter) > 0) {
     			foreach ( $filter as $key => $value ) {
     				if (($key == 's.fk_session_place') || ($key == 'f.rowid') || ($key == 's.type_session') || ($key == 's.status') || ($key == 'sale.fk_user_com')) {
     					$sql .= ' AND ' . $key . ' = ' . $value;
     				} else {
     					$sql .= ' AND ' . $key . ' LIKE \'%' . $this->db->escape($value) . '%\'';
     				}
     			}
     		}*/
     $sql .= " AND fk_soc=" . $lead->fk_soc;
     $sql .= " AND entity=" . $conf->entity;
     // $sql.= " AND entity IN (".getEntity($object->element,1).")";
     $sql .= " ORDER BY ref DESC";
     dol_syslog(get_class($this) . "::select_element sql=" . $sql, LOG_DEBUG);
     $resql = $this->db->query($sql);
     if ($resql) {
         $num = $this->db->num_rows($resql);
         $i = 0;
         if ($num > 0) {
             $sellist = '<select class="flat" name="' . $htmlname . '">';
             while ($i < $num) {
                 $obj = $this->db->fetch_object($resql);
                 $sellist .= '<option value="' . $obj->rowid . '">' . $obj->ref . ' (' . dol_print_date($this->db->jdate($obj->date_element), 'daytextshort') . ')';
                 $sellist .= (empty($obj->total_ht) ? '' : '-' . price($obj->total_ht) . $langs->getCurrencySymbol($conf->currency)) . '</option>';
                 $i++;
             }
             $sellist .= '</select>';
         }
         return $sellist;
     }
     $this->db->free($resql);
     return null;
 }
开发者ID:ndrosis,项目名称:lead,代码行数:63,代码来源:html.formlead.class.php


示例8: _get_percent

function _get_percent($qty, $qty_used)
{
    $percent = ($qty_used - $qty) / $qty * 100;
    $color = '';
    if ($percent > 0.5) {
        $color = 'red';
    } else {
        if ($percent < -0.5) {
            $color = 'orange';
        }
    }
    return '<span style="color:' . $color . ';">' . price($percent, '', '', 1, 2, 2) . '%</span>';
}
开发者ID:ATM-Consulting,项目名称:dolibarr_module_mandarin,代码行数:13,代码来源:graph_cost_price.php


示例9: _updateLine

function _updateLine($objectid, $objectelement, $lineid, $column, $value)
{
    global $db, $conf, $langs;
    ${$column} = price2num($value);
    $Tab = array();
    $o = new $objectelement($db);
    $o->fetch($objectid);
    $find = false;
    foreach ($o->lines as &$line) {
        if ($line->id == $lineid || $line->rowid == $lineid) {
            $find = true;
            break;
        }
    }
    if ($find) {
        if (is_null($qty)) {
            $qty = $line->qty;
        }
        if (is_null($price)) {
            $price = $line->subprice;
        }
        if (is_null($remise_percent)) {
            $remise_percent = $line->remise_percent;
        }
        if ($objectelement == 'facture') {
            $res = $o->updateline($lineid, $line->desc, $price, $qty, $remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
            $total_ht = $o->line->total_ht;
            $uttc = $o->line->subprice + $o->line->subprice * $o->line->tva_tx / 100;
        } else {
            if ($objectelement == 'commande') {
                $res = $o->updateline($lineid, $line->desc, $price, $qty, $remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->date_start, $line->date_end, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->fk_unit);
                $total_ht = $o->line->total_ht;
                $uttc = $o->line->subprice + $o->line->subprice * $o->line->tva_tx / 100;
            } else {
                $res = $o->updateline($lineid, $price, $qty, $remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit);
                $total_ht = $o->line->total_ht;
                $uttc = $o->line->subprice + $o->line->subprice * $o->line->tva_tx / 100;
            }
        }
        if ($res > 0) {
            $Tab = array('total_ht' => price($total_ht), 'qty' => $qty, 'price' => price($price), 'remise_percent' => $remise_percent, 'uttc' => $uttc);
        } else {
            $Tab = array('error' => 'updateFailed', 'msg' => $o->error);
        }
    } else {
        $Tab = array('error' => 'noline');
    }
    return $Tab;
}
开发者ID:ATM-Consulting,项目名称:dolibarr_module_quickcustomerprice,代码行数:49,代码来源:interface.php


示例10: voucher_summary

 function voucher_summary($validity, $currency, $value)
 {
     if ($validity != 2 && $validity != '0') {
         $return = '';
         $return .= '<div class="row row-5">';
         $return .= '<div class="col-xs-12"><p>Voucher</p></div>';
         $return .= '<div class="col-xs-12">';
         $return .= '<p class="amount">' . $currency . price(CURRENCY, $value) . '</p>';
         $return .= '</div>';
         $return .= '</div>';
     } else {
         $return = '';
     }
     echo $return;
 }
开发者ID:nickyudha,项目名称:hillpak-v2,代码行数:15,代码来源:get.php


示例11: voucher_summary

 function voucher_summary($validity, $currency, $value)
 {
     if ($currency == 1) {
         $currency = 'Rp.';
     } else {
         $currency = 'USD$';
     }
     if ($validity != 2 && $validity != '0') {
         $return = '';
         $return .= '<div class="col-sm-8"><p>Voucher</p></div>';
         $return .= '<div class="col-sm-4">';
         $return .= '<p class="amount">' . $currency . price(CURRENCY, $value) . '</p>';
         $return .= '</div>';
     } else {
         $return = '';
     }
     echo $return;
 }
开发者ID:nickyudha,项目名称:nagarey-v3,代码行数:18,代码来源:get.php


示例12: update_payment_cost

 public function update_payment_cost()
 {
     $id = $this->input->post('id');
     $type = $this->input->post('type');
     $value = trim($this->input->post('value'));
     $item_cost = $this->purchase_finance_model->fetch_purchase_order($id)->item_cost;
     $costs = $this->purchase_finance_model->fetch_payment_cost($id);
     $payment_costs = isset($costs->payment_cost) ? $costs->payment_cost : '0';
     $total_costs = price($payment_costs + $value);
     try {
         $payment_state = $this->purchase_finance_model->fetch_purchase_order($id)->payment_state;
         if ($payment_state == 0) {
             $skus_object = $this->purchase_order_model->fetch_all_sku_by_purchase_order_id($id);
             foreach ($skus_object as $row) {
                 $count = on_way_count($row->sku);
                 $data_product = array('on_way_count' => $count);
                 $this->product_model->update_product_by_sku($row->sku, $data_product);
             }
         }
         if (!is_numeric($value) || $value < 0) {
             echo $this->create_json(0, lang('your_input_is_not_positive_numeric'), $value);
             return;
         }
         if ($total_costs > $item_cost) {
             echo $this->create_json(0, lang('your_input_is_not_range_numeric'), $value);
             return;
         } else {
             //                $completed_id = fetch_status_id('review_state', 'completed');
             $data1 = array('purchase_order_id' => $id, 'payment_cost' => price($value));
             if ($total_costs > 0 && $total_costs < $item_cost) {
                 $data = array('payment_state' => '2');
             }
             if ($total_costs == price($item_cost)) {
                 $data = array('payment_state' => '3');
             }
             $this->purchase_finance_model->add_purchase_payment($data1);
             $this->purchase_order_model->review_reject_order($id, $data);
             echo $this->create_json(1, lang('ok'), $value);
         }
     } catch (Exception $e) {
         $this->ajax_failed();
         echo lang('error_msg');
     }
 }
开发者ID:ohjack,项目名称:mallerp_standard,代码行数:44,代码来源:finance.php


示例13: edit_save

 public function edit_save()
 {
     $rules = array(array('field' => 'name_cn', 'label' => lang('chinese_name'), 'rules' => 'trim|required'), array('field' => 'name_en', 'label' => lang('english_name'), 'rules' => 'trim|required'), array('field' => 'image_url', 'label' => lang('image_url'), 'rules' => 'trim|is_url'), array('field' => 'length', 'label' => lang('length'), 'rules' => 'trim|required|positive_numeric'), array('field' => 'width', 'label' => lang('width'), 'rules' => 'trim|required|positive_numeric'), array('field' => 'height', 'label' => lang('height'), 'rules' => 'trim|required|positive_numeric'), array('field' => 'weight', 'label' => lang('weight'), 'rules' => 'trim|required|positive_numeric'), array('field' => 'content', 'label' => lang('content'), 'rules' => 'trim|required|positive_numeric'), array('field' => 'cost', 'label' => lang('packing_cost'), 'rules' => 'trim|required|positive_numeric'));
     $this->form_validation->set_rules($rules);
     if ($this->form_validation->run() == FALSE) {
         $error = validation_errors();
         echo $this->create_json(0, $error);
         return;
     }
     $data = array('name_cn' => trim($this->input->post('name_cn')), 'name_en' => trim($this->input->post('name_en')), 'image_url' => trim($this->input->post('image_url')), 'length' => trim($this->input->post('length')), 'width' => trim($this->input->post('width')), 'height' => trim($this->input->post('height')), 'weight' => trim($this->input->post('weight')), 'content' => trim($this->input->post('content')), 'cost' => price(trim($this->input->post('cost'))));
     try {
         $id = $this->input->post('packing_id');
         $this->product_packing_model->update_product_packing($id, $data);
         echo $this->create_json(1, lang('product_packing_saved'));
     } catch (Exception $e) {
         echo lang('error_msg');
         $this->ajax_failed();
     }
 }
开发者ID:ohjack,项目名称:mallerp_standard,代码行数:19,代码来源:packing.php


示例14: pt

function pt ($db, $sql, $title) {
  global $bc;
  global $langs,$conf;

  print '<table class="border" width="100%">';
  print '<tr class="liste_titre">';
  print "<td>$title</td>";
  print "<td align=\"right\">Montant</td>";
  print "</tr>\n";

  $result = $db->query($sql);
  if ($result)
    {
      $num = $db->num_rows($result);
      $i = 0; $total = 0 ;

      $var=True;
      while ($i < $num)
	{
	  $obj = $db->fetch_object($result);
	  $var=!$var;
	  print '<tr '.$bc[$var].'>';
	  print '<td>'.$obj->dm.'</td>';
	  print '<td align="right">'.price($obj->amount).'</td>';

	  print "</tr>\n";
	  $total = $total + $obj->amount;
	  $i++;
	}
      print "<tr class=\"total\"><td colspan=\"2\" align=\"right\"><b>".$langs->trans("TotalHT").": ".price($total)."</b> ".$langs->trans("Currency".$conf->monnaie)."</td></tr>";

      $db->free();
    }
  else
    {
      dol_print_error($db);

    }
  print "</table>";

}
开发者ID:remyyounes,项目名称:dolibarr,代码行数:41,代码来源:prev.php


示例15: pt

function pt ($db, $sql, $date)
{
    global $conf, $bc,$langs;

    $result = $db->query($sql);
    if ($result)
    {
        $num = $db->num_rows($result);
        $i = 0;
        $total = 0;
        print "<table class=\"noborder\" width=\"100%\">";
        print "<tr class=\"liste_titre\">";
        print "<td nowrap width=\"60%\">$date</td>";
        print "<td align=\"right\">".$langs->trans("Amount")."</td>";
        print "<td>&nbsp;</td>\n";
        print "</tr>\n";
        $var=True;
        while ($i < $num)
        {
            $obj = $db->fetch_object($result);
            $var=!$var;
            print "<tr $bc[$var]>";
            print "<td nowrap>$obj->dm</td>\n";
            $total = $total + $obj->mm;

            print "<td nowrap align=\"right\">".price($obj->mm)."</td><td >&nbsp;</td>\n";
            print "</tr>\n";

            $i++;
        }
        print "<tr class=\"liste_total\"><td align=\"right\">".$langs->trans("Total")." :</td><td nowrap align=\"right\"><b>".price($total)."</b></td><td>&nbsp;</td></tr>";

        print "</table>";
        $db->free($result);
    }
    else {
        dolibar_print_error($db);
    }
}
开发者ID:remyyounes,项目名称:dolibarr,代码行数:39,代码来源:index.php


示例16: lists

 function lists($select = '*', $where = '', $ordering = '', $limit = '', $other = '')
 {
     if ($where != '') {
         $where = ' && ' . $where;
     }
     $where = 'p.lang = ' . $_SESSION['lang'] . $where;
     $select = str_replace(',', ',p.', $select);
     if ($ordering == '') {
         $ordering = 'p.special DESC';
     }
     if ($other != '') {
         $cha = new channel_pro();
         $cat = new category_pro();
         $select = $select . ',cha.cha_id,cha.name as cha_name,cat.cat_id,cat.name as cat_name';
         $other = " LEFT JOIN " . $cha->table . " as cha ON cha.cha_id = p.cha_id\n\t\t\t\t\tLEFT JOIN " . $cat->table . " as cat ON cat.cat_id = p.cat_id";
     }
     $result = $this->db->lists($this->table . ' AS p', 'p.' . $select, $where, $ordering, $limit, $other);
     $i = 0;
     while ($row = $this->db->fetch_assoc($result)) {
         $list[$i]->pro_id = $row[$this->key];
         $list[$i]->cha_name = $row['cha_name'];
         $list[$i]->cat_name = $row['cat_name'];
         $list[$i]->name = $row['name'];
         $list[$i]->ordering = $row['ordering'];
         $list[$i]->alias = $row['alias'];
         $list[$i]->price = price($row['price']);
         $list[$i]->description = $row['description'];
         $list[$i]->color = $row['hit'];
         $list[$i]->date_up = $row['date_up'];
         $list[$i]->image = $row['image'];
         $list[$i]->status = $row['status'];
         $list[$i]->special = $row['special'];
         $list[$i]->link_demo = $row['link_demo'];
         $i++;
     }
     $this->db->free_result($result);
     return $list;
 }
开发者ID:sydneyDAD,项目名称:cardguys.com,代码行数:38,代码来源:class_product.php


示例17: price

             if ($user->rights->stock->creer) {
                 print '<td align="center"><a href="' . DOL_URL_ROOT . '/product/stock/product.php?dwid=' . $object->id . '&amp;id=' . $objp->rowid . '&amp;action=correction">';
                 print $langs->trans("StockCorrection");
                 print "</a></td>";
             }
             print "</tr>";
             $i++;
         }
         $db->free($resql);
         print '<tr class="liste_total"><td class="liste_total" colspan="2">' . $langs->trans("Total") . '</td>';
         print '<td class="liste_total" align="right">' . $totalunit . '</td>';
         print '<td class="liste_total">&nbsp;</td>';
         print '<td class="liste_total" align="right">' . price(price2num($totalvalue, 'MT')) . '</td>';
         if (empty($conf->global->PRODUIT_MULTIPRICES)) {
             print '<td class="liste_total">&nbsp;</td>';
             print '<td class="liste_total" align="right">' . price(price2num($totalvaluesell, 'MT')) . '</td>';
         }
         print '<td class="liste_total">&nbsp;</td>';
         print '<td class="liste_total">&nbsp;</td>';
         print '</tr>';
     } else {
         dol_print_error($db);
     }
     print "</table>\n";
 }
 /*
  * Edition fiche
  */
 if (($action == 'edit' || $action == 're-edit') && 1) {
     print_fiche_titre($langs->trans("WarehouseEdit"), $mesg);
     print '<form action="fiche.php" method="POST">';
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:fiche.php


示例18: showOutputField

 /**
  * Return HTML string to put an output field into a page
  *
  * @param   string	$key            Key of attribute
  * @param   string	$value          Value to show
  * @param	string	$moreparam		To add more parametes on html input tag (only checkbox use html input for output rendering)
  * @return	string					Formated value
  */
 function showOutputField($key, $value, $moreparam = '')
 {
     global $conf, $langs;
     $label = $this->attribute_label[$key];
     $type = $this->attribute_type[$key];
     $size = $this->attribute_size[$key];
     $elementtype = $this->attribute_elementtype[$key];
     $unique = $this->attribute_unique[$key];
     $required = $this->attribute_required[$key];
     $params = $this->attribute_param[$key];
     $perms = $this->attribute_perms[$key];
     $list = $this->attribute_list[$key];
     $showsize = 0;
     if ($type == 'date') {
         $showsize = 10;
         $value = dol_print_date($value, 'day');
     } elseif ($type == 'datetime') {
         $showsize = 19;
         $value = dol_print_date($value, 'dayhour');
     } elseif ($type == 'int') {
         $showsize = 10;
     } elseif ($type == 'double') {
         if (!empty($value)) {
             $value = price($value);
         }
     } elseif ($type == 'boolean') {
         $checked = '';
         if (!empty($value)) {
             $checked = ' checked ';
         }
         $value = '<input type="checkbox" ' . $checked . ' ' . ($moreparam ? $moreparam : '') . ' readonly disabled>';
     } elseif ($type == 'mail') {
         $value = dol_print_email($value);
     } elseif ($type == 'phone') {
         $value = dol_print_phone($value);
     } elseif ($type == 'price') {
         $value = price($value, 0, $langs, 0, 0, -1, $conf->currency);
     } elseif ($type == 'select') {
         $value = $params['options'][$value];
     } elseif ($type == 'sellist') {
         $param_list = array_keys($params['options']);
         $InfoFieldList = explode(":", $param_list[0]);
         $selectkey = "rowid";
         $keyList = 'rowid';
         if (count($InfoFieldList) >= 3) {
             $selectkey = $InfoFieldList[2];
             $keyList = $InfoFieldList[2] . ' as rowid';
         }
         $fields_label = explode('|', $InfoFieldList[1]);
         if (is_array($fields_label)) {
             $keyList .= ', ';
             $keyList .= implode(', ', $fields_label);
         }
         $sql = 'SELECT ' . $keyList;
         $sql .= ' FROM ' . MAIN_DB_PREFIX . $InfoFieldList[0];
         if (strpos($InfoFieldList[4], 'extra') !== false) {
             $sql .= ' as main';
         }
         $sql .= " WHERE " . $selectkey . "='" . $this->db->escape($value) . "'";
         //$sql.= ' AND entity = '.$conf->entity;
         dol_syslog(get_class($this) . ':showOutputField:$type=sellist', LOG_DEBUG);
         $resql = $this->db->query($sql);
         if ($resql) {
             $value = '';
             // value was used, so now we reste it to use it to build final output
             $obj = $this->db->fetch_object($resql);
             // Several field into label (eq table:code|libelle:rowid)
             $fields_label = explode('|', $InfoFieldList[1]);
             if (is_array($fields_label) && count($fields_label) > 1) {
                 foreach ($fields_label as $field_toshow) {
                     $translabel = '';
                     if (!empty($obj->{$field_toshow})) {
                         $translabel = $langs->trans($obj->{$field_toshow});
                     }
                     if ($translabel != $field_toshow) {
                         $value .= dol_trunc($translabel, 18) . ' ';
                     } else {
                         $value .= $obj->{$field_toshow} . ' ';
                     }
                 }
             } else {
                 $translabel = '';
                 if (!empty($obj->{$InfoFieldList}[1])) {
                     $translabel = $langs->trans($obj->{$InfoFieldList}[1]);
                 }
                 if ($translabel != $obj->{$InfoFieldList}[1]) {
                     $value = dol_trunc($translabel, 18);
                 } else {
                     $value = $obj->{$InfoFieldList}[1];
                 }
             }
         } else {
//.........这里部分代码省略.........
开发者ID:Samara94,项目名称:dolibarr,代码行数:101,代码来源:extrafields.class.php


示例19: price

        }
        print '<td align="right">' . price(price2num($subtot_paye_total_ht, 'MT')) . '</td>';
        print '<td class="nowrap" align="right">' . price(price2num($subtot_paye_vat, 'MT')) . '</td>';
        print '</tr>';
    }
    if (count($x_paye) == 0) {
        print '<tr class="liste_total">';
        print '<td>&nbsp;</td>';
        print '<td align="right">' . $langs->trans("Total") . ':</td>';
        if ($modetax == 0) {
            print '<td class="nowrap" align="right">&nbsp;</td>';
            print '<td align="right">&nbsp;</td>';
        }
        print '<td align="right">' . price(price2num(0, 'MT')) . '</td>';
        print '<td class="nowrap" align="right">' . price(price2num(0, 'MT')) . '</td>';
        print '</tr>';
    }
    print '</table>';
    // Total to pay
    print '<br><br>';
    print '<table class="noborder" width="100%">';
    $diff = $x_coll_sum - $x_paye_sum;
    print '<tr class="liste_total">';
    print '<td class="liste_total" colspan="' . $span . '">' . $langs->trans("TotalToPay") . ($q ? ', ' . $langs->trans("Quadri") . ' ' . $q : '') . '</td>';
    print '<td class="liste_total nowrap" align="right"><b>' . price(price2num($diff, 'MT')) . "</b></td>\n";
    print "</tr>\n";
    $i++;
}
echo '</table>';
llxFooter();
$db->close();
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:quadri_detail.php


示例20: _tableau_versements

	/**
	 *  Show payments table
	 *  @param      pdf     		Object PDF
	 *  @param      object     		Object invoice
	 *	@param		posy			Position y in PDF
	 *	@param		outputlangs		Object langs for output
	 *	@return 	int				<0 if KO, >0 if OK
	 */
	function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
	{
		$tab3_posx = 120;
		$tab3_top = $posy + 8;
		$tab3_width = 80;
		$tab3_height = 4;

		$default_font_size = pdf_getPDFFontSize($outputlangs);

		$pdf->SetFont('','', $default_font_size - 2);
		$pdf->SetXY ($tab3_posx, $tab3_top - 5);
		$pdf->MultiCell(60, 5, $outputlangs->transnoentities("PaymentsAlreadyDone"), 0, 'L', 0);

		$pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height);

		$pdf->SetFont('','', $default_font_size - 4);
		$pdf->SetXY ($tab3_posx, $tab3_top );
		$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', 0);
		$pdf->SetXY ($tab3_posx+21, $tab3_top );
		$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0);
		$pdf->SetXY ($tab3_posx+40, $tab3_top );
		$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0);
		$pdf->SetXY ($tab3_posx+58, $tab3_top );
		$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0);

		$y=0;

		$pdf->SetFont('','', $default_font_size - 4);

		// Loop on each payment
		$sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount,";
		$sql.= " cp.code";
		$sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf, ".MAIN_DB_PREFIX."paiementfourn as p";
		$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id";
		$sql.= " WHERE pf.fk_paiementfourn = p.rowid and pf.fk_facturefourn = ".$object->id;
		$sql.= " ORDER BY p.datep";
		$resql=$this->db->query($sql);
		if ($resql)
		{
		    $num = $this->db->num_rows($resql);
			$i=0;
			while ($i < $num) {
			    $y+=3;
				$row = $this->db->fetch_object($resql);

				$pdf->SetXY ($tab3_posx, $tab3_top+$y );
				$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0);
				$pdf->SetXY ($tab3_posx+21, $tab3_top+$y);
				$pdf->MultiCell(20, 3, price($row->amount), 0, 'L', 0);
				$pdf->Se 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP price2num函数代码示例发布时间:2022-05-15
下一篇:
PHP previous_posts_link函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap