本文整理汇总了PHP中dte函数的典型用法代码示例。如果您正苦于以下问题:PHP dte函数的具体用法?PHP dte怎么用?PHP dte使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dte函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actSend
function actSend()
{
global $post;
$error = array();
if (!$this->getUserId()) {
$error['userid'] = 'Ќеобходимо выпонить вход, или зарегистрироватьс¤';
}
if (!trim($post->get('description'))) {
$error['description'] = '¬ведите описание';
}
if (!trim($post->get('text'))) {
$error['text'] = '¬ведите текст';
}
if (empty($error)) {
$data = array('userid' => $this->getUserId(), 'text' => $post->get('text'), 'description' => $post->get('description'), 'category' => $post->getInt('category'), 'time' => now(), 'date_to' => dte($post->get('date_to'), DTE_FORMAT_SQL), 'status' => 0);
DB::insert('sc_shop_board', $data);
$this->sendTemplateMail($this->cfg('MAIL'), 'notice_board', $data);
// $this->noticeICQ($this->cfg('ICQ'),'Ќовое объ¤вление на сайте на сайте');
} else {
echo printJSON(array('err' => $error));
exit;
}
echo printJSON(array('msg' => 'ok'));
exit;
}
示例2: actSave
function actSave()
{
global $ST, $get, $post;
$id = $post->getInt('id');
$data = array('description' => $post->get('description'), 'text' => $post->get('text'), 'status' => $post->getInt('status'), 'date_to' => dte($post->get('date_to'), DTE_FORMAT_SQL));
if ($id) {
$ST->update('sc_shop_board', $data, "id=" . $id);
} else {
$id = $ST->insert('sc_shop_board', $data);
}
echo printJSON(array('msg' => 'Сохранено', 'id' => $id));
exit;
}
示例3: actSave
function actSave()
{
global $ST, $get, $post;
$id = $post->getInt('id');
$data = array('content' => $post->get('content'), 'description' => $post->get('description'), 'title' => $post->get('title'), 'author' => $post->get('author'), 'date' => dte($post->get('date'), 'Y-m-d'), 'date_to' => $post->get('date_to') ? dte($post->get('date_to'), 'Y-m-d') : null, 'state' => $post->get('state'), 'img' => $post->get('img'), 'gallery' => $post->getInt('gallery'), 'position' => $post->getInt('position'), 'type' => $this->getType());
if ($data['img'] && file_exists(ROOT . $data['img'])) {
$from = ROOT . $data['img'];
$name = md5_file(ROOT . $data['img']) . '.' . substr($data['img'], -3);
$path = $this->cfg('NEWS_IMAGE_PATH') . '/' . $name;
$data['img'] = $path;
if (!file_exists(ROOT . $data['img'])) {
rename($from, ROOT . $data['img']);
}
} elseif ($data['img'] == 'clear') {
$data['img'] = '';
}
if ($id) {
$ST->update('sc_news', $data, "id=" . $id);
} else {
$id = $ST->insert('sc_news', $data);
}
if (true) {
$content = '';
if ($post->get('type') == 'news') {
$content .= '<small>' . date('d.m.Y') . '</small> ';
}
$content .= '<strong>' . $post->getHtml('title') . '</strong><br />';
$content .= '<span>' . $post->getHtml('description') . '</span><br />';
$content .= '<a href="http://' . $this->cfg('SITE') . '/' . $post->get('type') . '/view/' . $id . '/">подробнее...</a>';
if ($get->exists('save_and_send')) {
$mail = new Mail();
$mail->setFromMail(array($this->cfg('SITE'), $this->cfg('mail')));
$mail->setTemplate('letter_' . $post->get('type'), array('FROM_SITE' => $this->cfg('SITE'), 'CONTENT' => $content, 'BODY' => $post->get('content')));
$mail->xsend($this->getUser('mail'));
} elseif ($get->exists('save_and_send_all')) {
$rs = $ST->execute("SELECT distinct mail FROM sc_subscribe WHERE type LIKE '%" . $post->get('type') . "%'");
$mail = new Mail();
$mail->setFromMail($this->getConfig('mail'));
$mail->setFromMail(array($post->get('title'), $this->cfg('mail')));
$mail->setTemplate('letter_' . $post->get('type'), array('FROM_SITE' => $this->cfg('SITE'), 'CONTENT' => $content, 'BODY' => $post->get('content')));
while ($rs->next()) {
$key = 'http://' . $this->cfg('SITE') . '/cabinet/unsubscribe/?key=' . md5($rs->get('mail') . $post->get('type') . 'unsubscribe') . '&type=' . $post->get('type') . '&mail=' . $rs->get('mail');
$key = '<a href="' . $key . '">' . $key . '</a>';
$mail->xsend($rs->get('mail'), array('UNSUBSCRIBE' => $key));
}
}
}
echo printJSON(array('msg' => 'Сохранено', 'nws_id' => $id));
exit;
}
示例4: actOrder1c
function actOrder1c()
{
global $ST, $get;
$login = $get->get('login');
$password = $get->get('password');
$q = "SELECT * FROM sc_users WHERE type='admin' \n\t\t\tAND login='" . SQL::slashes($login) . "'\n\t\t\tAND password=PASSWORD('" . SQL::slashes($password) . "')";
$rs = $ST->select($q);
if (!$rs->next()) {
exit;
}
$data = array('make_date' => date('Y-m-d'), 'make_time' => date('H:i:s'), 'document' => array());
$date_from = date('Y-m-d');
$date_to = date('Y-m-d', time() + 3600 * 24);
if ($get->get('date_from')) {
$date_from = $get->get('date_from');
}
if ($get->get('date_to')) {
$date_to = $get->get('date_to');
}
$q = "SELECT * FROM sc_shop_order o,sc_users u WHERE u.u_id=o.userid\n\t\t\tAND o.create_time>='{$date_from}' AND o.create_time<='{$date_to}'\n\t\t";
$rs = $ST->select($q);
while ($rs->next()) {
$d = array('id' => $rs->get('id'), 'num' => $rs->get('id'), 'date' => dte($rs->get('create_time'), 'Y-m-d'), 'summ' => $rs->get('total_price'), 'contragent' => array('id' => $rs->get('u_id') . '#' . $rs->get('login') . '#' . $rs->get('name'), 'name' => $rs->get('type') == 'user_jur' ? $rs->get('company') : $rs->get('name'), 'address' => $rs->get('address'), 'mail' => $rs->get('mail')), 'time' => dte($rs->get('create_time'), 'H:i:s'), 'additionally' => $rs->get('additionally'), 'goods' => array());
$q = "SELECT *,ec.id AS ext_cat_id, oi.price AS price \t\n\t\t\tFROM sc_shop_order_item AS oi, sc_shop_item AS si\n\t\t\tLEFT JOIN sc_shop_srv_extcat AS ec ON ec.lnk=si.category\n\t\t\tWHERE\n\t\t\t\tsi.id=oi.itemid\n\t\t\t\tAND oi.orderid={$rs->get('id')} \n\t\t\t\t\n\t\t\t";
$q = "SELECT *, oi.price AS price \t\n\t\t\tFROM sc_shop_order_item AS oi, sc_shop_item AS si\n\t\t\t\n\t\t\tWHERE\n\t\t\t\tsi.id=oi.itemid\n\t\t\t\tAND oi.orderid={$rs->get('id')} \n\t\t\t\t\n\t\t\t";
$rs1 = $ST->select($q);
while ($rs1->next()) {
$g = array('name' => $rs1->get('name'), 'id' => $rs1->get('ext_id'), 'price' => $rs1->get('price') / $rs1->get('count'), 'count' => $rs1->get('count'), 'summ' => $rs1->get('price'));
$d['goods'][] = $g;
}
$data['document'][] = $d;
}
if ($data['document']) {
echo '<?xml version="1.0" encoding="windows-1251"?>';
echo $this->render($data, dirname(__FILE__) . '/order1c.xml.php');
exit;
} else {
echo 'Нет заказов';
}
}
示例5: actSave
function actSave()
{
global $ST, $post;
$id = $post->getInt('id');
$data = array('description' => $post->get('description'), 'file' => $post->get('file'), 'place' => $post->getInt('place'), 'start_date' => dte($post->get('start_date'), 'Y-m-d'), 'stop_date' => dte($post->get('stop_date'), 'Y-m-d'), 'url' => $post->get('url'), 'code' => $post->get('code'));
if ($data['file'] && file_exists(ROOT . $data['file'])) {
$from = ROOT . $data['file'];
$name = md5_file(ROOT . $data['file']) . '.' . substr($data['file'], -3);
$path = $this->cfg('ADVERTISING_PATH') . '/' . $name;
$data['file'] = $path;
if (!file_exists(ROOT . $data['file'])) {
rename($from, ROOT . $data['file']);
}
} elseif ($data['file'] == 'clear') {
$data['file'] = '';
}
if ($id) {
$ST->update('sc_advertising', $data, 'id=' . $id);
} else {
$id = $ST->insert('sc_advertising', $data);
}
echo printJSON(array('msg' => 'Сохранено', 'id' => $id));
exit;
}
示例6: scaleImg
<img src="<?php
echo scaleImg($row['mail'], 'w150h200');
?>
">
<?php
}
?>
<div class="autor"><?php
echo $row['name'];
?>
<?php
echo $row['phone'];
?>
<span class="date"><?php
echo dte($row['time']);
?>
</span></div>
<div class="description">
<?php
echo $row['comment'];
?>
</div>
</div>
</li>
<?php
}
?>
</ul>
</div>
示例7: dte
?>
</td>
<td><?php
echo dte($row['end_date']);
?>
</td>
<td><?php
echo $row['volume_min'];
?>
</td>
<td><?php
echo $row['volume_total'];
?>
</td>
<td><?php
echo dte($row['delivery_date']);
?>
<?php
echo $row['delivery_time'];
?>
</td>
<td><?php
echo $row['delivery_comment'];
?>
</td>
</tr>
<?php
}
?>
</table>
示例8: actSberPDF
function actSberPDF()
{
// $this->needAuth();
global $ST, $get;
$q = "SELECT o.*,u.company,u.other_info,u.address AS u_address FROM sc_shop_order o \r\n\t\tLEFT JOIN sc_users u ON u_id=o.userid\r\n\t\t\r\n\t\tWHERE o.id=" . $get->getInt('id');
if (strpos('user', $this->getUser('type')) !== false) {
$q .= " AND o.userid=" . $this->getUserId();
}
$rs = $ST->select($q);
if ($rs->next()) {
$inn = '';
if ($other_info = getJSON($rs->get('other_info'))) {
$inn = @$other_info['inn'];
}
$data = array('doc_number' => $rs->get('id'), 'order_num' => $rs->get('ordernum'), 'doc_date' => dte($rs->get('create_time')), 'full_firm_name' => $this->cfg('SHOP_R_FULL_FIRM_NAME'), 'firm_name1' => $this->cfg('SHOP_R_FIRM_NAME'), 'firm_address' => $this->cfg('SHOP_R_FIRM_ADRESS'), 'firm_inn' => $this->cfg('SHOP_R_FIRM_INN'), 'firm_kpp' => $this->cfg('SHOP_R_FIRM_KPP'), 'firm_name' => $this->cfg('SHOP_R_FIRM_INN'), 'firm_phone' => $this->cfg('SHOP_R_FIRM_PHONE'), 'firm_account' => $this->cfg('SHOP_R_FIRM_ACCOUNT'), 'firm_bank' => $this->cfg('SHOP_R_FIRM_BANK'), 'firm_bank_bik' => $this->cfg('SHOP_R_FIRM_BANK_BIK'), 'firm_corr_account' => $this->cfg('SHOP_R_FIRM_CORR_ACCOUNT'), 'firm_name' => $this->cfg('SHOP_R_FIRM_NAME'), 'doc_receiver' => $rs->get('fullname') . ' ' . $rs->get('first_name') . ' ' . $rs->get('middle_name'), 'receiver_address' => $rs->get('u_address'), 'doc_buyer' => $rs->get('company'), 'buyer_address' => $rs->get('u_address'), 'buyer_inn' => $inn, 'buyer_kpp' => $rs->get('kpp'), 'doc_director' => $this->cfg('SHOP_R_FIRM_DIRECTOR'), 'doc_accountant' => $this->cfg('SHOP_R_FIRM_ACCOUNTANT'), 'sum_nds' => 0, 'total' => 0, 'delivery' => $rs->get('delivery'), 'total_amount' => $rs->get('total_price'), 'goods' => array());
$data['total_propis'] = num2str($data['total_amount']);
// $tpl=new MSXML($xml,$data,true);
// header('Content-Type: application/vnd.ms-word');
// header('Content-Disposition: attachment; filename=СЧЕТ_НА_ОПЛАТУ_№_'.$data['order_num'].'_от_'.$data['doc_date'].'.doc');
// header('Expires: 0');
// header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
include "shared/php/mPDF/mpdf.php";
// $str = "<strong>Привет</strong>";
$tpl = 'schet_sber.htm';
$data['dir'] = dirname(__FILE__);
$str = $this->render($data, dirname(__FILE__) . "/{$tpl}");
// $mpdf = new mPDF('UTF-8','A4','','',10,10,0,10,0,0);
$mpdf = new mPDF('UTF-8', 'A4', '', '');
@$mpdf->WriteHTML(iconv('windows-1251', 'utf-8', $str));
@$mpdf->Output();
}
exit;
}
示例9: elseif
?>
<br /><i style="color:red"><?php
echo $item['name'];
?>
</i><?php
} elseif ($item['type'] != 'user') {
?>
<br /><i style="color:green"><?php
echo $item['name'];
?>
</i><?php
}
?>
</td>
<td style="white-space:nowrap"><strong><?php
echo dte($item['date']);
?>
</strong><br /><i><?php
echo $item['time'];
?>
</i></td>
<td><i><?php
echo $item['address'];
?>
</i></td>
<td><?php
echo $item['price'];
?>
</td>
<td><?php
echo $item['discount'];
示例10: export1c
static function export1c()
{
global $CONFIG, $ST;
set_time_limit(1000);
$data = array('make_date' => date('Y-m-d'), 'make_time' => date('H:i:s'), 'document' => array());
$date_from = date('Y-m-d');
$date_to = date('Y-m-d', time() + 3600 * 24);
if (isset($_GET['d']) && ($t = strtotime($_GET['d']))) {
$date_from = date('Y-m-d', $t);
$date_to = date('Y-m-d', $t + 3600 * 24);
}
// if($get->get('date_from')){
// $date_from=$get->get('date_from');
// }
//
// if($get->get('date_to')){
// $date_to=$get->get('date_to');
// }
$q = "SELECT u.*,o.* FROM sc_shop_order o\r\n\t\tLEFT JOIN sc_users AS u ON u.u_id=o.userid\r\n\t\tWHERE \r\n\t\t o.create_time>='{$date_from}' AND o.create_time<='{$date_to}'\r\n\t\t";
$rs = $ST->select($q);
while ($rs->next()) {
$d = array('id' => $rs->get('id'), 'num' => $rs->get('id'), 'date' => dte($rs->get('create_time'), 'Y-m-d'), 'summ' => $rs->get('total_price'), 'contragent' => array('id' => $rs->get('u_id') . '#' . $rs->get('login') . '#' . $rs->get('fullname') . '#' . $rs->get('phone'), 'name' => $rs->get('type') == 'user_jur' && trim($rs->get('company')) ? $rs->get('company') : $rs->get('fullname'), 'address' => $rs->get('address'), 'mail' => $rs->get('mail')), 'time' => dte($rs->get('create_time'), 'H:i:s'), 'additionally' => $rs->get('additionally'), 'goods' => array());
$q = "SELECT *,ec.id AS ext_cat_id, oi.price AS price \t\r\n\t\t\tFROM sc_shop_order_item AS oi, sc_shop_item AS si\r\n\t\t\tLEFT JOIN sc_shop_srv_extcat AS ec ON ec.lnk=si.category\r\n\t\t\tWHERE\r\n\t\t\t\tsi.id=oi.itemid\r\n\t\t\t\tAND oi.orderid={$rs->get('id')} \r\n\t\t\t\t\r\n\t\t\t";
$q = "SELECT *, oi.price AS price \t\r\n\t\t\tFROM sc_shop_order_item AS oi, sc_shop_item AS si\r\n\t\t\t\r\n\t\t\tWHERE\r\n\t\t\t\tsi.id=oi.itemid\r\n\t\t\t\tAND oi.orderid={$rs->get('id')} ";
$rs1 = $ST->select($q);
while ($rs1->next()) {
$g = array('name' => $rs1->get('name'), 'id' => $rs1->get('ext_id'), 'price' => $rs1->get('price'), 'count' => $rs1->get('count'), 'summ' => $rs1->get('price') * $rs1->get('count'));
if ($rs1->get('unit_sale') == 2) {
if ($rs1->getInt('pack_size') != 0) {
//03.02.2013
$g['count'] *= $rs1->getInt('pack_size');
$g['price'] /= $rs1->getInt('pack_size');
$g['price'] = round($g['price'], 2);
}
}
$d['goods'][] = $g;
}
$data['document'][] = $d;
}
$file = ROOT . '/' . CATALOG_EXPORT_DIR . '/' . 'order.xml';
if (isset($_GET['d']) && ($t = strtotime($_GET['d']))) {
$file = ROOT . '/' . CATALOG_EXPORT_DIR . '/' . date('Y_m_d', $t) . '.xml';
}
$out = '<?xml version="1.0" encoding="windows-1251"?>';
$out .= LibCatsrv::render($data, dirname(__FILE__) . '/order1c.xml.php');
if (isset($_GET['get'])) {
return $out;
} else {
file_put_contents($file, $out);
exit;
}
}
示例11: dte
echo $item["id"];
?>
"/></td>
<td><a href="<?php
echo $this->mod_uri;
?>
waybillEdit/?id=<?php
echo $item['id'];
?>
" title="Просмотр">№ <strong style="font-size:14px"><?php
echo $item['id'];
?>
</strong></td>
<td>
<i><?php
echo dte($item['time'], 'd.m H:i');
?>
</i>
</td>
<td>
<?php
if ($item['name']) {
?>
<i><?php
echo $item['name'];
?>
- [<?php
echo $item['car'];
?>
]</i>
<?php
示例12: dte
?>
</td>
<td class="xl65"><?php
echo $row['price'];
?>
</td>
<td class="xl65"><?php
echo $row['delivery'];
?>
</td>
<td class="xl65"><?php
echo $row['total_price'];
?>
</td>
<td class="xl65"><?php
echo dte($row['date'], 'd.m.Y');
?>
</td>
<td class="xl65"><?php
echo $row['order_status_desc'];
?>
</td>
<td class="xl65"><?php
echo $row['comment'];
?>
</td>
</tr>
<?php
}
?>
示例13: htmlspecialchars
</td>
<td style="text-align:left">
<a href="/admin/<?php
echo $this->rs->get('type');
?>
/?act=edit&id=<?php
echo $this->rs->get('id');
?>
"><?php
echo htmlspecialchars($this->rs->get('title'));
?>
</a>
</td>
<td>
<small>[<?php
echo dte($this->rs->get('date'));
?>
]</small> (<?php
echo $this->rs->get('position');
?>
)
</td>
<td style="text-align:center" id="view<?php
echo $this->rs->get('id');
?>
">
<?php
echo $this->rs->get('view');
?>
</td>
<td>
示例14: while
?>
<table class="grid">
<tr><th>Время</th><th>Имя</th><th>Телефон</th><th>e-mail</th><th>Сообщение</th><th>Браузер</th><th>Тип</th><th>URL</th><th>Статус</th><th>Действие</th></tr>
<?php
while ($this->rs->next()) {
?>
<tr>
<td>
<a href="<?php
echo $this->mod_uri;
?>
?act=edit&id=<?php
echo $this->rs->get('id');
?>
"><?php
echo dte($this->rs->get('time'), 'd.m.Y H:i');
?>
</a><br>
<?php
echo $this->rs->get('ip');
?>
</td>
<td><strong><?php
echo $this->rs->get('name');
?>
</strong></td>
<td><?php
echo $this->rs->get('phone');
?>
</td>
<td><?php
示例15: htmlspecialchars
<tr>
<td style="text-align:left">
<a href="/admin/<?php
echo $this->rs->get('type');
?>
/?act=edit&id=<?php
echo $this->rs->get('id');
?>
"><?php
echo htmlspecialchars($this->rs->get('name'));
?>
</a>
</td>
<td>
<small>[<?php
echo dte($this->rs->get('time'));
?>
]</small>
</td>
<td><small><?php
echo $this->rs->get('question');
?>
</small></td>
<td><small><?php
echo $this->rs->get('answer');
?>
</small></td>
<td><?php
echo $this->rs->get('pos');
?>
</td>