当前位置: 首页>>代码示例>>PHP>>正文


PHP customer::addCustomer方法代码示例

本文整理汇总了PHP中customer::addCustomer方法的典型用法代码示例。如果您正苦于以下问题:PHP customer::addCustomer方法的具体用法?PHP customer::addCustomer怎么用?PHP customer::addCustomer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在customer的用法示例。


在下文中一共展示了customer::addCustomer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

     } else {
         ob_start();
         $a = ob_get_clean();
         $responce = array('status' => 'failed', 'error' => 'Data missing' . $a, 'data' => array());
     }
 } else {
     if ($form_id == 6) {
         if (isset($_POST['customer_name']) and !empty($_POST['customer_name']) and isset($_POST['contact_number']) and !empty($_POST['contact_number'])) {
             $customer = new customer();
             $customer->customer_name = $_POST['customer_name'];
             $customer->contact_number = $_POST['contact_number'];
             $user = new user();
             $user->id = $_SESSION['user_id'];
             $user->getUser();
             $customer->company_id = $user->company_id;
             if ($customer->addCustomer()) {
                 $message = "Customer added successfully";
                 $responce = array('status' => 'success', 'error' => '', 'data' => array("message" => $message));
             } else {
                 Log::e($tag, "Customer adding failed Customer : " . $customer->to_string() . 'Error : ' . mysql_error());
                 $mysql_error = mysql_error();
                 if (empty($mysql_error)) {
                     $error_message = 'Some server error occured';
                 } else {
                     $error_message = $mysql_error;
                 }
                 $responce = array('status' => 'failed', 'error' => $error_message, 'data' => array());
             }
         } else {
             ob_start();
             $a = ob_get_clean();
开发者ID:sakkeerhussain,项目名称:online_ims,代码行数:31,代码来源:add_form_data.php

示例2: customer

//Check user is already login or not
checkAuthentication();
$id = $_SESSION['adminid'];
$customer = new customer();
if (isset($_GET['action']) && $_GET['action'] == 'new') {
    $smarty->assign('content', $smarty->fetch('addcustomer.tpl'));
} elseif (isset($_GET['action']) && $_GET['action'] == 'edit') {
    $id = $_GET['id'];
    $smarty->assign('customer', $customer->getCustomer($id));
    $smarty->assign('billing', $customer->getCustomerBilling($id));
    $smarty->assign('shipping', $customer->getCustomerShipping($id));
    $smarty->assign('tax', $customer->getCustomerTax($id));
    $smarty->assign('content', $smarty->fetch('editcustomer.tpl'));
} elseif (isset($_POST['action']) && $_POST['action'] == 'add') {
    $data = $_POST['data']['Customer'];
    if ($customer->addCustomer($data)) {
        header('Location: ' . FRONTEND . 'customer.php');
        exit;
    }
} elseif (isset($_POST['action']) && $_POST['action'] == 'update') {
    $data = $_POST['data']['Customer'];
    if ($customer->updateCustomer($data)) {
        header('Location: ' . FRONTEND . 'customer.php');
        exit;
    }
} elseif (isset($_GET['action']) && $_GET['action'] == 'search') {
    $keyword = $_POST['keywords'];
    $smarty->assign('customer', $customer->getSearchCustomers($keyword));
    $smarty->assign('content', $smarty->fetch('customerlist.tpl'));
} else {
    $page = 1;
开发者ID:roshanbhgt,项目名称:erp,代码行数:31,代码来源:customer.php


注:本文中的customer::addCustomer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。