topical media & game development

talk show tell print

#mobile-ar-8-5.txt / txt



  // Prepare checkbox value which will be used in SQL statement.
  // In this function, we add all the numbers in checkboxlist parameter.
  // If checkboxlist is empty, then we return 0.
  //
  // Arguments:
  // checkboxlist ; the value of CHECKBOXLIST parameter in the GetPOI request.
  //
  // Returns:
  // checkbox_value ; the value that can be used to construct the right
  // SQL statement.
  
  function GetCheckboxValue ( checkboxlist ) {
          // if checkboxlist exists, prepare checkbox_value.
          if( isset( checkboxlist ) ) {
          // Initialize returned value to be 0 if checkboxlist is empty.
          checkbox_value = 0;
          // If checkboxlist is not empty, return the added value of all
          // the numbers splited by ‘,’.
  
          if (!empty(checkboxlist)) {
                  if ( strstr(checkboxlist,’,’) ) {
                          checkbox_array = explode(‘,’, checkboxlist);
                                  for( i=0; i<count(checkbox_array); i++ )
                          checkbox_value+=checkbox_array[i];
                  }//if
          else
                  checkbox_value = checkboxlist;
          }//if
          return checkbox_value;
          } //if
          else {
          throw new Exception(“checkboxlist parameter is not passed in GetPOI request.”);
          }//else
  }//GetCheckboxValueCustom Slider Filter


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.