Example #1
0
 public function beforeSave($event)
 {
     $campos = explode(',', $this->campos);
     foreach ($campos as $campo) {
         if (!(isset($this->getOwner()->{trim($campo) . '_alt'}) && $this->getOwner()->{trim($campo) . '_alt'} != '' && $this->getOwner()->{trim($campo) . '_bdd'} != $this->getOwner()->{trim($campo) . '_alt'})) {
             $this->getOwner()->{trim($campo)} = $this->getOwner()->{trim($campo) . '_bdd'};
         }
         if (isset($this->getOwner()->{trim($campo) . '_time'})) {
             $aux = DateTools::parseAmPmTo24h($this->getOwner()->{trim($campo) . '_time_bdd'});
             $this->getOwner()->{trim($campo)} .= ' ' . $aux;
         }
     }
     return true;
 }
 public function __construct($message, $Http_Code, $info = null)
 {
     if (!php_Boot::$skip_constructor) {
         parent::__construct(null, _hx_anonymous(array("fileName" => "Error.hx", "lineNumber" => 50, "className" => "system.base.Http_exception", "methodName" => "new")));
         while (!system_base_Cache::$cookie_buffer->isEmpty()) {
             system_base_Wet_base::send_cookie(system_base_Cache::$cookie_buffer->pop());
         }
         header("X-Powered-By" . ": " . "Webrathea/0.4 (PHP)");
         $value = DateTools::format(Date::now(), "%a, %d %b %Y %X %Z");
         header("Date" . ": " . _hx_string_or_null($value));
         header("X-Frame-Options" . ": " . "sameorigin");
         header("X-XSS-Protection" . ": " . "1; mode=block");
         php_Web::setReturnCode($Http_Code);
         $message1 = null;
         $message1 = Std::string($message);
         haxe_Log::trace("DEPRECATED FUNCTION: " . _hx_string_or_null($message1), _hx_anonymous(array("fileName" => "Base.hx", "lineNumber" => 449, "className" => "system.base.Wet_base", "methodName" => "echo")));
     }
 }
 public function requestIn($ctx)
 {
     $_g = $this;
     if (strtolower($ctx->request->get_httpMethod()) === "post" && $ctx->request->isMultipart()) {
         $file = null;
         $postName = null;
         $origFileName = null;
         $size = 0;
         $tmpFilePath = null;
         $dateStr = DateTools::format(Date::now(), "%Y%m%d-%H%M");
         $dir = _hx_string_or_null($ctx->get_contentDirectory()) . _hx_string_or_null(haxe_io_Path::addTrailingSlash(ufront_web_upload_TmpFileUploadMiddleware::$subDir));
         $path = haxe_io_Path::removeTrailingSlashes($dir);
         $path1 = haxe_io_Path::addTrailingSlash($path);
         $_p = null;
         $parts = new _hx_array(array());
         while ($path1 !== ($_p = haxe_io_Path::directory($path1))) {
             $parts->unshift($path1);
             $path1 = $_p;
         }
         $_g1 = 0;
         while ($_g1 < $parts->length) {
             $part = $parts[$_g1];
             ++$_g1;
             if (_hx_char_code_at($part, strlen($part) - 1) !== 58 && !file_exists($part)) {
                 @mkdir($part, 493);
             }
             unset($part);
         }
         $onPart = array(new _hx_lambda(array(&$_g, &$ctx, &$dateStr, &$dir, &$file, &$origFileName, &$postName, &$size, &$tmpFilePath), "ufront_web_upload_TmpFileUploadMiddleware_0"), 'execute');
         $onData = array(new _hx_lambda(array(&$_g, &$ctx, &$dateStr, &$dir, &$file, &$onPart, &$origFileName, &$postName, &$size, &$tmpFilePath), "ufront_web_upload_TmpFileUploadMiddleware_1"), 'execute');
         $onEndPart = array(new _hx_lambda(array(&$_g, &$ctx, &$dateStr, &$dir, &$file, &$onData, &$onPart, &$origFileName, &$postName, &$size, &$tmpFilePath), "ufront_web_upload_TmpFileUploadMiddleware_2"), 'execute');
         return tink_core__Future_Future_Impl_::map($ctx->request->parseMultipart($onPart, $onData, $onEndPart), array(new _hx_lambda(array(&$_g, &$ctx, &$dateStr, &$dir, &$file, &$onData, &$onEndPart, &$onPart, &$origFileName, &$postName, &$size, &$tmpFilePath), "ufront_web_upload_TmpFileUploadMiddleware_3"), 'execute'), null);
     } else {
         return ufront_core_SurpriseTools::success();
     }
 }
