Beispiel #1
0
 protected static function TraceTabulation()
 {
     $tab = self::getTime(DateTime::now()) . " Trace : ";
     $txt = "";
     for ($i = 0; $i < Strings::lenght($tab); $i++) {
         $txt .= " ";
     }
     return $txt . " ";
 }
Beispiel #2
0
 public function edit()
 {
     $sql = "update " . $this->DBtable . " set ";
     //
     $data = $this->getData();
     //
     $i = 0;
     //
     foreach ($data as $key => $value) {
         if ($i == 0) {
             $sql .= "{$key}='{$value}'";
         } else {
             $sql .= ",{$key}='{$value}'";
         }
         $i++;
     }
     if ($this->isMaj) {
         if ($i == 0) {
             $sql .= "edited_at='" . Time::now() . "'";
         } else {
             $sql .= ",edited_at='" . Time::now() . "'";
         }
     }
     //
     $key = $this->getPKvalue();
     $sql .= " where " . $this->primaryKey . "='" . $key . "'";
     //
     return Database::exec($sql);
 }
Beispiel #3
0
 /**
  * time call
  */
 public static function timeCall()
 {
     require self::$root . 'vendor/fiesta/kernel/Objects/DateTime.php';
     DateTime::setTimezone();
 }
Beispiel #4
0
 public static function create()
 {
     $time = Time::now();
     $name = $_POST['link_name'];
     if (empty($name)) {
         $name = $time;
     }
     //
     $Root = "../";
     if (!file_exists($Root . "app/links/" . $name . ".php")) {
         $myfile = fopen($Root . "app/links/" . $name . ".php", "w");
         $txt = self::set($name);
         fwrite($myfile, $txt);
         fclose($myfile);
         //
         echo "Le fichier link a été creé";
     } else {
         echo "Le fichier deja existe";
     }
 }
Beispiel #5
0
/**
 * Time
 */
function now()
{
    return DateTime::now();
}