Source for file DBMS_FIELD_TIME.phpclass
Documentation is available at DBMS_FIELD_TIME.phpclass
* Class file DBMS_FIELD_TIME.phpclass
* @project Open CSP-Management
* @author Peter Krebs <p.krebs@lvus.at>
* @copyright (c) 2002-2005 by LVUS <http://opencsp.lvu.at>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
if (empty($GLOBALS['OCSP']['PHPFORMPATH'])) $GLOBALS['OCSP']['PHPFORMPATH']=
dirname(__FILE__
).
"/";
require_once $GLOBALS['OCSP']['PHPFORMPATH'].
"DBMS_FIELD.phpclass";
* @project Open CSP-Management
* @author Peter Krebs <p.krebs@lvus.at>
* @copyright (c) 2002-2005 by LVUS <http://opencsp.lvu.at>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* source file of the class
* @var string $classSrcFile
// ###########################
$ret.=
"<input name=\"".
$arrName.
"[".
$this->myName.
"][HOUR]\" value=\"".
($aTimeArr['HOUR']).
"\" size=\"2\" maxlength=\"2\">:\n";
$ret.=
"<input name=\"".
$arrName.
"[".
$this->myName.
"][MIN]\" value=\"".
($aTimeArr['MIN']).
"\" size=\"2\" maxlength=\"2\">:\n";
$ret.=
"<input name=\"".
$arrName.
"[".
$this->myName.
"][SEC]\" value=\"".
($aTimeArr['SEC']).
"\" size=\"2\" maxlength=\"2\">\n";
$ret.=
" <a class=\"button\" href=\"#\" onClick=\"{";
$ret.=
"var aktDate=new Date();";
$ret.=
"setElemValByName(document.forms[0],'".
$arrName.
"[".
$this->myName.
"][HOUR]',aktDate.getHours());";
$ret.=
"setElemValByName(document.forms[0],'".
$arrName.
"[".
$this->myName.
"][MIN]',aktDate.getMinutes());";
$ret.=
"setElemValByName(document.forms[0],'".
$arrName.
"[".
$this->myName.
"][SEC]',aktDate.getSeconds());";
$ret.=
"}\"><img src=\"".
$GLOBALS[PROJECT]['SYSIMGURL'].
"buttons/setnow.gif\" border=\"0\"></a> ";
require_once $GLOBALS['PHPINCPATH'].
"common/pcf.phpinc";
$ret=
array('HOUR'=>
'','MIN'=>
'','SEC'=>
'');
if ($debug) {echo
"<pre>$aString:\n";print_r($arr);print_r($ret);echo
"</pre>";}
function writeField($mode,$aValue=
"",$arrName=
"DBVAL",$debug=
FALSE) {
echo
"<input name=\"".
$arrName.
"[".
$this->myName.
"]\" ";
echo
"value=\"".
$aValue.
"\" type=\"hidden\">";
if ((trim($timeArr['HOUR'])==
"") ||
(intval($timeArr['HOUR']) <
0) ||
(intval($timeArr['HOUR']) >
24)) return FALSE;
if ((trim($timeArr['MIN'])==
"") ||
(intval($timeArr['MIN']) <
0) ||
(intval($timeArr['MIN']) >
59)) return FALSE;
if ((trim($timeArr['SEC'])==
"") ||
(intval($timeArr['SEC']) <
0) ||
(intval($timeArr['SEC']) >
59)) return FALSE;
* returns the string representation of the time
* @param string $aValue the value
* @param array $err error array
* @param string $arrName name of the array to access fieldsarray gloabl ${$arrName}
function getValue($aValue,&$err,$arrName=
"DBVAL",$debug=
FALSE) {
if ($debug) echo
"<hr><p><b>DBMS_FIELD_SELECTLIST::getValue($aValue,$err,$arrName,$debug)</b> (".
get_class($this).
"/".
$this->myName.
")</p>";
$err[$this->myName]['MSG']=
"NULL_NOT_ALLOWED";
* add slashes to the value from getValue to add it to a sql command
* @param string $aValue the value
* @param array $err error array
* @param string $arrName name of the global array to access field gloabl ${$arrName}
function slashedValue($aValue,&$err,$arrName=
"DBVAL",$debug=
FALSE) {
if ($debug) echo
"<hr><p><b>DBMS_FIELD_SELECTLIST::slashedValue($aValue,$err,$arrName,$debug)</b> (".
get_class($this).
"/".
$this->myName.
")</p>";
if (!($aValue=
$this->getValue($aValue,$err,$arrName,$debug))) {
return $GLOBALS[$this->getGlobalDBObjIdx()]->qs_getNullStmt();
return $GLOBALS[$this->getGlobalDBObjIdx()]->qs_getSlashedValue($aValue);
Documentation generated on Thu, 08 Jan 2009 17:43:05 +0100 by phpDocumentor 1.4.0a2