本文整理汇总了PHP中Client::setPeriodicalid方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::setPeriodicalid方法的具体用法?PHP Client::setPeriodicalid怎么用?PHP Client::setPeriodicalid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client::setPeriodicalid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createperiodicalClients
function createperiodicalClients()
{
$now = Carbon::Now();
$criteria = new AndStatement();
$field = $this->clientPeriodicalDao->getQHourName();
$criteria->addStatement($field . "=" . $now->hour);
$periodicalClients = $this->clientPeriodicalDao->find($criteria, null);
if (is_null($periodicalClients) || is_string($periodicalClients)) {
$mail_ob = new Mail();
$mail_ob->setTo("just.urbonas@gmail.com");
$mail_ob->setText("Nepavyko nuskaityti periodiniu klientu." . (is_string($periodicalClients) ? $periodicalClients : ""));
$mail_ob->setSubject("WorkFlow.kaizensistema.lt | Nepavyko nuskaityti periodiniu klientu.");
$mail_ob->sendMail();
return false;
}
foreach ($periodicalClients as $client) {
$createNewClient = false;
if ($client->getPeriod_type() == 1) {
$createNewClient = true;
}
if ($client->getPeriod_type() == 2 && $now->isWeekday()) {
$createNewClient = true;
}
if ($client->getPeriod_type() == 3 && $now->day == $client->getMonth_day()) {
$createNewClient = true;
}
if ($client->getPeriod_type() == 4) {
$monthBegin = $now->copy()->startOfMonth();
while ($monthBegin->dayOfWeek != $client->getWeek_day()) {
$monthBegin->addDay();
}
if ($monthBegin->isSameDay($now)) {
$createNewClient = true;
}
}
if ($client->getPeriod_type() == 5) {
$monthEnd = $now->copy()->endOfMonth();
while ($monthEnd->dayOfWeek != $client->getWeek_day()) {
$monthEnd->subDay();
}
if ($monthEnd->isSameDay($now)) {
$createNewClient = true;
}
}
if ($createNewClient) {
$newClient = new Client();
$newClient->setPid($client->getPid());
$newClient->setName($client->getName());
$newClient->setEmail($client->getEmail());
$newClient->setCustomer($client->getCustomer());
$newClient->setTelephone($client->getTelephone());
$newClient->setComment($client->getComment());
$newClient->setActive(true);
$newClient->setPeriodical(true);
$newClient->setPeriodicalid($client->getId());
$newClient->setR_date($now->toDateTimeString());
$newClient->setR_user(988);
$store = $this->storeClient($newClient);
if (!$store) {
$mail_ob = new Mail();
$mail_ob->setTo("just.urbonas@gmail.com");
$mail_ob->setText(print_r($newClient, true));
$mail_ob->setSubject("WorkFlow.kaizensistema.lt | Nepavyko sukurti periodinio kliento.");
$mail_ob->sendMail();
} else {
$eventHistory = new EventHistory();
$eventHistory->setPid($newClient->getPid());
$eventHistory->setCid($newClient->getId());
$eventHistory->setR_date($newClient->getR_date());
$eventHistory->setDescription("Sukurtas kaip periodinis klientas");
$this->storeEventHistory($eventHistory);
}
}
}
}
示例2: importAction
function importAction()
{
if (!isset($_POST['client'])) {
$this->setOutPut(array("error" => $this->errorCode['param_not_found']));
return false;
}
$client = json_decode(urldecode($_POST['client']));
//$client = $this->utf8Decode($client1);
//var_dumpas($client['projectKey']);
if (!isset($client->projectKey) || is_null($client->projectKey)) {
$this->setOutPut(array("error" => $this->errorCode['wrong_param']));
return false;
}
$project = $this->getProject($client->projectKey, $client);
if (!is_object($project)) {
return false;
}
if (!isset($client->name) || is_null($client->name)) {
$this->setOutPut(array("error" => $this->errorCode['wrong_param']));
return false;
}
if (!isset($client->email) || is_null($client->email)) {
$this->setOutPut(array("error" => $this->errorCode['wrong_param']));
return false;
}
if (!isset($client->telephone) || is_null($client->telephone)) {
$this->setOutPut(array("error" => $this->errorCode['wrong_param']));
return false;
}
/*if (!isset($client->comment) || is_null($client->comment)){
$this->setOutPut(array("error" => $this->errorCode['wrong_param']));
return false;
}*/
$now = Carbon::Now();
//Kuriam nauja klienta
$newClient = new Client();
$newClient->setPid($project->getId());
$newClient->setName(substr($client->name, 0, 255));
$newClient->setEmail(substr($client->email, 0, 255));
$newClient->setTelephone(substr($client->telephone, 0, 50));
$newClient->setComment(substr($client->comment, 0, 255));
$newClient->setCustomer(substr($client->customer, 0, 255));
$newClient->setActive(true);
$newClient->setPeriodical(false);
$newClient->setPeriodicalid(0);
$newClient->setR_date($now->toDateTimeString());
$newClient->setR_user(977);
$store = $this->storeClient($newClient);
if (!$store) {
$this->setOutPut(array("error" => $this->errorCode['client_not_stored']));
$mail_ob = new Mail();
$mail_ob->setTo("just.urbonas@gmail.com");
$mail_ob->setText(print_r($newClient, true));
$mail_ob->setSubject("WorkFlow.kaizensistema.lt | Nepavyko sukurti importo kliento.");
$mail_ob->sendMail();
return false;
} else {
$eventHistory = new EventHistory();
$eventHistory->setPid($newClient->getPid());
$eventHistory->setCid($newClient->getId());
$eventHistory->setR_date($newClient->getR_date());
$eventHistory->setDescription(!is_null($client->from) ? $client->from : "Sukurtas integracijos metu");
$this->storeEventHistory($eventHistory);
}
$this->setOutPut(array("ok" => "ok"));
}
示例3: actionSaveClient
function actionSaveClient($currentProject)
{
$backUrl = $this->context->getFlowScopeAttr("backUrl");
$projectID = $this->context->getRequestAttr("projectID");
$edit = $this->context->getRequestAttr("edit");
$client = new Client();
$clientErrs = array();
$client->setId($this->context->getRequestAttr("id"));
$client->setPid($this->context->getRequestAttr("projectID"));
$client->setName($this->context->getRequestAttr("name"));
if (!is_null($client->getName())) {
$client->setName(trim($client->getName()));
if (strlen($client->getName()) < 1) {
$client->setName(null);
}
}
if (is_null($client->getName())) {
$clientErrs["name"] = "field.error.empty";
}
$client->setEmail($this->context->getRequestAttr("email"));
if (!is_null($client->getEmail())) {
$client->setEmail(trim($client->getEmail()));
if (strlen($client->getEmail()) < 1) {
$client->setEmail(null);
}
}
if (is_null($client->getEmail())) {
$clientErrs["email"] = "field.error.empty";
}
$client->setTelephone($this->context->getRequestAttr("telephone"));
if (!is_null($client->getTelephone())) {
$client->setTelephone(trim($client->getTelephone()));
if (strlen($client->getTelephone()) < 1) {
$client->setTelephone(null);
}
}
$client->setCustomer($this->context->getRequestAttr("customer"));
if (!is_null($client->getCustomer())) {
$client->setCustomer(trim($client->getCustomer()));
if (strlen($client->getCustomer()) < 1) {
$client->setCustomer(null);
}
}
$client->setComment($this->context->getRequestAttr("comment"));
if (!is_null($client->getComment())) {
$client->setComment(trim($client->getComment()));
if (strlen($client->getComment()) < 1) {
$client->setComment(null);
}
}
$client->setPeriodical(false);
$client->setPeriodicalid(0);
$timeZone = new DateTimeZone("Europe/Vilnius");
$time = new DateTime("now", $timeZone);
$client->setR_date($time->format("Y-m-d H:i:s"));
$client->setR_user(777);
$client->setActive(true);
$this->context->setFlashScopeAttr("createClient", $client);
$this->context->setFlashScopeAttr("clientErrs", $clientErrs);
$this->context->setFlashScopeAttr("projectID", $projectID);
if (count($clientErrs) >= 1) {
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
$insert = true;
$store = $this->storeClient($client);
if (!$store) {
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
if ($insert && $edit == 0) {
$eventHistory = new EventHistory();
$eventHistory->setPid($client->getPid());
$eventHistory->setCid($client->getId());
$eventHistory->setR_date($client->getR_date());
$eventHistory->setDescription("Sukurtas partnerio");
$this->storeEventHistory($eventHistory);
}
$this->cancelClientCreate();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
示例4: find
function find($criteria = null, $order = null, $limit = 1000, $from = 0)
{
$result = $this->database->query($this->buildFindQuery($criteria, $order, $limit, $from));
if (!is_null($result->getError())) {
return $result->getError();
}
$clients = array();
while ($row = $result->fetchRow()) {
$client = new Client();
$value = $row[0];
$client->setId($value);
$value = $row[1];
$client->setPid($value);
$value = $row[2];
$client->setName($value);
$value = $row[3];
$client->setEmail($value);
$value = $row[4];
$client->setTelephone($value);
$value = $row[5];
$client->setCustomer($value);
$value = $row[6];
$client->setComment($value);
$value = $row[7];
$value = $this->database->toBoolean($value);
$client->setActive($value);
$value = $row[8];
$value = $this->database->toBoolean($value);
$client->setEnded($value);
$value = $row[9];
$value = $this->database->toBoolean($value);
$client->setEnded_eve($value);
$value = $row[10];
$value = $this->database->toBoolean($value);
$client->setMoved($value);
$value = $row[11];
$value = $this->database->toBoolean($value);
$client->setPeriodical($value);
$value = $row[12];
$client->setPeriodicalid($value);
$value = $row[13];
$value = $this->database->toBoolean($value);
$client->setCan_create($value);
$value = $row[14];
$client->setR_date($value);
$value = $row[15];
$client->setR_user($value);
if ($order != null) {
array_push($clients, $client);
} else {
$clients[$client->getId()] = $client;
}
}
return $clients;
}
示例5: actionSaveClient
function actionSaveClient($currentUser)
{
$backUrl = $this->context->getFlowScopeAttr("backUrl");
$client = new Client();
$clientErrs = array();
$client->setId($this->context->getRequestAttr("id"));
$client->setPid($this->context->getRequestAttr("projectID"));
$client->setName($this->context->getRequestAttr("name"));
if (!is_null($client->getName())) {
$client->setName(trim($client->getName()));
if (strlen($client->getName()) < 1) {
$client->setName(null);
}
}
if (is_null($client->getName())) {
$clientErrs["name"] = "field.error.empty";
}
$client->setEmail($this->context->getRequestAttr("email"));
if (!is_null($client->getEmail())) {
$client->setEmail(trim($client->getEmail()));
if (strlen($client->getEmail()) < 1) {
$client->setEmail(null);
}
}
if (is_null($client->getEmail())) {
$clientErrs["email"] = "field.error.empty";
}
$client->setTelephone($this->context->getRequestAttr("telephone"));
if (!is_null($client->getTelephone())) {
$client->setTelephone(trim($client->getTelephone()));
if (strlen($client->getTelephone()) < 1) {
$client->setTelephone(null);
}
}
$client->setCustomer($this->context->getRequestAttr("customer"));
if (!is_null($client->getCustomer())) {
$client->setCustomer(trim($client->getCustomer()));
if (strlen($client->getCustomer()) < 1) {
$client->setCustomer(null);
}
}
$client->setComment($this->context->getRequestAttr("comment"));
if (!is_null($client->getComment())) {
$client->setComment(trim($client->getComment()));
if (strlen($client->getComment()) < 1) {
$client->setComment(null);
}
}
$periodicalID = $this->context->getRequestAttr("periodicalid");
$periodical = $this->context->getRequestAttr("periodCustomer");
$client->setPeriodical($periodical == 1 ? true : false);
$timeZone = new DateTimeZone("Europe/Vilnius");
$time = new DateTime("now", $timeZone);
$client->setR_date($time->format("Y-m-d H:i:s"));
$client->setR_user($currentUser->getId());
$client->setActive(true);
if (!is_null($periodicalID) && !$client->isPeriodical()) {
$this->clientPeriodicalDao->delete($periodicalID);
$this->clientDaol->resetPeriodicalClients($periodicalID);
$client->setPeriodicalid(0);
}
if ($client->isPeriodical()) {
$clientPeriodical = new ClientPeriodical();
$clientPeriodical->setId($periodicalID);
$clientPeriodical->setPid($client->getPid());
$clientPeriodical->setName($client->getName());
$clientPeriodical->setEmail($client->getEmail());
$clientPeriodical->setCustomer($client->getCustomer());
$clientPeriodical->setTelephone($client->getTelephone());
$clientPeriodical->setComment($client->getComment());
$clientPeriodical->setR_date($time->format("Y-m-d H:i:s"));
$clientPeriodical->setR_user($currentUser->getId());
$clientPeriodical->setPeriod_type($this->context->getRequestAttr("period_type"));
$clientPeriodical->setWeek_day($this->context->getRequestAttr("week_day"));
$clientPeriodical->setMonth_day($this->context->getRequestAttr("month_day"));
$clientPeriodical->setHour($this->context->getRequestAttr("hour"));
} else {
$clientPeriodical = new ClientPeriodical();
}
$this->context->setFlashScopeAttr("client", $client);
$this->context->setFlashScopeAttr("clientPeriodical", $clientPeriodical);
$this->context->setFlashScopeAttr("clientErrs", $clientErrs);
$projectID = $client->getPid();
if (!$this->setStoreProject($projectID, "clientProject")) {
$this->cancelClientEdit();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
if (count($clientErrs) >= 1) {
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
$insert = false;
if (is_null($client->getId())) {
//.........这里部分代码省略.........