CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 CCS 3.0 Month Names-Multi-Language

Print topic Send  topic

Author Message
lvalverdeb

Posts: 299
Posted: 09/19/2005, 3:23 PM

In multi language apps, here's the code I am currently using to populate a Select control with the appropriate Month Names ( mainly for search forms pulling data from a mysql database using month('date') as part of the query criteria).

  
function GetMonthList() {  
	global $Months; // defined in Common.php;  
	$MonthList = array();  
	foreach(array_keys($Months) as $EachMonth) {  
		array_push($MonthList,array($EachMonth+1,$Months[$EachMonth]));  
	}  
	return $MonthList;  
}  
  

In the BeforeShow event of the select control add the following code:
  
$form->selectControl->Values = GetMonthList();  

Similar approach can be used for Weekdays:
  
function GetDayList() {  
	global $Weekdays; // defined in Common.php;  
	$DayList = array();  
	foreach(array_keys($Weekdays) as $EachDay) {  
		array_push($DayList,array($EachDay+1,$Weekdays[$EachDay]));  
	}  
	return $DayList;  
  
}  

Please note that I am using an increment of 1 for $EachMonth and $EachDay to make the result compatible with MySQL date calculations.

Luis
_________________
lvalverdeb
CR, GMT-6
XAMPP/Ubuntu/CCS3.2/4
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.