分类 其他 下的文章

如果还没部署可参考站内前文 :第一篇:GoodERP首测win2003server纯净+GoodERP20170302绿色版
部署后简体中文语言等参数配置:第二篇:部署GoodERP启动成功! 修改为默认简体中文语言
【GoodERP实施笔记一】 :Ubuntu14.04源码安装GoodERP最新版记录
GoodERP绿色版升级更新方法(含32位和64位):GoodERP绿色版升级更新
案例:用GoodERP替代用友U8普及版

参考官方:http://best.gooderp.org/d/7
记录如下:

1、纯净安装ubuntu14.04 server 64-bit之后,

sudo apt install git -y
sudo apt install npm -y
ln -s /usr/bin/nodejs /usr/bin/node
npm install -g less

把git和npm安装上(要点时间)。

2、安装postgresql数据库 (根据你的操作系统),Ubuntu 14.04中的版本是9.3的postgresql数据库:

sudo apt-get install postgresql

3、
安装依赖环境:

安装python-pip依赖:

sudo apt install python-pip
sudo pip install -r base/requirements.txt
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
cp /usr/local/bin/wkhtmltopdf /usr/bin

安装 ppsycopg2报错, Error: You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application

解决:

sudo apt-get install libpq-dev

3、开始拉源码:

adduser good
su good
cd ~
git clone http://github.com/osbzr/gooderp_addons
git clone http://github.com/osbzr/base

一定要切到good自己有权限的目录下才能git clone拉源码回来。

如果还没部署可参考站内前文 :第一篇:GoodERP首测win2003server纯净+GoodERP20170302绿色版
部署后简体中文语言等参数配置:第二篇:部署GoodERP启动成功! 修改为默认简体中文语言
【GoodERP实施笔记一】 :Ubuntu14.04源码安装GoodERP最新版记录
案例:用GoodERP替代用友U8普及版

==没写错==
1、这事从2017年5月5日开始在我脑子里萌芽,用GoodERP替代用友U8普及版,正式向除我以外的人提及则是5月末(具体哪天给忘了),一天在财务办公室和张老大闲聊,聊到用友,就顺嘴提了一句GoodERP,可以用GoodERP替代用友。于是就由财务的老大向老板提了,周总首肯。
===不需要犹豫===
2、6月12日中午12:09:49创建了一个只有4人的QQ群,我把上海开阖-Jeff王剑锋王总邀请到群里,把财务张老大邀请进群里,而Jeff也把开阖的财务囡囡也邀请进群里,互相认识一翻之后,就介入正题了:需要张老大从用友里导出凭证.txt、科目表.txt、供应商档案.txt、客户档案.txt、职员档案.txt、存货档案.txt、其初余额.txt。其中,凭证.txt这里又因12号的时候导了1月凭证.txt,15号的时候Jeff提到,导三个月的凭证,可以核对,这样就追加了2月和3月的凭证.txt。
====会记得====
3、

来自:https://github.com/leangjia/ez_SQL_help-zh_cn

附:
ez_sql_help_zh_cn.htm

DEMO.PHP 演示示例代码:

<?php

    /**********************************************************************
    *  ezSQL initialisation for mySQL
    */

    // Include ezSQL core
    include_once "../shared/ez_sql_core.php";

    // Include ezSQL database specific component
    include_once "ez_sql_mysql.php";

    // Initialise database object and establish a connection
    // at the same time - db_user / db_password / db_name / db_host
    $db = new ezSQL_mysql('db_user','db_password','db_name','db_host');

    /**********************************************************************
    *  ezSQL demo for mySQL database
    */

    // Demo of getting a single variable from the db
    // (and using abstracted function sysdate)
    $current_time = $db->get_var("SELECT " . $db->sysdate());
    print "ezSQL demo for mySQL database run @ $current_time";

    // Print out last query and results..
    $db->debug();

    // Get list of tables from current database..
    $my_tables = $db->get_results("SHOW TABLES",ARRAY_N);

    // Print out last query and results..
    $db->debug();

    // Loop through each row of results..
    foreach ( $my_tables as $table )
    {
        // Get results of DESC table..
        $db->get_results("DESC $table[0]");

        // Print out last query and results..
        $db->debug();
    }

?>

----------以下转载----------

操作MySQL,使用ezSQL,简单而方便

ezSQL官方下载地址:http://justinvincent.com/ezsql

使用示例:

事先 include once <ez_sql.php>;

include once <ez_sql.php>;

取数值:

