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


PHP customer::insert方法代码示例

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


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

示例1: customer

 echo "<div class='container'>";
 echo "<div class='col-md-9'>";
 if ($_POST) {
     //public $cust_kode, $cust_nama, $cust_alamat, $cust_jk, $cust_tempat, $cust_dob, $isactive;
     include_once $_SERVER['DOCUMENT_ROOT'] . '/objects/customer.php';
     $customer = new customer($db);
     $customer->cust_kode = $_POST['cust_kode'];
     $customer->cust_nama = $_POST['cust_nama'];
     $customer->cust_alamat = $_POST['cust_alamat'];
     $customer->cust_jk = $_POST['cust_jk'];
     $customer->cust_tempat = $_POST['cust_tempat'];
     $customer->cust_dob = $_POST['cust_dob'];
     //tanggal lahir pelanggan
     $customer->isactive = $_POST['isactive'];
     //fungsi insert data pelanggan
     if ($customer->insert()) {
         echo "<div class='alert alert-success alert-dismissable'>";
         echo "<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>";
         echo "Pelanggan Baru berhasil di Tambah";
         echo "</div>";
     } else {
         echo "<div class='alert alert-danger alert-dismissable'>";
         echo "<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>";
         echo "pelanggan Baru gagal di tambah";
         echo "</div>";
     }
 }
 echo "<div class='row'>";
 echo "<form id='form_reg' class='form-horizontal' action='' method='POST' role='form'>";
 echo "<legend class='text-center'>Tambah Data Pelanggan</legend>";
 //dari sini
开发者ID:ilhamdoanggg,项目名称:penjualan_salon,代码行数:31,代码来源:insert.php

示例2: customer

?>
</h1>

<?php 
$customerInst = new customer();
#######################################################################
## perform action
$status = 1;
if (tool::securePost('action') == "save" && tool::securePost('id')) {
    # fill customer with submitted data
    $customerInst->id = tool::securePost('id');
    $customerInst->fill(tool::securePostAll());
    $status = $customerInst->update();
} elseif (tool::securePost('action') == "save") {
    $customerInst->fill(tool::securePostAll());
    $status = $customerInst->insert();
}
if (tool::securePost('action') == "delete") {
    $customerInst->id = tool::securePost('id');
    $customerInst->delete();
}
if (tool::securePost('action') == "edit") {
    $status = 0;
    $customerInst->activate(tool::securePost('id'));
}
#######################################################################
## make edit / new form
if (!$status) {
    echo "<h2>" . $lang['common_editRecord'] . " (<a href=\"" . $toolInst->encodeUrl("index.php?content=" . $content) . "\">" . $lang['common_newRecord'] . "</a>)</h2>\n";
} else {
    $customerInst->clear();
开发者ID:pmtool,项目名称:pmtool,代码行数:31,代码来源:customers.php

示例3: customer

     $validate->phone('phone', $phone);
     // Load appropriate view based on hasErrors
     if ($fields->hasErrors()) {
         include '../view/register.php';
     } else {
         /*
          $name = $_POST['name'];
          $age = $_POST['age'];
          $mail = $_POST['email'];
          $pass = md5($_POST['pass']);
          $address = $_POST['address'];
          $city = $_POST['city'];
          $phone = $_POST['phone'];
         */
         $add = new customer(Null, $name, $age, $email, $password, $address, $city, $phone);
         $result = $add->insert();
         header("location:?action=acc_login_form");
     }
     break;
 case "acc_login":
     $User = $_POST["email"];
     $Pass = md5($_POST["password"]);
     $ad = new customer();
     $ar = $ad->login($User, $Pass);
     if ($ar[0] == 0) {
         echo "Login Failed";
         include "../view/login_order.php";
     } else {
         if ($ar[0] == 1) {
             $_SESSION["\\/m&coppy;fptp\$02241"] = $ar[1];
             include "../view/home.php";
开发者ID:ntcongthang,项目名称:futuretech_ok,代码行数:31,代码来源:usercontroller.php

示例4: customer

<?php

if ($_POST) {
    include_once $_SERVER['DOCUMENT_ROOT'] . '/objects/customer.php';
    $customer = new customer($db);
    $customer->cust_kode = $_POST['cust_kode'];
    $customer->cust_nama = $_POST['cust_nama'];
    $customer->cust_alamat = $_POST['cust_alamat'];
    $customer->cust_jk = $_POST['cust_jk'];
    $customer->cust_tempat = $_POST['cust_tempat'];
    $customer->cust_dob = $_POST['cust_dob'];
    //tanggal lahir pelanggan
    $customer->cust_hp = $_POST['cust_hp'];
    $customer->isactive = $_POST['isactive'];
    $customer->insert();
    header("refresh: 0");
}
?>

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
				<h4 class="modal-title" id="myModalLabel">Tambah Data Pelanggan</h4>
			</div>
		<div class="modal-body">
			<form class="form-horizontal" action="" method="post">
				<div class="row">
<?php 
echo "<div class='form-group'>";
开发者ID:ilhamdoanggg,项目名称:penjualan_salon,代码行数:31,代码来源:modalinsert.php

示例5: elseif

if (isset($_POST['update'])) {
    $fname1 = $_POST['fname1'];
    $lname1 = $_POST['lname1'];
    $address1 = $_POST['address1'];
    $telNo1 = $_POST['telNo1'];
    if (strlen($telNo1) < 1) {
        $addError[] = "Enter Tel No.";
    } elseif (strlen($fname1) < 1) {
        $addError[] = "Enter Firstname";
    } elseif (strlen($lname1) < 1) {
        $addError[] = "Enter Lastname";
    } elseif (strlen($address1) < 2) {
        $addError[] = "Enter Address";
    } else {
        $up = new customer(NULL, $fname1, $lname1, $address1, $telNo1);
        $up->insert();
    }
}
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <title>Costumer</title>

    <!-- Bootstrap core CSS -->
开发者ID:jayp3e011,项目名称:Planas-Bautista_Finals,代码行数:31,代码来源:Customer1.php


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