📄 a2b_entity_card.php
字号:
<?phpinclude ("../lib/defines.php");include ("../lib/module.access.php");include ("../lib/Form/Class.FormHandler.inc.php");include ("./form_data/FG_var_card.inc");include ("../lib/smarty.php");if (! has_rights (ACX_CUSTOMER)){ Header ("HTTP/1.0 401 Unauthorized"); Header ("Location: PP_error.php?c=accessdenied"); die(); }/***********************************************************************************/$HD_Form -> setDBHandler (DbConnect());$HD_Form -> init();/********************************* BATCH UPDATE ***********************************/getpost_ifset(array('popup_select', 'popup_formname', 'popup_fieldname', 'upd_inuse', 'upd_activated', 'upd_language', 'upd_tariff', 'upd_credit', 'upd_credittype', 'upd_simultaccess', 'upd_currency', 'upd_typepaid', 'upd_creditlimit', 'upd_enableexpire', 'upd_expirationdate', 'upd_expiredays', 'upd_runservice', 'upd_runservice', 'batchupdate', 'check', 'type', 'mode', 'addcredit', 'cardnumber'));// CHECK IF REQUEST OF BATCH UPDATEif ($batchupdate == 1 && is_array($check)){ $HD_Form->prepare_list_subselection('list'); // Array ( [upd_simultaccess] => on [upd_currency] => on ) $loop_pass=0; $SQL_UPDATE = ''; foreach ($check as $ind_field => $ind_val){ //echo "<br>::> $ind_field -"; $myfield = substr($ind_field,4); if ($loop_pass!=0) $SQL_UPDATE.=','; // Standard update mode if (!isset($mode["$ind_field"]) || $mode["$ind_field"]==1){ if (!isset($type["$ind_field"])){ $SQL_UPDATE .= " $myfield='".$$ind_field."'"; }else{ $SQL_UPDATE .= " $myfield='".$type["$ind_field"]."'"; } // Mode 2 - Equal - Add - Subtract }elseif($mode["$ind_field"]==2){ if (!isset($type["$ind_field"])){ $SQL_UPDATE .= " $myfield='".$$ind_field."'"; }else{ if ($type["$ind_field"] == 1){ $SQL_UPDATE .= " $myfield='".$$ind_field."'"; }elseif ($type["$ind_field"] == 2){ $SQL_UPDATE .= " $myfield = $myfield +'".$$ind_field."'"; }else{ $SQL_UPDATE .= " $myfield = $myfield -'".$$ind_field."'"; } } } $loop_pass++; } $SQL_UPDATE = "UPDATE $HD_Form->FG_TABLE_NAME SET $SQL_UPDATE"; if (strlen($HD_Form->FG_TABLE_CLAUSE)>1) { $SQL_UPDATE .= ' WHERE '; $SQL_UPDATE .= $HD_Form->FG_TABLE_CLAUSE; } if (! $res = $HD_Form -> DBHandle -> Execute($SQL_UPDATE)){ $update_msg = '<center><font color="red"><b>'.gettext('Could not perform the batch update!').'</b></font></center>'; } else { $update_msg = '<center><font color="green"><b>'.gettext('The batch update has been successfully perform!').'</b></font></center>'; } }/********************************* END BATCH UPDATE ***********************************/if (($form_action == "addcredit") && ($addcredit>0 || $addcredit<0) && ($id>0 || $cardnumber>0)){ $instance_table = new Table("cc_card", "username, id"); if ($cardnumber>0){ /* CHECK IF THE CARDNUMBER IS ON THE DATABASE */ $FG_TABLE_CLAUSE_card = "username='".$cardnumber."'"; $list_tariff_card = $instance_table -> Get_list ($HD_Form -> DBHandle, $FG_TABLE_CLAUSE_card, null, null, null, null, null, null); if ($cardnumber == $list_tariff_card[0][0]) $id = $list_tariff_card[0][1]; } if ($id>0){ $param_update .= "credit = credit + '".$addcredit."'"; if ($HD_Form->FG_DEBUG == 1) echo "<br><hr> $param_update"; $FG_EDITION_CLAUSE = " id='$id'"; if ($HD_Form->FG_DEBUG == 1) echo "<br>-----<br>$param_update<br>$FG_EDITION_CLAUSE"; $instance_table -> Update_table ($HD_Form -> DBHandle, $param_update, $FG_EDITION_CLAUSE, $func_table = null); $field_insert = "date, credit, card_id"; $value_insert = "now(), '$addcredit', '$id'"; $instance_sub_table = new Table("cc_logrefill", $field_insert); $result_query = $instance_sub_table -> Add_table ($HD_Form -> DBHandle, $value_insert, null, null); if (!$result_query ){ $update_msg ="<b>".$instance_sub_table -> errstr."</b>"; } }}if ($form_action == "addcredit") $form_action='list';if ($id!="" || !is_null($id)){ $HD_Form -> FG_EDITION_CLAUSE = str_replace("%id", "$id", $HD_Form -> FG_EDITION_CLAUSE); }if (!isset($form_action)) $form_action="list"; //ask-addif (!isset($action)) $action = $form_action;$list = $HD_Form -> perform_action($form_action);// #### HEADER SECTION$smarty->display('main.tpl');if ($popup_select){?><SCRIPT LANGUAGE="javascript"><!-- Beginfunction sendValue(selvalue){ window.opener.document.<?php echo $popup_formname ?>.<?php echo $popup_fieldname ?>.value = selvalue; window.close();}// End --></script><?php}// #### HELP SECTIONif ($form_action=='list' && !($popup_select>=1)){echo $CC_help_list_customer;?><script language="JavaScript" src="javascript/card.js"></script><div class="toggle_hide2show"><center><a href="#" target="_self"><img class="toggle_hide2show" src="<?php echo KICON_PATH; ?>/toggle_hide2show.png" onmouseover="this.style.cursor='hand';" HEIGHT="16"> <font class="fontstyle_002"><?php echo gettext("REFILL");?> </font></a></center> <div class="tohide" style="display:none;"> <table width="90%" border="0" align="center"> <tr><form NAME="theForm"> <td align="left" width="5%"><img src="<?php echo KICON_PATH; ?>/pipe.png"> </td> <td align="left" width="35%" class="bgcolor_001"> <table> <tr><td align="center"> <?php echo gettext("CARD ID");?> :<input class="form_input_text" name="choose_list" onfocus="clear_textbox2();" size="18" maxlength="16" value="enter ID Card"> <a href="#" onclick="window.open('A2B_entity_card.php?nodisplay=1&popup_select=1&popup_formname=theForm&popup_fieldname=choose_list' , 'CardNumberSelection','width=550,height=330,top=20,left=100,scrollbars=1');"><img src="<?php echo Images_Path;?>/icon_arrow_orange.gif"></a> <?php echo gettext("or");?> </td></tr> <tr><td align="center"> <?php echo gettext("CARDNUMBER");?> :<input class="form_input_text" name="cardnumber" onfocus="clear_textbox();" size="18" maxlength="16" value="enter cardnumber"> </td></tr> </table> </td> <td class="bgcolor_001" align="center"> <input class="form_enter" name="addcredit" size="18" maxlength="6" value=""> <input class="form_input_button" TYPE="button" VALUE="<?php echo gettext("ADD CREDIT TO THE SELECTED CARD");?>" onClick="openURL('<?php echo $_SERVER['PHP_SELF']?>?form_action=addcredit&stitle=Card_Refilled¤t_page=<?php echo $current_page?>&order=<?php echo $order?>&sens=<?php echo $sens?>&id=')"> </td></form> </tr> </table> </div></div><div class="toggle_hide2show"><center><a href="#" target="_self"><img class="toggle_hide2show" src="<?php echo KICON_PATH; ?>/toggle_hide2show.png" onmouseover="this.style.cursor='hand';" HEIGHT="16"> <font class="fontstyle_002"><?php echo gettext("SEARCH CARDS");?> </font></a></center> <div class="tohide" style="display:none;"><?php// #### CREATE SEARCH FORMif ($form_action == "list"){ $HD_Form -> create_search_form();}?> </div></div><div class="toggle_hide2show"><center><a href="#" target="_self"><img class="toggle_hide2show" src="<?php echo KICON_PATH; ?>/toggle_hide2show.png" onmouseover="this.style.cursor='hand';" HEIGHT="16"> <font class="fontstyle_002"><?php echo gettext("BATCH UPDATE");?> </font></a></center> <div class="tohide" style="display:none;"><?php/********************************* BATCH UPDATE ***********************************/if ($form_action == "list" && (!($popup_select>=1)) ){ $instance_table_tariff = new Table("cc_tariffgroup", "id, tariffgroupname"); $FG_TABLE_CLAUSE = ""; $list_tariff = $instance_table_tariff -> Get_list ($HD_Form -> DBHandle, $FG_TABLE_CLAUSE, "tariffgroupname", "ASC", null, null, null, null); $nb_tariff = count($list_tariff);?><!-- ** ** ** ** ** Part for the Update ** ** ** ** ** --><center><b> <?php echo $HD_Form -> FG_NB_RECORD ?> <?php echo gettext("cards selected!"); ?> <?php echo gettext("Use the options below to batch update the selected cards.");?></b> <table align="center" border="0" width="65%" cellspacing="1" cellpadding="2"> <tbody> <form name="updateForm" action="<?php echo $_SERVER['PHP_SELF']?>" method="post"> <INPUT type="hidden" name="batchupdate" value="1"> <tr> <td align="left" class="bgcolor_001" > <input name="check[upd_inuse]" type="checkbox" <?php if ($check["upd_inuse"]=="on") echo "checked"?>> </td> <td align="left" class="bgcolor_001"> 1) <?php echo gettext("INUSE"); ?> : <select NAME="upd_inuse" size="1" class="form_input_select"> <?php foreach($inuse_list as $key => $cur_value) { ?> <option value='<?php echo $cur_value[1] ?>' <?php if ($upd_inuse==$cur_value[1]) echo 'selected="selected"'?>><?php echo $cur_value[0] ?></option> <?php } ?> </select> </td> </tr> <tr> <td align="left" class="bgcolor_001"> <input name="check[upd_activated]" type="checkbox" <?php if ($check["upd_activated"]=="on") echo "checked"?>> </td> <td align="left" class="bgcolor_001"> 2) <?php echo gettext("ACTIVATE");?> : <font class="version"> <input type="radio" NAME="type[upd_activated]" value="t" <?php if((!isset($type[upd_activated]))|| ($type[upd_activated]=='t') ){?>checked<?php }?>> <?php echo gettext("Yes");?> <input type="radio" NAME="type[upd_activated]" value="f" <?php if($type[upd_activated]=='f'){?>checked<?php }?>> <?php echo gettext("No");?> </font> </td> </tr> <tr> <td align="left" class="bgcolor_001"> <input name="check[upd_language]" type="checkbox" <?php if ($check["upd_language"]=="on") echo "checked"?>> </td> <td align="left" class="bgcolor_001"> 3) <?php echo gettext("LANGUAGE");?> : <select NAME="upd_language" size="1" class="form_input_select"> <?php foreach($language_list as $key => $cur_value) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -