Exemplo n.º 1
0
function getMenu()
{
    $queryresult = getDbArray("SELECT * FROM `meal`");
    $newresult = array();
    //gruppieren des Arrays nach caterer
    foreach ($queryresult as $result) {
        $caterer_id = $result["caterer_id"];
        $index_caterer = FALSE;
        for ($i = 0; $i < count($newresult); $i++) {
            if ($newresult[$i][0] == $caterer_id) {
                $index_caterer = $i;
                break;
            }
        }
        if ($index_caterer === FALSE) {
            $newresult[] = array($caterer_id);
            $index_caterer = count($newresult) - 1;
        }
        $newresult[$index_caterer][] = array($result["meal_name"], $result["meal_price"], $result["idmeal"]);
    }
    //kodieren in UTF8
    $newresult = utf8($newresult);
    return $newresult;
}
Exemplo n.º 2
0
?>
 | `U+1F601` | GRINNING FACE WITH SMILING EYES            |
| `:')`                                         | <?php 
echo utf8(0x1f602);
?>
 | `U+1F602` | FACE WITH TEARS OF JOY                     |
| `:-/` or `:/`                                 | <?php 
echo utf8(0x1f612);
?>
 | `U+1F612` | UNAMUSED FACE                              |
| <code>:-&#124;</code> or <code>:&#124;</code> | <?php 
echo utf8(0x1f614);
?>
 | `U+1F614` | PENSIVE FACE                               |
| `*_*`                                         | <?php 
echo utf8(0x1f60d);
?>
 | `U+1F60D` | SMILING FACE WITH HEART-SHAPED EYES        |

## License

