Example #1
0
 function bug()
 {
     dbobj::dbobj("bugs", "bID");
     // SQL table `bugs', PK `bID'
     // this just calls the super-class's constructor
     // this tells the dbobj sutff to use the the
     // `bugs' table, with a primary key of `bID'.
 }
Example #2
0
function tables_define(&$app)
{
    $def =& $app->db->def;
    dbobj::define_tables($def);
    $def->define_table('directories', array(array('n' => 'id', 't' => 'INT NOT NULL AUTO_INCREMENT PRIMARY KEY', 'd' => 'primary key', 'tk_auto' => 'hide'), array('n' => 'id_directory_type', 't' => 'INT NOT NULL', 'i' => true, 'd' => 'Directory type', 'tk_auto' => 'hide'), array('n' => 'id_obj', 't' => 'INT NOT NULL', 'i' => true, 'd' => 'Object reference', 'tk_auto' => 'hide'), array('n' => 'id_parent', 't' => 'INT NOT NULL', 'i' => true, 'd' => 'Reference to parent', 'tk_auto' => 'hide'), array('n' => 'id_last', 't' => 'INT NOT NULL', 'i' => true, 'd' => 'Reference to previous sibling', 'tk_auto' => 'hide'), array('n' => 'id_next', 't' => 'INT NOT NULL', 'i' => true, 'd' => 'Reference to next sibling', 'tk_auto' => 'hide'), array('n' => 'name', 't' => 'VARCHAR(255) NOT NULL', 'i' => true, 'd' => 'Category name')));
    $def->set_primary('directories', 'id');
    $def->set_ref('directories', 'directories', 'id_parent');
    $def->set_listref('directories', 'id_last', 'id_next');
    $def->set_obj_id('directories', 'id_obj');
    $def->define_table('directory_types', array(array('n' => 'id', 't' => 'INT NOT NULL AUTO_INCREMENT PRIMARY KEY', 'd' => 'primary key'), array('n' => 'name', 't' => 'VARCHAR(255) NOT NULL', 'i' => true, 'd' => 'Name')));
    $def->set_primary('directory_types', 'id');
    $def->define_table('product_variants', array(array('n' => 'id', 't' => 'INT NOT NULL AUTO_INCREMENT PRIMARY KEY', 'd' => 'primary key'), array('n' => 'id_directory', 't' => 'INT NOT NULL', 'i' => true, 'd' => 'Directory reference'), array('n' => 'id_last', 't' => 'INT NOT NULL', 'i' => true, 'd' => 'Reference to previous sibling'), array('n' => 'id_next', 't' => 'INT NOT NULL', 'i' => true, 'd' => 'Reference to next sibling'), array('n' => 'name', 't' => 'VARCHAR(255) NOT NULL', 'i' => true, 'd' => 'Description'), array('n' => 'code', 't' => 'VARCHAR(255) NOT NULL', 'i' => true, 'd' => 'Product code'), array('n' => 'price', 't' => 'DECIMAL(14,2) NOT NULL', 'i' => true, 'd' => 'Price')));
    $def->set_primary('product_variants', 'id');
    $def->set_ref('directories', 'product_variants', 'id_directory');
    $def->set_ref('product_variants', 'cart', 'id_product_variant');
    $def->set_listref('product_variants', 'id_last', 'id_next');
    $def->define_table('cart', array(array('n' => 'id', 't' => 'INT NOT NULL AUTO_INCREMENT PRIMARY KEY', 'd' => 'primary key'), array('n' => 'id_session', 't' => 'INT NOT NULL', 'i' => true, 'd' => 'Reference to session'), array('n' => 'id_product_variant', 't' => 'INT NOT NULL', 'i' => true, 'd' => 'Reference to product'), array('n' => 'quantity', 't' => 'INT NOT NULL', 'i' => true, 'd' => 'Quantity of product'), array('n' => 'attrib', 't' => 'VARCHAR(255) NOT NULL', 'i' => true, 'd' => 'Product attributes')));
    $def->set_primary('cart', 'id');
    $def->define_table('addresses', array(array('n' => 'id', 't' => 'INT NOT NULL AUTO_INCREMENT PRIMARY KEY', 'd' => 'primary key'), array('n' => 'name_prefix', 't' => 'VARCHAR(255) NOT NULL', 'd' => ''), array('n' => 'name_first', 't' => 'VARCHAR(255) NOT NULL', 'd' => ''), array('n' => 'name_middle', 't' => 'VARCHAR(255) NOT NULL', 'd' => ''), array('n' => 'name_last', 't' => 'VARCHAR(255) NOT NULL', 'd' => ''), array('n' => 'name_suffix', 't' => 'VARCHAR(255) NOT NULL', 'd' => ''), array('n' => 'company', 't' => 'VARCHAR(255) NOT NULL', 'd' => ''), array('n' => 'street1', 't' => 'VARCHAR(255) NOT NULL', 'd' => ''), array('n' => 'street2', 't' => 'VARCHAR(255) NOT NULL', 'd' => ''), array('n' => 'street3', 't' => 'VARCHAR(255) NOT NULL', 'd' => ''), array('n' => 'city', 't' => 'VARCHAR(255) NOT NULL', 'd' => ''), array('n' => 'state', 't' => 'VARCHAR(255) NOT NULL', 'd' => ''), array('n' => 'postal_code', 't' => 'VARCHAR(255) NOT NULL', 'd' => ''), array('n' => 'country_code', 't' => 'VARCHAR(255) NOT NULL', 'd' => ''), array('n' => 'phone', 't' => 'VARCHAR(255) NOT NULL', 'd' => ''), array('n' => 'email', 't' => 'VARCHAR(255) NOT NULL', 'd' => '')));
    $def->set_primary('addresses', 'id');
    $def->define_table('orders', array(array('n' => 'id', 't' => 'INT NOT NULL AUTO_INCREMENT PRIMARY KEY', 'd' => 'primary key'), array('n' => 'id_session', 't' => 'INT NOT NULL', 'd' => 'Reference to session'), array('n' => 'id_address_shipto', 't' => 'INT NOT NULL', 'd' => 'Reference to ShipTo address'), array('n' => 'id_address_billto', 't' => 'INT NOT NULL', 'd' => 'Reference to BillTo address'), array('n' => 'id_address_receiptto', 't' => 'INT NOT NULL', 'd' => 'Reference to ReceiptTo address'), array('n' => 'extrafields', 't' => 'MEDIUMTEXT NOT NULL', 'd' => 'Serialized php array of user defined fields'), array('n' => 'wallet_id', 't' => 'VARCHAR(255) NOT NULL', 'd' => 'ECML wallet id (unused)')));
    $def->set_primary('orders', 'id');
}
Example #3
0
 function user()
 {
     dbobj::dbobj("users", "uID");
 }
