本文整理汇总了PHP中Record::get_classname方法的典型用法代码示例。如果您正苦于以下问题:PHP Record::get_classname方法的具体用法?PHP Record::get_classname怎么用?PHP Record::get_classname使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Record
的用法示例。
在下文中一共展示了Record::get_classname方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
<?php
header("Content-Type: text/plain");
define("BASE_DIR", dirname(__FILE__));
require_once BASE_DIR . "/include/constants.inc";
require_once BASE_DIR . "/include/globals.inc";
require_once BASE_DIR . "/include/misc.inc";
require_once BASE_DIR . "/include/dd.inc";
require_once BASE_DIR . "/include/mail.inc";
// execute some task if any.
Task::run(TASK_RUNNING_DURATION);
$type = "task";
$classname = Record::get_classname($type);
eval('$remaining_tasks = ' . $classname . '::get_progression($type, $_POST["event_id"]);');
echo join(",", $remaining_tasks);
示例2: get_table
public static function get_table($type)
{
$classname = Record::get_classname($type);
$start = default_value("start", 0);
$qty = default_value("qty", 50);
eval('list($db_records, $start, $total) = ' . $classname . '::select_range($type, $start, $qty);');
eval('$columns = ' . $classname . '::get_fields($type);');
$min = min($start + 1, $total);
$max = $start + count($db_records);
$prev = "{{prev}}";
if ($min > 1) {
$prev_start = max(0, $start - $qty);
$prev = '<a href="?action=manage&type=' . $type . '&start=' . $prev_start . '#top_table">{{prev}}</a>';
}
$next = "{{next}}";
if ($max < $total) {
$next = '<a href="?action=manage&type=' . $type . '&start=' . $max . '#top_table">{{next}}</a>';
}
$colspan = count($columns) + 2;
$result = <<<EOF
<table id="top_table" class="evt_table_record_manage">
\t<tr>
\t\t<td>{$min} - {$max} {{of}} {$total} {$prev} {$next}</td>
\t</tr>
\t<tr>
\t\t<td>
<table class="evt_table_record">
\t<tr>
\t\t<th><input type="checkbox" class="check_all_record" /></th>
\t\t<th>Actions</th>
EOF;
foreach ($columns as $field) {
$result .= <<<EOF
\t\t<th>{$field->label}</th>
EOF;
}
$result .= <<<EOF
\t</tr>
EOF;
foreach ($db_records as $db_record) {
$record = Record::get_from_db_record($db_record, $type);
$result .= <<<EOF
\t<tr>
EOF;
$id = $db_record["id"];
$html = <<<EOF
\t\t\t<select class="evt_record_actions">
\t\t\t\t<option value="#" selected>Choose...</option>
EOF;
$classname = dd()->get_entity($type)->classname;
foreach (dd()->get_entity($type)->get_actions() as $action) {
if ($record->accept($action)) {
$html .= <<<EOF
\t\t\t\t<option value="?action={$action->name}&type={$type}&id={$id}">{$action->label}</option>
EOF;
}
}
$html .= <<<EOF
\t\t\t</select>
EOF;
$result .= <<<EOF
\t\t<td><input type="checkbox" name="{$id}" class="record" /></td>
\t\t<td>{$html}</td>
EOF;
foreach ($columns as $field) {
$colname = Field::get_colname($field->name);
$value = $db_record[$colname];
$html = Record::format_value($value, $field, $db_record["id"]);
$result .= <<<EOF
\t\t<td>{$html}</td>
EOF;
}
$result .= <<<EOF
\t</tr>
EOF;
}
$result .= <<<EOF
</table>
\t\t</td>
\t</tr>
\t<tr>
\t\t<td>{$min} - {$max} {{of}} {$total} {$prev} {$next}</td>
\t</tr>
</table>
EOF;
return $result;
}