本文整理汇总了PHP中Client::addClient方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::addClient方法的具体用法?PHP Client::addClient怎么用?PHP Client::addClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client::addClient方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
echo '>Delete Client</a></li>';
echo '</ul>';
echo '</div>
<div style="float: right; width: 750px;">';
if ($_GET['do'] == 'add-client' || empty($_GET['do'])) {
echo '<p>On this page you can add a client.</p>';
if ($_SERVER['REQUEST_METHOD'] == "POST") {
if (empty($_POST['client_firstname']) || empty($_POST['client_nickname']) || empty($_POST['client_valid'])) {
echo '<p class="notification red">All fields are required.</p>';
} else {
if (strlen($_POST['client_nickname']) > 32) {
echo '<p class="notification red">The client username cannot contain more than 32 characters!</p>';
} elseif ($_POST['client_valid'] !== "True" && $_POST['client_valid'] !== "False") {
echo '<p class="notification red">The client status is not valid.</p>';
} else {
if ($client->addClient($_POST['client_firstname'], $_POST['client_nickname'], $_POST['client_valid'])) {
echo '<p class="notification green">You have successfully added a client user.</p>';
$log->addLog($_SESSION['loggedIn']['id'], "Added a client.");
$hideform = true;
}
}
}
}
if ($hideform !== true) {
?>
<form action="" method="post" class="styled">
<label style="width: 150px;">Client Firstname</label>
<input type="text" name="client_firstname" />
<br />
<label style="width: 150px;">Client Nickname</label>
示例2: Worksheet
include_once "classes/Worksheet.php";
include_once "classes/Client.php";
$worksheet = new Worksheet();
//check if client has to be added
if ($_POST['worksheet']['addCompany']) {
$info = $_POST['worksheet']['addCompany'];
// add through Client class, get last id and setClient
$client = new Client();
$client->setClientAddress($info['address']);
$client->setClientCity($info['city']);
$client->setClientEmail($info['email']);
$client->setClientName($info['name']);
$client->setClientPostal($info['postal']);
$client->setClientTelephone($info['phone']);
$client->setCompany($info['company']);
$client_id = $client->addClient();
$worksheet->setClient($client_id);
} else {
// its set as false, take saved id
$worksheet->setClient($_POST['worksheet']['client']);
}
// set data
$worksheet->setCRM($_POST['worksheet']['CRMNumber']);
$worksheet->setCRMDate($_POST['worksheet']['CRMDate']);
$worksheet->setDate($_POST['worksheet']['date']);
$worksheet->setExpenses($_POST['worksheet']['expenses']);
$worksheet->setMaterial($_POST['worksheet']['material']);
$worksheet->setNotes($_POST['worksheet']['notes']);
$worksheet->setSignatureClient($_POST['worksheet']['signature']);
$worksheet->setSignatureUser(1);
$worksheet->setStopwatch($_POST['worksheet']['stopwatch']);
示例3: Client
<?php
/**
* Created by PhpStorm.
* User: Ach-Khalil
* Date: 10/08/15
* Time: 09:35
*/
require 'Client.php';
session_start();
$date = date_create('2000-01-01');
$datos = date_format($date, 'Y-m-d');
$client = new Client(131315, "El Boss", "Del Testos", "Paris Couzin ! ", 3333333333.0, 5, "El promotor", "El teleOperationnal", "El Leader", "Canalos 123", "El Titularios", "gerancias", 30, "Gold", $datos, "El potential TOUS ÇA !", "El Zonas", "Los planogrammos");
$statut = $client->addClient();
if ($statut == 1) {
echo 'Client Ajouté avec succée';
} else {
echo 'idekfih';
}
示例4: sanitize
if(Client::countClientUsername($username)==1) {
$error = "Username already in used";$ctr=1;
}
if($ctr=="") {
//save customer information and send confirmation email
$_POST = sanitize($_POST);
$client = $_POST;
settype($client,'object');
$client_id = Client::addClient($client);
//send email to client
require("includes/class.phpmailer.php");
$mail = new PHPMailer();
$to = $email;
$name_from = "Piggyments";
$mail->From = "info@piggyments.com";
$mail->FromName = $name_from;
$emailto = $to;
$mail->AddAddress($emailto);
$mail->IsHTML(true); // set email format to HTML
示例5: sanitize
$firstname_error = "Please enter your firstname";
$ctr = 1;
}
if ($lastname == "") {
$lastname_error = "Please enter your lastname";
$ctr = 1;
}
if (!checkEmail($email)) {
$email_error = "Please enter your valid email address";
$ctr = 1;
}
if ($ctr == "") {
$_POST = sanitize($_POST);
$client = $_POST;
settype($client, 'object');
Client::addClient($client);
$success = "Client Successfully Saved!";
$updates = 'Add new clients content';
AdminAction::addAdminAction($_SESSION['admin_name'], $updates);
}
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" type="text/css" media="screen" href="<?php
echo $ROOT_URL;
?>
_admin/_assets/css/core3.css" />