コード例 #1
0
ファイル: TimeField.php プロジェクト: aagusti/padl-tng
 function buildControl($value, $mode, $fieldNum = 0, $validate, $additionalCtrlParams, $data)
 {
     if ($this->container->pageType == PAGE_LIST || $this->container->pageType == PAGE_SEARCH) {
         $value = prepare_for_db($this->field, $value, "time");
     }
     parent::buildControl($value, $mode, $fieldNum, $validate, $additionalCtrlParams, $data);
     echo '<input id="' . $this->ctype . '" ' . $this->inputStyle . ' type="hidden" name="' . $this->ctype . '" value="time">';
     $arr_number = parsenumbers((string) $value);
     if (count($arr_number) == 6) {
         $value = mysprintf("%d:%02d:%02d", array($arr_number[3], $arr_number[4], $arr_number[5]));
     }
     $timeAttrs = $this->pageObject->pSetEdit->getFormatTimeAttrs($this->field);
     if (count($timeAttrs)) {
         $input = '<input type="text" ' . $this->inputStyle . ' name="' . $this->cfield . '" ' . (($mode == MODE_INLINE_EDIT || $mode == MODE_INLINE_ADD) && $this->is508 == true ? 'alt="' . $this->strLabel . '" ' : '') . 'id="' . $this->cfield . '" ' . $this->pageObject->pSetEdit->getEditParams($this->field);
         if ($timeAttrs["useTimePicker"]) {
             $convention = $timeAttrs["hours"];
             $loc = getLacaleAmPmForTimePicker($convention, true);
             $tpVal = getValForTimePicker($this->type, $value, $loc['locale']);
             echo $input . ' value="' . htmlspecialchars($tpVal['val']) . '">';
             echo '&nbsp;';
             echo '<img class="runner-imgclock" src="images/clock.gif" alt="Time" border="0" style="margin:4px 0 0 6px; visibility: hidden;" id="trigger-test-' . $this->cfield . '" />';
         } else {
             echo $input . ' value="' . htmlspecialchars($value) . '">';
         }
     }
     $this->buildControlEnd($validate);
 }
コード例 #2
0
ファイル: ViewTimeField.php プロジェクト: aagusti/padl-tng
 public function showDBValue(&$data, $keylink)
 {
     $result = "";
     if (IsDateFieldType($this->fieldType)) {
         $result = str_format_time(db2time($data[$this->field]));
     } else {
         $numbers = parsenumbers($data[$this->field]);
         if (!count($numbers)) {
             return "";
         }
         while (count($numbers) < 3) {
             $numbers[] = 0;
         }
         $result = str_format_time(array(0, 0, 0, $numbers[0], $numbers[1], $numbers[2]));
     }
     return $this->checkForEncoding($result, $keylink);
 }
コード例 #3
0
 /**
  * @param &Array data
  * @return String	 
  */
 public function getTextValue(&$data)
 {
     $result = "";
     if (IsDateFieldType($this->fieldType)) {
         return str_format_time(db2time($data[$this->field]));
     }
     $numbers = parsenumbers($data[$this->field]);
     if (!count($numbers)) {
         return "";
     }
     while (count($numbers) < 3) {
         $numbers[] = 0;
     }
     if (count($numbers) == 6) {
         return str_format_time(array(0, 0, 0, $numbers[3], $numbers[4], $numbers[5]));
     }
     // sometimes data is datetime
     return str_format_time(array(0, 0, 0, $numbers[0], $numbers[1], $numbers[2]));
 }
コード例 #4
0
/**
 * @intellisense
 */
