Changeset 818

Show
Ignore:
Timestamp:
06/18/08 08:11:57 (5 months ago)
Author:
areski
Message:

little fix on simulator

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.3/A2BCustomer_UI/simulator.php

    r1 r818  
    3838$DBHandle  = DbConnect(); 
    3939 
    40 if ($called  && $id_cc_card){ 
    41                  
    42                 $calling=ereg_replace("^\+","011",$called);      
    43                 $calling=ereg_replace("[^0-9]","",$calling);     
    44                 $calling=ereg_replace("^01100","011",$calling);  
    45                 $calling=ereg_replace("^00","011",$calling);     
    46                 $calling=ereg_replace("^0111","1",$calling); 
    47                  
    48                 if ( strlen($calling)>2 && is_numeric($calling)){ 
     40if ($called  && $id_cc_card) { 
     41                 
     42                $calling = $called; 
     43                 
     44                if ( strlen($calling)>2 && is_numeric($calling)) { 
    4945                                 
    5046                                $A2B -> DBHandle = DbConnect(); 
     
    5652                                        $num = $resmax -> RecordCount(); 
    5753 
    58                                 if ($num==0){ echo gettext("Error card !!!"); exit();} 
    59  
    60                                 for($i=0;$i<$num;$i++) 
    61                                         { 
    62                                                 $row[] =$resmax -> fetchRow(); 
    63                                         } 
     54                                if ($num==0) { echo gettext("Error card !!!"); exit();} 
     55 
     56                                for($i=0;$i<$num;$i++) { 
     57                                        $row[] =$resmax -> fetchRow(); 
     58                                } 
    6459 
    6560                                $A2B -> cardnumber = $row[0][0] ; 
  • branches/1.3/A2Billing_UI/Public/CC_entity_sim_ratecard.php

    r1 r818  
    1717$DBHandle  = DbConnect(); 
    1818 
    19 /* 
    20 if (is_string ($tariffplan) && strlen(trim($tariffplan))>0){ 
    21                  
    22                 list($sim_mytariff_id, $sim_mytariffname) = split('-:-', $tariffplan);           
    23                 $_SESSION["sim_mytariff_id"]= $sim_mytariff_id; 
    24                 $_SESSION["sim_mytariffname"]= $sim_mytariffname; 
    25                 //$_SESSION["basetariffgroup"]= $basetariffgroup;                
    26 }else{ 
    27                 $sim_mytariff_id = $_SESSION["sim_mytariff_id"]; 
    28                 $sim_mytariffname = $_SESSION["sim_mytariffname"]; 
    29                 //$basetariffgroup = $_SESSION["basetariffgroup"];       
    30 
    31 if ($FG_DEBUG == 1)  echo "sim_mytariff_id:$sim_mytariff_id<br>"; 
    32 if ($FG_DEBUG == 1)  echo "sim_mytariffname:$sim_mytariffname<br>"; 
    33 */ 
    34  
    35  
    36 if ($called  && $id_cc_card){ 
    37  
    38                  
    39                 $calling=ereg_replace("^\+","011",$called);      
    40                 $calling=ereg_replace("[^0-9]","",$calling);     
    41                 $calling=ereg_replace("^01100","011",$calling);  
    42                 $calling=ereg_replace("^00","011",$calling);     
    43                 $calling=ereg_replace("^0111","1",$calling); 
    44                  
    45                 if ( strlen($calling)>2 && is_numeric($calling)){ 
     19if ($called  && $id_cc_card) { 
     20 
     21                $calling = $called; 
     22                 
     23                if ( strlen($calling)>2 && is_numeric($calling)) { 
    4624                         
    4725                        $A2B -> DBHandle = DbConnect(); 
     
    5533                        if ($num==0){ echo gettext("Error card !!!"); exit();}                   
    5634                         
    57                         for($i=0;$i<$num;$i++) 
    58                         { 
     35                        for($i=0;$i<$num;$i++) { 
    5936                                $row [] =$resmax -> fetchRow();  
    6037                        } 
     
    6441                        if ($FG_DEBUG == 1) echo "cardnumber = ".$row[0][0] ."<br>"; 
    6542                         
    66                         if ($A2B -> callingcard_ivr_authenticate_light ($error_msg))
     43                        if ($A2B -> callingcard_ivr_authenticate_light ($error_msg))
    6744                                if ($FG_DEBUG == 1) $RateEngine -> debug_st = 1; 
    6845                                 
     
    8259                                 
    8360                                // IF FIND RATE 
    84                                 if ($resfindrate!=0) 
     61                                if ($resfindrate!=0) { 
    8562                                        $res_all_calcultimeout = $RateEngine->rate_engine_all_calcultimeout($A2B, $A2B->credit); 
    8663                                        if ($FG_DEBUG == 1) print_r($RateEngine->ratecard_obj); 
     
    9471 
    9572$instance_table_tariffname = new Table("cc_tariffplan", "id, tariffname"); 
    96  
    9773$FG_TABLE_CLAUSE = ""; 
    98  
    9974$list_tariffname = $instance_table_tariffname  -> Get_list ($DBHandle, $FG_TABLE_CLAUSE, "tariffname", "ASC", null, null, null, null); 
    100  
    10175$nb_tariffname = count($list_tariffname); 
    10276 
    103  
    10477/*************************************************************/ 
    10578 
    10679 
     80 
     81$smarty->display('main.tpl'); 
     82 
     83 
     84echo $CC_help_sim_ratecard; 
     85 
     86if (false) { 
    10787?> 
    108  
    109 <?php 
    110         $smarty->display('main.tpl'); 
    111 ?> 
    112  
    113 <script language="JavaScript" type="text/JavaScript"> 
    114 <!-- 
    115 function MM_openBrWindow(theURL,winName,features) { //v2.0 
    116   window.open(theURL,winName,features); 
    117 } 
    118  
    119 function openURL(theLINK) 
    120 { 
    121          
    122         // grab index number of the selected option 
    123         selInd = document.theForm.choose_list.selectedIndex; 
    124         if(selInd==''){alert('Please, select a tariff'); return false;} 
    125         // get value of the selected option 
    126         goURL = document.theForm.choose_list.options[selInd].value; 
    127            
    128         definecredit = document.theForm.definecredit.value; 
    129         // redirect browser to the grabbed value (hopefully a URL)         
    130         self.location.href = theLINK + goURL + "&definecredit="+definecredit ; //+ "&opt="+opt; 
    131 } 
    132  
    133  
    134  
    135 //--> 
    136 </script> 
    137  
    138  
    139 <?php 
    140         echo $CC_help_sim_ratecard; 
    141 ?> 
    142  
    143 <?php  if (false){ ?> 
    14488          <center> 
    14589          <?php  if (is_string ($sim_mytariffname)) echo "<font size=\"3\">".gettext("THE CURRENT RATECARD")." : <b>$sim_mytariffname</b></font><br><br>"; ?> 


Google