本文整理汇总了PHP中Database::line方法的典型用法代码示例。如果您正苦于以下问题:PHP Database::line方法的具体用法?PHP Database::line怎么用?PHP Database::line使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Database
的用法示例。
在下文中一共展示了Database::line方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GtkLabel
function __construct($Owner)
{
parent::__construct();
$this->pack_start(new GtkLabel(latin1(' Tipo de Endereço: ')), false);
$this->store = new GtkListStore(TYPE_STRING, TYPE_LONG);
$this->pack_start($this->combobox = new GtkComboBox($this->store));
$this->combobox->pack_start($cell = new GtkCellRendererText());
$this->combobox->set_attributes($cell, 'text', 0);
$this->combobox->connect('changed', array($this, 'tipo_endereco_changed'));
$this->show_all();
/*
* preenche lista
*/
$db = new Database($Owner, true);
if (!$db->link) {
return;
}
/*
* Tipo de Endereco
*/
if (!$db->multi_query('SELECT * FROM Vw_Tipos_Endereco')) {
return;
}
$this->store->clear();
unset($this->it);
while ($line = $db->line()) {
$row = $this->store->append();
$this->store->set($row, 0, $line['Descricao'], 1, $line['Id']);
$this->it[$line['Id']] = $row;
}
}
示例2: Database
function pega_dados()
{
$db = new Database($this, true);
if (!$db->link) {
return;
}
// Lançamentos
if (!$db->multi_query('SELECT * FROM Vw_Contas_Receber WHERE Id = ' . $this->CodConta)) {
return;
}
$line = $db->line();
$this->cod_conta->set_markup('<b>Cod. Conta: <span color="red">' . $this->CodConta . '</span></b>');
$this->tipo_doc->set_markup('<b>Tipo de Doc.: <span color="red">' . $line['TipoDoc'] . '</span></b>');
$this->num_doc->set_markup('<b>Numero do Doc.: <span color="red">' . $line['NumDoc'] . '</span></b>');
$row = $this->grid->store->append();
$this->grid->store->set($row, 0, $line['Id'], 1, 'Lancamento', 2, FDateTime($line['Emissao']), 3, $line['Anotacoes'], 4, $line['Usuario']);
// Baixas
if (!$db->multi_query('SELECT * FROM Vw_Mov_Contas_Receber WHERE CodConta = ' . $this->CodConta)) {
return;
}
while ($line = $db->line()) {
$row = $this->grid->store->append();
$this->grid->store->set($row, 0, $line['Id'], 1, 'Baixa', 2, FDateTime($line['Pagamento']), 3, $line['Anotacoes'], 4, $line['Usuario']);
}
// Cancelamentos
if (!$db->multi_query('SELECT * FROM Vw_Del_Contas_Receber WHERE CodConta = ' . $this->CodConta)) {
return;
}
while ($line = $db->line()) {
$row = $this->grid->store->append();
$this->grid->store->set($row, 0, $line['Id'], 1, 'Cancelamento', 2, FDateTime($line['Cancelado']), 3, $line['Anotacoes'], 4, $line['Usuario']);
}
$this->grid->first_line();
return true;
}
示例3: run
function run()
{
$db = new Database($this, true);
if (!$db->link) {
exit(1);
}
while (true) {
$this->username->grab_focus();
$response = parent::run();
$username = $this->username->get_text();
$password = $this->password->get_text();
if ($response != Gtk::RESPONSE_OK) {
exit(1);
}
if (!$username || !$password) {
new Message($this, latin1('Usuário e senha devem ser informados!'), Gtk::MESSAGE_ERROR);
continue;
}
$sql = 'SELECT Cod_S_Usuario FROM Tb_Usuarios WHERE Ativo = 1 AND Senha LIKE ' . String(md5($username . '@' . $password));
if (!$db->multi_query($sql)) {
continue;
}
if (!($line = $db->line())) {
new Message($this, latin1('Usuário ou senha incorreta!', Gtk::MESSAGE_ERROR));
continue;
} else {
$CodUsuario = $line['Cod_S_Usuario'];
putenv('XMONEY_UID=' . $CodUsuario);
}
$sql = 'SELECT * FROM Vw_Usuario_Filial WHERE CodUsuario = ' . $CodUsuario;
if (!$db->multi_query($sql)) {
continue;
}
if (!($line = $db->line())) {
new Message($this, latin1('Usuário não encontrado!', Gtk::MESSAGE_ERROR));
continue;
} else {
$GLOBALS['CodUsuario'] = $CodUsuario;
$GLOBALS['Usuario'] = $line['Usuario'];
$GLOBALS['Nome'] = $line['Nome'];
$GLOBALS['CodFilial'] = $line['CodFilial'];
$GLOBALS['Filial'] = $line['Filial'];
$GLOBALS['CodPerfil'] = $line['CodPerfil'];
$GLOBALS['Perfil'] = $line['Perfil'];
break;
}
}
}
示例4: GtkLabel
function __construct($Owner)
{
parent::__construct();
$this->pack_start(new GtkLabel(' Forma de Pgto: '), false);
$this->store = new GtkListStore(TYPE_STRING, TYPE_LONG);
$this->pack_start($this->combobox = new GtkComboBox($this->store));
$this->combobox->pack_start($cell = new GtkCellRendererText());
$this->combobox->set_attributes($cell, 'text', 0);
$this->combobox->connect('changed', array($this, 'forma_pgto_changed'));
$this->show_all();
/*
* preenche lista
*/
$db = new Database($Owner, true);
if (!$db->link) {
return;
}
/*
* Formas de Pagamento
*/
if (!$db->multi_query('SELECT * FROM Vw_Formas_Pgto')) {
return;
}
$this->store->clear();
unset($this->it);
while ($line = $db->line()) {
$row = $this->store->append();
$this->store->set($row, 0, $line['Nome'], 1, $line['Id']);
$this->it[$line['Id']] = $row;
}
}
示例5: GtkLabel
function __construct($Owner)
{
parent::__construct();
$this->pack_start(new GtkLabel(' Fornecedor: '), false);
$completion = new GtkEntryCompletion();
$completion->set_model($this->store = new GtkListStore(TYPE_STRING, TYPE_LONG));
$completion->set_text_column(0);
$completion->pack_start($cell = new GtkCellRendererText());
$completion->set_attributes($cell, 'text', 1);
$completion->connect('match-selected', array($this, 'fornecedor_selected'));
$this->pack_start($this->entry = new GtkEntry());
$this->entry->set_completion($completion);
$this->show_all();
/*
* preenche lista
*/
$db = new Database($Owner, true);
if (!$db->link) {
return;
}
/*
* Fornecedores
*/
if (!$db->multi_query('SELECT * FROM Vw_Fornecedores')) {
return;
}
$this->store->clear();
unset($this->it);
while ($line = $db->line()) {
$row = $this->store->append();
$this->store->set($row, 0, $line['Nome'], 1, $line['Id']);
$this->it[$line['Id']] = $row;
}
}
示例6: Database
function preenche_lista()
{
$db = new Database($this->Owner, true);
if (!$db->link) {
return;
}
// Secoes
$sql = 'SELECT * FROM Tb_Secoes';
if (!$db->multi_query($sql)) {
return;
}
while ($line = $db->line()) {
$CodSecao = $line['Cod_S_Secao'];
$Imagem = $line['Imagem'];
$Nome = $line['Nome'];
$this->lista->pack_start($ptr = $this->secoes[$CodSecao] = new GtkExpander(''), false);
$ptr->add(new GtkVBox());
$ptr->set_label_widget($hbox = new GtkHBox());
$hbox->pack_start(GtkImage::new_from_file(XMONEY_IMAGES . DIRECTORY_SEPARATOR . $Imagem), false);
$hbox->pack_start($label = new GtkLabel());
$label->set_markup('<b>' . $Nome . '</b>');
$ptr->show_all();
}
// Menus
$sql = 'SELECT * FROM Tb_Menus';
if (!$db->multi_query($sql)) {
return;
}
while ($line = $db->line()) {
$CodMenu = $line['Cod_S_Menu'];
$CodSecao = $line['Cod_S_Secao'];
$Imagem = $line['Imagem'];
$Nome = $line['Nome'];
$Permissao = $line['Permissao'];
$Classe = $line['Classe'];
$this->secoes[$CodSecao]->child->pack_start($button = new GtkButton());
$button->set_relief(Gtk::RELIEF_NONE);
$button->add($hbox = new GtkHBox());
$hbox->pack_start(GtkImage::new_from_file(XMONEY_IMAGES . DIRECTORY_SEPARATOR . $Imagem), false);
$hbox->pack_start(new GtkLabel(' ' . $Nome . ' '));
$button->show_all();
$button->connect('clicked', array($this, 'button_clicked'), array($Permissao, $Classe));
}
// Ajuda
$this->lista->pack_start($ptr = new GtkExpander(''), false);
$ptr->set_label_widget($hbox = new GtkHBox());
$hbox->pack_start(GtkImage::new_from_file(XMONEY_IMAGES . DIRECTORY_SEPARATOR . 'ajuda.png'), false);
$hbox->pack_start($label = new GtkLabel());
$label->set_markup('<b>Ajuda</b>');
$ptr->show_all();
// Sobre
$ptr->add($button = new GtkButton());
$button->set_relief(Gtk::RELIEF_NONE);
$button->add($hbox = new GtkHBox());
$hbox->pack_start(GtkImage::new_from_file(XMONEY_IMAGES . DIRECTORY_SEPARATOR . 'sobre.png'), false);
$hbox->pack_start(new GtkLabel('Sobre'));
$ptr->show_all();
$button->connect('clicked', array($this, 'sobre_clicked'));
return true;
}
示例7: CheckPermissao
function CheckPermissao($Owner, $tag, $show = false)
{
$db = new Database($Owner, true);
if (!$db->link) {
return;
}
$sql = 'SELECT * FROM Vw_Permissoes';
$db->multi_query($sql . ' WHERE CodPerfil = ' . $GLOBALS['CodPerfil'] . ' AND Alias = ' . String($tag));
if ($db->line()) {
return true;
} else {
if ($show) {
new Message($Owner, latin1('Você não tem permissão para acessar esse recurso no sistema!'));
}
}
}
示例8: Database
function grava_dados()
{
if (!$this->check_dados()) {
return;
}
$db = new Database($this, false);
if (!$db->link) {
return;
}
$anotacoes = $this->anotacoes->get_text();
$sql = 'call SP_Mov_Conta_Receber_Del';
$data = $sql . '(' . String($this->CodId) . ',' . String($anotacoes) . ',' . $GLOBALS['CodUsuario'] . ');';
if (!$db->multi_query($data)) {
return;
}
if (!($line = $db->line())) {
return;
}
$db->free_result();
$this->Parent->pega_dados_mov();
new Message($this, $line['Mensagem']);
return true;
}
示例9: Database
function grava_dados()
{
if (!$this->check_dados()) {
return;
}
$db = new Database($this, false);
if (!$db->link) {
return;
}
$num_doc = $this->num_doc->get_text();
$parcela = $this->parcela->get_text();
$vencimento = CDate($this->vencimento->get_text());
$valor = CommaToPoint($this->valor->get_text());
$anotacoes = $this->anotacoes->get_text();
if ($this->operacao == 'i') {
$sql = 'call SP_Conta_Receber_Inc';
} else {
$sql = 'call SP_Conta_Receber_Alt';
}
$data = $sql . '(' . String($this->tipo_doc->CodTipoDoc) . ',' . String($this->filial->CodFilial) . ',' . String($this->clientes->CodCliente) . ',' . String($num_doc) . ',' . String($parcela) . ',' . String($vencimento) . ',' . String($valor) . ',' . String($anotacoes) . ',' . $GLOBALS['CodUsuario'] . ');';
if (!$db->multi_query($data)) {
return;
}
$line = $db->line();
$db->free_result();
new Message($this, $line['Mensagem']);
return true;
}
示例10: Database
function pega_dados()
{
$db = new Database($this, true);
if (!$db->link) {
return;
}
if (!$db->multi_query('SELECT * FROM Vw_Fornecedores WHERE Id = ' . $this->CodFor)) {
return;
}
if (!($line = $db->line())) {
return;
}
$this->pessoa->combobox->set_active_iter($this->pessoa->it[$line['CodTipo']]);
$this->nome->set_text($line['Nome']);
$this->cpf->set_text($line['CPF']);
$this->fantasia->set_text($line['Fantasia']);
$this->ie->set_text($line['IE']);
$this->suframa->set_text($line['Suframa']);
$this->fone->set_text($line['Fone']);
$this->fone2->set_text($line['Fone2']);
$this->fax->set_text($line['Fax']);
$this->fax2->set_text($line['Fax2']);
$this->email->set_text($line['Email']);
$this->site->set_text($line['URL']);
$this->anotacoes->set_text($line['Anotacoes']);
$this->limite_compra->set_text(PointToComma($line['LimiteCompra']));
$this->ativo->set_active($line['Ativo']);
return true;
}
示例11: Database
function grava_dados()
{
if (!$this->check_dados()) {
return;
}
$db = new Database($this, false);
if (!$db->link) {
return;
}
$nome = $this->nome->get_text();
$descricao = $this->descricao->get_text();
if ($this->operacao == 'i') {
$sql = 'call SP_Perfil_Inc';
} else {
$sql = 'call SP_Perfil_Alt';
}
$data = $sql . '(' . String($this->CodPerfil) . ',' . String($nome) . ',' . String($descricao) . ',' . $GLOBALS['CodUsuario'] . ');';
if (!$db->multi_query($data)) {
return;
}
// Mensagem
$line = $db->line();
$mensagem = $line['Mensagem'];
if ($this->operacao == 'i') {
$line = $db->line();
$CodPerfil = $line['CodPerfil'];
}
// limpa BUFFER
while ($db->line()) {
}
// pega CodPerfil
if (!$CodPerfil) {
$CodPerfil = $this->CodPerfil;
}
// Permissoes
$db->query(' DELETE FROM Tb_Permissoes WHERE Cod_S_Perfil = ' . $CodPerfil);
foreach ($this->itens as $key => $value) {
if ($value->get_active()) {
if (!$db->query(' INSERT INTO Tb_Permissoes (Cod_S_Perfil, Cod_S_Item) ' . ' VALUES (' . String($CodPerfil) . ',' . String($key) . ');')) {
return;
} else {
$this->progresso->pulse();
while (Gtk::events_pending()) {
Gtk::main_iteration();
}
}
}
}
new Message($this, $mensagem);
return true;
}
示例12: Database
function check_duplicated($Owner, $break_tab)
{
if (!$this->duplicated) {
$this->set_ok();
return true;
}
$db = new Database($Owner, true);
if (!$db->link) {
return;
}
if (!$db->multi_query(' SELECT ' . $this->field . ' FROM ' . $this->table . ' WHERE ' . $this->field . " LIKE '" . $this->text . "'" . ' AND ' . $GLOBALS['XMONEY_FIELD'] . ' != ' . $GLOBALS['XMONEY_FIELD_ID'])) {
return;
}
if ($db->line()) {
if ($break_tab) {
$this->entry->grab_focus();
}
$this->set_warning();
return;
}
$this->set_bg('white');
$this->set_ok();
return true;
}
示例13: Database
function grava_dados()
{
if (!$this->check_dados()) {
return;
}
$db = new Database($this, false);
if (!$db->link) {
return;
}
if ($this->operacao == 'a') {
$id = $this->id->get_text();
}
$nome = $this->nome->get_text();
$agencia = $this->agencia->get_text();
$conta = $this->conta->get_text();
if ($this->operacao == 'i') {
$sql = 'call SP_Banco_Inc';
} else {
$sql = 'call SP_Banco_Alt';
}
$data = $sql . '(' . String($id) . ',' . String($nome) . ',' . String($agencia) . ',' . String($conta) . ',' . String($this->filial->CodFilial) . ',' . $GLOBALS['CodUsuario'] . ');';
if (!$db->multi_query($data)) {
return;
}
$line = $db->line();
$db->free_result();
new Message($this, $line['Mensagem']);
return true;
}
示例14: Database
function grava_dados()
{
if (!$this->check_dados()) {
return;
}
$db = new Database($this, false);
if (!$db->link) {
return;
}
$nome = $this->nome->get_text();
if ($this->operacao == 'i') {
$sql = 'call SP_Unid_Estoque_Inc';
} else {
$sql = 'call SP_Unid_Estoque_Alt';
}
$data = $sql . '(' . String($this->CodUnidade) . ',' . String($nome) . ',' . $GLOBALS['CodUsuario'] . ');';
if (!$db->multi_query($data)) {
return;
}
$line = $db->line();
$db->free_result();
new Message($this, $line['Mensagem']);
return true;
}
示例15: Database
function pega_dados()
{
$db = new Database($this->Owner, true);
if (!$db->link) {
return;
}
if (!$db->multi_query(' SELECT * FROM Vw_Usuario_Filial ')) {
return;
}
$this->grid->store->clear();
while ($line = $db->line()) {
$row = $this->grid->store->append();
$this->grid->store->set($row, 0, $line['CodUsuario'], 1, $line['Filial'], 2, $line['Usuario'], 3, $line['Nome'], 4, $line['Perfil'], 5, $line['Depto'], 6, $line['Cargo'], 7, $line['Email']);
}
$this->grid->first_line();
return true;
}