本文整理汇总了PHP中Reports::setClients方法的典型用法代码示例。如果您正苦于以下问题:PHP Reports::setClients方法的具体用法?PHP Reports::setClients怎么用?PHP Reports::setClients使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reports
的用法示例。
在下文中一共展示了Reports::setClients方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateReport
function generateReport()
{
$code = $this->generatePass();
$now = Carbon::Now();
$clients = isset($_GET["clients"]) ? $_GET["clients"] : null;
$name = isset($_GET["name"]) ? $_GET["name"] : "";
$periodFrom = isset($_GET["periodFrom"]) ? $_GET["periodFrom"] : null;
$periodTo = isset($_GET["periodTo"]) ? $_GET["periodTo"] : null;
if (is_null($clients)) {
echo "Nepavyko nuskaityti parametro!";
return;
}
$reports = new Reports();
$reports->setName($name);
$reports->setCode($code);
$reports->setClients($clients);
$reports->setOwner(9);
$reports->setPeriod_from($periodFrom);
$reports->setPeriod_to($periodTo);
$reports->setAdd_date($now->toDateTimeString());
$rez = $this->reportsDao->insert($reports);
if (is_string($rez)) {
echo "-1";
return;
}
$fullUrl = $this->reportsUrl . $code;
//$return = '<span style="font-size: 12px; font-weight: bold;">Ataskaitos adresas</span><br /><div class="well well-sm">'.$fullUrl.'</div>';
$return = '<span style="font-size: 12px; font-weight: bold;">Ataskaitos adresas</span><br /><input type="text" class="form-control" id="exampleInputEmail1" value="' . $fullUrl . '" onclick="this.select(); document.execCommand(\'copy\');">';
echo $return;
}
示例2: 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();
}
$reportss = array();
while ($row = $result->fetchRow()) {
$reports = new Reports();
$value = $row[0];
$reports->setId($value);
$value = $row[1];
$reports->setName($value);
$value = $row[2];
$reports->setCode($value);
$value = $row[3];
$reports->setClients($value);
$value = $row[4];
$reports->setOwner($value);
$value = $row[5];
$reports->setPeriod_from($value);
$value = $row[6];
$reports->setPeriod_to($value);
$value = $row[7];
$reports->setAdd_date($value);
if ($order != null) {
array_push($reportss, $reports);
} else {
$reportss[$reports->getId()] = $reports;
}
}
return $reportss;
}