This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/modules/core/list_setup_default_date.inc.php

58 lines
2.5 KiB
PHP
Raw Normal View History

<?php
/**
* AgileBill - Open Billing Software
*
* This body of work is free software; you can redistribute it and/or
* modify it under the terms of the Open AgileBill License
* License as published at http://www.agileco.com/agilebill/license1-4.txt
2009-08-03 04:10:16 +00:00
*
* Originally authored by Tony Landis, AgileBill LLC
*
* Recent modifications by Deon George
*
* @author Deon George <deonATleenooksDOTnet>
* @copyright 2009 Deon George
* @link http://osb.leenooks.net
*
* @link http://www.agileco.com/
* @copyright 2004-2008 Agileco, LLC.
* @license http://www.agileco.com/agilebill/license1-4.txt
2009-08-03 04:10:16 +00:00
* @author Tony Landis <tony@agileco.com>
* @package AgileBill
* @subpackage List
*/
/**
* The main AgileBill List Default Date Method
*
* @package AgileBill
2009-08-03 04:10:16 +00:00
* @subpackage List
*/
2009-08-03 04:10:16 +00:00
function list_setup_default_date($default,$css) {
global $C_translate;
$arr = unserialize($default);
$ret ='';
2009-08-03 04:10:16 +00:00
# loop through the menus
for ($i=0; $i<3; $i++) {
$ret .= sprintf('<select name="setup_date_format[]" id="setdate%s">',$i);
$ret .= sprintf('<option value=""%s>-- %s --</option>',($arr[$i] == '') ? ' selected="selected"' : '',$C_translate->translate('date_option','setup',''));
$ret .= sprintf('<option value="d"%s>%s</option>',($arr[$i] == 'd') ? ' selected="selected"' : '',$C_translate->translate('date_month_day','setup',''));
$ret .= sprintf('<option value="m"%s>%s</option>',($arr[$i] == 'm') ? ' selected="selected"' : '',$C_translate->translate('date_month','setup',''));
$ret .= sprintf('<option value="Y"%s>%s</option>',($arr[$i] == 'Y') ? ' selected="selected"' : '',$C_translate->translate('date_year_four','setup',''));
$ret .= '</select>';
}
2009-08-03 04:10:16 +00:00
$ret .= '<select name="setup_date_format[]" id="setdate4">';
$ret .= sprintf('<option value=" "%s>-- separator --</option>',($arr[$i] == '') ? ' selected="selected"' : '');
$ret .= sprintf('<option value=" "%s> %s [ ] </option>',($arr[$i] == ' ') ? ' selected="selected"' : '',$C_translate->translate('sep_space','setup',''));
$ret .= sprintf('<option value="-"%s> %s [-] </option>',($arr[$i] == '-') ? ' selected="selected"' : '',$C_translate->translate('sep_dash','setup',''));
$ret .= sprintf('<option value="/"%s> %s [/] </option>',($arr[$i] == '/') ? ' selected="selected"' : '',$C_translate->translate('sep_slash','setup',''));
$ret .= sprintf('<option value="."%s> %s [.] </option>',($arr[$i] == '.') ? ' selected="selected"' : '',$C_translate->translate('sep_period','setup',''));
$ret .= '</select>';
return $ret;
}
2009-08-03 04:10:16 +00:00
?>