```
Copyright (c) delight.im <*****@*****.**>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
Exemplo n.º 3
0
function print_char($c)
{
    print "    ";
    for ($i = 0; $i < func_num_args(); $i++) {
        if ($i > 0) {
            print ", ";
        }
        $c = func_get_arg($i);
        print "0x" . dechex($c);
        if ($c >= 32) {
            print " '" . utf8($c) . "'";
        }
    }
    print "\n";
}
Exemplo n.º 4
0
	$fnom_transmis = $tab_file['name'];
	$fnom_serveur = $tab_file['tmp_name'];
	$ftaille = $tab_file['size'];
	$ferreur = $tab_file['error'];
	if( (!file_exists($fnom_serveur)) || (!$ftaille) || ($ferreur) )
	{
		require_once('./_inc/fonction_infos_serveur.php');
		exit('Erreur : problème de transfert ! Fichier trop lourd ? min(memory_limit,post_max_size,upload_max_filesize)='.minimum_limitations_upload());
	}
	$extension = strtolower(pathinfo($fnom_transmis,PATHINFO_EXTENSION));
	if(!in_array($extension,array('txt','csv')))
	{
		exit('Erreur : l\'extension du fichier transmis est incorrecte !');
	}
	$contenu_csv = file_get_contents($fnom_serveur);
	$contenu_csv = utf8($contenu_csv); // Mettre en UTF-8 si besoin
	$tab_lignes = extraire_lignes($contenu_csv); // Extraire les lignes du fichier
	$separateur = extraire_separateur_csv($tab_lignes[0]); // Déterminer la nature du séparateur
	// Pas de ligne d'en-tête à supprimer
	// Mémoriser les eleve_id de la 1ère ligne
	$tab_eleve = array();
	$tab_elements = explode($separateur,$tab_lignes[0]);
	unset($tab_elements[0]);
	foreach ($tab_elements as $num_colonne => $element_contenu)
	{
		$eleve_id = clean_entier($element_contenu);
		if($eleve_id)
		{
			$tab_eleve[$num_colonne] = $eleve_id ;
		}
	}
Exemplo n.º 5
0
function funGetValoresDeOpciones()
{
    $u = "";
    $query2 = mysql_query("select id_val_op, descripcion from valor_opcion") or die(mysql_error());
    $json = array(array());
    $indice = 0;
    while ($row = mysql_fetch_assoc($query2)) {
        $u = $u . $row['id_val_op'] . "=>" . $row['descripcion'] . "=>";
        $json[$indice] = array('id_valor' => $row['id_val_op'], 'descripcion' => utf8($row['descripcion']));
        $indice = $indice + 1;
    }
    return tojson($json, 2);
}
Exemplo n.º 6
0
 public function getTitleAttribute()
 {
     return utf8(Cache::get('CrawledContent-' . $this->id . '-title', array_get($this->attributes, 'title', '')));
 }
    $studiengang_kz = $_GET['studiengang_kz'];
}
if ($studiengang_kz == 'undefined') {
    $studiengang_kz = '';
}
$person_id = isset($_REQUEST['person_id']) ? $_REQUEST['person_id'] : '';
$ueberschreiben = isset($_REQUEST['ueberschreiben']) ? $_REQUEST['ueberschreiben'] : '';
$studiensemester_kurzbz = isset($_REQUEST['studiensemester_kurzbz']) ? $_REQUEST['studiensemester_kurzbz'] : '';
$ausbildungssemester = isset($_REQUEST['ausbildungssemester']) ? $_REQUEST['ausbildungssemester'] : '0';
$incoming = isset($_REQUEST['incoming']) ? true : false;
$orgform_kurzbz = isset($_REQUEST['orgform_kurzbz']) ? $_REQUEST['orgform_kurzbz'] : '';
$studienplan_id = isset($_REQUEST['studienplan_id']) ? $_REQUEST['studienplan_id'] : '';
//end Parameter
$geburtsdatum_error = false;
$ausbildungsart = utf8($ausbildungsart);
$anmerkungen = utf8($anmerkungen);
// ****
// * Generiert die Matrikelnummer
// * FORMAT: 0710254001
// * 07 = Jahr
// * 1/2/0  = WS/SS/incoming
// * 0254 = Studiengangskennzahl vierstellig
// * 001 = Laufende Nummer
// ****
function generateMatrikelnummer($studiengang_kz, $studiensemester_kurzbz)
{
    $db = new basis_db();
    $jahr = mb_substr($studiensemester_kurzbz, 4);
    $sem = mb_substr($studiensemester_kurzbz, 0, 2);
    if ($sem == 'SS') {
        $jahr = $jahr - 1;
Exemplo n.º 8
0
 function dir2Array($directory, $prevDir = '', $level = 0)
 {
     $array_items = array();
     if ($dh = @opendir($directory)) {
         while (false !== ($file = readdir($dh))) {
             if ($level <= $this->maxMenuLevel && !in_array($file, $this->ignore) && is_dir($directory . '/' . $file) && $file[0] != '.') {
                 $array_items = array_merge($array_items, $this->dir2Array($directory . '/' . $file, $file, $level + 1));
                 $array_items[] = array('parent' => $prevDir, 'id' => utf8($file));
             }
         }
         closedir($dh);
     }
     return inflate($array_items);
 }
Exemplo n.º 9
0
 /**
  * Execute action when called for explicitly by the user
  * @return void
  */
 function run()
 {
     global $USER, $CONFIG, $Templates, $Controller;
     /**
      * User input types
      */
     $_REQUEST->setType('w', 'numeric');
     $_REQUEST->setType('h', 'numeric');
     $_REQUEST->setType('mw', 'numeric');
     $_REQUEST->setType('mh', 'numeric');
     $_REQUEST->setType('ok', 'string');
     $_REQUEST->setType('to', 'numeric');
     $_REQUEST->setType('fcontent', 'any');
     $_REQUEST->setType('action', 'string');
     $_REQUEST->setType('imgrot', 'numeric');
     $_REQUEST->setType('rot', 'numeric');
     if (@filesize($this->path)) {
         if ($this->may($USER, READ)) {
             switch ($_REQUEST['action']) {
                 case 'edit':
                     if ($this->may($USER, EDIT)) {
                         if (in_array($this->extension, $CONFIG->extensions->plaintext)) {
                             /**
                              * Save changes
                              */
                             if ($_REQUEST['editFile']) {
                                 file_put_contents($p, mb_detect_encoding(file_get_contents($p)) == "UTF-8" ? utf8($_REQUEST['fcontent']) : deutf8($_REQUEST['fcontent']));
                                 if ($_REQUEST['mkcopy']) {
                                     redirect(array('id' => $copy->ID, 'action' => 'edit', 'ok' => 'true'));
                                 }
                             }
                             /**
                              * Display page for editing plain text documents
                              */
                             $tmp = new TextArea(__('File contents'), 'fcontent', utf8(file_get_contents($this->path)));
                             $tmp->class = 'large';
                             $formfields[] = $tmp;
                             unset($tmp);
                         }
                         $formfields[] = new Checkbox(__('Save as copy'), 'mkcopy', $_REQUEST['mkcopy']);
                         $nav = '<div class="nav"><a href="' . url(array('id' => $this->DirID)) . '">' . icon('small/arrow_left') . __('Back') . '</a></div>';
                         $this->content = array('header' => __('Editing file') . ': ' . $this->basename, 'main' => $nav . $form->collection(new Set($formfields)));
                         $t = 'admin';
                         if ($_REQUEST['popup']) {
                             $t = 'popup';
                         }
                         $Templates->{$t}->render();
                     } else {
                         errorPage(401);
                     }
                     break;
                 case 'download':
                 default:
                     if (strpos($this->path, $this->rootDir()) === 0) {
                         $p = $this->path;
                         $n = $this->basename;
                         if (isImage($this->path) && ($_REQUEST['w'] || $_REQUEST['h'] || $_REQUEST['mw'] || $_REQUEST['mh'] || isset($_REQUEST['tr']) || isset($_REQUEST['tg']) || isset($_REQUEST['tb']) || isset($_REQUEST['rot'])) && function_exists("gd_info")) {
                             $s = getimagesize($this->path);
                             // s(1) / s(0) = h / w
                             if ($_REQUEST['mw'] && $s[0] > $_REQUEST['mw']) {
                                 $_REQUEST['h'] = round($s[1] * $_REQUEST['mw'] / $s[0]);
                                 $_REQUEST['w'] = round($_REQUEST['mw']);
                             }
                             if ($_REQUEST['mh'] && $s[1] > $_REQUEST['mh']) {
                                 $_REQUEST['w'] = round($s[0] * $_REQUEST['mh'] / $s[1]);
                                 $_REQUEST['h'] = round($_REQUEST['mh']);
                             }
                             $p = $this->getConvertedImage($_REQUEST['w'], $_REQUEST['h'], $_REQUEST['rot'], $_REQUEST['tr'], $_REQUEST['tg'], $_REQUEST['tb'], false);
                             $n = pathinfo($p, PATHINFO_BASENAME);
                         }
                         $this->stream($p);
                     }
             }
         } else {
             while (ob_get_level()) {
                 @ob_end_clean();
             }
             die;
         }
     }
 }
Exemplo n.º 10
0
         clientBalansUpdate($z['client_id']);
         clientBalansUpdate($client_id);
     }
     $changes = _historyChange('Клиент', $z['client_id'], $client_id, _clientVal($z['client_id'], 'go'), _clientVal($client_id, 'go')) . _historyChange('Название', $z['name'], $name) . _historyChange('Описание', $z['about'], $about) . _historyChange('Количество', $z['count'], $count) . _historyChange('Адрес', $z['adres'], $adres) . _historyChange('Стоимость', _cena($z['pre_cost']), $pre_cost);
     if ($changes) {
         _history(array('type_id' => 72, 'client_id' => $z['client_id'], 'zayav_id' => $zayav_id, 'v1' => '<table>' . $changes . '</table>'));
     }
     jsonSuccess();
     break;
 case 'zayav_spisok':
     $_POST['find'] = win1251($_POST['find']);
     $data = zayav_spisok($_POST);
     if ($data['filter']['page'] == 1) {
         $send['all'] = utf8($data['result']);
     }
     $send['spisok'] = utf8($data['spisok']);
     jsonSuccess($send);
     break;
 case 'zayav_status':
     if (!($zayav_id = _num($_POST['zayav_id']))) {
         jsonError();
     }
     if (!($zayav_status = _num($_POST['status']))) {
         jsonError();
     }
     $sql = "SELECT * FROM `zayav` WHERE `ws_id`=" . WS_ID . " AND !`deleted` AND `id`=" . $zayav_id;
     if (!($z = query_assoc($sql))) {
         jsonError();
     }
     if ($z['status'] == $zayav_status) {
         jsonError();
function sql2csv($sql, $filename, $encode = "utf8")
{
    $res = $sql;
    $colnames = array();
    // get column captions and enclose them in doublequotes (")
    for ($i = 0; $i < $res->FieldCount(); $i++) {
        $fld = $res->FetchField($i);
        $colnames[] = '"' . $fld->name . '"';
    }
    // insert column captions at the beginning of .csv file
    //replace some colnames
    $CSV .= str_replace(array("tema_id", "cuando", "tema", "date_estado"), array("internal_term_id", "date", "term", "date_status"), implode(";", $colnames));
    // iterate through each row
    // replace single double-quotes with double double-quotes
    // and add values to .csv file contents
    if (SQLcount($res) > 0) {
        $CSV .= "\n";
        while ($array = $res->FetchRow()) {
            //for ($i = 0; $i < sizeof($row); $i++) {
            for ($i = 0; $i < $res->FieldCount(); $i++) {
                $array[$i] = '"' . str_replace('"', '""', $array[$i]) . '"';
                $CSV .= $array[$i] . ";";
            }
            /*
            		$CSV=substr($CSV,0,-1);
            */
            $CSV .= "\n";
            //$CSV .= "\n".implode(";", $array);
        }
    }
    // send output to browser as attachment (force to download file
    header('Expires: Mon, 1 Jan 1990 00:00:00 GMT');
    header('Last-Modified: ' . gmdate("D,d M Y H:i:s") . ' GMT');
    header('Pragma: no-cache');
    header('Content-type: text/csv;charset=latin1');
    header('Content-Disposition: attachment; filename=' . $filename);
    // print the final contents of .csv file
    print $encode == 'latin1' ? latin1($CSV) : utf8($CSV);
}