Changeset 1040

Show
Ignore:
Timestamp:
09/17/08 09:02:57 (4 months ago)
Author:
rach
Message:

correct limit behaviours for adding callerid in customer section

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/customer/A2B_entity_callerid.php

    r1038 r1040  
    2929        $QUERY = "SELECT count(*) FROM cc_callerid WHERE id_cc_card='".$_SESSION["card_id"]."'"; 
    3030        $result = $instance_sub_table -> SQLExec ($HD_Form -> DBHandle, $QUERY, 1); 
    31          
    3231        // CHECK IF THE AMOUNT OF CALLERID IS LESS THAN THE LIMIT 
    3332        if ($result[0][0] < $A2B->config["webcustomerui"]['limit_callerid']){ 
    34                  
    3533                $QUERY = "INSERT INTO cc_callerid (id_cc_card, cid) VALUES ('".$_SESSION["card_id"]."', '".$add_callerid."')"; 
    3634                $result = $instance_sub_table -> SQLExec ($HD_Form -> DBHandle, $QUERY, 0); 
    37                  
    3835        } 
    3936} 
     
    5754$smarty->display( 'main.tpl'); 
    5855 
    59  
    60  
    6156if ($form_action == "list") 
    6257{ 
     
    6560    if (strlen($_GET["menu"])>0) $_SESSION["menu"] = $_GET["menu"]; 
    6661     
    67  
    6862        if (isset($update_msg) && strlen($update_msg)>0) echo $update_msg; 
     63         
     64        if(sizeof($list)<$A2B->config["webcustomerui"]['limit_callerid']){ 
    6965 
    7066?> 
    71           </center> 
     67          
    7268           <table align="center"  border="0" width="55%" class="bgcolor_006"> 
    7369                <form name="theForm" action="<?php  $_SERVER["PHP_SELF"]?>"> 
     
    8278                </td> 
    8379        </tr> 
    84         </form> 
     80               </form> 
    8581      </table> 
    8682          <br> 
    8783        <?php 
     84        }else{  
     85         
     86        ?> 
     87                <table align="center"  border="0" width="70%" class="bgcolor_006"> 
     88                        <tr class="bgcolor_001" > 
     89                                <td align="center" valign="middle"> 
     90                                        <b><i> <?php  echo gettext("You cannot add more CallerID. Please delete one before");?> </i> </b> 
     91                                        <br/> 
     92                                        <?php echo gettext("Max CallerId");?> &nbsp;:&nbsp; <?php echo $A2B->config["webcustomerui"]['limit_callerid'] ?> 
     93                                </td> 
     94                 </tr> 
     95                </table> 
     96        <?php     
     97        } 
    8898    // END END END My code for Creating two functionalities in a page 
    8999} 


Google