Example #4
0
<?php

session_start();
require_once "../../../JPFLibs.php";
libadd("lib.JPF");
libadd("lib.JPF.Data.MySQL");
$month = DateTools::getCurrentoMnth();
if (isset($_GET['calmonthCal2'])) {
    $month = $_GET['calmonthCal2'];
}
$year = date("Y");
if (isset($_GET['yearCal2'])) {
    $year = $_GET['yearCal2'];
}
$cal2 = new Calendar($month, $year, "Cal2");
$cal2->preURL = "javascript:void(0);";
$cal2->FUID = $_GET['FUID'];
$cal2->extraURL = "onclick=\"opener.addDate{{FUID}}('{{DATE}}');window.close();\"";
//$cal2->browseable=false;
echo $cal2->BuildStandardCalendar();
//@todo template
Example #5
0
 function BuildStandardCalendar()
 {
     $tpl = $this->tpl;
     $firstDayOfWeek = $this->days[1];
     $row = "";
     $allRows = "";
     for ($i = 1; $i < $firstDayOfWeek; $i++) {
         $tpl->setVars("CALENDARCOL", "DAY", "");
         $row .= $tpl->ParseBlock("CALENDARCOL");
     }
     $dayTD = "";
     foreach ($this->days as $dayOfMonth => $dayOfWeek) {
         if (isset($this->preURL)) {
             $tpl->setVars("LINK", "LINK", $this->preURL);
             $tpl->setVars("LINK", "TEXT", $dayOfMonth);
             if (isset($this->extraURL)) {
                 $tpl->setVars("LINK", "EXTRA", $this->extraURL);
                 $tpl->setVars("LINK", "DATE", $dayOfMonth . "/" . $this->month . "/" . $this->year);
                 //Anywhere in the link, DATE var is replaced
                 $tpl->setVars("LINK", "FUID", $this->FUID);
                 //Anywhere in the link, DATE var is replaced
             }
             $dayTD = $tpl->parseBlock("LINK");
         } else {
             $dayTD = $dayOfMonth;
         }
         if (DateTools::isToday($this->month . "/" . $dayOfMonth . "/" . $this->year)) {
             $tpl->setVars("TODAY", "DAY", $dayTD);
             $tpl->setVars("TODAY", "EVENTS", $this->BuildEventsForDay($this->month . "/" . $dayOfMonth . "/" . $this->year));
             $row .= $tpl->ParseBlock("TODAY");
         } else {
             $tpl->setVars("CALENDARCOL", "DAY", $dayTD);
             $tpl->setVars("CALENDARCOL", "EVENTS", $this->BuildEventsForDay($this->month . "/" . $dayOfMonth . "/" . $this->year));
             $row .= $tpl->ParseBlock("CALENDARCOL");
         }
         if ($dayOfWeek == 7 || $dayOfMonth == count($this->days)) {
             $tpl->setVars("CALENDARROW", "ROW", $row);
             $allRows .= $tpl->ParseBlock("CALENDARROW");
             $row = "";
         }
     }
     $this->addBrowseButtons($tpl);
     $tpl->setVars("CALENDAR", "ALLROWS", $allRows);
     return $tpl->ParseBlock("CALENDAR");
 }
Example #6
0
 public static function dateTimeField($name, $value = '', $htmlOptions = array())
 {
     $id = $htmlOptions['id'];
     $value = DateTools::dataFormat($value, 'd/m/Y H:i:s');
     $dataValue = $timeValue = '';
     if (!empty($value)) {
         $dataValue = substr($value, 0, 10);
         $timeValue = substr($value, 11);
     }
     //Javascript necessário
     $jsFuncChange = "function changeValues( data, time, dataTime ){ " . "var valor = jQuery(data).val()+' '+jQuery(time).val(); " . "jQuery(dataTime).val( valor ); }";
     Yii::app()->clientScript->registerScript('funcDateTimeField', $jsFuncChange, CClientScript::POS_HEAD);
     $idData = $id . '_dataField';
     $idTime = $id . '_timeField';
     $jsChange = "changeValues('#{$idData}','#{$idTime}','#{$id}');";
     $out = MyHtml::datepickerField('', $dataValue, array_merge($htmlOptions, array('id' => $idData, 'name' => '', 'onchange' => $jsChange)));
     $out .= MyHtml::timeField('', $timeValue, array_merge($htmlOptions, array('id' => $idTime, 'name' => '', 'onchange' => $jsChange)));
     $out .= MyHtml::hiddenField($name, $value);
     return self::tag('div', array('class' => 'dateTimeField'), $out);
 }
