Пример #1
0
function get_group($pid, $depth)
{
    $q = "\n\t\t\tselect\t\tA._profile_id\n\t\t\t,\t\t\tA.id\n\t\t\t,\t\t\tA.pid\n\t\t\t,\t\t\tA.name\n\t\t\t,\t\t\tA.name\t\tas text\n\t\t\tfrom\t\t_group\t\tA\n\t\t\twhere\t\tA._profile_id\t= ?\n\t\t\tand\t\t\tA.pid\t\t\t= ?\n\t\t\torder by\tA.id\n\t\t";
    $ps = Jaring::$_db->prepare($q);
    $ps->execute(array(Jaring::$_c_profile_id, $pid));
    $rs = $ps->fetchAll(PDO::FETCH_ASSOC);
    $ps->closeCursor();
    $index = 0;
    foreach ($rs as &$m) {
        $id = $m["id"];
        if ($index === 0) {
            $m["isFirst"] = true;
        } else {
            $m["isFirst"] = false;
        }
        $m["iconCls"] = "group";
        $m["index"] = $index++;
        $m["depth"] = $depth;
        $c = get_group($id, $depth + 1);
        if (count($c) <= 0) {
            $m["leaf"] = true;
        } else {
            $m["children"] = $c;
            $m["expandable"] = true;
            $m["expanded"] = true;
            $m["loaded"] = true;
        }
    }
    return $rs;
}
 /**
  * @param string $postId Id del post donde se encuentrael grupo.
  * @param string $groupName nombre del grupo declarado en magic fields.
  * @param array $memberMappings un array que mapea cómo construir el objeto a partir de los campos declarados en el grupo de magic fields.
  *          Tal mapeo debe seguir ésta estructura:
  *			"key" : string Nombre que será usado en la llave del objeto creado de cada campo.
  *			"value" : string|closure Si es un string, el valor para ese campo será el primer elemento del array de campos cuyo nombre coincida con éste valor. Si ningún campo magic-fields tiene dicho nombre, un string vacío será asignado como value.
  *                  El value también puede ser una función anónima, usada para campos con estructuras más complejas, como "image_media".
  *                  Tal función anónima deberá aceptar un parametro llamado (preferentemente) $group al cuál le será pasado el grupo tal
  *                  cuál es devuelto por majic fields, y como tal contendrá todos los campos del grupo, de modo que puedas aplicar lógica más completa para
  *                  seleccionar el valor que se desea asignar a ese miembro del objeto. Ésta función anónima debe regresar el elemento a ser usado como value.
  *
  * Ejemplo
  *
  * Un código como éste:
  * <code>
  *      $data = get_group( 'info_instagram', $this->ID );
  *      $instagramTitulo = isset( $data['info_instagram_titulo'] ) ? $data['info_instagram_titulo'] : false;
  *      $instagramDescripcion = isset( $data['info_instagram_descripcion'] )	? $data['info_instagram_descripcion'] : false;
  *      $instagramFoto = isset( $data['info_instagram_foto'] )	? $data['info_instagram_foto'] : false;
  * </code>
  *
  * Puede ser convertido en éste más sencillo:
  * <code>
  *      $instagramData = Producto::magic_fields_get_group_as_single(
  *          $this->ID,
  *          'info_instagram',
  *          array(
  *              'titulo' => 'info_instagram_titulo',
  *              'descripcion' => 'info_instagram_descripcion',
  *              'foto' => function($elements){return isset($elements['info_instagram_foto']) ? reset($elements['info_instagram_foto'])['original'] : "";},
  *          )
  *      );
  * </code>
  *
  * @return array El array de objetos construidos en base a las reglas especificadas en $memberMappings. Si no se encontró ningún grupo, será devuelto un array vacío.
  */
 public static function get_group_as_array($postId, $groupName, $memberMappings)
 {
     /**
      * The array of groups as returned by magic fields.
      */
     $groups = get_group($groupName, $postId);
     if (!$groups) {
         return array();
     }
     /**
      * The formatted magic fields' group formatted by the rules of $memberMappings.
      */
     $formatedGroup = array();
     foreach ($groups as $group) {
         $members = array();
         foreach ($memberMappings as $memberName => $memberValue) {
             if (is_string($memberValue)) {
                 $members[$memberName] = isset($group[$memberValue]) ? reset($group[$memberValue]) : "";
             } else {
                 $members[$memberName] = $memberValue($group);
             }
         }
         $formatedGroup[] = $members;
     }
     return $formatedGroup;
 }
 function __construct($id)
 {
     $info = get_group("info", $id);
     $info = reset($info);
     $this->nombre = get_the_title($id);
     $this->email = reset($info["info_email"]);
     $this->ciudad = reset($info["info_ciudad"]);
     $this->web = reset($info["info_pagina_web"]);
     $this->descripcion = reset($info["info_descripcion"]);
     $this->imagen = reset($info["info_foto"])["original"];
     $this->telefono = reset($info["info_telefono"]);
     $this->telefonoClean = preg_replace("/[^0-9]/", "", $this->telefono);
 }
Пример #4
0
function get_project($project_code)
{
    global $g4;
    $sql = " select wr_id,wr_subject,wr_datetime,wr_1,wr_2,wr_3,wr_5 from g4_write_i01_project where wr_1 = '{$project_code}' ";
    //원본
    $result = sql_fetch($sql);
    $group = get_group($project_code);
    if ($group['gr_id']) {
        $result['group'] = $group;
    } else {
        $result['group'] = "그룹이존재하지않는다";
    }
    return $result;
}
 /**  @inheritdoc */
 public function getPropertyValue(&$wpPost, &$wpPostMeta)
 {
     $rawGroups = get_group($this->magicFieldId, $wpPost->ID);
     $groups = array();
     foreach ($rawGroups as $rawGroupKey => $rawGroup) {
         $group = new \stdClass();
         foreach ($this->subFields as $subPropertyBuilder) {
             if (!$subPropertyBuilder instanceof MFMember) {
                 throw new \Exception("Only instances that inherit from 'MFMember' are allowed to build a 'MFGroup'.");
             }
             $group->{$subPropertyBuilder->getPropertyName()} = $subPropertyBuilder->getPropertyValueFromContext($rawGroup);
         }
         $groups[] = $group;
     }
     return $this->isDuplicableGroup ? $groups : reset($groups);
 }
 function __construct($id)
 {
     $this->nombre = get_the_title($id);
     $info = get_group("info", $id);
     $info = reset($info);
     $this->emails = $info["info_emails"];
     $this->email = $this->emails ? reset($this->emails) : "";
     $this->direccion = reset($info["info_direccion"]);
     $this->ciudad = reset($info["info_ciudad"]);
     $this->web = reset($info["info_web"]);
     $this->descripcion = reset($info["info_descripcion"]);
     $this->imagen = reset($info["info_imagen"])["original"];
     $this->telefonos = $info["info_telefonos"];
     $this->telefono = $this->telefonos ? reset($this->telefonos) : "";
     $this->telefonoClean = preg_replace("/[^0-9]/", "", $this->telefono);
     $this->EsPersona = isset($info['info_persona_fisica']) ? reset($info['info_persona_fisica']) == 1 : false;
     $this->fundacionCategories = get_the_terms($id, Fundacion::CategoriaFundacionTaxName);
 }
Пример #7
0
 private function set_playlist()
 {
     $grupo = get_group('playlists', $this->ID);
     if (!$grupo) {
         return;
     }
     $format_grupo = array();
     foreach ($grupo as $g) {
         if (!isset($g['playlists_spotify_uri']) || !isset($g['playlists_imagen']) || !isset($g['playlists_titulo'])) {
             continue;
         }
         if (empty($g['playlists_spotify_uri']) || empty($g['playlists_imagen']) || empty($g['playlists_titulo'])) {
             continue;
         }
         $format_grupo[] = array('uri' => reset($g['playlists_spotify_uri']), 'img' => reset($g['playlists_imagen']), 'title' => reset($g['playlists_titulo']));
     }
     return $format_grupo;
 }
 /**  @inheritdoc */
 public function getPropertyValue(&$wpPost, &$wpPostMeta)
 {
     $group = get_group($this->magicFieldGroup, $wpPost->ID);
     if (!is_array($group)) {
         return null;
     }
     // El get group siempre devuelve un array. Mas esta clase, trata con grupos no duplicables.
     // El grupo es el que no es duplicable, mas sus fields son los que son duplicables.
     $group = reset($group);
     if (!isset($group[$this->magicFieldId])) {
         return null;
     }
     $results = $group[$this->magicFieldId];
     foreach ($results as $resultKey => $result) {
         $results[$resultKey] = $this->getProcessedValue($result);
     }
     // The MF core returns an object for arrays counting from 1. We find more useful to cast it into an array
     // starting with zero, so we use this function to force cast the MF fashion to an array fashion value.
     return array_values($results);
 }
Пример #9
0
<?php

require_once '_header.php';
$s = supporter_array_db($_REQUEST['supporter_KEY']);
$g = get_group($_REQUEST['groups_KEY']);
?>
<h1>Call</h1>
<div class="row">
	<h3>Instructions</h3>
	<p><?php 
echo nl2br($g['Description']);
?>
</p>
	
</div>

<div class="row">
	<div class="span5">
		<h2>
			<?php 
echo $s['First_Name'];
?>
  <?php 
echo $s['Last_Name'];
?>
<br>
			<?php 
echo $s['Phone'];
?>
  <?php 
echo $s['Timezone'];
Пример #10
0
<?php

get_header();
?>
	
    <div class="content_wrapper clear">
		<section role="main" class="main">
        <?php 
//Get post thumbnail URL
$img = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'original');
// Set up Magic Fields
$sub_title = get_field('title');
$sub_content = get_field('sub_content');
$obsessions = get_group('obsessions');
$read = get_field('read');
$linkedin = get_field('linked_in_url');
$music = get_field('music');
$email = get_field('email');
$quote = get_field('quote');
$manifesto = get_field('manifesto');
//Extract First Name
$name = get_the_title();
$names = explode(' ', $name);
?>
        <?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
        	<img src="<?php 
        echo $img[0];
