Exemple #1
0
 public function __construct($title, $msg)
 {
     $value = '';
     $sizes = exec("stty size");
     $size = explode(" ", $sizes);
     $this->max_width = $size[1];
     $this->max_height = $size[0];
     echo $this->windows($title, $msg);
     echo "[{$this->cursor_position_input[0]['y']};{$this->cursor_position_input[0]['x']}H";
     $read = new \Hoa\Console\Readline\Readline();
     $read->setAutocompleter(new \Hoa\Console\Readline\Autocompleter\Word(get_defined_functions()['internal']));
     $read->setAutocompleter(new \Hoa\Console\Readline\Autocompleter\Word(get_defined_functions()['internal']));
     $color = Color::setColor("grey", "red");
     // $line = $read->readLine($color);
     $line = fgets(STDIN);
     echo "";
     echo "";
     for ($i = 0; $i < $this->max_height; $i++) {
         echo Color::getColoredString(str_repeat(" ", $this->max_width), $this->color_shadow, $this->color_shadow);
         echo PHP_EOL;
     }
     echo "";
     return $value;
 }
 public function createOrganisation()
 {
     $this->view = false;
     $DB = $this->di['db']->sql(DB_DEFAULT);
     createOragnisation:
     $this->cadre("create oraganisation");
     do {
         $rl = new Hoa\Console\Readline\Readline();
         $oraganisation = $rl->readLine('Your Oraganisation : ');
     } while (strlen($oraganisation) < 3);
     $sql = "INSERT INTO client (`id`,`libelle`,`date`) VALUES (1,'" . $oraganisation . "', '" . date('Y-m-d H:i:s') . "')";
     $DB->sql_query($sql);
 }