Example #7
0
function Index_0(&$base, &$cache, &$cl, &$params, &$profiler, &$route, &$user_class, &$user_method)
{
    $router = null;
    if (system_base_Router::$instance === null) {
        system_base_Router::$instance = new system_base_Router();
    }
    $router = system_base_Router::$instance;
    $hash = $router->query_hash;
    $fullpath = _hx_string_or_null(system_base_Wet_base::$cache_path) . _hx_string_or_null($hash) . ".htm";
    if (!file_exists($fullpath)) {
        return false;
    } else {
        $r_query = $router->query_string;
        $fin = sys_io_File::read($fullpath, false);
        $query = $fin->readLine();
        if ($r_query === $query) {
            $etag = null;
            if (file_exists($fullpath)) {
                $stats = sys_FileSystem::stat($fullpath);
                $etag = _hx_string_or_null(StringTools::hex($stats->size, null)) . "-" . _hx_string_or_null(StringTools::hex($stats->ino, null)) . "-" . _hx_string_or_null(_hx_string_call(_hx_string_call($stats->mtime, "toString", array()), "substr", array(17, 2)));
            } else {
                $etag = "";
            }
            if (php_Web::getClientHeader("If-none-match") === $etag) {
                php_Web::setReturnCode(304);
                $fin->close();
                return true;
            } else {
                while (!system_base_Cache::$cookie_buffer->isEmpty()) {
                    system_base_Wet_base::send_cookie(system_base_Cache::$cookie_buffer->pop());
                }
                header("X-Powered-By" . ": " . "Webrathea/0.4 (PHP)");
                $value = DateTools::format(Date::now(), "%a, %d %b %Y %X %Z");
                header("Date" . ": " . _hx_string_or_null($value));
                header("X-Frame-Options" . ": " . "sameorigin");
                header("X-XSS-Protection" . ": " . "1; mode=block");
                php_Web::setReturnCode(200);
                $value1 = Std::string(sys_FileSystem::stat($fullpath)->size);
                header("Content-Length" . ": " . _hx_string_or_null($value1));
                header("ETag" . ": " . _hx_string_or_null($etag));
                $m = null;
                $pos = strlen($query);
                $fin1 = sys_io_File::read($fullpath, false);
                $size = sys_FileSystem::stat($fullpath)->size;
                $fin1->seek($pos, sys_io_FileSeek::$SeekBegin);
                $output = $fin1->readString($size - $pos);
                $fin1->close();
                $m = $output;
                $message = null;
                $message = Std::string($m);
                haxe_Log::trace("DEPRECATED FUNCTION: " . _hx_string_or_null($message), _hx_anonymous(array("fileName" => "Base.hx", "lineNumber" => 449, "className" => "system.base.Wet_base", "methodName" => "echo")));
                $fin->close();
                return true;
            }
            unset($etag);
        } else {
            $fin->close();
            return false;
        }
        unset($r_query, $query, $fin);
    }
    unset($router, $hash, $fullpath);
}
Example #8
0
 static function formatDbDate($data)
 {
     return DateTools::formatDbDate($data);
 }
Example #9
0
 static function send_basic_headers($return_code)
 {
     while (!system_base_Cache::$cookie_buffer->isEmpty()) {
         system_base_Wet_base::send_cookie(system_base_Cache::$cookie_buffer->pop());
     }
     header("X-Powered-By" . ": " . "Webrathea/0.4 (PHP)");
     $value = DateTools::format(Date::now(), "%a, %d %b %Y %X %Z");
     header("Date" . ": " . _hx_string_or_null($value));
     header("X-Frame-Options" . ": " . "sameorigin");
     header("X-XSS-Protection" . ": " . "1; mode=block");
     php_Web::setReturnCode($return_code);
 }