Exemple #1
0
 public function testCheckLuhn()
 {
     $array = ["4111111111111111" => true];
     foreach ($array as $k => $v) {
         if ($v) {
             $this->assertTrue(std::checkLuhn($k));
         } else {
             $this->assertFalse(std::checkLuhn($k));
         }
     }
 }
Exemple #2
0
 /**
  * Convert a plain text to an HTML
  * text including french quotes.
  * 
  * @param string $texte plain text
  */
 public function frquotes($texte)
 {
     return "« " . std::html($texte) . " »";
 }
Exemple #3
0
 /**
  * 
  * @param unknown_type $data an array containing
  * 		the expected data to be displayed (in the HTML
  * 		format). If this variable is not an array, the row
  * 		is simply ignored.
  *
  * @return the row.
  */
 public function getRow($data)
 {
     $ret = '';
     if (is_array($data)) {
         $options = array();
         $rowstyle = '';
         if (isset($data['tr-style'])) {
             $rowstyle = $data["tr-style"];
             if (strlen($rowstyle) > 0) {
                 $options["style"] = $rowstyle;
             }
         }
         if (strlen($rowstyle) > 0) {
             $options["style"] = $rowstyle;
         }
         if (isset($data['tr-class'])) {
             $options['class'] = $data["tr-class"];
         }
         $ret .= std::tagln("tr", $options);
         foreach ($this->headers as $key => $value) {
             $opt = array();
             $val = @$data[$key];
             $style = '';
             if (isset($data["{$key}-style"])) {
                 $style = $data["{$key}-style"];
             }
             if (isset($data["{$key}-order"])) {
                 $opt['data-order'] = $data["{$key}-order"];
             }
             if ($style || $rowstyle) {
                 $opt["style"] = $style . $rowstyle;
             }
             if ($this->columns[$key]['plain']) {
                 $val = std::html($val);
             }
             $ret .= "  " . std::tag("td", $opt) . $val . std::tagln("/td");
         }
         $ret .= std::tagln("/tr");
     }
     return $ret;
 }
Exemple #4
0
<?php

require_once 'config.inc.php';
std::prt('Hello world');