本文整理汇总了PHP中Supplier::register方法的典型用法代码示例。如果您正苦于以下问题:PHP Supplier::register方法的具体用法?PHP Supplier::register怎么用?PHP Supplier::register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Supplier
的用法示例。
在下文中一共展示了Supplier::register方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$stmt->execute(array(":sup_code" => $scode));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if ($stmt->rowCount() > 0) {
$msg = '<div class="alert alert-warning alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4> <i class="icon fa fa-check"></i> Sorry!</h4>
supplier allready exists , Please Try another one.
</div>';
// $msg = "
// <div class='alert alert-error'>
// <button class='close' data-dismiss='alert'>×</button>
// <strong>Sorry !</strong> email allready exists , Please Try another one
// </div>
// ";
} else {
if ($supplier->register($scode, $fname, $lname, $nic, $iCheck, $email, $address_1, $mobile, $estate, $estate_name, $reg_no, $size_of_estate, $estate_address, $bankn, $branch, $account, $bankacc, $editor)) {
$message = "Thalapalakanada Tea factory, username: 0001 password: {$nic} http://tsms.x10host.com/page/";
if (!empty($mobile)) {
$mobileNumber = Communication::prepareNumber($mobile);
Communication::sendMessage($message, $mobileNumber);
}
echo '
<div class="row">
<div class="col-md-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">Supplier Settings</h3>
</div>
<div class="box-body">
<p>Supplier Successfuly added to the database. Also You can change Supplier settings.</p>
<a class="btn btn-app">
示例2: array
<?php
require_once 'core/init.php';
if (count($_POST) > 0) {
$supplier_data = array("company" => $_POST["company"], "email" => $_POST["email"], "street" => $_POST["street"], "line2" => $_POST["line2"], "city" => $_POST["city"], "province" => $_POST["province"], "postal" => $_POST["postal"], "country" => $_POST["country"], "telephone" => $_POST["links"]);
$_SESSION['form_data'] = $supplier_data;
header("Location: supplier_registration.php", true, 303);
die;
} else {
if (isset($_SESSION['form_data'])) {
$new_supplier = new Supplier();
print_r($_SESSION["form_data"]);
$new_supplier->create($_SESSION["form_data"]);
if ($new_supplier->register()) {
$message = "You have successfully Registered the Supplier !!";
echo "<script type='text/javascript'>alert('{$message}');</script>";
} else {
$message = "The Supplier Registration was unsuccessful.";
echo "<script type='text/javascript'>alert('{$message}');</script>";
}
unset($_SESSION["form_data"]);
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Supplier Management</title>