$var = $db->get_var("SELECT count(*) FROM users");


取对象:

$user = $db->get_row("SELECT name,email FROM users WHERE id = 2");


取数组:

$users = $db->get_results("SELECT name, email FROM users");
foreach ( $users as $user )
{
    // 使用对象语法
    echo $user->name;
    echo $user->email;
}

可以看出,其实函数返回值为二维数组,经foreach分解后,$user为每条记录的内容,可直接用$user->字段名的方式访问。

get_results()还有另一种调用方式:

// Extract results into the array $dogs (and evaluate if there are any results at the same time)..
if ( $dogs = $db->get_results(“SELECT breed, owner, name FROM dogs”, ARRAY_A) )
{
            // Loop through the resulting array on the index $dogs[n]
            foreach ( $dogs as $dog_detail )
            {
 
                        // Loop through the resulting array
                        foreach ( $dogs_detail as $key => $val )
                        {
                                    // Access and format data using $key and $val pairs..
                                    echo “<b>” . ucfirst($key) . “</b>: $val<br>”;
                        }
 
                        // Do a P between dogs..
                        echo “<p>”;
            }
}
else
{
            // If no users were found then if evaluates to false..
            echo “No dogs found.”;
}
 

输出结果:

Output:
Breed: Boxer
Owner: Amy
Name: Tyson

Breed: Labrador
Owner: Lee
Name: Henry

Breed: Dachshund
Owner: Mary
Name: Jasmine


执行Insert操作:

$db->query("INSERT INTO users (id, name, email) VALUES (NULL,'duuge','duuge@duuge.com')");


调试信息

// Display last query and all associated results

$db->debug();

四种方法:

  1. bool $db->query(query)
  2. var $db->get_var(query)
  3. mixed $db->get_row(query)
  4. mixed $db->get_results(query)

ezSQL functions

$db->get_results -- get multiple row result set from the database (or previously cached results)

$db->get_row -- get one row from the database (or previously cached results)

$db->get_col -- get one column from query (or previously cached results) based on column offset

$db->get_var -- get one variable, from one row, from the database (or previously cached results)

$db->query -- send a query to the database (and if any results, cache them)

$db->debug -- print last sql query and returned results (if any)

$db->vardump -- print the contents and structure of any variable

$db->select -- select a new database to work with

$db->get_col_info -- get information about one or all columns such as column name or type

$db->hide_errors -- turn ezSQL error output to browser off

$db->show_errors -- turn ezSQL error output to browser on

$db->escape -- Format a string correctly to stop accidental mal formed queries under all PHP conditions

$db = new db -- Initiate new db object.


ezSQL variables

$db->num_rows – Number of rows that were returned (by the database) for the last query (if any)

$db->insert_id -- ID generated from the AUTO_INCRIMENT of the previous INSERT operation (if any)

$db->rows_affected -- Number of rows affected (in the database) by the last INSERT, UPDATE or DELETE (if any)

$db->num_queries -- Keeps track of exactly how many 'real' (not cached) queries were executed during the lifetime of the current script

$db->debug_all – If set to true (i.e. $db->debug_all = true;) Then it will print out ALL queries and ALL results of your script.

$db->cache_dir – Path to mySQL caching dir.

$db->cache_queries – Boolean flag (see mysql/disk_cache_example.php)

$db->cache_inserts – Boolean flag (see mysql/disk_cache_example.php)

$db->use_disk_cache – Boolean flag (see mysql/disk_cache_example.php)

$db->cache_timeout – Number in hours (see mysql/disk_cache_example.php)



EOF


两分钟让你明白什么是ERP
www.chinamaker.net 2013-04-18 19:26:00 admin 10302
ERP(Enterprise ResourcePlanning)企业资源计划系统,是指建立在信息技术基础上,以系统化的管理思想,为企业决策层及员工提供决策运行手段的管理平台。 。
一天中午,丈夫在外给家里打电话:“亲爱的老婆,晚上我想带几个同事回家吃饭可以吗?”(订货意向) 。
妻子:“当然可以,来几个人,几点来,想吃什么菜? ” 。
丈夫:“6个人,我们7点左右回来,准备些酒、烤鸭、番茄炒蛋、凉菜、蛋花汤……。你看可吗?”(商务沟通) 。

妻子:“没问题,我会准备好的。”(订单确认) 。

