PHP Classes
elePHPant
Icontem

File: empresa.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Francisco Caserio  >  cls_form  >  empresa.php  >  Download  
File: empresa.php
Role: Example script
Content type: text/plain
Description: company table administration
Class: cls_form
Generate Web pages to manipulate database records
Author: By
Last change:
Date: 6 years ago
Size: 2,780 bytes
 

Contents

Class file image Download
<?
include "../admin/autent.php";
include
"../admin/connect.php";
include
"../inc/cls_form.php";

if (!isset(
$step)) $step = 1;

$form = new cls_form();
//$form->debug = 1;
$form->set_entity("empresa", "EMPRESA");

// key params
$form->set_key("id");
$form->add_label("empresa.nome","Nome","dac");
$form->add_label("empresa.dac","DAC","nome");
$form->set_label_alignment("center");
$form->add_label("empresa.ck_meta_pedido", "Meta");
$form->set_label_flag_mode();
$form->set_label_alignment("center");
$form->set_groupbyativo();
$form->add_condition("empresa.id_empresa_grupo = $empresa_grupo_siig");

// fields
$form->add_field("nome", "Nome fantasia", "text", 1);
$form->add_field_prop("size", 30);
$form->add_field("razao_social", "Razão Social", "text", 1);
$form->add_field_prop("size", 30);
$form->add_field("logo", "Logotipo", "file", 1);
$form->add_field_dir("logo", $maxsize=180);
$form->add_field("estado", "UF", "dropdown", 1);
$form->add_field_list(array("AC"=>"AC","AL"=>"AL","AM"=>"AM","AP"=>"AP","BA"=>"BA","CE"=>"CE","DF"=>"DF","ES"=>"ES","GO"=>"GO","MA"=>"MA","MG"=>"MG","MS"=>"MS","MT"=>"MT","PA"=>"PA","PB"=>"PB","PE"=>"PE","PI"=>"PI","PR"=>"PR","RJ"=>"RJ","RN"=>"RN","RO"=>"RO","RR"=>"RR","RS"=>"RS","SC"=>"SC","SE"=>"SE","SP"=>"SP","TO"=>"TO"));
$form->add_field("cidade", "Cidade", "text", 1);
$form->add_field_prop("size", 30);
$form->add_field("endereco", "Endereço", "text", 1);
$form->add_field_prop("size", 30);
$form->add_field("numero", "Número", "text", 1);
$form->add_field_prop("size", 4);
$form->add_field("complemento", "Complemento", "text");
$form->add_field_prop("size", 30);
$form->add_field("bairro", "Bairro", "text", 1);
$form->add_field_prop("size", 30);
$form->add_field("cep", "CEP", "text", 1);
$form->set_field_mask(array(5,"-",3));
$form->add_field("telefone", "Telefone", "text", 1);
$form->set_field_mask(array(2,8));
$form->add_field("fax", "FAX", "text");
$form->set_field_mask(array(2,8));
$form->add_field("cnpj", "CNPJ", "text", 1);
$form->set_field_mask(array(2,".",3,".",3,"/",4,"-",2));
$form->add_field_prop("size", 15);
$form->add_field("ie", "IE", "text");
$form->add_field_prop("size", 15);
$form->add_field("dac", "DAC", "text", 1);
$form->add_field_prop("size", 2);
$form->add_field("matriz", "Matriz", "checkbox");
$form->add_field("ck_meta_pedido", "Utiliza meta para aprovação de pedido", "checkbox");
if (
$modo == "insert") $form->add_field_prop("CHECKED");
$form->add_field("ativo", "Ativo", "checkbox");
if (
$modo == "insert") $form->add_field_prop("CHECKED");

//echo "<pre>"; print_r($form); echo "</pre>";
// build
$form->build($modo, $step, count($_POST) > 0 ? $_POST : $_GET, $_FILES);

//echo "<pre>"; print_r($form); echo "</pre>";
?>