本文整理汇总了PHP中Constants::getRefillType_List方法的典型用法代码示例。如果您正苦于以下问题:PHP Constants::getRefillType_List方法的具体用法?PHP Constants::getRefillType_List怎么用?PHP Constants::getRefillType_List使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Constants
的用法示例。
在下文中一共展示了Constants::getRefillType_List方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gettext
</tr>
<tr height="20px">
<td class="form_head">
<?php echo gettext("CREATION DATE") ?> :
</td>
<td class="tableBodyRight" background="../Public/templates/default/images/background_cells.gif" width="70%">
<?php echo $payment['date']?>
</td>
</tr>
<tr height="20px">
<td class="form_head">
<?php echo gettext("PAYMENT TYPE") ?> :
</td>
<td class="tableBodyRight" background="../Public/templates/default/images/background_cells.gif" width="70%">
<?php
$list_type = Constants::getRefillType_List();
echo $list_type[$payment['payment_type']][0];?>
</td>
</tr>
<tr height="20px">
<td class="form_head">
<?php echo gettext("DESCRIPTION ") ?> :
</td>
<td class="tableBodyRight" background="../Public/templates/default/images/background_cells.gif" width="70%">
<?php echo $payment['description']?>
</td>
</tr>
<?php if(!empty($payment['id_logrefill'])){ ?>
<tr height="20px">
<td class="form_head">
<?php echo gettext("LINK REFILL") ?> :
示例2: create_refill_after_payment
/**
* Function create_refill
* @public
*/
static public function create_refill_after_payment()
{
global $A2B;
$FormHandler = FormHandler::GetInstance();
$processed = $FormHandler->getProcessed();
if ($processed['added_refill']==1) {
$id_payment = $FormHandler -> RESULT_QUERY;
// CREATE REFILL
$field_insert = "date, credit, card_id ,refill_type, description";
$date = $processed['date'];
$credit = $processed['payment'];
$card_id = $processed['card_id'];
$refill_type= $processed['payment_type'];
$description = $processed['description'];
$card_table = new Table('cc_card','vat');
$card_clause = "id = ".$card_id;
$card_result = $card_table -> Get_list($FormHandler->DBHandle, $card_clause, 0);
if(!is_array($card_result)||empty($card_result[0][0])||!is_numeric($card_result[0][0]))
$vat=0;
else
$vat = $card_result[0][0];
$credit_without_vat = $credit / (1+$vat/100);
$value_insert = " '$date' , '$credit_without_vat', '$card_id','$refill_type', '$description' ";
$instance_sub_table = new Table("cc_logrefill", $field_insert);
$id_refill = $instance_sub_table -> Add_table ($FormHandler->DBHandle, $value_insert, null, null,"id");
// REFILL CARD .. UPADTE CARD
$instance_table_card = new Table("cc_card");
$param_update_card = "credit = credit + '".$credit_without_vat."'";
$clause_update_card = " id='$card_id'";
$instance_table_card -> Update_table ($FormHandler->DBHandle, $param_update_card, $clause_update_card, $func_table = null);
//LINK THE REFILL TO THE PAYMENT .. UPADTE PAYMENT
$instance_table_pay = new Table("cc_logpayment");
$param_update_pay = "id_logrefill = '".$id_refill."'";
$clause_update_pay = " id ='$id_payment'";
$instance_table_pay-> Update_table ($FormHandler->DBHandle, $param_update_pay, $clause_update_pay, $func_table = null);
// Create invoice associated
// CREATE AND UPDATE REF NUMBER
$list_refill_type=Constants::getRefillType_List();
$refill_type = $processed['payment_type'];
$year = date("Y");
$invoice_conf_table = new Table('cc_invoice_conf','value');
$conf_clause = "key_val = 'count_$year'";
$result = $invoice_conf_table -> Get_list($FormHandler->DBHandle, $conf_clause, 0);
if (is_array($result) && !empty($result[0][0])) {
// update count
$count =$result[0][0];
if(!is_numeric($count)) $count=0;
$count++;
$param_update_conf = "value ='".$count."'";
$clause_update_conf = "key_val = 'count_$year'";
$invoice_conf_table -> Update_table ($FormHandler->DBHandle, $param_update_conf, $clause_update_conf, $func_table = null);
} else {
// insert newcount
$count=1;
$QUERY= "INSERT INTO cc_invoice_conf (key_val ,value) VALUES ( 'count_$year', '1');";
$invoice_conf_table -> SQLExec($FormHandler->DBHandle,$QUERY);
}
$field_insert = "date, id_card, title ,reference, description,status,paid_status";
if($refill_type!=0) {
$title = $list_refill_type[$refill_type][0]." ".gettext("REFILL");
} else {
$title = gettext("REFILL");
}
$description = gettext("Invoice for refill");
$reference = $year.sprintf("%08d",$count);
$value_insert = " '$date' , '$card_id', '$title','$reference','$description','1','1' ";
$instance_table = new Table("cc_invoice", $field_insert);
$id_invoice = $instance_table -> Add_table ($FormHandler->DBHandle, $value_insert, null, null,"id");
//add payment to this invoice
$field_insert = "id_invoice, id_payment";
$value_insert = "'$id_invoice' , '$id_payment'";
$instance_table = new Table("cc_invoice_payment", $field_insert);
$instance_table -> Add_table ($FormHandler->DBHandle, $value_insert, null, null);
//load vat of this card
if (!empty($id_invoice) && is_numeric($id_invoice)) {
$description = $processed['description'];
$field_insert = "date, id_invoice ,price,vat, description";
$instance_table = new Table("cc_invoice_item", $field_insert);
$value_insert = " '$date' , '$id_invoice', '$credit_without_vat','$vat','$description' ";
$instance_table -> Add_table ($FormHandler->DBHandle, $value_insert, null, null,"id");
}
}
if($processed['added_commission']==1) {
$card_id = $processed['card_id'];
$table_transaction = new Table();
$result_agent = $table_transaction -> SQLExec($FormHandler->DBHandle,"SELECT cc_card_group.id_agent FROM cc_card LEFT JOIN cc_card_group ON cc_card_group.id = cc_card.id_group WHERE cc_card.id = $card_id");
if (is_array($result_agent)&& !is_null($result_agent[0]['id_agent']) && $result_agent[0]['id_agent']>0 ) {
// test if the agent exist and get its commission
$id_agent = $result_agent[0]['id_agent'];
// update refill & payment to keep a trace of agent in the timeline
//.........这里部分代码省略.........