Example #4
0
 function rights()
 {
     dbobj::dbobj("user_rights", "userID");
 }
Example #5
0
File: bug.php Project: saji89/whube
 function bug()
 {
     dbobj::dbobj("bugs", "bID");
 }
Example #6
0
 function project()
 {
     dbobj::dbobj("projects", "pID");
 }
Example #7
0
 function register()
 {
     dbobj::dbobj("users", "uID");
 }
Example #8
0
 function bug_comment()
 {
     dbobj::dbobj("bug_comments", "cID");
     // SQL table `bug_comments', PK `cID'
 }
Example #9
0
<?php

include "../common.inc.php";
global $mysqlhost, $mysqluser, $mysqlpwd, $mysqldb;
$mysqlhost = "localhost";
//host name
$mysqluser = "root";
//login name
$mysqlpwd = "";
//password
$mysqldb = "zzqssdaigou";
//name of database
include "mydb.php";
$d = new dbobj($mysqlhost, $mysqluser, $mysqlpwd, $mysqldb);
/*--------------界面--------------*/
if (!isset($_POST['act'])) {
    /*----------------------*/
    $msgs[] = "服务器备份目录为backup";
    $msgs[] = "对于较大的数据表,强烈建议使用分卷备份";
    $msgs[] = "只有选择备份到服务器,才能使用分卷备份功能";
    show_msg($msgs);
    ?>
<form name="form1" method="post" action="backup.php">
  <table width="99%" border="1" cellpadding='0' cellspacing='1'>
    <tr align="center" class='header'><td colspan="2">数据备份</td></tr>
    <tr><td colspan="2">备份方式</td></tr>
    <tr><td><input type="radio" name="bfzl" value="quanbubiao">        备份全部数据</td><td>备份全部数据表中的数据到一个备份文件</td></tr>
    <tr><td><input type="radio" name="bfzl" value="danbiao">备份单张表数据
        <select name="tablename"><option value="">请选择</option>
          <?php 
    $d->query("show table status from {$mysqldb}");