Example #1
0
 protected static function TraceTabulation()
 {
     $tab = self::getTime(DateTime::now()) . " Trace : ";
     $txt = "";
     for ($i = 0; $i < Strings::lenght($tab); $i++) {
         $txt .= " ";
     }
     return $txt . " ";
 }
Example #2
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";
     }
 }
Example #3
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);
 }
Example #4
0
/**
 * Time
 */
function now()
{
    return DateTime::now();
}