Exemplo n.º 1
0
 private function getParsedLog($value, $name, $log_class)
 {
     $msg = "[{$name}] " . gettype($value) . "(";
     if (is_array($value) || is_object($value)) {
         $msg .= count($value);
     } else {
         $msg .= strlen($value);
     }
     $msg .= ") " . getDateToPrint(mktime());
     return array($msg, $value, $log_class);
 }
Exemplo n.º 2
0
 /**
  * adds msg to static logs in this class
  * @param string $msg
  */
 public static function addFileLog($msg)
 {
     $time = microtimeFloat() - cLogsDb::$startLogs;
     cLogsDb::$aDbFileLogs[] = getDateToPrint(mktime(), "m-d-Y H:i:s") . " + {$time}\n\t" . $msg . "\n";
     //$this->addLog($msg,"MYSQL ERROR", "_dbLog _error");
 }
Exemplo n.º 3
0
/**
 * covert timestamp from DB to format to print out
 * @param string $date - format of timestamp in DB (2010-07-06 18:11:48) 
 * @param string $sDparts[optional] - pattern how to convert the date; <br>
 * 			default depends on LNG and fce getDateToPrint()
 * @return string - formated value by fce date()
 */
function getDateToPrintFromDb($date, $sDparts = "")
{
    $date = getMktimeCustom($date);
    return getDateToPrint($date, $sDparts);
}
Exemplo n.º 4
0
 private function setData($array = null)
 {
     if (is_array($array)) {
         $this->data = tpl_main::parseArrayToObject($array);
         /// defaultni nastaveni dat ///
     } else {
         $this->data = new stdClass();
         $this->data->datum_vystaveni = getDateToPrint(mktime(), "j.n.Y");
         $this->data->splatnost = 0;
         /// pocet dnu
         $this->data->datum_splatnosti = getDateToPrint(mktime() + $this->data->splatnost * 24 * 60 * 60, "j.n.Y");
         $this->data->typ_faktury = CD_FAKT_TYP_POL;
     }
     if ($this->CFG->isAuthenticated()) {
         $this->data->dod_id = $this->CFG->getActiveDodId();
         $this->addVar($this->CFG->getUserData('dodavatele'), 'dodavatele');
         $aOdb = self::getOdberatel(null, $this->CFG->getUseraccountId());
         $od = array();
         foreach ($aOdb as $odb) {
             $od[$odb['id']] = $odb;
         }
         $this->addVar($od, 'odberatele');
     }
 }