本文整理汇总了PHP中Table类的典型用法代码示例。如果您正苦于以下问题:PHP Table类的具体用法?PHP Table怎么用?PHP Table使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Table类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: list_data_radio
function list_data_radio($hal = 0) {
$_SESSION[setting_radiologi_spesimen][hal] = $hal;
$objResponse = new xajaxResponse();
$paging = new MyPagina;
$paging->rows_on_page = 15;
$paging->sql = "
SELECT
rp.id as id,
rp.nama as nama,
rp.biaya_bhp as biaya_bhp,
rpd.biaya_jasa as biaya_jasa,
rpd.kelas as kelas
FROM
radio_pemeriksaan rp
JOIN radio_pemeriksaan_detil rpd ON (rpd.tingkat = rp.tingkat)
ORDER BY
rp.nama
";
$paging->hal = $hal;
$paging->get_page_result();
$data = $paging->data;
$no = $paging->start_number();
$navi = $paging->navi();
$table = new Table;
$table->tbody_height = 350;
$table->addTh(
"No",
"Nama",
"Biaya BHP",
"Biaya Jasa",
"Kelas",
"Hapus"
);
//$table->addExtraTh("style=\"width:50px;\"","style=\"width:200px;\"","","","");
//$kon = new Konek;
for($i=0;$i<sizeof($data);$i++) {
$table->addRow(
($no+$i),
$data[$i][nama],
$data[$i][biaya_bhp],
$data[$i][biaya_jasa],
$data[$i][kelas],
"<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_kamar('".$data[$i][id]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>"
);
$table->addOnclickTd(
"xajax_get_info('".$data[$i][id]."')",
"xajax_get_info('".$data[$i][id]."')",
"xajax_get_info('".$data[$i][id]."')",
"xajax_get_info('".$data[$i][id]."')",
"xajax_get_info('".$data[$i][id]."')"
);
}
$buka = $table->build();
$objResponse->addAssign("list_data_radio", "innerHTML", $buka);
$objResponse->addAssign("navi", "innerHTML", $navi);
return $objResponse;
}
示例2: __construct
public function __construct(Database $database, Table $table, $info)
{
// Table
$this->table = $table;
// Name
$this->name = $info->Field;
// Type
$this->parse_type($info->Type);
// Default
$this->default_value = $info->Default;
// Primary key
if (strtoupper($info->Key) == 'PRI') {
$this->is_primary_key = true;
if ($info->Extra == 'auto_increment') {
$this->is_auto_increment = true;
}
}
// Unique key
if (strtoupper($info->Key) == 'UNI') {
$this->is_unique = true;
}
// Comment
$this->comment = $info->Comment;
// Collation
$this->collation = $info->Collation;
// NULL?
$this->nullable = $info->Null == 'YES';
// Is this a foreign key?
if (in_array($this->name, $table->get_foreign_key_names())) {
$referencedTables = $table->get_referenced_tables(false);
$this->references = $referencedTables[$this->name];
}
}
示例3: getPrimaryKeyDDL
public function getPrimaryKeyDDL(Table $table)
{
if ($table->hasPrimaryKey()) {
$pattern = 'CONSTRAINT %s PRIMARY KEY (%s)';
return sprintf($pattern, $this->quoteIdentifier($this->getPrimaryKeyName($table)), $this->getColumnListDDL($table->getPrimaryKey()));
}
}
示例4: testToPhpUnitTable
/**
* Tests toPhpUnitTable.
*/
public function testToPhpUnitTable()
{
$table = new Table(new Test(new ReflectionMethod(__CLASS__, __FUNCTION__)), 'dbName', 'tableName');
$result = $table->toPhpUnitTable();
$this->assertInstanceOf('PHPUnit_Extensions_Database_DataSet_ITable', $result);
$this->assertSame('dbName.tableName', $result->getTableMetaData()->getTableName());
}
示例5: getHtml
public function getHtml()
{
$trace = $this->trace->addChild("HodnoteniaCallback");
$hodnotenia = $this->app->getHodnotenia($trace);
$hodnoteniaTable = new Table(TableDefinitions::hodnotenia());
$priemeryCalculator = new PriemeryCalculator();
foreach (Sorter::sort($hodnotenia->getData(), array("semester" => -1, "nazov" => 1)) as $row) {
if ($row['semester'] == 'L') {
$class = 'leto';
$priemeryCalculator->add(PriemeryCalculator::SEMESTER_LETNY, $row['znamka'], $row['kredit']);
} else {
$class = 'zima';
$priemeryCalculator->add(PriemeryCalculator::SEMESTER_ZIMNY, $row['znamka'], $row['kredit']);
}
$hodnoteniaTable->addRow($row, array('class' => $class));
}
$hodnoteniaCollapsible = new Collapsible(new HtmlHeader('Hodnotenia'), $hodnoteniaTable);
$priemery = $this->app->getPriemery($trace);
$priemeryTable = new Table(TableDefinitions::priemery());
$priemeryTable->addRows($priemery->getData());
$priemeryContainer = new Container();
$priemeryContainer->addChild(new Label('Nasledovné priemery sú prebraté z AISu, čiže to (ne)funguje presne rovnako:'));
$priemeryContainer->addChild($priemeryTable);
if ($priemeryCalculator->hasPriemer()) {
$priemeryFajrText = '<p><br />Nasledovné vážené študijné priemery sú počítané Fajrom priebežne z tabuľky Hodnotenia, <strong>preto nemôžu byť považované ako oficiálne</strong>:<br /><br />';
$priemeryFajrText .= $priemeryCalculator->getHtml();
$priemeryFajrText .= '</p>';
$priemeryContainer->addChild(new Label($priemeryFajrText));
}
$priemeryCollapsible = new Collapsible(new HtmlHeader('Priemery'), $priemeryContainer);
return $hodnoteniaCollapsible->getHtml() . $priemeryCollapsible->getHtml();
}
示例6: display
public function display()
{
$form = new Form(2);
$form->submit();
$GLOBALS['editinglanguage'] = new Language($_GET['language']);
$table = new Table();
$token = new TableColumn("token", "Token");
$translation = new TableFunctionColumn("token", Language::DirectTranslate("TRANSLATION"));
$translation->functionName = "TranslationEditor_GetString";
$translation->autoWidth = true;
$languagetoken = new TableColumn("'" . DataBase::Current()->EscapeString($_GET['language']) . "' as language", "Language");
$languagetoken->value = $_GET['language'];
$languagetoken->visible = false;
$table->columns->add($token);
$table->columns->add($translation);
$table->columns->add($languagetoken);
$table->name = "{'dbprefix'}language_tokens";
$table->actions = "translation_tokens";
$table->orderBy = "token";
$table->size = -1;
$table->display();
$newModule = Language::DirectTranslateHtml("NEW_MODULE");
echo "<h2>" . $newModule . "</h2>";
$form->display();
}
示例7: list_data
function list_data($hal = 0) {
$_SESSION[hal] = $hal;
$objResponse = new xajaxResponse();
$paging = new MyPagina;
$paging->rows_on_page = 20;
$paging->sql = "SELECT
i.id as icid,
i.kode as kode,
i.nama as nama,
id.id as idid,
id.*
FROM
icopim i
LEFT JOIN icopim_detil id ON (id.tingkat = i.tingkat)
GROUP BY i.id, id.kelas
ORDER BY i.nama, id.kelas
";
$paging->hal = $hal;
$paging->get_page_result();
$data = $paging->data;
$no = $paging->start_number();
$navi = $paging->navi();
$tabel = new Table;
$tabel->tbody_height = 400;
$tabel->addTh(
"No",
"Kode",
"Tindakan",
"Tingkat",
"Kelas",
"Biaya",
"Hapus"
);
for($i=0;$i<sizeof($data);$i++) {
$tabel->addRow(
($no+$i),
$data[$i][kode],
$data[$i][nama],
$data[$i][tingkat],
$data[$i][kelas],
$data[$i][biaya],
"<a href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"hapus_tindakan('".$data[$i][icid]."', '".$data[$i][idid]."', this)\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus\" border=\"0\" /></a>");
$tabel->addOnclickTd(
"xajax_get_tindakan('".$data[$i][icid]."', '".$data[$i][tingkat]."', '".$data[$i][kelas]."')",
"xajax_get_tindakan('".$data[$i][icid]."', '".$data[$i][tingkat]."', '".$data[$i][kelas]."')",
"xajax_get_tindakan('".$data[$i][icid]."', '".$data[$i][tingkat]."', '".$data[$i][kelas]."')",
"xajax_get_tindakan('".$data[$i][icid]."', '".$data[$i][tingkat]."', '".$data[$i][kelas]."')",
"xajax_get_tindakan('".$data[$i][icid]."', '".$data[$i][tingkat]."', '".$data[$i][kelas]."')",
"xajax_get_tindakan('".$data[$i][icid]."', '".$data[$i][tingkat]."', '".$data[$i][kelas]."')"
);
}
$buka = $tabel->build();
$objResponse->addAssign("list_data", "innerHTML", $buka);
$objResponse->addAssign("navi", "innerHTML", $navi);
return $objResponse;
}
示例8: Load
public function Load()
{
require_once dirname(__FILE__) . "/includes/utils-unset-var.inc.php";
if (!$this->isAjaxPage()) {
unsetWspAdminVariables();
}
parent::$PAGE_TITLE = __(CONNECT_PAGE_TITLE);
$this->setUserRights("");
// Welcome message
$this->render = new Table();
$this->render->setWidth("100%");
$connect_box = new RoundBox(RoundBox::STYLE_SECOND, "connect_box", 420, 150);
$connect_box->setShadow(true);
$connect_box->setValign(RoundBox::VALIGN_CENTER);
$connect_table = new Table();
$connect_table->setWidth("100%")->setDefaultAlign(RowTable::ALIGN_LEFT);
$admin_pic = new Picture("img/wsp-admin/admin_128.png", 128, 128);
$this->auth_obj = new Authentication($this, "connect");
$this->auth_obj->setTableWidth(265);
$connect_table->addRowColumns($admin_pic, $this->auth_obj);
$connect_box->setContent($connect_table);
$this->render->addRow("<br/><br/><br/><br/><br/>");
$this->obj_br_before = new Object();
$this->obj_br_before->setId("divBrBefore");
$this->render->addRow($this->obj_br_before);
$this->mod_obj = new Object();
$this->mod_obj->setId("divConfigRecommandation")->setWidth(400);
$this->render->addRow($this->mod_obj);
$this->render->addRow("");
$this->render->addRow($connect_box, RowTable::ALIGN_CENTER, RowTable::VALIGN_CENTER);
$this->render->addRow("<br/>");
}
示例9: display
public function display()
{
$rolelist = new Template();
$rolelist->load("role_list");
$actions = ActionList::get("rolelist");
if (isset($_POST['insert'])) {
$role = new Role();
$role->name = $_POST['insert'];
$role->insert();
}
if (isset($_GET['delete'])) {
$role = new Role();
$role->ID = $_GET['delete'];
$role->delete();
}
$table = new Table();
$id = new TableColumn("id", Language::DirectTranslate("ID"));
$id->autoWidth = true;
$name = new TableColumn("name", Language::DirectTranslate("NAME"));
$table->columns->add($id);
$table->columns->add($name);
$table->name = "{'dbprefix'}roles";
$table->actions = "rolelist";
$table->orderBy = "name";
$table->cacheName = "rolelist";
$rolelist->assign_var("TABLE", $table->getCode());
$rolelist->output();
}
示例10: commentform
function commentform($pageid)
{
//global $session;
$process = new ProcessForm();
$validate = $process::validate();
$postcomment = new Table("Comments");
//Process Page Form
if ($process->submitForm()) {
/*@setting validation rules*/
$required = array("name", "comment");
$process->errorinfo = array_merge($process->errorinfo, $validate->check_requiredFields($required));
$massage = $process->message("Comment has been successfully submmited.");
//$sucessmsg = $_REQUEST["msg"]=$massage;
if ($process->successflag) {
//put database table here
$postcomment::$tablefields = array("Name" => $process->post("name"), "Comment" => $process->post("comment"), "Pageid" => $pageid);
/*saved to database*/
$postcomment->save();
//echo "new recored was added with id=".$postcomment->lastInsertedId();
//echo "<br> success happened and all fields are sent to database, Thank you ! :)";
}
}
$form = new Form("commentform", filter_var($_SERVER['PHP_SELF']) . "?" . filter_var($_SERVER['QUERY_STRING']), "post");
//Company;
$form->startForm();
$form->setFormField("", $form->addFormInfo("<h2>Comment Form</h2>"));
//Page Title
$form->setFormField($form->inputLabel("name", "*Name"), $form->inputField("text", "name", $process->post("name")), $validate->displayErrorField($process->errorinfo, "name"));
// Page Content
$form->setFormField($form->inputLabel("comment", "*Comment (HTML is not allowed)"), $form->textAreaField("comment", $process->post("comment"), 10, 45, 'placeholder="Type comment here"'), $validate->displayErrorField($process->errorinfo, "comment"));
//Submit Form
$form->setFormField(null, $form->inputField("hidden", "userid", $process->post("userid", $authorid = "")) . $form->inputField("submit", "submit", "Add Comment"));
$form->endForm();
return $form->DisplayFields($GLOBALS["form_labling"], $process->message);
}
示例11: payment
public function payment($module = '')
{
global $payment, $language, $PHP_SELF;
$instance_sub_table = new Table("cc_payment_methods", "payment_filename");
$DBHandle = DbConnect();
$return = null;
$return = $instance_sub_table->Get_list($DBHandle, $QUERY, 0);
$this->modules = array();
if (is_array($return)) {
foreach ($return as $value) {
array_push($this->modules, $value["payment_filename"]);
}
}
$include_modules = array();
if (!empty($module) && in_array($module . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1), $this->modules)) {
$this->selected_module = $module;
$include_modules[] = array('class' => $module, 'file' => $module . '.php');
} else {
reset($this->modules);
while (list(, $value) = each($this->modules)) {
$class = substr($value, 0, strrpos($value, '.'));
$include_modules[] = array('class' => $class, 'file' => $value);
}
}
for ($i = 0, $n = sizeof($include_modules); $i < $n; $i++) {
include dirname(__FILE__) . '/../methods/' . $include_modules[$i]['file'];
$GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class']();
}
if (!is_null($module) && in_array($module, $this->modules) && isset($GLOBALS[$module]->form_action_url)) {
$this->form_action_url = $GLOBALS[$module]->form_action_url;
}
$actived_module = $this->selection();
$payment = $actived_module[0]['id'];
}
示例12: createUiContainers
function createUiContainers(){
$t = new Table();
$t->add($this->_createNameElement(_T("Zone name"),false),
array("value" => $this->hostname, "required" => True));
$t->add(new TrFormElement( _T("Name server"),
new InputTpl($this->pn("dnsserver")),
$this->_dnRulesTooltip(AllowedDn::RELATIVE|AllowedDn::FQDN)
),
array("value" => $this->values["dnsserver"], "required" => True));
$t->add(new TrFormElement( _T("Responsible person e-mail"),
new InputTpl($this->pn("mail")),
$this->_dnRulesTooltip(AllowedDn::RELATIVE|AllowedDn::FQDN)
),
array("value"=>$this->values["mail"], "required" => True));
$t->add(new TrFormElement(_T("Time interval before the zone should be refreshed"), new BindRemainingTimeTpl($this->pn("refresh"))),
array("value"=>BindRemainingTimeTpl::valueFromBindTimeString($this->values["refresh"])));
$t->add(new TrFormElement(_T("Time interval that should elapse before a failed refresh should be retried"), new BindRemainingTimeTpl($this->pn("retry"))),
array("value"=>BindRemainingTimeTpl::valueFromBindTimeString($this->values["retry"])));
$t->add(new TrFormElement(_T("Expiry time"), new BindRemainingTimeTpl($this->pn("expiry"))),
array("value"=>BindRemainingTimeTpl::valueFromBindTimeString($this->values["expiry"])));
$t->add(new TrFormElement(_T("Minimum TTL"), new BindRemainingTimeTpl($this->pn("minttl"))),
array("value"=>BindRemainingTimeTpl::valueFromBindTimeString($this->values["minttl"])));
$t->add(new TrFormElement(_T("Serial number"), new HiddenTpl($this->pn("serial"))),
array("value"=>$this->values["serial"], "required" => True));
return array($this->stackedUi($t));
}
示例13: mod
public function mod()
{
$id_trans = Get::req('id_trans', DOTY_INT, 0);
if (isset($_POST['undo'])) {
Util::jump_to('index.php?r=alms/transaction/show');
}
if (isset($_POST['save']) || isset($_POST['not_paid'])) {
$product_to_activate = Get::req('product', DOTY_MIXED, array());
$id_user = Get::req('id_user', DOTY_MIXED, 0);
if ($this->model->saveTransaction($product_to_activate, $id_trans, $id_user)) {
$this->model->controlActivation($id_trans, isset($_POST['not_paid']));
Util::jump_to('index.php?r=alms/transaction/show&res=ok');
}
Util::jump_to('index.php?r=alms/transaction/show&res=err');
}
$transaction_info = $this->model->getTransactionInfo($id_trans);
$user_info = $this->acl_man->getUser($transaction_info['id_user'], false);
$user_info[ACL_INFO_USERID] = $this->acl_man->relativeId($user_info[ACL_INFO_USERID]);
require_once _base_ . '/lib/lib.table.php';
$tb = new Table(false, Lang::t('_DETAILS', 'transaction'), Lang::t('_DETAILS', 'transaction'));
$ts = array('', '', 'min-cell', 'image');
$th = array(Lang::t('_CODE', 'transaction'), Lang::t('_NAME', 'transaction'), Lang::t('_PRICE', 'transaction'), Lang::t('_MARK_AS_PAID', 'transaction'));
$tb->setColsStyle($ts);
$tb->addHead($th);
foreach ($transaction_info['product'] as $product_info) {
$tb->addBody(array($product_info['code'], $product_info['name'], $product_info['price'], Form::getInputCheckbox('product_' . $product_info['id_course'] . '_' . $product_info['id_date'] . '_' . $product_info['id_edition'], 'product[' . $product_info['id_course'] . '_' . $product_info['id_date'] . '_' . $product_info['id_edition'] . ']', 1, $product_info['activated'], $product_info['activated'] ? ' disabled="disabled"' : '')));
}
$this->render('mod', array('transaction_info' => $transaction_info, 'user_info' => $user_info, 'tb' => $tb, 'id_trans' => $id_trans));
}
示例14: __construct
public function __construct(Table $table, $name, array $options = array())
{
$columnTypes = array(self::TYPE_COLUMN_FIX_SIZE, self::TYPE_COLUMN_VAR_SIZE, self::TYPE_COLUMN_INDEX);
if ($this->isObjectResource($name, $columnTypes)) {
parent::__construct($name);
return;
}
$ctx = $table->getContext();
$path = null;
$flags = 0;
$type = null;
foreach (array('path', 'flags', 'type') as $option) {
if (isset($options[$option])) {
if ($option === 'type') {
${$option} = $this->fetchResource($options[$option], $ctx);
} else {
${$option} = $options[$option];
}
}
}
$previous = ini_set('track_errors', '1');
$column = @grn_column_open_or_create($table->getResource(), $name, $path, $flags, $type);
ini_set('track_errors', $previous);
if (!$column) {
throw new Exception($php_errormsg);
}
parent::__construct($column);
}
示例15: createEnumerationTable
function createEnumerationTable($enumeration, $dbSchema)
{
if ($this->is_table_filtered($enumeration['name'])) {
$this->logger->log("<br>Ignoriere Enumeration: {$enumeration['name']}");
}
$this->logger->log('<br><b>Create Enumeration Tables: ' . $enumeration['name'] . '</b> (' . $enumeration['xmi_id'] . ')');
$table = new Table($enumeration['name']);
# read Values
$enumType = new EnumType($enumeration['name'], $this->logger);
$enumType->setSchemas($this->umlSchema, $dbSchema);
$enumType->setId($enumeration['id']);
$table->values = $enumType->getValues($enumeration);
# definiere Attribute
$wert_type = empty($enumType) ? 'chacacter varying' : $enumType->getWertType();
$attribute = new Attribute('wert', $wert_type);
$table->addAttribute($attribute);
$attribute = new Attribute('beschreibung', 'character varying');
$table->addAttribute($attribute);
# definiere Primärschlüssel
$table->primaryKey = 'wert';
$this->logger->log($table->values->asTable($table->attributes));
# if (
# $table->values->rows[0][0] != $table->values->rows[0][1] AND
# $table->values->rows[0][1] != 'NULL'
# )
# definiere Commentare
$table->addComment('UML-Typ: Enumeration');
$sql .= $table->asSql();
$this->enumerations[$enumType->name] = $enumType;
$this->logger->log('<pre>' . $tableSql . '</pre>');
return $sql;
}