Пример #11
0
     $repertoire = 'eleves';
     $requete_trombi = "SELECT e.login, e.nom, e.prenom, e.elenoet, jec.login, jec.id_classe, jec.periode, c.classe, c.id, c.nom_complet\n\t\t\t\t\t\t\t\tFROM " . $prefix_base . "eleves e, " . $prefix_base . "j_eleves_classes jec, " . $prefix_base . "classes c\n\t\t\t\t\t\t\t\tWHERE e.login = jec.login\n\t\t\t\t\t\t\t\tAND jec.id_classe = c.id\n\t\t\t\t\t\t\t\tAND id = '" . $classe . "'\n\t\t\t\t\t\t\t\tAND (e.date_sortie is NULL OR e.date_sortie NOT LIKE '20%')\n\t\t\t\t\t\t\t\tGROUP BY nom, prenom";
 }
 if ($action_affiche === 'aid') {
     echo "AID : " . $donnees_qui['nom'];
     $repertoire = 'eleves';
     if (isset($_POST['order_by']) && $_POST['order_by'] == 'classe') {
         $grp_order_by = "c.classe, e.nom, e.prenom";
         $requete_trombi = "SELECT e.login , e.nom, e.prenom , e.elenoet , a.id , a.nom nom_complet\n\t\t\t\t\t\t\t\t\tFROM eleves e, aid a, j_aid_eleves j , j_eleves_classes jec , classes c\n\t\t\t\t\t\t\t\t\tWHERE j.login = e.login\n\t\t\t\t\t\t\t\t\tAND  e.login = jec.login\n\t\t\t\t\t\t\t\t\tAND jec.id_classe = c.id\n\t\t\t\t\t\t\t\t\tAND j.id_aid = a.id\n\t\t\t\t\t\t\t\t\tAND a.id = '" . $aid . "'\n\t\t\t\t\t\t\t\t\tAND (e.date_sortie is NULL OR e.date_sortie NOT LIKE '20%')\n\t\t\t\t\t\t\t\t\tGROUP BY e.login , e.nom , e.prenom\n\t\t\t\t\t\t\t\t\tORDER BY {$grp_order_by};";
     } else {
         $grp_order_by = "e.nom, e.prenom";
         $requete_trombi = "SELECT e.login, e.nom, e.prenom, e.elenoet, a.id, a.nom nom_complet\n\t\t\t\t\t\t\t\t\tFROM eleves e , aid a , j_aid_eleves j , classes c\n\t\t\t\t\t\t\t\t\tWHERE j.login = e.login\n\t\t\t\t\t\t\t\t\tAND j.id_aid = a.id\n\t\t\t\t\t\t\t\t\tAND a.id = '" . $aid . "'\n\t\t\t\t\t\t\t\t\tAND (e.date_sortie is NULL OR e.date_sortie NOT LIKE '20%')\n\t\t\t\t\t\t\t\t\tGROUP BY e.nom, e.prenom\n\t\t\t\t\t\t\t\t\tORDER BY {$grp_order_by};";
     }
 }
 if ($action_affiche === 'groupe') {
     $current_group = get_group($groupe);
     echo "Groupe : " . htmlspecialchars($donnees_qui['name']) . " (<em>" . $current_group['classlist_string'] . "</em>)";
     $repertoire = 'eleves';
     if (isset($_POST['order_by']) && $_POST['order_by'] == 'classe') {
         $grp_order_by = "c.classe, e.nom, e.prenom";
         $requete_trombi = "SELECT jeg.login, jeg.id_groupe, jeg.periode, e.login, e.nom, e.prenom, e.elenoet, g.id, g.name, g.description\n\t\t\t\t\t\t\t\t\tFROM " . $prefix_base . "eleves e, " . $prefix_base . "groupes g, " . $prefix_base . "j_eleves_groupes jeg, " . $prefix_base . "j_eleves_classes jec, " . $prefix_base . "classes c\n\t\t\t\t\t\t\t\t\tWHERE jeg.login = e.login\n\t\t\t\t\t\t\t\t\tAND jec.login = e.login\n\t\t\t\t\t\t\t\t\tAND jec.id_classe=c.id\n\t\t\t\t\t\t\t\t\tAND jeg.id_groupe = g.id\n\t\t\t\t\t\t\t\t\tAND g.id = '" . $groupe . "'\n\t\t\t\t\t\t\t\t\tAND (e.date_sortie is NULL OR e.date_sortie NOT LIKE '20%')\n\t\t\t\t\t\t\t\t\tGROUP BY nom, prenom\n\t\t\t\t\t\t\t\t\tORDER BY {$grp_order_by};";
     } else {
         $grp_order_by = "nom, prenom";
         $requete_trombi = "SELECT jeg.login, jeg.id_groupe, jeg.periode, e.login, e.nom, e.prenom, e.elenoet, g.id, g.name, g.description\n\t\t\t\t\t\t\t\t\tFROM " . $prefix_base . "eleves e, " . $prefix_base . "groupes g, " . $prefix_base . "j_eleves_groupes jeg\n\t\t\t\t\t\t\t\t\tWHERE jeg.login = e.login\n\t\t\t\t\t\t\t\t\tAND jeg.id_groupe = g.id\n\t\t\t\t\t\t\t\t\tAND g.id = '" . $groupe . "'\n\t\t\t\t\t\t\t\t\tAND (e.date_sortie is NULL OR e.date_sortie NOT LIKE '20%')\n\t\t\t\t\t\t\t\t\tGROUP BY nom, prenom\n\t\t\t\t\t\t\t\t\tORDER BY {$grp_order_by};";
     }
     //echo "$requete_trombi<br />";
 }
 if ($action_affiche === 'equipepeda') {
     echo "Equipe pédagogique : " . $donnees_qui['nom_complet'] . " (<em>" . $donnees_qui['classe'] . "</em>)";
     $repertoire = 'personnels';
     $requete_trombi = 'SELECT * FROM ' . $prefix_base . 'utilisateurs u, ' . $prefix_base . 'j_groupes_professeurs jgp, ' . $prefix_base . 'j_groupes_classes jgc, ' . $prefix_base . 'classes c
Пример #12
0
echo home_url();
?>
" class="right">
                            <img src="<?php 
bloginfo('template_directory');
?>
/img/white-logo.svg" alt="Primitive Spark" />
                        </a>
                        
                    </header>
                    <article class="clear">
					<?php 
//Get post thumbnail URL
$img = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'original');
// Set up Magic Fields
$questions = get_group('questions');
//Add in an ID to the array
foreach ($questions as $key => $question) {
    $questions[$key]['id'] = $key;
}
//Shuffle up that array!!
shuffle($questions);
//print_r($questions);
//Question A
echo "<ul class='left question question-a'>";
foreach ($questions as $key => $question) {
    $style = 'display:none';
    //$qid = getQuestionID($question['questions_question_a_title'][1]);
    //$pid = getQuestionID($question['questions_question_b_title'][1]);
    $id = $question['id'];
    $title = $question['questions_question_a_title'][1];
Пример #13
0
function dir_list_form()
{
    global $fm_current_root, $current_dir, $quota_mb, $resolveIDs, $order_dir_list_by, $islinux, $cmd_name, $ip, $path_info, $fm_color;
    $ti = getmicrotime();
    clearstatcache();
    $out = "<table border=0 cellspacing=1 cellpadding=4 width=\"100%\" bgcolor=\"#eeeeee\">\n";
    if ($opdir = @opendir($current_dir)) {
        $has_files = false;
        $entry_count = 0;
        $total_size = 0;
        $entry_list = array();
        while ($file = readdir($opdir)) {
            if ($file != "." && $file != "..") {
                $entry_list[$entry_count]["size"] = 0;
                $entry_list[$entry_count]["sizet"] = 0;
                $entry_list[$entry_count]["type"] = "none";
                if (is_file($current_dir . $file)) {
                    $ext = lowercase(strrchr($file, "."));
                    $entry_list[$entry_count]["type"] = "file";
                    // Função filetype() returns only "file"...
                    $entry_list[$entry_count]["size"] = filesize($current_dir . $file);
                    $entry_list[$entry_count]["sizet"] = format_size($entry_list[$entry_count]["size"]);
                    if (strstr($ext, ".")) {
                        $entry_list[$entry_count]["ext"] = $ext;
                        $entry_list[$entry_count]["extt"] = $ext;
                    } else {
                        $entry_list[$entry_count]["ext"] = "";
                        $entry_list[$entry_count]["extt"] = "&nbsp;";
                    }
                    $has_files = true;
                } elseif (is_dir($current_dir . $file)) {
                    // Recursive directory size disabled
                    // $entry_list[$entry_count]["size"] = total_size($current_dir.$file);
                    $entry_list[$entry_count]["size"] = 0;
                    $entry_list[$entry_count]["sizet"] = "&nbsp;";
                    $entry_list[$entry_count]["type"] = "dir";
                }
                $entry_list[$entry_count]["name"] = $file;
                $entry_list[$entry_count]["date"] = date("Ymd", filemtime($current_dir . $file));
                $entry_list[$entry_count]["time"] = date("his", filemtime($current_dir . $file));
                $entry_list[$entry_count]["datet"] = date("d/m/y h:i", filemtime($current_dir . $file));
                if ($islinux && $resolveIDs) {
                    $entry_list[$entry_count]["p"] = show_perms(fileperms($current_dir . $file));
                    $entry_list[$entry_count]["u"] = get_user(fileowner($current_dir . $file));
                    $entry_list[$entry_count]["g"] = get_group(filegroup($current_dir . $file));
                } else {
                    $entry_list[$entry_count]["p"] = base_convert(fileperms($current_dir . $file), 10, 8);
                    $entry_list[$entry_count]["p"] = substr($entry_list[$entry_count]["p"], strlen($entry_list[$entry_count]["p"]) - 3);
                    $entry_list[$entry_count]["u"] = fileowner($current_dir . $file);
                    $entry_list[$entry_count]["g"] = filegroup($current_dir . $file);
                }
                $total_size += $entry_list[$entry_count]["size"];
                $entry_count++;
            }
        }
        @closedir($opdir);
        if ($entry_count) {
            $or1 = "1A";
            $or2 = "2D";
            $or3 = "3A";
            $or4 = "4A";
            $or5 = "5A";
            $or6 = "6D";
            $or7 = "7D";
            switch ($order_dir_list_by) {
                case "1A":
                    $entry_list = array_csort($entry_list, "type", SORT_STRING, SORT_ASC, "name", SORT_STRING, SORT_ASC);
                    $or1 = "1D";
                    break;
                case "1D":
                    $entry_list = array_csort($entry_list, "type", SORT_STRING, SORT_ASC, "name", SORT_STRING, SORT_DESC);
                    $or1 = "1A";
                    break;
                case "2A":
                    $entry_list = array_csort($entry_list, "type", SORT_STRING, SORT_ASC, "p", SORT_STRING, SORT_ASC, "g", SORT_STRING, SORT_ASC, "u", SORT_STRING, SORT_ASC);
                    $or2 = "2D";
                    break;
                case "2D":
                    $entry_list = array_csort($entry_list, "type", SORT_STRING, SORT_ASC, "p", SORT_STRING, SORT_DESC, "g", SORT_STRING, SORT_ASC, "u", SORT_STRING, SORT_ASC);
                    $or2 = "2A";
                    break;
                case "3A":
                    $entry_list = array_csort($entry_list, "type", SORT_STRING, SORT_ASC, "u", SORT_STRING, SORT_ASC, "g", SORT_STRING, SORT_ASC);
                    $or3 = "3D";
                    break;
                case "3D":
                    $entry_list = array_csort($entry_list, "type", SORT_STRING, SORT_ASC, "u", SORT_STRING, SORT_DESC, "g", SORT_STRING, SORT_ASC);
                    $or3 = "3A";
                    break;
                case "4A":
                    $entry_list = array_csort($entry_list, "type", SORT_STRING, SORT_ASC, "g", SORT_STRING, SORT_ASC, "u", SORT_STRING, SORT_DESC);
                    $or4 = "4D";
                    break;
                case "4D":
                    $entry_list = array_csort($entry_list, "type", SORT_STRING, SORT_ASC, "g", SORT_STRING, SORT_DESC, "u", SORT_STRING, SORT_DESC);
                    $or4 = "4A";
                    break;
                case "5A":
                    $entry_list = array_csort($entry_list, "type", SORT_STRING, SORT_ASC, "size", SORT_NUMERIC, SORT_ASC);
                    $or5 = "5D";
                    break;
                case "5D":
                    $entry_list = array_csort($entry_list, "type", SORT_STRING, SORT_ASC, "size", SORT_NUMERIC, SORT_DESC);
                    $or5 = "5A";
                    break;
                case "6A":
                    $entry_list = array_csort($entry_list, "type", SORT_STRING, SORT_ASC, "date", SORT_STRING, SORT_ASC, "time", SORT_STRING, SORT_ASC, "name", SORT_STRING, SORT_ASC);
                    $or6 = "6D";
                    break;
                case "6D":
                    $entry_list = array_csort($entry_list, "type", SORT_STRING, SORT_ASC, "date", SORT_STRING, SORT_DESC, "time", SORT_STRING, SORT_DESC, "name", SORT_STRING, SORT_ASC);
                    $or6 = "6A";
                    break;
                case "7A":
                    $entry_list = array_csort($entry_list, "type", SORT_STRING, SORT_ASC, "ext", SORT_STRING, SORT_ASC, "name", SORT_STRING, SORT_ASC);
                    $or7 = "7D";
                    break;
                case "7D":
                    $entry_list = array_csort($entry_list, "type", SORT_STRING, SORT_ASC, "ext", SORT_STRING, SORT_DESC, "name", SORT_STRING, SORT_ASC);
                    $or7 = "7A";
                    break;
            }
        }
        $out .= "\r\n        <script language=\"Javascript\" type=\"text/javascript\">\r\n        <!--\r\n        function go(arg) {\r\n            document.location.href='" . addslashes($path_info["basename"]) . "?frame=3&current_dir=" . addslashes($current_dir) . "'+arg+'/';\r\n        }\r\n        function resolveIDs() {\r\n            document.location.href='" . addslashes($path_info["basename"]) . "?frame=3&set_resolveIDs=1&current_dir=" . addslashes($current_dir) . "';\r\n        }\r\n        var entry_list = new Array();\r\n        // Custom object constructor\r\n        function entry(name, type, size, selected){\r\n            this.name = name;\r\n            this.type = type;\r\n            this.size = size;\r\n            this.selected = false;\r\n        }\r\n        // Declare entry_list for selection procedures";
        foreach ($entry_list as $i => $data) {
            $out .= "\nentry_list['entry{$i}'] = new entry('" . addslashes($data["name"]) . "', '" . $data["type"] . "', " . $data["size"] . ", false);";
        }
        $out .= "\r\n        // Select/Unselect Rows OnClick/OnMouseOver\r\n        var lastRows = new Array(null,null);\r\n        function selectEntry(Row, Action){\r\n            if (multipleSelection){\r\n                // Avoid repeated onmouseover events from same Row ( cell transition )\r\n                if (Row != lastRows[0]){\r\n                    if (Action == 'over') {\r\n                        if (entry_list[Row.id].selected){\r\n                            if (unselect(entry_list[Row.id])) {\r\n                                Row.className = 'entryUnselected';\r\n                            }\r\n                            // Change the last Row when you change the movement orientation\r\n                            if (lastRows[0] != null && lastRows[1] != null){\r\n                                var LastRowID = lastRows[0].id;\r\n                                if (Row.id == lastRows[1].id){\r\n                                    if (unselect(entry_list[LastRowID])) {\r\n                                        lastRows[0].className = 'entryUnselected';\r\n                                    }\r\n                                }\r\n                            }\r\n                        } else {\r\n                            if (select(entry_list[Row.id])){\r\n                                Row.className = 'entrySelected';\r\n                            }\r\n                            // Change the last Row when you change the movement orientation\r\n                            if (lastRows[0] != null && lastRows[1] != null){\r\n                                var LastRowID = lastRows[0].id;\r\n                                if (Row.id == lastRows[1].id){\r\n                                    if (select(entry_list[LastRowID])) {\r\n                                        lastRows[0].className = 'entrySelected';\r\n                                    }\r\n                                }\r\n                            }\r\n                        }\r\n                        lastRows[1] = lastRows[0];\r\n                        lastRows[0] = Row;\r\n                    }\r\n                }\r\n            } else {\r\n                if (Action == 'click') {\r\n                    var newClassName = null;\r\n                    if (entry_list[Row.id].selected){\r\n                        if (unselect(entry_list[Row.id])) newClassName = 'entryUnselected';\r\n                    } else {\r\n                        if (select(entry_list[Row.id])) newClassName = 'entrySelected';\r\n                    }\r\n                    if (newClassName) {\r\n                        lastRows[0] = lastRows[1] = Row;\r\n                        Row.className = newClassName;\r\n                    }\r\n                }\r\n            }\r\n            return true;\r\n        }\r\n        // Disable text selection and bind multiple selection flag\r\n        var multipleSelection = false;\r\n        if (is.ie) {\r\n            document.onselectstart=new Function('return false');\r\n            document.onmousedown=switch_flag_on;\r\n            document.onmouseup=switch_flag_off;\r\n            // Event mouseup is not generated over scrollbar.. curiously, mousedown is.. go figure.\r\n            window.onscroll=new Function('multipleSelection=false');\r\n            window.onresize=new Function('multipleSelection=false');\r\n        } else {\r\n            if (document.layers) window.captureEvents(Event.MOUSEDOWN);\r\n            if (document.layers) window.captureEvents(Event.MOUSEUP);\r\n            window.onmousedown=switch_flag_on;\r\n            window.onmouseup=switch_flag_off;\r\n        }\r\n        // Using same function and a ternary operator couses bug on double click\r\n        function switch_flag_on(e) {\r\n            if (is.ie){\r\n                multipleSelection = (event.button == 1);\r\n            } else {\r\n                multipleSelection = (e.which == 1);\r\n            }\r\n\t\t\tvar type = String(e.target.type);\r\n\t\t\treturn (type.indexOf('select') != -1 || type.indexOf('button') != -1 || type.indexOf('input') != -1 || type.indexOf('radio') != -1);\r\n        }\r\n        function switch_flag_off(e) {\r\n            if (is.ie){\r\n                multipleSelection = (event.button != 1);\r\n            } else {\r\n                multipleSelection = (e.which != 1);\r\n            }\r\n            lastRows[0] = lastRows[1] = null;\r\n            update_sel_status();\r\n            return false;\r\n        }\r\n        var total_dirs_selected = 0;\r\n        var total_files_selected = 0;\r\n        function unselect(Entry){\r\n            if (!Entry.selected) return false;\r\n            Entry.selected = false;\r\n            sel_totalsize -= Entry.size;\r\n            if (Entry.type == 'dir') total_dirs_selected--;\r\n            else total_files_selected--;\r\n            return true;\r\n        }\r\n        function select(Entry){\r\n            if(Entry.selected) return false;\r\n            Entry.selected = true;\r\n            sel_totalsize += Entry.size;\r\n            if(Entry.type == 'dir') total_dirs_selected++;\r\n            else total_files_selected++;\r\n            return true;\r\n        }\r\n        function is_anything_selected(){\r\n            var selected_dir_list = new Array();\r\n            var selected_file_list = new Array();\r\n            for(var x=0;x<" . (int) count($entry_list) . ";x++){\r\n                if(entry_list['entry'+x].selected){\r\n                    if(entry_list['entry'+x].type == 'dir') selected_dir_list.push(entry_list['entry'+x].name);\r\n                    else selected_file_list.push(entry_list['entry'+x].name);\r\n                }\r\n            }\r\n            document.form_action.selected_dir_list.value = selected_dir_list.join('<|*|>');\r\n            document.form_action.selected_file_list.value = selected_file_list.join('<|*|>');\r\n            return (total_dirs_selected>0 || total_files_selected>0);\r\n        }\r\n        function format_size (arg) {\r\n            var resul = '';\r\n            if (arg>0){\r\n                var j = 0;\r\n                var ext = new Array(' bytes',' Kb',' Mb',' Gb',' Tb');\r\n                while (arg >= Math.pow(1024,j)) ++j;\r\n                resul = (Math.round(arg/Math.pow(1024,j-1)*100)/100) + ext[j-1];\r\n            } else resul = 0;\r\n            return resul;\r\n        }\r\n        var sel_totalsize = 0;\r\n        function update_sel_status(){\r\n            var t = total_dirs_selected+' " . et('Dir_s') . " " . et('And') . " '+total_files_selected+' " . et('File_s') . " " . et('Selected_s') . " = '+format_size(sel_totalsize);\r\n            //document.getElementById(\"sel_status\").innerHTML = t;\r\n            window.status = t;\r\n        }\r\n        // Select all/none/inverse\r\n        function selectANI(Butt){\r\n        \tcancel_copy_move();\r\n            for(var x=0;x<" . (int) count($entry_list) . ";x++){\r\n                var Row = document.getElementById('entry'+x);\r\n                var newClassName = null;\r\n                switch (Butt.value){\r\n                    case '" . et('SelAll') . "':\r\n                        if (select(entry_list[Row.id])) newClassName = 'entrySelected';\r\n                    break;\r\n                    case '" . et('SelNone') . "':\r\n                        if (unselect(entry_list[Row.id])) newClassName = 'entryUnselected';\r\n                    break;\r\n                    case '" . et('SelInverse') . "':\r\n                        if (entry_list[Row.id].selected){\r\n                            if (unselect(entry_list[Row.id])) newClassName = 'entryUnselected';\r\n                        } else {\r\n                            if (select(entry_list[Row.id])) newClassName = 'entrySelected';\r\n                        }\r\n                    break;\r\n                }\r\n                if (newClassName) {\r\n                    Row.className = newClassName;\r\n                }\r\n            }\r\n            if (Butt.value == '" . et('SelAll') . "'){\r\n                for(var i=0;i<2;i++){\r\n                    document.getElementById('ANI'+i).value='" . et('SelNone') . "';\r\n                }\r\n            } else if (Butt.value == '" . et('SelNone') . "'){\r\n                for(var i=0;i<2;i++){\r\n                    document.getElementById('ANI'+i).value='" . et('SelAll') . "';\r\n                }\r\n            }\r\n            update_sel_status();\r\n            return true;\r\n        }\r\n        function download(arg){\r\n            parent.frame1.location.href='" . addslashes($path_info["basename"]) . "?action=3&current_dir=" . addslashes($current_dir) . "&filename='+escape(arg);\r\n        }\r\n        function upload(){\r\n            var w = 400;\r\n            var h = 250;\r\n            window.open('" . addslashes($path_info["basename"]) . "?action=10&current_dir=" . addslashes($current_dir) . "', '', 'width='+w+',height='+h+',fullscreen=no,scrollbars=no,resizable=yes,status=no,toolbar=no,menubar=no,location=no');\r\n        }\r\n        function execute_cmd(){\r\n            var arg = prompt('" . et('TypeCmd') . ".');\r\n            if(arg.length>0){\r\n                if(confirm('" . et('ConfExec') . " \\' '+arg+' \\' ?')) {\r\n                    var w = 800;\r\n                    var h = 600;\r\n                    window.open('" . addslashes($path_info["basename"]) . "?action=6&current_dir=" . addslashes($current_dir) . "&cmd='+escape(arg), '', 'width='+w+',height='+h+',fullscreen=no,scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no');\r\n                }\r\n            }\r\n        }\r\n        function decompress(arg){\r\n            if(confirm('" . uppercase(et('Decompress')) . " \\' '+arg+' \\' ?')) {\r\n                document.form_action.action.value = 72;\r\n                document.form_action.cmd_arg.value = arg;\r\n                document.form_action.submit();\r\n            }\r\n        }\r\n        function execute_file(arg){\r\n            if(arg.length>0){\r\n                if(confirm('" . et('ConfExec') . " \\' '+arg+' \\' ?')) {\r\n                    var w = 800;\r\n                    var h = 600;\r\n                    window.open('" . addslashes($path_info["basename"]) . "?action=11&current_dir=" . addslashes($current_dir) . "&filename='+escape(arg), '', 'width='+w+',height='+h+',fullscreen=no,scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no');\r\n                }\r\n            }\r\n        }\r\n        function edit_file(arg){\r\n            var w = 1024;\r\n            var h = 768;\r\n            // if(confirm('" . uppercase(et('Edit')) . " \\' '+arg+' \\' ?'))\r\n            window.open('" . addslashes($path_info["basename"]) . "?action=7&current_dir=" . addslashes($current_dir) . "&filename='+escape(arg), '', 'width='+w+',height='+h+',fullscreen=no,scrollbars=no,resizable=yes,status=no,toolbar=no,menubar=no,location=no');\r\n        }\r\n        function config(){\r\n            var w = 650;\r\n            var h = 400;\r\n            window.open('" . addslashes($path_info["basename"]) . "?action=2', 'win_config', 'width='+w+',height='+h+',fullscreen=no,scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no');\r\n        }\r\n        function server_info(arg){\r\n            var w = 800;\r\n            var h = 600;\r\n            window.open('" . addslashes($path_info["basename"]) . "?action=5', 'win_serverinfo', 'width='+w+',height='+h+',fullscreen=no,scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no');\r\n        }\r\n        function shell(){\r\n            var w = 800;\r\n            var h = 600;\r\n            window.open('" . addslashes($path_info["basename"]) . "?action=9', '', 'width='+w+',height='+h+',fullscreen=no,scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no');\r\n        }\r\n        function view(arg){\r\n            var w = 800;\r\n            var h = 600;\r\n            if(confirm('" . uppercase(et('View')) . " \\' '+arg+' \\' ?')) window.open('" . addslashes($path_info["basename"]) . "?action=4&current_dir=" . addslashes($current_dir) . "&filename='+escape(arg), '', 'width='+w+',height='+h+',fullscreen=no,scrollbars=yes,resizable=yes,status=yes,toolbar=no,menubar=no,location=yes');\r\n        }\r\n        function rename(arg){\r\n            var nome = '';\r\n            if (nome = prompt('" . uppercase(et('Ren')) . " \\' '+arg+' \\' " . et('To') . " ...')) document.location.href='" . addslashes($path_info["basename"]) . "?frame=3&action=3&current_dir=" . addslashes($current_dir) . "&old_name='+escape(arg)+'&new_name='+escape(nome);\r\n        }\r\n        function set_dir_dest(arg){\r\n            document.form_action.dir_dest.value=arg;\r\n            if (document.form_action.action.value.length>0) test(document.form_action.action.value);\r\n            else alert('" . et('JSError') . ".');\r\n        }\r\n        function sel_dir(arg){\r\n            document.form_action.action.value = arg;\r\n            document.form_action.dir_dest.value='';\r\n            if (!is_anything_selected()) alert('" . et('NoSel') . ".');\r\n            else {\r\n                if (!getCookie('sel_dir_warn')) {\r\n                    //alert('" . et('SelDir') . ".');\r\n                    document.cookie='sel_dir_warn'+'='+escape('true')+';';\r\n                }\r\n                set_sel_dir_warn(true);\r\n                parent.frame2.set_flag(true);\r\n            }\r\n        }\r\n\t\tfunction set_sel_dir_warn(b){\r\n        \tdocument.getElementById(\"sel_dir_warn\").style.display=(b?'':'none');\r\n\t\t}\r\n\t\tfunction cancel_copy_move(){\r\n           \tset_sel_dir_warn(false);\r\n           \tparent.frame2.set_flag(false);\r\n\t\t}\r\n        function chmod_form(){\r\n            cancel_copy_move();\r\n            document.form_action.dir_dest.value='';\r\n            document.form_action.chmod_arg.value='';\r\n            if (!is_anything_selected()) alert('" . et('NoSel') . ".');\r\n            else {\r\n                var w = 280;\r\n                var h = 180;\r\n                window.open('" . addslashes($path_info["basename"]) . "?action=8', '', 'width='+w+',height='+h+',fullscreen=no,scrollbars=no,resizable=yes,status=no,toolbar=no,menubar=no,location=no');\r\n            }\r\n        }\r\n        function set_chmod_arg(arg){\r\n            cancel_copy_move();\r\n            if (!is_anything_selected()) alert('" . et('NoSel') . ".');\r\n            else {\r\n            \tdocument.form_action.dir_dest.value='';\r\n            \tdocument.form_action.chmod_arg.value=arg;\r\n            \ttest(9);\r\n\t\t\t}\r\n        }\r\n        function test_action(){\r\n            if (document.form_action.action.value != 0) return true;\r\n            else return false;\r\n        }\r\n        function test_prompt(arg){\r\n        \tcancel_copy_move();\r\n\t\t\tvar erro='';\r\n            var conf='';\r\n            if (arg == 1){\r\n                document.form_action.cmd_arg.value = prompt('" . et('TypeDir') . ".');\r\n            } else if (arg == 2){\r\n                document.form_action.cmd_arg.value = prompt('" . et('TypeArq') . ".');\r\n            } else if (arg == 71){\r\n                if (!is_anything_selected()) erro = '" . et('NoSel') . ".';\r\n                else document.form_action.cmd_arg.value = prompt('" . et('TypeArqComp') . "');\r\n            }\r\n            if (erro!=''){\r\n                document.form_action.cmd_arg.focus();\r\n                alert(erro);\r\n            } else if(document.form_action.cmd_arg.value.length>0) {\r\n                document.form_action.action.value = arg;\r\n                document.form_action.submit();\r\n            }\r\n        }\r\n        function strstr(haystack,needle){\r\n            var index = haystack.indexOf(needle);\r\n            return (index==-1)?false:index;\r\n        }\r\n        function valid_dest(dest,orig){\r\n            return (strstr(dest,orig)==false)?true:false;\r\n        }\r\n        // ArrayAlert - Selection debug only\r\n        function aa(){\r\n            var str = 'selected_dir_list:\\n';\r\n            for (x=0;x<selected_dir_list.length;x++){\r\n                str += selected_dir_list[x]+'\\n';\r\n            }\r\n            str += '\\nselected_file_list:\\n';\r\n            for (x=0;x<selected_file_list.length;x++){\r\n                str += selected_file_list[x]+'\\n';\r\n            }\r\n            alert(str);\r\n        }\r\n        function test(arg){\r\n        \tcancel_copy_move();\r\n            var erro='';\r\n            var conf='';\r\n            if (arg == 4){\r\n                if (!is_anything_selected()) erro = '" . et('NoSel') . ".\\n';\r\n                conf = '" . et('RemSel') . " ?\\n';\r\n            } else if (arg == 5){\r\n                if (!is_anything_selected()) erro = '" . et('NoSel') . ".\\n';\r\n                else if(document.form_action.dir_dest.value.length == 0) erro = '" . et('NoDestDir') . ".';\r\n                else if(document.form_action.dir_dest.value == document.form_action.current_dir.value) erro = '" . et('DestEqOrig') . ".';\r\n                else if(!valid_dest(document.form_action.dir_dest.value,document.form_action.current_dir.value)) erro = '" . et('InvalidDest') . ".';\r\n                conf = '" . et('CopyTo') . " \\' '+document.form_action.dir_dest.value+' \\' ?\\n';\r\n            } else if (arg == 6){\r\n                if (!is_anything_selected()) erro = '" . et('NoSel') . ".';\r\n                else if(document.form_action.dir_dest.value.length == 0) erro = '" . et('NoDestDir') . ".';\r\n                else if(document.form_action.dir_dest.value == document.form_action.current_dir.value) erro = '" . et('DestEqOrig') . ".';\r\n                else if(!valid_dest(document.form_action.dir_dest.value,document.form_action.current_dir.value)) erro = '" . et('InvalidDest') . ".';\r\n                conf = '" . et('MoveTo') . " \\' '+document.form_action.dir_dest.value+' \\' ?\\n';\r\n            } else if (arg == 9){\r\n                if (!is_anything_selected()) erro = '" . et('NoSel') . ".';\r\n                else if(document.form_action.chmod_arg.value.length == 0) erro = '" . et('NoNewPerm') . ".';\r\n                //conf = '" . et('AlterPermTo') . " \\' '+document.form_action.chmod_arg.value+' \\' ?\\n';\r\n            }\r\n            if (erro!=''){\r\n                document.form_action.cmd_arg.focus();\r\n                alert(erro);\r\n            } else if(conf!='') {\r\n                if(confirm(conf)) {\r\n                    document.form_action.action.value = arg;\r\n                    document.form_action.submit();\r\n                } else {\r\n                    set_sel_dir_warn(false);\r\n\t\t\t\t}\r\n            } else {\r\n                document.form_action.action.value = arg;\r\n                document.form_action.submit();\r\n            }\r\n        }\r\n        //-->\r\n        </script>";
        $out .= "\r\n        <form name=\"form_action\" action=\"" . $path_info["basename"] . "\" method=\"post\" onsubmit=\"return test_action();\">\r\n            <input type=hidden name=\"frame\" value=3>\r\n            <input type=hidden name=\"action\" value=0>\r\n            <input type=hidden name=\"dir_dest\" value=\"\">\r\n            <input type=hidden name=\"chmod_arg\" value=\"\">\r\n            <input type=hidden name=\"cmd_arg\" value=\"\">\r\n            <input type=hidden name=\"current_dir\" value=\"{$current_dir}\">\r\n            <input type=hidden name=\"dir_before\" value=\"{$dir_before}\">\r\n            <input type=hidden name=\"selected_dir_list\" value=\"\">\r\n            <input type=hidden name=\"selected_file_list\" value=\"\">";
        $out .= "\r\n            <tr>\r\n            <td bgcolor=\"#DDDDDD\" colspan=50><nobr>\r\n            <input type=button onclick=\"config()\" value=\"" . et('Config') . "\">\r\n            <input type=button onclick=\"server_info()\" value=\"" . et('ServerInfo') . "\">\r\n            <input type=button onclick=\"test_prompt(1)\" value=\"" . et('CreateDir') . "\">\r\n            <input type=button onclick=\"test_prompt(2)\" value=\"" . et('CreateArq') . "\">\r\n            <input type=button onclick=\"execute_cmd()\" value=\"" . et('ExecCmd') . "\">\r\n            <input type=button onclick=\"upload()\" value=\"" . et('Upload') . "\">\r\n            <input type=button onclick=\"shell()\" value=\"" . et('Shell') . "\">\r\n            <b>{$ip}</b>\r\n            </nobr>";
        $uplink = "";
        if ($current_dir != $fm_current_root) {
            $mat = explode("/", $current_dir);
            $dir_before = "";
            for ($x = 0; $x < count($mat) - 2; $x++) {
                $dir_before .= $mat[$x] . "/";
            }
            $uplink = "<a href=\"" . $path_info["basename"] . "?frame=3&current_dir={$dir_before}\"><<</a> ";
        }
        if ($entry_count) {
            $out .= "\r\n                <tr bgcolor=\"#DDDDDD\"><td colspan=50><nobr>{$uplink} <a href=\"" . $path_info["basename"] . "?frame=3&current_dir={$current_dir}\">{$current_dir}</a></nobr>\r\n                <tr>\r\n                <td bgcolor=\"#DDDDDD\" colspan=50><nobr>\r\n                    <input type=\"button\" style=\"width:80\" onclick=\"selectANI(this)\" id=\"ANI0\" value=\"" . et('SelAll') . "\">\r\n                    <input type=\"button\" style=\"width:80\" onclick=\"selectANI(this)\" value=\"" . et('SelInverse') . "\">\r\n                    <input type=\"button\" style=\"width:80\" onclick=\"test(4)\" value=\"" . et('Rem') . "\">\r\n                    <input type=\"button\" style=\"width:80\" onclick=\"sel_dir(5)\" value=\"" . et('Copy') . "\">\r\n                    <input type=\"button\" style=\"width:80\" onclick=\"sel_dir(6)\" value=\"" . et('Move') . "\">\r\n                    <input type=\"button\" style=\"width:100\" onclick=\"test_prompt(71)\" value=\"" . et('Compress') . "\">";
            if ($islinux) {
                $out .= "\r\n                    <input type=\"button\" style=\"width:100\" onclick=\"resolveIDs()\" value=\"" . et('ResolveIDs') . "\">";
            }
            $out .= "\r\n                    <input type=\"button\" style=\"width:100\" onclick=\"chmod_form()\" value=\"" . et('Perms') . "\">";
            $out .= "\r\n                </nobr></td>\r\n                </tr>\r\n\t\t\t\t<tr>\r\n                <td bgcolor=\"#DDDDDD\" colspan=50 id=\"sel_dir_warn\" style=\"display:none\"><nobr><font color=\"red\">" . et('SelDir') . "...</font></nobr></td>\r\n                </tr>";
            $file_count = 0;
            $dir_count = 0;
            $dir_out = array();
            $file_out = array();
            $max_opt = 0;
            foreach ($entry_list as $ind => $dir_entry) {
                $file = $dir_entry["name"];
                if ($dir_entry["type"] == "dir") {
                    $dir_out[$dir_count] = array();
                    $dir_out[$dir_count][] = "\r\n                        <tr ID=\"entry{$ind}\" class=\"entryUnselected\" onmouseover=\"selectEntry(this, 'over');\" onmousedown=\"selectEntry(this, 'click');\">\r\n                        <td><nobr><a href=\"JavaScript:go('" . addslashes($file) . "')\">{$file}</a></nobr></td>";
                    $dir_out[$dir_count][] = "<td>" . $dir_entry["p"] . "</td>";
                    if ($islinux) {
                        $dir_out[$dir_count][] = "<td><nobr>" . $dir_entry["u"] . "</nobr></td>";
                        $dir_out[$dir_count][] = "<td><nobr>" . $dir_entry["g"] . "</nobr></td>";
                    }
                    $dir_out[$dir_count][] = "<td><nobr>" . $dir_entry["sizet"] . "</nobr></td>";
                    $dir_out[$dir_count][] = "<td><nobr>" . $dir_entry["datet"] . "</nobr></td>";
                    if ($has_files) {
                        $dir_out[$dir_count][] = "<td>&nbsp;</td>";
                    }
                    // Opções de diretório
                    if (is_writable($current_dir . $file)) {
                        $dir_out[$dir_count][] = "\r\n                        <td align=center><a href=\"JavaScript:if(confirm('" . et('ConfRem') . " \\'" . addslashes($file) . "\\' ?')) document.location.href='" . addslashes($path_info["basename"]) . "?frame=3&action=8&cmd_arg=" . addslashes($file) . "&current_dir=" . addslashes($current_dir) . "'\">" . et('Rem') . "</a>";
                    }
                    if (is_writable($current_dir . $file)) {
                        $dir_out[$dir_count][] = "\r\n                        <td align=center><a href=\"JavaScript:rename('" . addslashes($file) . "')\">" . et('Ren') . "</a>";
                    }
                    if (count($dir_out[$dir_count]) > $max_opt) {
                        $max_opt = count($dir_out[$dir_count]);
                    }
                    $dir_count++;
                } else {
                    $file_out[$file_count] = array();
                    $file_out[$file_count][] = "\r\n                        <tr ID=\"entry{$ind}\" class=\"entryUnselected\" onmouseover=\"selectEntry(this, 'over');\" onmousedown=\"selectEntry(this, 'click');\">\r\n                        <td><nobr><a href=\"JavaScript:download('" . addslashes($file) . "')\">{$file}</a></nobr></td>";
                    $file_out[$file_count][] = "<td>" . $dir_entry["p"] . "</td>";
                    if ($islinux) {
                        $file_out[$file_count][] = "<td><nobr>" . $dir_entry["u"] . "</nobr></td>";
                        $file_out[$file_count][] = "<td><nobr>" . $dir_entry["g"] . "</nobr></td>";
                    }
                    $file_out[$file_count][] = "<td><nobr>" . $dir_entry["sizet"] . "</nobr></td>";
                    $file_out[$file_count][] = "<td><nobr>" . $dir_entry["datet"] . "</nobr></td>";
                    $file_out[$file_count][] = "<td>" . $dir_entry["extt"] . "</td>";
                    // Opções de arquivo
                    if (is_writable($current_dir . $file)) {
                        $file_out[$file_count][] = "\r\n                                <td align=center><a href=\"javascript:if(confirm('" . uppercase(et('Rem')) . " \\'" . addslashes($file) . "\\' ?')) document.location.href='" . addslashes($path_info["basename"]) . "?frame=3&action=8&cmd_arg=" . addslashes($file) . "&current_dir=" . addslashes($current_dir) . "'\">" . et('Rem') . "</a>";
                    } else {
                        $file_out[$file_count][] = "<td>&nbsp;</td>";
                    }
                    if (is_writable($current_dir . $file)) {
                        $file_out[$file_count][] = "\r\n                                <td align=center><a href=\"javascript:rename('" . addslashes($file) . "')\">" . et('Ren') . "</a>";
                    } else {
                        $file_out[$file_count][] = "<td>&nbsp;</td>";
                    }
                    if (is_readable($current_dir . $file) && strpos(".wav#.mp3#.mid#.avi#.mov#.mpeg#.mpg#.rm#.iso#.bin#.img#.dll#.psd#.fla#.swf#.class#.ppt#.tif#.tiff#.pcx#.jpg#.gif#.png#.wmf#.eps#.bmp#.msi#.exe#.com#.rar#.tar#.zip#.bz2#.tbz2#.bz#.tbz#.bzip#.gzip#.gz#.tgz#", $dir_entry["ext"] . "#") === false) {
                        $file_out[$file_count][] = "\r\n                                <td align=center><a href=\"javascript:edit_file('" . addslashes($file) . "')\">" . et('Edit') . "</a>";
                    } else {
                        $file_out[$file_count][] = "<td>&nbsp;</td>";
                    }
                    if (is_readable($current_dir . $file) && strpos(".txt#.sys#.bat#.ini#.conf#.swf#.php#.php3#.asp#.html#.htm#.jpg#.gif#.png#.bmp#", $dir_entry["ext"] . "#") !== false) {
                        $file_out[$file_count][] = "\r\n                                <td align=center><a href=\"javascript:view('" . addslashes($file) . "');\">" . et('View') . "</a>";
                    } else {
                        $file_out[$file_count][] = "<td>&nbsp;</td>";
                    }
                    if (is_readable($current_dir . $file) && strlen($dir_entry["ext"]) && strpos(".tar#.zip#.bz2#.tbz2#.bz#.tbz#.bzip#.gzip#.gz#.tgz#", $dir_entry["ext"] . "#") !== false) {
                        $file_out[$file_count][] = "\r\n                                <td align=center><a href=\"javascript:decompress('" . addslashes($file) . "')\">" . et('Decompress') . "</a>";
                    } else {
                        $file_out[$file_count][] = "<td>&nbsp;</td>";
                    }
                    if (is_readable($current_dir . $file) && strlen($dir_entry["ext"]) && strpos(".exe#.com#.sh#.bat#", $dir_entry["ext"] . "#") !== false) {
                        $file_out[$file_count][] = "\r\n                                <td align=center><a href=\"javascript:execute_file('" . addslashes($file) . "')\">" . et('Exec') . "</a>";
                    } else {
                        $file_out[$file_count][] = "<td>&nbsp;</td>";
                    }
                    if (count($file_out[$file_count]) > $max_opt) {
                        $max_opt = count($file_out[$file_count]);
                    }
                    $file_count++;
                }
            }
            if ($dir_count) {
                $out .= "\r\n                <tr>\r\n                      <td bgcolor=\"#DDDDDD\"><nobr><a href=\"" . $path_info["basename"] . "?frame=3&or_by={$or1}&current_dir={$current_dir}\">" . et('Name') . "</a></nobr></td>\r\n                      <td bgcolor=\"#DDDDDD\"><nobr><a href=\"" . $path_info["basename"] . "?frame=3&or_by={$or2}&current_dir={$current_dir}\">" . et('Perm') . "</a></nobr></td>";
                if ($islinux) {
                    $out .= "\r\n                      <td bgcolor=\"#DDDDDD\"><nobr><a href=\"" . $path_info["basename"] . "?frame=3&or_by={$or3}&current_dir={$current_dir}\">" . et('Owner') . "</a></td>\r\n                      <td bgcolor=\"#DDDDDD\"><nobr><a href=\"" . $path_info["basename"] . "?frame=3&or_by={$or4}&current_dir={$current_dir}\">" . et('Group') . "</a></nobr></td>";
                }
                $out .= "\r\n                      <td bgcolor=\"#DDDDDD\"><nobr><a href=\"" . $path_info["basename"] . "?frame=3&or_by={$or5}&current_dir={$current_dir}\">" . et('Size') . "</a></nobr></td>\r\n                      <td bgcolor=\"#DDDDDD\"><nobr><a href=\"" . $path_info["basename"] . "?frame=3&or_by={$or6}&current_dir={$current_dir}\">" . et('Date') . "</a></nobr></td>";
                if ($file_count) {
                    $out .= "\r\n                      <td bgcolor=\"#DDDDDD\"><nobr><a href=\"" . $path_info["basename"] . "?frame=3&or_by={$or7}&current_dir={$current_dir}\">" . et('Type') . "</a></nobr></td>";
                }
                $out .= "\r\n                      <td bgcolor=\"#DDDDDD\" colspan=50>&nbsp;</td>\r\n                </tr>";
            }
            foreach ($dir_out as $k => $v) {
                while (count($dir_out[$k]) < $max_opt) {
                    $dir_out[$k][] = "<td>&nbsp;</td>";
                }
                $out .= implode($dir_out[$k]);
                $out .= "</tr>";
            }
            if ($file_count) {
                $out .= "\r\n                <tr>\r\n                      <td bgcolor=\"#DDDDDD\"><nobr><a href=\"" . $path_info["basename"] . "?frame=3&or_by={$or1}&current_dir={$current_dir}\">" . et('Name') . "</a></nobr></td>\r\n                      <td bgcolor=\"#DDDDDD\"><nobr><a href=\"" . $path_info["basename"] . "?frame=3&or_by={$or2}&current_dir={$current_dir}\">" . et('Perm') . "</a></nobr></td>";
                if ($islinux) {
                    $out .= "\r\n                      <td bgcolor=\"#DDDDDD\"><nobr><a href=\"" . $path_info["basename"] . "?frame=3&or_by={$or3}&current_dir={$current_dir}\">" . et('Owner') . "</a></td>\r\n                      <td bgcolor=\"#DDDDDD\"><nobr><a href=\"" . $path_info["basename"] . "?frame=3&or_by={$or4}&current_dir={$current_dir}\">" . et('Group') . "</a></nobr></td>";
                }
                $out .= "\r\n                      <td bgcolor=\"#DDDDDD\"><nobr><a href=\"" . $path_info["basename"] . "?frame=3&or_by={$or5}&current_dir={$current_dir}\">" . et('Size') . "</a></nobr></td>\r\n                      <td bgcolor=\"#DDDDDD\"><nobr><a href=\"" . $path_info["basename"] . "?frame=3&or_by={$or6}&current_dir={$current_dir}\">" . et('Date') . "</a></nobr></td>\r\n                      <td bgcolor=\"#DDDDDD\"><nobr><a href=\"" . $path_info["basename"] . "?frame=3&or_by={$or7}&current_dir={$current_dir}\">" . et('Type') . "</a></nobr></td>\r\n                      <td bgcolor=\"#DDDDDD\" colspan=50>&nbsp;</td>\r\n                </tr>";
            }
            foreach ($file_out as $k => $v) {
                while (count($file_out[$k]) < $max_opt) {
                    $file_out[$k][] = "<td>&nbsp;</td>";
                }
                $out .= implode($file_out[$k]);
                $out .= "</tr>";
            }
            $out .= "\r\n                <tr>\r\n                <td bgcolor=\"#DDDDDD\" colspan=50><nobr>\r\n                      <input type=\"button\" style=\"width:80\" onclick=\"selectANI(this)\" id=\"ANI1\" value=\"" . et('SelAll') . "\">\r\n                      <input type=\"button\" style=\"width:80\" onclick=\"selectANI(this)\" value=\"" . et('SelInverse') . "\">\r\n                      <input type=\"button\" style=\"width:80\" onclick=\"test(4)\" value=\"" . et('Rem') . "\">\r\n                      <input type=\"button\" style=\"width:80\" onclick=\"sel_dir(5)\" value=\"" . et('Copy') . "\">\r\n                      <input type=\"button\" style=\"width:80\" onclick=\"sel_dir(6)\" value=\"" . et('Move') . "\">\r\n                      <input type=\"button\" style=\"width:100\" onclick=\"test_prompt(71)\" value=\"" . et('Compress') . "\">";
            if ($islinux) {
                $out .= "\r\n                      <input type=\"button\" style=\"width:100\" onclick=\"resolveIDs()\" value=\"" . et('ResolveIDs') . "\">";
            }
            $out .= "\r\n                      <input type=\"button\" style=\"width:100\" onclick=\"chmod_form()\" value=\"" . et('Perms') . "\">";
            $out .= "\r\n                </nobr></td>\r\n                </tr>";
            $out .= "\r\n            </form>";
            $out .= "\r\n                <tr><td bgcolor=\"#DDDDDD\" colspan=50><b>{$dir_count} " . et('Dir_s') . " " . et('And') . " {$file_count} " . et('File_s') . " = " . format_size($total_size) . "</td></tr>";
            if ($quota_mb) {
                $out .= "\r\n                <tr><td bgcolor=\"#DDDDDD\" colspan=50><b>" . et('Partition') . ": " . format_size($quota_mb * 1024 * 1024) . " " . et('Total') . " - " . format_size($quota_mb * 1024 * 1024 - total_size($fm_current_root)) . " " . et('Free') . "</td></tr>";
            } else {
                $out .= "\r\n                <tr><td bgcolor=\"#DDDDDD\" colspan=50><b>" . et('Partition') . ": " . format_size(disk_total_space($current_dir)) . " " . et('Total') . " - " . format_size(disk_free_space($current_dir)) . " " . et('Free') . "</td></tr>";
            }
            $tf = getmicrotime();
            $tt = $tf - $ti;
            $out .= "\r\n                <tr><td bgcolor=\"#DDDDDD\" colspan=50><b>" . et('RenderTime') . ": " . substr($tt, 0, strrpos($tt, ".") + 5) . " " . et('Seconds') . "</td></tr>";
            $out .= "\r\n            <script language=\"Javascript\" type=\"text/javascript\">\r\n            <!--\r\n                update_sel_status();\r\n            //-->\r\n            </script>";
        } else {
            $out .= "\r\n            <tr>\r\n            <td bgcolor=\"#DDDDDD\" width=\"1%\">{$uplink}<td bgcolor=\"#DDDDDD\" colspan=50><nobr><a href=\"" . $path_info["basename"] . "?frame=3&current_dir={$current_dir}\">{$current_dir}</a></nobr>\r\n            <tr><td bgcolor=\"#DDDDDD\" colspan=50>" . et('EmptyDir') . ".</tr>";
        }
    } else {
        $out .= "<tr><td><font color=red>" . et('IOError') . ".<br>{$current_dir}</font>";
    }
    $out .= "</table>";
    echo $out;
}
Пример #14
0
         affiche_debug("{$sql}<br />");
         $del = mysqli_query($GLOBALS["mysqli"], $sql);
     }
     // Suppression des anciennes notes de conteneurs
     $sql = "SELECT * FROM cn_conteneurs WHERE id_racine='" . $lig_ccn->id_cahier_notes . "';";
     affiche_debug("{$sql}<br />");
     $res_cn = mysqli_query($GLOBALS["mysqli"], $sql);
     if (mysqli_num_rows($res_cn) > 0) {
         while ($lig_cn = mysqli_fetch_object($res_cn)) {
             $sql = "DELETE FROM cn_notes_conteneurs WHERE login='******' AND id_conteneur='" . $lig_cn->id . "';";
             affiche_debug("{$sql}<br />");
             $del = mysqli_query($GLOBALS["mysqli"], $sql);
         }
     }
 } else {
     $group_fut = get_group($id_grp_fut[$i]);
     echo "Transfert des notes/devoirs vers " . htmlspecialchars($group_fut['name']) . " (<i>" . htmlspecialchars($group_fut['matiere']['nom_complet']) . " en " . $group_fut["classlist_string"] . "</i>)" . "<br />";
     // Recherche du carnet de notes du nouveau groupe
     $sql = "SELECT * FROM cn_cahier_notes WHERE id_groupe='" . $id_grp_fut[$i] . "' AND periode='{$current_periode_num}'";
     $res_ccn_fut = mysqli_query($GLOBALS["mysqli"], $sql);
     if (mysqli_num_rows($res_ccn_fut) == 0) {
         // On crée le carnet de notes dans le groupe futur
         $nom_complet_matiere_fut = $group_fut["matiere"]["nom_complet"];
         $nom_court_matiere_fut = $group_fut["matiere"]["matiere"];
         $sql = "INSERT INTO cn_conteneurs SET id_racine='',\n\t\t\t\t\t\t\t\t\t\t\tnom_court='" . traitement_magic_quotes($group_fut["description"]) . "',\n\t\t\t\t\t\t\t\t\t\t\tnom_complet='" . traitement_magic_quotes($nom_complet_matiere_fut) . "',\n\t\t\t\t\t\t\t\t\t\t\tdescription = '',\n\t\t\t\t\t\t\t\t\t\t\tmode = '2',\n\t\t\t\t\t\t\t\t\t\t\tcoef = '1.0',\n\t\t\t\t\t\t\t\t\t\t\tarrondir = 's1',\n\t\t\t\t\t\t\t\t\t\t\tponderation = '0.0',\n\t\t\t\t\t\t\t\t\t\t\tdisplay_parents = '0',\n\t\t\t\t\t\t\t\t\t\t\tdisplay_bulletin = '1',\n\t\t\t\t\t\t\t\t\t\t\tparent = '0'";
         affiche_debug("{$sql}<br />");
         $reg = mysqli_query($GLOBALS["mysqli"], $sql);
         if ($reg) {
             $id_racine_fut = is_null($___mysqli_res = mysqli_insert_id($GLOBALS["mysqli"])) ? false : $___mysqli_res;
             $sql = "UPDATE cn_conteneurs SET id_racine='{$id_racine_fut}', parent = '0' WHERE id='{$id_racine_fut}';";
             affiche_debug("{$sql}<br />");
Пример #15
0
<?php

$sub_menu = "300200";
include_once "./_common.php";
sql_query(" ALTER TABLE {$g4['group_member_table']} CHANGE `gm_id` `gm_id` INT( 11 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ", false);
if ($w == "") {
    auth_check($auth[$sub_menu], "w");
    $mb = get_member($mb_id);
    if (!$mb[mb_id]) {
        alert("존재하지 않는 회원입니다.");
    }
    $gr = get_group($gr_id);
    if (!$gr[gr_id]) {
        alert("존재하지 않는 그룹입니다.");
    }
    $sql = " select count(*) as cnt\n               from {$g4['group_member_table']}\n              where gr_id = '{$gr_id}'\n                and mb_id = '{$mb_id}' ";
    $row = sql_fetch($sql);
    if ($row[cnt]) {
        alert("이미 등록되어 있는 자료입니다.");
    } else {
        check_token();
        $sql = " insert into {$g4['group_member_table']}\n                    set gr_id       = '{$_POST['gr_id']}',\n                        mb_id       = '{$_POST['mb_id']}',\n                        gm_datetime = '{$g4['time_ymdhis']}' ";
        sql_query($sql);
    }
} else {
    if ($w == 'd' || $w == 'listdelete') {
        auth_check($auth[$sub_menu], "d");
        $sql = " select * from {$g4['group_member_table']} where gm_id = '{$_POST['gm_id']}' ";
        $gm = sql_fetch($sql);
        if (!$gm[gm_id]) {
            alert("존재하지 않는 자료입니다.");
Пример #16
0
							$insert=mysqli_query($GLOBALS["mysqli"], $sql);
							if(!$insert) {
								$msg.="Erreur lors de l'insertion de la note ($lig_ele->note|$lig_ele->statut) pour $lig_ele->login_ele sur le devoir n°$id_devoir<br />";
								//echo "Erreur lors de l'insertion de la note ($lig_ele->note|$lig_ele->statut) pour $lig_ele->login_ele sur le devoir n°$id_devoir<br />";
							}
							else {
								$cpt_notes++;
							}
						}


						// Préparatifs de la mise à jour des moyennes de conteneurs
						$sql="SELECT id_groupe FROM cn_cahier_notes WHERE id_cahier_notes='$current_id_cn';";
						$res=mysqli_query($GLOBALS["mysqli"], $sql);
						$lig=mysqli_fetch_object($res);
						$current_group=get_group($lig->id_groupe);
						$periode_num=$current_periode;

						// Renseignement d'un témoin comme quoi le transfert a déjà été effectué pour le groupe
						$sql="UPDATE eb_groupes SET transfert='y' WHERE id_epreuve='$id_epreuve' AND id_groupe='$lig->id_groupe';";
						$update=mysqli_query($GLOBALS["mysqli"], $sql);

						// Mise à jour des moyennes de conteneurs
						recherche_enfant($id_racine);

					}

				}
			}
		
			if(($msg=='')&&($cpt_notes>0)) {
Пример #17
0
} else {
    if ($w == 'u') {
        $html_title .= ' 수정';
        if (!$board['bo_table']) {
            alert('존재하지 않은 게시판 입니다.');
        }
        if ($is_admin == 'group') {
            if ($member['mb_id'] != $group['gr_admin']) {
                alert('그룹이 틀립니다.');
            }
        }
        $readonly = 'readonly';
    }
}
if ($is_admin != 'super') {
    $group = get_group($board['gr_id']);
    $is_admin = is_admin($member['mb_id']);
}
$g5['title'] = $html_title;
include_once './admin.head.php';
$pg_anchor = '<ul class="anchor">
    <li><a href="#anc_bo_basic">기본 설정</a></li>
    <li><a href="#anc_bo_auth">권한 설정</a></li>
    <li><a href="#anc_bo_function">기능 설정</a></li>
    <li><a href="#anc_bo_design">디자인/양식</a></li>
    <li><a href="#anc_bo_point">포인트 설정</a></li>
    <li><a href="#anc_bo_extra">여분필드</a></li>
</ul>';
$frm_submit = '<div class="btn_confirm01 btn_confirm">
    <input type="submit" value="확인" class="btn_submit" accesskey="s">
    <a href="./board_list.php?' . $qstr . '">목록</a>' . PHP_EOL;
Пример #18
0
//
// définition des colonnes matières
//
$i = '0';
//pour calculer la moyenne annee de chaque matiere
$moyenne_annee_matiere = array();
$prev_cat_id = null;
while ($i < $lignes_groupes) {
    $moy_max = -1;
    $moy_min = 21;
    //echo "<p>Debut d'un tour de boucle<br />\$i=$i et \$lignes_groupes=$lignes_groupes<br />";
    foreach ($moyenne_annee_matiere as $tableau => $value) {
        unset($moyenne_annee_matiere[$tableau]);
    }
    $var_group_id = old_mysql_result($groupeinfo, $i, "id_groupe");
    $current_group = get_group($var_group_id);
    // Coeff pour la classe
    $current_coef = old_mysql_result($groupeinfo, $i, "coef");
    //echo $current_group['name']."<br />";
    if (!isset($current_group['visibilite']['cahier_notes']) || $current_group['visibilite']['cahier_notes'] == 'y') {
        $nb_col++;
        $k++;
        //==============================
        // AJOUT: boireaus
        if ($referent == "une_periode") {
            $sql = "SELECT round(avg(cnc.note),1) moyenne FROM cn_cahier_notes ccn, cn_conteneurs cc, cn_notes_conteneurs cnc WHERE\n\t\t\tccn.id_groupe='" . $current_group["id"] . "' AND\n\t\t\tccn.periode='{$num_periode}' AND\n\t\t\tcc.id_racine = ccn.id_cahier_notes AND\n\t\t\tcnc.id_conteneur=cc.id AND\n\t\t\tcc.id=cc.id_racine AND\n\t\t\tcnc.statut='y'";
            $call_moyenne = mysqli_query($GLOBALS["mysqli"], $sql);
        } else {
            $sql = "SELECT round(avg(cnc.note),1) moyenne FROM cn_cahier_notes ccn, cn_conteneurs cc, cn_notes_conteneurs cnc WHERE\n\t\t\tccn.id_groupe='" . $current_group["id"] . "' AND\n\t\t\tcc.id_racine = ccn.id_cahier_notes AND\n\t\t\tcnc.id_conteneur=cc.id AND\n\t\t\tcc.id=cc.id_racine AND\n\t\t\tcnc.statut='y'";
            $call_moyenne = mysqli_query($GLOBALS["mysqli"], $sql);
        }
    $details = get_group('Details', $post->ID);
    if ($details) {
        foreach ($details as $detail) {
            ?>
					<dt><?php 
            echo $detail['details_label'][1];
            ?>
</dt>
					<dd><?php 
            echo $detail['details_description'][1];
            ?>
</dd>
<?php 
        }
    }
    $classes = get_group('Classes Taken', $post->ID);
    if ($classes) {
        ?>
					<dt>Classes Taken</dt>
					<dd>
<?php 
        foreach ($classes as $class) {
            ?>
					<a href="<?php 
            echo get_page_link($class['classes_taken_class'][1]);
            ?>
"><?php 
            echo get_the_title($class['classes_taken_class'][1]);
            ?>
</a> 
<?php 
Пример #20
0
 while (list($key, $value) = each($players)) {
     $val = $players[$key];
     if ($val['wins'] == "") {
         $val['wins'] = 0;
     }
     if ($val['draws'] == "") {
         $val['draws'] = 0;
     }
     if ($val['losses'] == "") {
         $val['losses'] = 0;
     }
     // Calculate Points: Wins = 2 Points, Draws = 1 Point, Losses = 0 Points
     $points = 0;
     $points = $points + $val['wins'] * 2 + $val['draws'];
     $list[$key] = $points;
     $h = get_group($key);
     $teams[$h[0]['group_id']] += $points;
 }
 // while
 arsort($teams);
 while (list($key, $value) = each($teams)) {
     if ($g = mysql_fetch_array(mysql_query("SELECT * FROM groups WHERE group_id = '{$key}'"))) {
         echo "<tr><td>" . $value . "</td>";
         echo '<td><a href="groups.php?action=view&id=' . $key . '">' . $g['title'] . '</a></td><td>';
         echo $g['ag'] == 1 ? 'Ja' : 'Nein';
         echo "</td></tr>";
     }
     // if
 }
 // while
 echo "</table>";
Пример #21
0
                "g.id = jgc.id_groupe AND " .
                "jgc.id_classe = '" . $id_classe2 . "' and " .
                "jgc.id_groupe = jgm.id_groupe and " .
                "jgm.id_matiere = '" . $current_group["matiere"]["matiere"] . "')");

        if (mysqli_num_rows($call_group2) == 1) {
            $group2_id = old_mysql_result($call_group2, 0, "id_groupe");
            $current_group2 = get_group($group2_id);
        } elseif (mysqli_num_rows($call_group2) > 1) {
            while ($row = mysqli_fetch_object($call_group2)) {
                if ($row->description == $current_group["description"]) {
                    //echo "\$row->description=".$row->description."<br />";
                    //echo "\$row->id=".$row->id."<br />";
                    //echo "\$row->id_groupe=".$row->id_groupe."<br />";
                    //$current_group2 = get_group($row->id);
                    $current_group2 = get_group($row->id_groupe);
                    break;
                } else {
                    $current_group2 = false;
                }
            }
        } else {
            $current_group2 = false;
        }

        if ($current_group2) {

            if ($affiche_categories) {
            // On regarde si on change de catégorie de matière
                if ($current_group["classes"]["classes"][$id_classe]["categorie_id"] != $prev_cat_id) {
                    $prev_cat_id = $current_group["classes"]["classes"][$id_classe]["categorie_id"];
Пример #22
0
             echo ")\n";
             $temoin_note_app++;
         }
     }
     $i++;
 }
 //
 //Vérification des moyennes
 //
 $i = 0;
 //
 //Début de la boucle matière
 //
 while ($i < $lignes_groupes) {
     $group_id = old_mysql_result($groupeinfo, $i, "id_groupe");
     $current_group = get_group($group_id);
     //if (in_array($id_eleve[$j], $current_group["eleves"][$per]["list"])) { // Si l'élève suit cet enseignement pour la période considérée
     if ((!isset($current_group['visibilite']['bulletins']) || $current_group['visibilite']['bulletins'] != 'n') && in_array($id_eleve[$j], $current_group["eleves"][$per]["list"])) {
         // Si l'élève suit cet enseignement pour la période considérée
         //
         //Vérification des moyennes :
         //
         $test_notes = mysqli_query($GLOBALS["mysqli"], "SELECT * FROM matieres_notes WHERE (login = '******' and id_groupe = '" . $current_group["id"] . "' and periode = '{$per}')");
         //$note = @old_mysql_result($test_notes, 0, 'note');
         $note = "";
         if (mysqli_num_rows($test_notes) > 0) {
             $note = old_mysql_result($test_notes, 0, 'note');
         }
         if ($note == '') {
             $bulletin_rempli = 'no';
             if ($affiche_nom != 0) {
Пример #23
0
echo "><img src='../images/icons/back.png' alt='Retour' class='back_link'/> Retour</a>\n";
$nb_grp = 0;
if ($_SESSION['statut'] == 'professeur') {
    $sql = "SELECT DISTINCT jgp.id_groupe FROM groupes g, j_groupes_professeurs jgp WHERE jgp.login='******'login'] . "' AND g.id=jgp.id_groupe ORDER BY g.name;";
    //echo "$sql<br />\n";
    $res_grp = mysqli_query($GLOBALS["mysqli"], $sql);
    $nb_grp = mysqli_num_rows($res_grp);
}
if ($nb_grp > 1) {
    echo " | ";
    echo "<select name='id_groupe' id='id_groupe_a_passage_autre_grp' onchange=\"confirm_changement_grp(change, '{$themessage}');\">\n";
    $cpt_grp = 0;
    $chaine_js = array();
    //echo "<option value=''>---</option>\n";
    while ($lig_grp = mysqli_fetch_object($res_grp)) {
        $tmp_grp = get_group($lig_grp->id_groupe);
        echo "<option value='{$lig_grp->id_groupe}'";
        if ($lig_grp->id_groupe == $id_groupe) {
            echo " selected";
            $indice_grp_courant = $cpt_grp;
        }
        echo ">" . $tmp_grp['description'] . " (" . $tmp_grp['name'] . " en " . $tmp_grp["classlist_string"] . ")</option>\n";
        $cpt_grp++;
    }
    echo "</select>\n";
    if ($mode_signalement == "2") {
        echo " | <a href='" . $_SERVER['PHP_SELF'] . "?mode_signalement=1&amp;id_groupe={$id_groupe}'>Ancien mode</a>\n";
    } else {
        echo " | <a href='" . $_SERVER['PHP_SELF'] . "?mode_signalement=2&amp;id_groupe={$id_groupe}'>Nouveau mode</a>\n";
    }
    echo "</p>\n";
Пример #24
0
                 //echo "<!-- \$ligne_eleve->login=$ligne_eleve->login -->\n";
             }
         }
         $create = update_group($id_groupe, $id_matiere[$i], $ligne_matiere->nom_complet, $id_matiere[$i], $reg_clazz, $reg_professeurs, $reg_eleves);
         if (!$create) {
             $msg .= "Erreur lors de la mise à jour du groupe {$id_matiere[$i]}";
         }
         //else {
         //	$msg .= "Le groupe a bien été mis à jour.";
         //}
     }
 } elseif ($checkmat[$i] != "") {
     // Mise à jour du groupe $id_groupe=$checkmat[$i]
     $id_groupe = $checkmat[$i];
     //echo "\$id_groupe=$id_groupe<br />\n";
     $group = get_group($id_groupe);
     $sql = "SELECT * FROM matieres WHERE matiere='{$id_matiere[$i]}'";
     $resultat_matiere = mysqli_query($GLOBALS["mysqli"], $sql);
     $ligne_matiere = mysqli_fetch_object($resultat_matiere);
     $reg_clazz[0] = $id_classe;
     /*
     for($k=0;$k<count();$k++){
         echo "\$group[profs][list][$k]=".$group["profs"]["list"][$k]."<br />\n";
     }
     */
     //$create = update_group($id_groupe, $reg_nom_groupe, $reg_nom_complet, $reg_matiere, $reg_clazz, $reg_professeurs, $reg_eleves);
     //echo "<!--update_group($id_groupe, $id_matiere[$i], $ligne_matiere->nom_complet, $id_matiere[$i], $reg_clazz, ".$group["profs"]["list"].", ".$group["eleves"]["list"].");-->\n";
     //echo "update_group($id_groupe, $id_matiere[$i], $ligne_matiere->nom_complet, $id_matiere[$i], $reg_clazz, ".$group["profs"]["list"].", ".$group["eleves"]["list"].");<br />\n";
     //$create = update_group($id_groupe, $id_matiere[$i], $ligne_matiere->nom_complet, $id_matiere[$i], $reg_clazz, $group["profs"]["list"], $group["eleves"]["list"]);
     if (isset($group["profs"]["list"])) {
         $tabprof = $group["profs"]["list"];
Пример #25
0
    }
}
// On teste si le carnet de notes appartient bien à la personne connectée
if (!Verif_prof_cahier_notes($_SESSION['login'], $id_racine)) {
    $mess = rawurlencode("Vous tentez de pénétrer dans un carnet de notes qui ne vous appartient pas !");
    header("Location: index.php?msg={$mess}");
    die;
}
if (!getSettingAOui('GepiPeutCreerBoitesProf')) {
    $msg = rawurlencode("Vous n'avez pas le droit de créer des " . getSettingValue('gepi_denom_boite')) . "s.";
    header("Location: ./index.php?id_racine={$id_racine}&msg={$msg}");
    die;
}
$appel_cahier_notes = mysqli_query($GLOBALS["mysqli"], "SELECT * FROM cn_cahier_notes WHERE id_cahier_notes = '{$id_racine}'");
$id_groupe = old_mysql_result($appel_cahier_notes, 0, 'id_groupe');
$current_group = get_group($id_groupe);
$periode_num = old_mysql_result($appel_cahier_notes, 0, 'periode');
/**
 * Gestion des périodes
 */
include "../lib/periodes.inc.php";
$acces_exceptionnel_saisie = false;
if ($_SESSION['statut'] == 'professeur') {
    $acces_exceptionnel_saisie = acces_exceptionnel_saisie_cn_groupe_periode($id_groupe, $periode_num);
}
// On teste si la periode est vérouillée !
if ($current_group["classe"]["ver_periode"]["all"][$periode_num] <= 1 && !$acces_exceptionnel_saisie) {
    $mess = rawurlencode("Vous tentez de pénétrer dans un carnet de notes dont la période est bloquée !");
    header("Location: index.php?msg={$mess}");
    die;
}
Пример #26
0
    if ($w == "u") {
        $html_title .= " 수정";
        if (!$board[bo_table]) {
            alert("존재하지 않은 게시판 입니다.");
        }
        if ($is_admin == "group") {
            if ($member[mb_id] != $group[gr_admin]) {
                alert("그룹이 틀립니다.");
            }
        }
        $required_bo_table = "";
        $update_bo_table = "readonly='readonly' style='background-color:#dddddd'";
    }
}
if ($is_admin != "super") {
    $group = get_group($board[gr_id]);
    $is_admin = is_admin($member[mb_id]);
}
$g4[title] = $html_title;
include_once "./admin.head.php";
echo editor_load();
?>

<?php 
echo subtitle("게시판 생성");
?>
<form id='fboardform' method='post' action='#' onsubmit="return fboardform_submit(this)" enctype="multipart/form-data">
<table class='normal3'>
<col width="40" />
<col width="170" />
<col />
Пример #27
0
		$i = 0;
		$compteur = 0;
		$prev_cat_id = null;
		while ($i < $nombre_lignes) {
			$inserligne="no";
			$group_id = old_mysql_result($call_groupes, $i, "id_groupe");
			$current_group = get_group($group_id);
			// On essaie maintenant de récupérer un groupe avec la même matière, auquel participerait l'élève 2
			$call_group2 = mysqli_query($GLOBALS["mysqli"], "SELECT distinct(jeg.id_groupe) id_groupe FROM j_eleves_groupes jeg, j_groupes_matieres jgm WHERE (" .
					"jeg.login = '******' and " .
					"jeg.id_groupe = jgm.id_groupe and " .
					"jgm.id_matiere = '" . $current_group["matiere"]["matiere"] . "')");

			if (mysqli_num_rows($call_group2) == 1) {
				$group2_id = old_mysql_result($call_group2, 0, "id_groupe");
				$current_group2 = get_group($group2_id);
			} else {
				$current_group2 = false;
			}

			if ($current_group2) {
				if ($periode != 'annee') {
					if (in_array($v_eleve1, $current_group["eleves"][$periode]["list"]) AND in_array($v_eleve2, $current_group2["eleves"][$periode]["list"])) {
						$inserligne="yes";
						$note_eleve1_query=mysqli_query($GLOBALS["mysqli"], "SELECT * FROM matieres_notes WHERE (login='******' AND periode='$periode' AND id_groupe='" . $current_group["id"] . "')");
						$note_eleve2_query=mysqli_query($GLOBALS["mysqli"], "SELECT * FROM matieres_notes WHERE (login='******' AND periode='$periode' AND id_groupe='" . $current_group2["id"] . "')");
						$eleve1_matiere_statut = @old_mysql_result($note_eleve1_query, 0, "statut");
						$note_eleve1 = @old_mysql_result($note_eleve1_query, 0, "note");
						if ($eleve1_matiere_statut != "") { $note_eleve1 = $eleve1_matiere_statut;}
						if ($note_eleve1 == '') {$note_eleve1 = '-';}
						$eleve2_matiere_statut = @old_mysql_result($note_eleve2_query, 0, "statut");
         echo "\n\t\t\t<td><input type='hidden' name='num_periode_" . $id_classe[$i] . "[]' value='{$key}' />{$value}</td>\n\t\t\t<td style='text-align:left;'>";
         if ($choix_matieres == 'certaines') {
             if (isset($_POST['id_groupe_' . $id_classe[$i]])) {
                 $tmp_grp = $_POST['id_groupe_' . $id_classe[$i]];
                 $temoin_grp = 0;
                 for ($loop = 0; $loop < count($tmp_grp); $loop++) {
                     if (isset($tmp_grp[$loop])) {
                         if ($temoin_grp > 0) {
                             //echo ", ";
                             echo "<br />";
                         }
                         // Pour ne pas pas mettre autant de fois le groupe qu'il y a de période:
                         if ($cpt_per == 0) {
                             echo "\n\t\t\t\t<input type='hidden' name='id_groupe_" . $id_classe[$i] . "[]' value='{$tmp_grp[$loop]}' />";
                         }
                         $current_group = get_group($tmp_grp[$loop]);
                         //echo $current_group['id']." ";
                         echo $current_group['name'] . " (<em>" . $current_group['description'] . "</em>) " . $current_group['profs']['proflist_string'];
                         $temoin_grp++;
                     }
                 }
             }
         } else {
             echo "\n\t\t\t\t\tTous";
         }
         echo "\n\t\t\t</td>\n\t\t</tr>";
         $cpt_per++;
     }
 }
 echo "\n\t</table>\n\n\t<input type='hidden' name='appliquer_le_modele' value='y' />\n\t<input type='submit' value='Valider' />\n\t<input type='hidden' name='temoin_suhosin_2' value='1' />\n</form>\n";
 //debug_var();
Template Name: Schedules
*/
get_header();
?>

		<section role="main" class="schedule">
			<a href="<?php 
echo get_page_link(48);
?>
" id="free-class" title="Book my free class now">Book my free class now</a>
			<h1>Schedules</h1>
			<div class="two-column">
				<aside>

					<?php 
$callouts = get_group('Callout');
if ($callouts) {
    $num = 0;
    foreach ($callouts as $callout) {
        $num++;
        if ($num != 1) {
            echo '<hr>';
        }
        echo $callout['callout_text'][1];
    }
}
?>

				</aside>
				<article class="loading">
					<div class="filters">
Пример #30
0
					echo "<a href='javascript:$chaine_coche'><img src='../images/enabled.png' width='15' height='15' alt='Tout cocher' /></a>/\n";
					echo "<a href='javascript:$chaine_decoche'><img src='../images/disabled.png' width='15' height='15' alt='Tout décocher' /></a>\n";

					echo "</th>\n";
					echo "</tr>\n";

					$tab_champs_grp=array('matieres','profs','classes');

					$nb_erreurs=0;
					$i=0;
					$alt=-1;
					while ($lig_call_group=$call_group->fetch_object()) {
						$id_groupe = $lig_call_group->id;
						$nom_groupe = $lig_call_group->name;

						$tmp_group=get_group($id_groupe,$tab_champs_grp);
						$chaine_profs="";
						//for($loop=0;$loop<count($tmp_group[])) {}
						foreach($tmp_group["profs"]["users"] as $login_prof) {
							$chaine_profs.=", ";
							$chaine_profs.=$login_prof['civilite']."&nbsp;".$login_prof['nom']." ".mb_substr($login_prof['prenom'],0,1);
						}
						if($chaine_profs!='') {$chaine_profs=mb_substr($chaine_profs,2);}

						$alt=$alt*(-1);
						/*
						echo "<tr style='background-color:";
						if($alt==1){
							echo "silver";
						}
						else{