本文整理汇总了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'>×</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'>×</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
示例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();
示例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";
示例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'>";
示例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 -->