Location: PHPKode > projects > PhpProjectMaster > www/inc/customer.lib.php
<?php
/* 
 customer related functions
 (c) 2004-2007 by "Oleg Savchuk" <hide@address.com>

 part of phpProjectMaster project
 http://phpprojmaster.sourceforge.net

 The contents of this file are subject to the GNU GENERAL PUBLIC LICENSE
 http://www.gnu.org/copyleft/gpl.html
*/

 require_once "sitelib.php";
 require_once "form_utils.php";
 require_once "upload_utils.php";

//preset module variables

 $customer_vars=array(
   'table_name'   => 'customer',
   'table_key_id' => 'c_id',
   'upload_url'   => "/upload/customer",
   'upload_path'  => "$site_root_offline/upload/customer",
 );


//get item fields from database
function get_customer($item_id){
 global $customer_vars;

 $sql="select * from $customer_vars[table_name] where $customer_vars[table_key_id]=$item_id";
 return db_row($sql);
}

//mark item as removed
function delete_customer($item_id){
 global $customer_vars;

 db_query("update $customer_vars[table_name] set status=127 where $customer_vars[table_key_id]=$item_id");
}

//********************* for uploads
function get_upload_url_customer($item_id, $is_preview=''){
 global $customer_vars;

 $nameadd='';
 if ($is_preview) $nameadd='_s';

 return get_upload_url($item_id, $customer_vars['upload_path'], $customer_vars['upload_url'], $nameadd);
}

function get_upload_path_customer($item_id, $is_preview='', $ext='', $nocheck=''){
 global $customer_vars;

 $nameadd='';
 if ($is_preview) $nameadd='_s';

 return get_upload_path($item_id, $customer_vars['upload_path'], $nameadd, $ext, $nocheck);
}


?>
Return current item: PhpProjectMaster