妻子记录下需要做的菜单(MPS计划),具体要准备的东西:鸭、酒、番茄、鸡蛋、调料……(BOM物料清单),发现需要:1只鸭蛋,5瓶酒,4个鸡蛋……(BOM展开),炒蛋需要6个鸡蛋,蛋花汤需要4个鸡蛋(共用物料)。
打开冰箱一看(库房),只剩下2个鸡蛋(缺料)。
来到自由市场,妻子:“请问鸡蛋怎么卖?”(采购询价) 。
小贩:“1个1元,半打5元,1打9.5元。” 。
妻子:“我只需要8个,但这次买1打。”(经济批量采购) 。
妻子:“这有一个坏的,换一个。”(验收、退料、换料) 。
回到家中,准备洗采、切菜、炒菜……(工艺线路),厨房中有燃气灶、微波炉、电饭煲……(工作中心)。
妻子发现拨鸭毛最费时间(瓶颈工序,关键工艺路线),用微波炉自己做烤鸭可能来不及(产能不足),于是阅览室在楼下的餐厅里买现成的(产品委外)。
下午4点,接到儿子的电话:“妈妈,晚上几个同学想来家里吃饭,你帮忙准备一下。”(紧急订单) 。
“好的,你们想吃什么,爸爸晚上也有客人,你愿意和他们一起吃吗?” 。
“菜你看着办吧,但一定要有番茄炒鸡蛋,我们不和大人一起吃,6:30左右回来。”(不能并单处理) 。
“好的,肯定让你们满意。”(订单确定) 。
“鸡蛋又不购了,打电话叫小贬送来。”(紧急采购) 。
6:30,一切准备就绪,可烤鸭还没送来,急忙打电话询问:“我是李太,怎么订的烤鸭还不送来?”(采购委外单跟催) 。
“不好意思,送货的人已经走了,可能是堵车吧,马上就会到的。” 。
门铃响了。
“李太太,这是您要的烤鸭。请在单上签一个字。”(验收、入库、转应付账款) 。
6:45,女儿的电话:“妈妈,我想现在带几个朋友回家吃饭可以吗?”(呵呵 ,又是紧急订购意向,要求现货) 。
“不行呀,女儿,今天妈已经需要准备两桌饭了,时间实在是来不及,真的非常抱歉,下次早点说,一定给你们准备好。”(哈哈,这就是ERP的使用局限,要有稳定的外部环境,要有一个起码的提前期 )。
…… …… 。
送走了所有客人,疲惫的妻子坐在沙发上对丈夫说:“亲爱的,现在咱们家请客的频率非常高,应该要买些厨房用品了(设备采购),最好能再雇个小保姆(连人力资源系统也有缺口了)。
丈夫:“家里你做主,需要什么你就去办吧。”(通过审核) 。
妻子:“还有,最近家里花销太大,用你的私房钱来补贴一下,好吗?”(最后就是应收货款的催要) 。
现在还有人不理解ERP吗?记住,每一个合格的家庭主妇都是生产厂长的有力竞争者。

一、转自:http://www.cnblogs.com/richardw/archive/2012/10/06/2713027.html
二、转自:https://sjolzy.cn/PHP-Class-ezSQL-database-operations.html(PHP数据库操作类 - ezSQL)

一、操作MySQL,使用ezSQL,简单而方便

最近使用PHP做点小东东,使用了ezSQL,真的感觉很简单很ez。

ezSQL官方下载地址:http://justinvincent.com/ezsql

使用示例:

取数值:

$var = $db->get_var("SELECT count(*) FROM users");


取对象:

$user = $db->get_row("SELECT name,email FROM users WHERE id = 2");


取数组:

复制代码

$users = $db->get_results("SELECT name, email FROM users");
foreach ( $users as $user )
{
    // 使用对象语法
    echo $user->name;
    echo $user->email;
}

复制代码
可以看出,其实函数返回值为二维数组,经foreach分解后,$user为每条记录的内容,可直接用$user->字段名的方式访问。

get_results()还有另一种调用方式:

复制代码

// Extract results into the array $dogs (and evaluate if there are any results at the same time)..
if ( $dogs = $db->get_results(“SELECT breed, owner, name FROM dogs”, ARRAY_A) )
{
            // Loop through the resulting array on the index $dogs[n]
            foreach ( $dogs as $dog_detail )
            {
 
                        // Loop through the resulting array
                        foreach ( $dogs_detail as $key => $val )
                        {
                                    // Access and format data using $key and $val pairs..
                                    echo “<b>” . ucfirst($key) . “</b>: $val<br>”;
                        }
 
                        // Do a P between dogs..
                        echo “<p>”;
            }
}
else
{
            // If no users were found then if evaluates to false..
            echo “No dogs found.”;
}