function localdatetime2db($strdatetime, $format = "")
{
    global $locale_info;
    $locale_idate = $locale_info["LOCALE_IDATE"];
    if ($format == "dmy") {
        $locale_idate = 1;
    }
    if ($format == "mdy") {
        $locale_idate = 0;
    }
    if ($format == "ymd") {
        $locale_idate = 2;
    }
    //	check if we use 12hours clock
    $strtime = strtoupper($strdatetime);
    $use12 = 0;
    $pos = strpos($locale_info["LOCALE_STIMEFORMAT"], "h" . $locale_info["LOCALE_STIME"]);
    if (!($pos === false) or (strpos($strtime, "AM") !== false or strpos($strtime, "PM") !== false)) {
        $use12 = 1;
        //	determine am/pm
        $pm = 0;
        $amstr = $locale_info["LOCALE_S1159"] == "" ? "AM" : $locale_info["LOCALE_S1159"];
        $pmstr = $locale_info["LOCALE_S2359"] == "" ? "PM" : $locale_info["LOCALE_S2359"];
        $posam = strpos($strdatetime, $amstr);
        $pospm = strpos($strdatetime, $pmstr);
        if ($posam === false && $pospm !== false) {
            $pm = 1;
        } elseif ($posam !== false && $pospm === false) {
            $pm = 0;
        } elseif ($posam === false && $pospm === false) {
            $use12 = 0;
        } else {
            if ($posam > $pospm) {
                $pm = 1;
            }
        }
    }
    $numbers = parsenumbers($strdatetime);
    if (!$numbers || count($numbers) < 2) {
        return "null";
    }
    //	add current year if not specified
    if (count($numbers) < 3) {
        if ($locale_idate != 1) {
            $month = $numbers[0];
            $day = $numbers[1];
        } else {
            $month = $numbers[1];
            $day = $numbers[0];
        }
        $tm = localtime(time(), true);
        $year = 1900 + $tm["tm_year"];
    } else {
        if (!$locale_idate) {
            $month = $numbers[0];
            $day = $numbers[1];
            $year = $numbers[2];
            //			list($month,$day,$year)=$numbers;
        } else {
            if ($locale_idate == 1) {
                $day = $numbers[0];
                $month = $numbers[1];
                $year = $numbers[2];
                //			list($day,$month,$year)=$numbers;
            } else {
                if ($locale_idate == 2) {
                    $year = $numbers[0];
                    $month = $numbers[1];
                    $day = $numbers[2];
                    //			list($year,$month,$day)=$numbers;
                }
            }
        }
    }
    if (!$month || !$day) {
        return "null";
    }
    while (count($numbers) < 6) {
        $numbers[] = 0;
    }
    $h = $numbers[3];
    $m = $numbers[4];
    $s = $numbers[5];
    if ($use12 && $h) {
        if (!$pm && $h == 12) {
            $h = 0;
        }
        if ($pm && $h < 12) {
            $h += 12;
        }
    }
    if ($year < 100) {
        if ($year < 60) {
            $year += 2000;
        } else {
            $year += 1900;
        }
    }
    return mysprintf("%04d-%02d-%02d", array($year, $month, $day)) . " " . mysprintf("%02d:%02d:%02d", array($h, $m, $s));
}
コード例 #5
0
ファイル: commonfunctions.php プロジェクト: aagusti/padl-tng
/**
 * Get value for field edit as time and get dpTime settings
 * @param integer $convention - 24 or 12 hours format for timePicker
 * @param string $type - type of field
 * @param string $value - value of field
 * @param boolean $useTimePicker -  use timePicker or not
 * @return array
 */
function getValForTimePicker($type, $value, $locale)
{
    $val = "";
    $dbtime = array();
    if (IsDateFieldType($type)) {
        $dbtime = db2time($value);
        if (count($dbtime)) {
            $val = format_datetime_custom($dbtime, $locale);
        }
    } else {
        $arr = parsenumbers($value);
        if (count($arr)) {
            while (count($arr) < 3) {
                $arr[] = 0;
            }
            $dbtime = array(0, 0, 0, $arr[0], $arr[1], $arr[2]);
            $val = format_datetime_custom($dbtime, $locale);
        }
    }
    return array('val' => $val, 'dbTime' => $dbtime);
}
コード例 #6
0
ファイル: reportlib.php プロジェクト: aagusti/padl-tng
 function value2time($value)
 {
     $res = 0;
     $arr = parsenumbers($value);
     if (isset($arr[0])) {
         $res += $arr[0] * 60 * 60;
     }
     if (isset($arr[1])) {
         $res += $arr[1] * 60;
     }
     if (isset($arr[2])) {
         $res += $arr[2];
     }
     return $res;
 }
