Exemple #1
0
				</tr>
				<?php 
    }
    ?>
			</tbody>
		</table>
		</div>
	<?php 
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-GB" xml:lang="en-GB">
	<head>
		<meta charset="UTF-8"/>
		<title>All Credited WordPress Contributors</title>
		<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="bootstrap-theme.min.css" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
	</head>
	<body>
		<div class="container-fluid" style="margin: 1em;">
			<h1>All Credited WordPress Contributors <small>(beta)</small></h1>
			<p class="lead">WordPress has had an API for listing the names of all the contributors and more in-depth roles since version 3.2. The table below looks at each version, and notes what role someone had, if any, for all of the versions since.</p>
			<p><small>This is considered beta, as it has no caching of results (currently a standalone page as a proof-of-concept) so it hits the Credits API once for each version, on every page load).</small></p>
			<?php 
do_table();
?>
		</div>
	</body>
</html>
<hr> 

<button class="btn btn-primary" onclick="get_send_options('researchtb', 's')">Submit</button>
</section>
<section id="admin">
	<h2 class="description" for="element_5">Dinner</h2>
<br>

<!-- 	<input type="checkbox" id="acheck" onchange="a_form.onchangee()" /><label for="acheck" id="ac" class="editbut">Edit</label>
 -->


<p id="li_4"><table id="admintb" width="40%" align="middle" class="result"><tbody><tr><td >Day</td><td>Meal 1</td><td>Meal 2</td><td>Meal 3</td><td>Meal 4</td></tr></tbody><tbody>

<?php 
do_table("d");
?>


	</tbody></table>


	<br><h4 class="total text-success">TOTAL : Rs <span id="totadmin"></span> per week (<span id="peradmin"></span>%)</h4>
</p>



<hr>

<button class="btn btn-primary" onclick="get_send_options('admintb', 'd')">Submit</button>
</section>
        $speakers = get_records_sql('SELECT SP.id, SP.login AS descr FROM ' . $CFG->prefix . 'ponente SP
                            JOIN ' . $CFG->prefix . 'propuesta P ON P.id_ponente = SP.id
                            WHERE P.id_status=7');
        $speakers_input = do_get_output('do_input_select', array('filter_id_ponente', $speakers, $id_ponente, true, '', 0, $onChange));
        $table_data[] = array('', __('Modificado por:'), __('Tipo:'), __('Ponente:'));
        $table_data[] = array(__('Filtro:'), $admins_input, $prop_type_input, $speakers_input);
    } elseif (Action == 'scheduleevent' || Action == 'addschedule') {
        // acepted proposals
        $prop_type = get_records_sql('SELECT PT.* FROM ' . $CFG->prefix . 'prop_tipo PT
                                JOIN ' . $CFG->prefix . 'propuesta P ON P.id_prop_tipo=PT.id
                                WHERE P.id_status=5');
        $prop_type_input = do_get_output('do_input_select', array('filter_id_prop_tipo', $prop_type, $id_prop_tipo, true, '', 0, $onChange));
        $track = get_records_sql('SELECT O.* FROM ' . $CFG->prefix . 'orientacion O
                            JOIN ' . $CFG->prefix . 'propuesta P ON P.id_orientacion=O.id
                            WHERE P.id_status=5');
        $track_input = do_get_output('do_input_select', array('filter_id_orientacion', $track, $id_orientacion, true, '', 0, $onChange));
        $table_data[] = array('', __('Tipo:'), __('Orientación:'));
        $table_data[] = array(__('Filtro:'), $prop_type_input, $track_input);
    }
} else {
    // get all tracks
    //$tracks = get_records('orientacion');
    $tracks = get_records_sql('SELECT O.* FROM ' . $CFG->prefix . 'orientacion O
                        JOIN ' . $CFG->prefix . 'propuesta P ON P.id_orientacion=O.id');
    $tracks_input = do_get_output('do_input_select', array('filter_id_orientacion', $tracks, $id_orientacion, true, '', 0, $onChange));
    //headers
    $table_data[] = array('', __('Tipo:'), __('Orientación:'), __('Estado:'));
    $table_data[] = array(__('Filtro:'), $prop_type_input, $tracks_input, $status_input);
}
do_table($table_data, 'prop-filter wide');
            // data
            $table_data[] = array($l_ponencia, $workshop->orientacion, $workshop->lugar, $time, $disp, $l_action);
        }
    }
    $human_date = friendly_date($last_date);
    ?>

<h2><?php 
    echo $human_date;
    ?>
</h2>
<h3><?php 
    echo $last_date_desc;
    ?>
</h2>

<?php 
    // do last table
    do_table($table_data, 'wide');
} else {
    ?>

<div class="block"></div>

<p class="error center"><?php 
    echo __('No se encontraron talleres/tutoriales registrados.');
    ?>
</p>

<?php 
}
<?php