复制代码

输出结果:

Output:
Breed: Boxer
Owner: Amy
Name: Tyson

Breed: Labrador
Owner: Lee
Name: Henry

Breed: Dachshund
Owner: Mary
Name: Jasmine


执行Insert操作:

$db->query("INSERT INTO users (id, name, email) VALUES (NULL,'justin','jv@foo.com')");


调试信息

// Display last query and all associated results

$db->debug();

四种方法:

bool    $db->query(query)
var    $db->get_var(query)
mixed    $db->get_row(query)
mixed    $db->get_results(query)
ezSQL functions

$db->get_results -- get multiple row result set from the database (or previously cached results)

$db->get_row -- get one row from the database (or previously cached results)

$db->get_col -- get one column from query (or previously cached results) based on column offset

$db->get_var -- get one variable, from one row, from the database (or previously cached results)

$db->query -- send a query to the database (and if any results, cache them)

$db->debug -- print last sql query and returned results (if any)

$db->vardump -- print the contents and structure of any variable

$db->select -- select a new database to work with

$db->get_col_info -- get information about one or all columns such as column name or type

$db->hide_errors -- turn ezSQL error output to browser off

$db->show_errors -- turn ezSQL error output to browser on

$db->escape -- Format a string correctly to stop accidental mal formed queries under all PHP conditions

$db = new db -- Initiate new db object.

 

ezSQL variables

$db->num_rows – Number of rows that were returned (by the database) for the last query (if any)

$db->insert_id -- ID generated from the AUTO_INCRIMENT of the previous INSERT operation (if any)

$db->rows_affected -- Number of rows affected (in the database) by the last INSERT, UPDATE or DELETE (if any)

$db->num_queries -- Keeps track of exactly how many 'real' (not cached) queries were executed during the lifetime of the current script

$db->debug_all – If set to true (i.e. $db->debug_all = true;) Then it will print out ALL queries and ALL results of your script.

$db->cache_dir – Path to mySQL caching dir.

$db->cache_queries – Boolean flag (see mysql/disk_cache_example.php)

$db->cache_inserts – Boolean flag (see mysql/disk_cache_example.php)

$db->use_disk_cache – Boolean flag (see mysql/disk_cache_example.php)

$db->cache_timeout – Number in hours (see mysql/disk_cache_example.php)



二、PHP数据库操作类 - ezSQL

07 August 2010 10:57 Saturdayby Sjolzy
ezSQL 下载地址://sjolzy.cn/php/ezSQL/bak/ez_sql_2.05.zip

新版本是2.05添加了很多支持,包括 CodeIgniter,MSSQL, PDO等等。

查看示例:

Example 1

// Select multiple records from the database and print them out..
$users = $db->get_results("SELECT name, email FROM users");
foreach ( $users as $user ) {
            // Access data using object syntax
            echo $user->name;
            echo $user->email;
}

Example 2

// Get one row from the database and print it out..
$user = $db->get_row("SELECT name,email FROM users WHERE id = 2");
echo $user->name;
echo $user->email;

Example 3

// Get one variable from the database and print it out..
$var = $db->get_var("SELECT count(*) FROM users");
echo $var;

Example 4

// Insert into the database
$db->query("INSERT INTO users (id, name, email) VALUES (NULL,'justin','jv@foo.com')");

Example 5

// Update the database
$db->query("UPDATE users SET name = 'Justin' WHERE id = 2)");

Example 6

// Display last query and all associated results
$db->debug();

Example 7

// Display the structure and contents of any result(s) .. or any variable
$results = $db->get_results("SELECT name, email FROM users");
$db->vardump($results);

Example 8

// Get 'one column' (based on column index) and print it out..
$names = $db->get_col("SELECT name,email FROM users",0)
foreach ( $names as $name ) {
    echo $name;
}

Example 9

// Same as above ‘but quicker’
foreach ( $db->get_col("SELECT name,email FROM users",0) as $name ) {
    echo $name;
}

Example 10

// Map out the full schema of any given database and print it out..
$db->select("my_database");
foreach ( $db->get_col("SHOW TABLES",0) as $table_name ) {
    $db->debug();
    $db->get_results("DESC $table_name");
}
$db->debug();


转自永久地址:https://sjolzy.cn/PHP-Class-ezSQL-database-operations.html

--EOF--


本文永久地址:http://duuge.com/archives/ezSQL.html