コード例 #7
0
 /**
  * Extract a date format form the dateTime string //#9684
  * @param String dateString
  * @return String 
  */
 public static function extractDateFormat($dateString)
 {
     global $locale_info;
     $dateComponents = parsenumbers($dateString);
     if (count($dateComponents) < 3) {
         return "";
     }
     $dateSeparator = $locale_info["LOCALE_SDATE"];
     $format = "";
     if ($dateComponents[0] > 31 && testMonth($dateComponents[1]) && $dateComponents[2] >= 12) {
         $year = $dateComponents[0];
         $format = "Y" . $dateSeparator . "M" . $dateSeparator . "D";
     }
     if ($dateComponents[0] >= 12 && testMonth($dateComponents[1]) && $dateComponents[2] > 31) {
         $year = $dateComponents[3];
         $format = "D" . $dateSeparator . "M" . $dateSeparator . "Y";
     }
     if (testMonth($dateComponents[0]) && $dateComponents[1] >= 12 && $dateComponents[2] > 31) {
         $year = $dateComponents[3];
         $format = "M" . $dateSeparator . "D" . $dateSeparator . "Y";
     }
     if ($format) {
         $format = str_replace("Y", $year < 100 ? "YY" : "YYYY", $format);
     }
     return $format;
 }
コード例 #8
0
function BuildEditControl($field, $value, $format, $edit, $fieldNum = 0, $id = "", $validate, $additionalCtrlParams, &$pageObj)
{
    global $rs, $data, $strTableName, $filenamelist, $keys, $locale_info, $jscode;
    $inputStyle = 'style="';
    $inputStyle .= $additionalCtrlParams['style'] ? $additionalCtrlParams['style'] : '';
    //$inputStyle .= ($additionalCtrlParams['hidden'] ? 'display: none;' : '');
    $inputStyle .= '"';
    $cfieldname = GoodFieldName($field) . "_" . $id;
    $cfield = "value_" . GoodFieldName($field) . "_" . $id;
    $ctype = "type_" . GoodFieldName($field) . "_" . $id;
    $is508 = isEnableSection508();
    $strLabel = Label($field);
    if ($fieldNum) {
        $cfield = "value" . $fieldNum . "_" . GoodFieldName($field) . "_" . $id;
        $ctype = "type" . $fieldNum . "_" . GoodFieldName($field) . "_" . $id;
    }
    $type = GetFieldType($field);
    $arr = "";
    $iquery = "field=" . rawurlencode($field);
    $keylink = "";
    $arrKeys = GetTableKeys($strTableName);
    for ($j = 0; $j < count($arrKeys); $j++) {
        $keylink .= "&key" . ($j + 1) . "=" . rawurlencode($data[$arrKeys[$j]]);
    }
    $iquery .= $keylink;
    $isHidden = isset($additionalCtrlParams['hidden']) && $additionalCtrlParams['hidden'];
    echo '<span id="edit' . $id . '_' . GoodFieldName($field) . '_' . $fieldNum . '" class="runner-nowrap"' . ($isHidden ? ' style="display:none"' : '') . '">';
    if ($format == EDIT_FORMAT_FILE && $edit == MODE_SEARCH) {
        $format = "";
    }
    if ($format == EDIT_FORMAT_TEXT_FIELD) {
        if (IsDateFieldType($type)) {
            echo '<input id="' . $ctype . '" type="hidden" name="' . $ctype . '" value="date' . EDIT_DATE_SIMPLE . '">' . GetDateEdit($field, $value, 0, $fieldNum, $edit, $id, $pageObj);
        } else {
            if ($edit == MODE_SEARCH) {
                echo '<input id="' . $cfield . '" ' . $inputStyle . ' type="text" autocomplete="off" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'name="' . $cfield . '" ' . GetEditParams($field) . ' value="' . htmlspecialchars($value) . '">';
            } else {
                echo '<input id="' . $cfield . '" ' . $inputStyle . ' type="text" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'name="' . $cfield . '" ' . GetEditParams($field) . ' value="' . htmlspecialchars($value) . '">';
            }
        }
    } else {
        if ($format == EDIT_FORMAT_TIME) {
            echo '<input id="' . $ctype . '" ' . $inputStyle . ' type="hidden" name="' . $ctype . '" value="time">';
            $arr_number = parsenumbers((string) $value);
            if (count($arr_number) == 6) {
                $value = mysprintf("%d:%02d:%02d", array($arr_number[3], $arr_number[4], $arr_number[5]));
            }
            $timeAttrs = GetFieldData($strTableName, $field, "FormatTimeAttrs", array());
            if (count($timeAttrs)) {
                if ($timeAttrs["useTimePicker"]) {
                    $convention = $timeAttrs["hours"];
                    $loc = getLacaleAmPmForTimePicker($convention, true);
                    $tpVal = getValForTimePicker($type, $value, $loc['locale']);
                    echo '<input type="text" ' . $inputStyle . ' name="' . $cfield . '" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'id="' . $cfield . '" ' . GetEditParams($field) . ' value="' . htmlspecialchars($tpVal['val']) . '">';
                    echo '&nbsp;';
                    echo '<img class="runner-imgclock" src="images/clock.gif" alt="Time" border="0" style="margin:4px 0 0 6px; visibility: hidden;" id="trigger-test-' . $cfield . '" />';
                } else {
                    echo '<input id="' . $cfield . '" ' . $inputStyle . ' type="text" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'name="' . $cfield . '" ' . GetEditParams($field) . ' value="' . htmlspecialchars($value) . '">';
                }
            }
        } else {
            if ($format == EDIT_FORMAT_TEXT_AREA) {
                $nWidth = GetNCols($field);
                $nHeight = GetNRows($field);
                if (UseRTE($field)) {
                    $value = RTESafe($value);
                } else {
                    echo '<textarea id="' . $cfield . '" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'name="' . $cfield . '" style="';
                    if (!isMobile()) {
                        echo "width: " . $nWidth . "px;";
                    }
                    echo 'height: ' . $nHeight . 'px;">' . htmlspecialchars($value) . '</textarea>';
                }
            } else {
                if ($format == EDIT_FORMAT_PASSWORD) {
                    echo '<input ' . $inputStyle . ' id="' . $cfield . '" type="Password" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'name="' . $cfield . '" ' . GetEditParams($field) . ' value="' . htmlspecialchars($value) . '">';
                } else {
                    if ($format == EDIT_FORMAT_DATE) {
                        echo '<input id="' . $ctype . '" type="hidden" name="' . $ctype . '" value="date' . DateEditType($field) . '">' . GetDateEdit($field, $value, DateEditType($field), $fieldNum, $edit, $id, $pageObj);
                    } else {
                        if ($format == EDIT_FORMAT_RADIO) {
                            BuildRadioControl($field, $value, $fieldNum, $id, $edit);
                        } else {
                            if ($format == EDIT_FORMAT_CHECKBOX) {
                                if ($edit == MODE_ADD || $edit == MODE_INLINE_ADD || $edit == MODE_EDIT || $edit == MODE_INLINE_EDIT) {
                                    $checked = "";
                                    if ($value && $value != 0) {
                                        $checked = " checked";
                                    }
                                    echo '<input id="' . $ctype . '" type="hidden" name="' . $ctype . '" value="checkbox">';
                                    echo '<input id="' . $cfield . '" type="Checkbox" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'name="' . $cfield . '" ' . $checked . '>';
                                } else {
                                    echo '<input id="' . $ctype . '" type="hidden" name="' . $ctype . '" value="checkbox">';
                                    echo '<select id="' . $cfield . '" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . 'name="' . $cfield . '">';
                                    $val = array("", "on", "off");
                                    $show = array("", "True", "False");
                                    foreach ($val as $i => $v) {
                                        $sel = "";
                                        if ($value === $v) {
                                            $sel = " selected";
                                        }
                                        echo '<option value="' . $v . '"' . $sel . '>' . $show[$i] . '</option>';
                                    }
                                    echo "</select>";
                                }
                            } else {
                                if ($format == EDIT_FORMAT_DATABASE_IMAGE || $format == EDIT_FORMAT_DATABASE_FILE) {
                                    $disp = "";
                                    $strfilename = "";
                                    //$onchangefile="";
                                    if ($edit == MODE_EDIT || $edit == MODE_INLINE_EDIT) {
                                        $value = db_stripslashesbinary($value);
                                        $itype = SupposeImageType($value);
                                        $thumbnailed = false;
                                        $thumbfield = "";
                                        if ($itype) {
                                            if ($thumbnailed) {
                                                $disp = "<a ";
                                                if (IsUseiBox($field, $strTableName)) {
                                                    $disp .= " rel='ibox'";
                                                } else {
                                                    $disp .= " target=_blank";
                                                }
                                                $disp .= " href=\"imager.php?table=" . GetTableURL($strTableName) . "&" . $iquery . "&rndVal=" . rand(0, 32768) . "\">";
                                                $disp .= "<img id=\"image_" . GoodFieldName($field) . "_" . $id . "\" name=\"" . $cfield . "\" border=0";
                                                if (isEnableSection508()) {
                                                    $disp .= " alt=\"Image from DB\"";
                                                }
                                                $disp .= " src=\"imager.php?table=" . GetTableURL($strTableName) . "&field=" . rawurlencode($thumbfield) . "&alt=" . rawurlencode($field) . $keylink . "&rndVal=" . rand(0, 32768) . "\">";
                                                $disp .= "</a>";
                                            } else {
                                                $disp = '<img id="image_' . GoodFieldName($field) . '_' . $id . '" name="' . $cfield . '"';
                                                if (isEnableSection508()) {
                                                    $disp .= ' alt="Image from DB"';
                                                }
                                                $disp .= ' border=0 src="imager.php?table=' . GetTableURL($strTableName) . '&' . $iquery . "&rndVal=" . rand(0, 32768) . '">';
                                            }
                                        } else {
                                            if (strlen($value)) {
                                                $disp = '<img id="image_' . GoodFieldName($field) . '_' . $id . '" name="' . $cfield . '" border=0 ';
                                                if (isEnableSection508()) {
                                                    $disp .= ' alt="file"';
                                                }
                                                $disp .= ' src="images/file.gif">';
                                            } else {
                                                $disp = '<img id="image_' . GoodFieldName($field) . '_' . $id . '" name="' . $cfield . '" border="0"';
                                                if (isEnableSection508()) {
                                                    $disp .= ' alt=" "';
                                                }
                                                $disp .= ' src="images/no_image.gif">';
                                            }
                                        }
                                        //	filename
                                        if ($format == EDIT_FORMAT_DATABASE_FILE && !$itype && strlen($value)) {
                                            if (!($filename = @$data[GetFilenameField($field)])) {
                                                $filename = "file.bin";
                                            }
                                            $disp = '<a href="getfile.php?table=' . GetTableURL($strTableName) . '&filename=' . htmlspecialchars($filename) . '&' . $iquery . '".>' . $disp . '</a>';
                                        }
                                        //	filename edit
                                        if ($format == EDIT_FORMAT_DATABASE_FILE && GetFilenameField($field)) {
                                            if (!($filename = @$data[GetFilenameField($field)])) {
                                                $filename = "";
                                            }
                                            if ($edit == MODE_INLINE_EDIT) {
                                                $strfilename = '<br><label for="filename_' . $cfieldname . '">' . mlang_message("FILENAME") . '</label>&nbsp;&nbsp;<input type="text" ' . $inputStyle . ' id="filename_' . $cfieldname . '" name="filename_' . $cfieldname . '" size="20" maxlength="50" value="' . htmlspecialchars($filename) . '">';
                                            } else {
                                                $strfilename = '<br><label for="filename_' . $cfieldname . '">' . mlang_message("FILENAME") . '</label>&nbsp;&nbsp;<input type="text" ' . $inputStyle . ' id="filename_' . $cfieldname . '" name="filename_' . $cfieldname . '" size="20" maxlength="50" value="' . htmlspecialchars($filename) . '">';
                                            }
                                        }
                                        $strtype = '<br><input id="' . $ctype . '_keep" type="Radio" name="' . $ctype . '" value="file0" checked>' . mlang_message("KEEP");
                                        if ((strlen($value) || $edit == MODE_INLINE_EDIT) && !IsRequired($field)) {
                                            $strtype .= '<input id="' . $ctype . '_delete" type="Radio" name="' . $ctype . '" value="file1">' . mlang_message("DELETE");
                                        }
                                        $strtype .= '<input id="' . $ctype . '_update" type="Radio" name="' . $ctype . '" value="file2">' . mlang_message("UPDATE");
                                    } else {
                                        //	if Add mode
                                        $strtype = '<input id="' . $ctype . '" type="hidden" name="' . $ctype . '" value="file2">';
                                        if ($format == EDIT_FORMAT_DATABASE_FILE && GetFilenameField($field)) {
                                            $strfilename = '<br><label for="filename_' . $cfieldname . '">' . mlang_message("FILENAME") . '</label>&nbsp;&nbsp;<input type="text" ' . $inputStyle . ' id="filename_' . $cfieldname . '" name="filename_' . $cfieldname . '" size="20" maxlength="50">';
                                        }
                                    }
                                    if ($edit == MODE_INLINE_EDIT && $format == EDIT_FORMAT_DATABASE_FILE) {
                                        $disp = "";
                                    }
                                    echo $disp . $strtype;
                                    if ($edit == MODE_EDIT || $edit == MODE_INLINE_EDIT) {
                                        echo '<br>';
                                    }
                                    echo '<input type="File" ' . $inputStyle . ' id="' . $cfield . '" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . ' name="' . $cfield . '" >' . $strfilename;
                                    echo '<input type="Hidden" id="notempty_' . $cfieldname . '" value="' . (strlen($value) ? 1 : 0) . '">';
                                } else {
                                    if ($format == EDIT_FORMAT_LOOKUP_WIZARD) {
                                        BuildSelectControl($field, $value, $fieldNum, $edit, $id, $additionalCtrlParams, $pageObj);
                                    } else {
                                        if ($format == EDIT_FORMAT_HIDDEN) {
                                            echo '<input id="' . $cfield . '" type="Hidden" name="' . $cfield . '" value="' . htmlspecialchars($value) . '">';
                                        } else {
                                            if ($format == EDIT_FORMAT_READONLY) {
                                                echo '<input id="' . $cfield . '" type="Hidden" name="' . $cfield . '" value="' . htmlspecialchars($value) . '">';
                                            } else {
                                                if ($format == EDIT_FORMAT_FILE) {
                                                    $disp = "";
                                                    $strfilename = "";
                                                    $function = "";
                                                    if ($edit == MODE_EDIT || $edit == MODE_INLINE_EDIT) {
                                                        //	show current file
                                                        if (ViewFormat($field) == FORMAT_FILE || ViewFormat($field) == FORMAT_FILE_IMAGE) {
                                                            $disp = GetData($data, $field, ViewFormat($field)) . "<br>";
                                                        }
                                                        $filename = $value;
                                                        //	filename edit
                                                        $filename_size = 30;
                                                        if (UseTimestamp($field)) {
                                                            $filename_size = 50;
                                                        }
                                                        $strfilename = '<input type=hidden name="filenameHidden_' . $cfieldname . '" value="' . htmlspecialchars($filename) . '"><br>' . mlang_message("FILENAME") . '&nbsp;&nbsp;<input type="text" style="background-color:gainsboro" disabled id="filename_' . $cfieldname . '" name="filename_' . $cfieldname . '" size="' . $filename_size . '" maxlength="100" value="' . htmlspecialchars($filename) . '">';
                                                        if ($edit == MODE_INLINE_EDIT) {
                                                            $strtype = '<br><input id="' . $ctype . '_keep" type="Radio" name="' . $ctype . '" value="upload0" checked class="runner-uploadtype">' . mlang_message("KEEP");
                                                        } else {
                                                            $strtype = '<br><input id="' . $ctype . '_keep" type="Radio" name="' . $ctype . '" value="upload0" checked class="runner-uploadtype">' . mlang_message("KEEP");
                                                        }
                                                        if ((strlen($value) || $edit == MODE_INLINE_EDIT) && !IsRequired($field)) {
                                                            $strtype .= '<input id="' . $ctype . '_delete" type="Radio" name="' . $ctype . '" value="upload1" class="runner-uploadtype">' . mlang_message("DELETE");
                                                        }
                                                        $strtype .= '<input id="' . $ctype . '_update" type="Radio" name="' . $ctype . '" value="upload2" class="runner-uploadtype">' . mlang_message("UPDATE");
                                                    } else {
                                                        //	if Adding record
                                                        $filename_size = 30;
                                                        if (UseTimestamp($field)) {
                                                            $filename_size = 50;
                                                        }
                                                        $strtype = '<input id="' . $ctype . '" type="hidden" name="' . $ctype . '" value="upload2">';
                                                        $strfilename = '<br>' . mlang_message("FILENAME") . '&nbsp;&nbsp;<input type="text" id="filename_' . $cfieldname . '" name="filename_' . $cfieldname . '" size="' . $filename_size . '" maxlength="100">';
                                                    }
                                                    echo $disp . $strtype . $function;
                                                    if ($edit == MODE_EDIT || $edit == MODE_INLINE_EDIT) {
                                                        echo '<br>';
                                                    }
                                                    echo '<input type="File" id="' . $cfield . '" ' . (($edit == MODE_INLINE_EDIT || $edit == MODE_INLINE_ADD) && $is508 == true ? 'alt="' . $strLabel . '" ' : '') . ' name="' . $cfield . '" >' . $strfilename;
                                                    echo '<input type="Hidden" id="notempty_' . $cfieldname . '" value="' . (strlen($value) ? 1 : 0) . '">';
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    if (count($validate['basicValidate']) && array_search('IsRequired', $validate['basicValidate']) !== false) {
        echo '&nbsp;<font color="red">*</font></span>';
    } else {
        echo '</span>';
    }
}
コード例 #9
0
 /**
  * Get the time slider's where
  * @return string
  */
 static function getTimeSliderWhere($fName, $pSet, $cipherer, $table, $SearchFor, $SearchFor2, $strSearchOption, $fullFieldName)
 {
     $firstDelimPos = strpos($SearchFor, ":");
     $lastDelimPos = strrpos($SearchFor, ":");
     if ($firstDelimPos === FALSE || $firstDelimPos == $lastDelimPos) {
         return "";
     }
     $stepType = $pSet->getFilterStepType($fName);
     $value1 = $cipherer->MakeDBValue($fName, $SearchFor, "", true);
     switch ($strSearchOption) {
         case "slider":
             $firstDelimPos = strpos($SearchFor2, ":");
             $lastDelimPos = strrpos($SearchFor2, ":");
             if ($firstDelimPos === FALSE || $firstDelimPos == $lastDelimPos) {
                 return "";
             }
             $cleanvalue2 = prepare_for_db($fName, $SearchFor2, "");
             $timeArr = parsenumbers($cleanvalue2);
             if ($stepType == FSST_SECONDS) {
                 $timeArr = addSecondsToTime($timeArr, 1);
             } else {
                 $timeArr = addMinutesToTime($timeArr, 1);
             }
             $hours = $timeArr[0] < 10 ? '0' . $timeArr[0] : $timeArr[0];
             $minutes = $timeArr[1] < 10 ? '0' . $timeArr[1] : $timeArr[1];
             $seconds = $timeArr[2] < 10 ? '0' . $timeArr[2] : $timeArr[2];
             $value2 = $hours . ":" . $minutes . ":" . $seconds;
             $value2 = add_db_quotes($fName, $value2, $table);
             return $fullFieldName . ">=" . $value1 . " and " . $fullFieldName . "<" . $value2;
         case 'moreequal':
             return $fullFieldName . ">=" . $value1;
         case 'lessequal':
             return $fullFieldName . "<=" . $value1;
         default:
             return "";
     }
 }