Пример #1
0
function input($name, $data = "", $type = "text", $file_location = FILES_URL, $blnReturn = false)
{
    $blnFileAda = false;
    $file = "";
    if (is_array($data)) {
        if (key_exists($name, $data) && isset($data[$name])) {
            if ($type == 'file') {
                $blnFileAda = true;
                $file = $data[$name];
            } elseif ($type == 'tanggal' || $type == 'tgl') {
                $data[$name] = tanggal($data[$name]);
            }
            $value = ' value="' . $data[$name] . '"';
        } else {
            $value = "";
        }
    } else {
        if ($data) {
            if ($type == 'file') {
                $blnFileAda = true;
                $file = $data;
            } elseif ($type == 'tanggal' || $type == 'tgl') {
                $data = tanggal($data);
            }
            $value = ' value="' . $data . '"';
        } else {
            $value = "";
        }
    }
    $out = "";
    if ($type == 'file' && $blnFileAda && $file) {
        $out .= link_href($file_location . $file, $file) . "<br />";
        $id = "inputfile_" . $name;
    } elseif ($type == "tanggal" || $type == "tgl") {
        $id = "inputtgl_" . $name;
        $name = $id;
        $GLOBALS['js'][] = JQUERY_UI;
        $GLOBALS['css'][] = JQUERY_UI_CSS;
        $GLOBALS['script'][] = '$("#' . $id . '").datepicker({ dateFormat:"dd-mm-yy", changeMonth: true, changeYear: true, yearRange:"-70:+1" });';
        $type = "text";
    } else {
        $id = "inputbox_" . $name;
    }
    $out .= '<input type="' . $type . '" id="' . $id . '" name="' . $name . '"' . $value . ' />';
    if ($blnReturn) {
        return $out;
    } else {
        echo $out;
    }
}
Пример #2
0
function link_to_feed(){
    return link_href("feed");
}
Пример #3
0
 static function camping_download($trip, $format, $country)
 {
     if ($country == "") {
         $url = link_href($trip, "campingDownload", $format);
     } else {
         $url = link_href($trip, "campingDownload", $format, $country);
     }
     return $url;
 }