if ($USER->id_tadmin != 1 || empty($catalog)) {
    die;
}
$table_data = array();
$datas = get_records($catalog);
if (!empty($datas)) {
    foreach ($datas as $data) {
        if ($catalog == 'tadmin') {
            $input_tareas = do_get_output('do_input', array($catalog . $data->id, 'text', $data->tareas, 'size="50"'));
            $table_data[] = array($data->id, $data->descr, $input_tareas);
        } else {
            $input_descr = do_get_output('do_input', array($catalog . $data->id, 'text', $data->descr, 'size="50"'));
            $table_data[] = array($data->id, $input_descr);
        }
    }
    if (in_array($catalog, $catalogs_addremove_field)) {
        // add input for new option
        $input_descr = do_get_output('do_input', array($catalog . '-new', 'text', '', 'size="50"'));
        $table_data[] = array('+', $input_descr);
    }
    do_table($table_data, 'catalog');
}
<?php

if (empty($CFG) || empty($q) || Context != 'admin') {
    die;
}
if ($reg_flags = get_records('config')) {
    $table_data = array();
    $table_data[] = array(__('Nombre'), __('Estado'), __('Acción'));
    foreach ($reg_flags as $conf) {
        $status_desc = $conf->status ? __('Abierto') : __('Cerrado');
        // toggle status
        $status_toggle = $conf->status ? 'close' : 'open';
        $action_desc = $conf->status ? __('Cerrar') : __('Abrir');
        $action_class = $conf->status ? 'precaucion' : 'verde';
        $url = get_url('admin/config');
        $action = <<<END
<a class="{$action_class}" href="{$url}/{$status_toggle}/{$conf->id}">{$action_desc}</a>
END;
        $table_data[] = array(sprintf('<ul><li>%s</li></ul>', $conf->descr), $status_desc, $action);
    }
    do_table($table_data, 'narrow');
}
Exemple #7
0
function display_inflection($w, $hidden = TRUE)
{
    if ($c = $w->cached()) {
        if (($_ = json_decode($c, true)) === NULL) {
            echo $c;
            return;
        } else {
            $c = $_;
        }
        for ($i = 0; $i < count($c); $i++) {
            if ($i === 0) {
                echo $c[$i];
            } else {
                echo format_word($c[$i]);
            }
        }
        return;
    } else {
        ob_start();
    }
    $pronunciations = $w->pronunciations();
    //error_log($pronunciations);
    $w->clear_connections();
    $connections = $w->connections();
    list($values0, $values1, $values2, $values3, $values4) = word_table_values($w);
    if (!$values0 and !$values1 and !$values3 and !$values4 and !$values2) {
        ?>
<span id="word<?php 
        echo $w->id();
        ?>
_forms">(No inflection for this word)</span><?php 
        return;
    }
    ?>
	Inflection
	<?php 
    display_icon("visibility", $hidden ? "Show" : "Hide", "toggle-forms" . $w->id());
    if ($pronunciations) {
        ?>
<span id="toggle-pronunciations<?php 
        echo $w->id();
        ?>
_outer">
			[<a href="javascript:void(0)" id="toggle-pronunciations<?php 
        echo $w->id();
        ?>
">show IPA</a>]<br><br>
		</span><?php 
    }
    ?>
<span id="toggle-quizzing<?php 
    echo $w->id();
    ?>
_outer">
		[<a href="javascript:void(0)" id="toggle-quizzing<?php 
    echo $w->id();
    ?>
">cover forms</a>]<br><br>
	</span><?php 
    do_table($w, $values0, $values1, $values2, $values3, $values4, NULL, "format_value", function ($v, $p) use($w) {
        return format_word($p, $w->lang(), true);
    }, function ($p) use($connections) {
        $p = (string) $p;
        foreach ($connections as $connect) {
            if ($connect->type() === $p) {
                return $connect->to();
            }
        }
    }, function ($p) use($pronunciations, $w) {
        $p = (string) $p;
        $made_div = FALSE;
        $last_type = NULL;
        $first = TRUE;
        foreach ($pronunciations as $pron) {
            if ((string) $pron->path() !== $p) {
                continue;
            }
            if ($pron->type() !== "IPA") {
                continue;
            }
            if (!$made_div) {
                ?>
<span class="word<?php 
                echo $w->id();
                ?>
_pronunciation"><?php 
                $made_div = TRUE;
            }
            ?>
<br><?php 
            $last_type = $pron->type();
            if ($pron->sublang()) {
                ?>
<sup>[<?php 
                echo $pron->sublang();
                ?>
]</sup><?php 
            }
            ?>
[<?php 
            echo format_pron($pron->value());
            ?>
]<?php 
            $first = FALSE;
        }
        if ($made_div) {
            ?>
</span><?php 
        }
    });
    ?>
	<script type="text/javascript">
		$(function(){
			var c = "<?php 
    echo $w->id();
    ?>
";
			var selector = $('#word'+c+'_forms, #toggle-pronunciations'+c+'_outer, #toggle-quizzing'+c+'_outer');
			$('#toggle-forms'+c).click(function () {
				selector.toggle();
				var vis = $('#word'+c+'_forms').is(':visible');
				$('#toggle-forms'+c).attr('title', vis ? 'Hide' : 'Show');
				if (!vis)
					$('.word'+c+'_pronunciation').hide();
			});
		<?php 
    if (!$hidden) {
        ?>
			selector.hide();
		<?php 
    }
    ?>
			$('#toggle-forms'+c).trigger("click");
			$('#toggle-pronunciations'+c).click(function () {
				$('.word'+c+'_pronunciation').toggle();
				$('#toggle-pronunciations'+c).attr('title', $('.word'+c+'_pronunciation').is(':visible') ? 'hide IPA' : 'show IPA');
			});
			$('#toggle-quizzing'+c).click(function () {
				$('#word'+c+' td').addClass('hidden').on('click', function() {$(this).removeClass('hidden').off('click')});
			});
			$('.word'+c+'_pronunciation, #toggle-pronunciations').hide();
		});
	</script>
	<?php 
    $w->set_cached(ob_get_contents());
    ob_end_flush();
}
function make_chart2($w, $w2, $values = NULL, $ignore = NULL, $legend = "this chart", $add = NULL, $basepath = NULL)
{
    ob_start();
    if ($values === NULL) {
        $values = word_table_values($w, $ignore);
        list($values0, $values1, $values2, $values3, $values4) = $values;
    } else {
        list($values0, $values1, $values2, $values3, $values4) = $values;
        $values0 = _do_ignore($values0, $ignore);
        if (is_fillable($values1)) {
            $values1 = _fill($values1, $values0);
        }
        if (is_fillable($values2)) {
            $values2 = _fill($values2, $values0);
        }
        if (is_fillable($values3)) {
            $values3 = _fill($values3, $values0);
        }
        if (is_fillable($values4)) {
            $values4 = _fill($values4, $values0);
        }
        _filter_ignore2($values1, $ignore, PATH($w), $values0);
        _filter_ignore2($values2, $ignore, PATH($w), $values0, $values1);
        _filter_ignore2($values3, $ignore, PATH($w), $values0);
        _filter_ignore2($values4, $ignore, PATH($w), $values0, $values3);
    }
    global $OP_USER_INPUT;
    $w->read_paths();
    $w->read_attrs();
    $w2->read_paths();
    $w2->read_attrs();
    if ($add) {
        $add = ", {$add}";
    }
    $ret = ["help" => "Fill in {$legend} for “" . display_word_name($w) . "” and “" . display_word_name($w2) . "”{$add}.", "selections" => [], "sentence" => []];
    $i = 0;
    $get_question = function ($form, $path) use(&$i, $w2, &$ret, $basepath) {
        $ret["answer{$i}-hidden"] = TRUE;
        $ret["answer{$i}"] = ["correct" => [], "acceptable" => []];
        $form2 = PATH($w2, $path, $basepath);
        $form2 = $form2->get();
        foreach (explode("\n", $form) as $f) {
            foreach (explode("\n", $form2) as $f2) {
                $ret["answer{$i}"]["correct"][] = $f . " " . $f2;
                $ret["answer{$i}"]["acceptable"][] = $f . " " . $f2;
                $ret["answer{$i}"]["acceptable"][] = $f2 . " " . $f;
            }
        }
        $ret["answer{$i}-tooltip"] = "Enter form";
        $i++;
        return '<input>';
    };
    do_table($w, $values0, $values1, $values2, $values3, $values4, $ignore, "format_value", $get_question, NULL, NULL, 0);
    $table = explode("<input>", ob_get_contents());
    ob_clean();
    $i = count($table) - 1;
    foreach ($table as $r) {
        $ret["sentence"][] = HTML($r);
        if ($i) {
            $ret["sentence"][] = $OP_USER_INPUT;
        }
        $i -= 1;
    }
    return $ret;
}
<p class="error center"><?php 
    echo __('Esta propuesta no tiene archivos adjuntos.');
    ?>
</p>

<?php 
} else {
    $table_data = array();
    // headers
    $table_data[] = array(__('Nombre'), __('Descripción'), __('Tamaño'), __('Público'), '');
    foreach ($files as $f) {
        $public = empty($f->public) ? __('No') : __('Si');
        //download file
        $url = get_url('speaker/proposals/' . $proposal->id . '/files/' . $f->id . '/' . $f->name);
        $l_name = "<a href=\"{$url}\">{$f->title}</a>";
        //size
        $size = sprintf('<span class="right">%s</span>', human_filesize($f->size));
        $sMod = __('Modificar');
        $sDelete = __('Eliminar');
        $url = get_url('speaker/proposals/' . $proposal->id . '/files/edit/' . $f->id . '/' . $f->name);
        $l_modify = "<a class=\"verde\" href=\"{$url}\">{$sMod}</a>";
        if ($proposal->id_status < 5) {
            $url = get_url('speaker/proposals/' . $proposal->id . '/files/delete/' . $f->id . '/' . $f->name);
            $l_delete = "&nbsp;|&nbsp;<a class=\"precaucion\" href=\"{$url}\">{$sDelete}</a>";
        } else {
            $l_delete = '';
        }
        $table_data[] = array($l_name, $f->descr, $size, $public, $l_modify . $l_delete);
    }
    do_table($table_data, 'narrow-form files');
}