本文整理汇总了PHP中check_date函数的典型用法代码示例。如果您正苦于以下问题:PHP check_date函数的具体用法?PHP check_date怎么用?PHP check_date使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_date函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dso_insupdmembership
/**
* Action handler for the INSERT / UPDATE of a membership record
* returns err:string or success:messages ...
*
* @param int $membership_id
* @param int $player_id
* @param int $verein_id
* @param int $mtype_id
* @param string $v_passnr
* @param date $v_mstart
* @param date $v_mend
*/
function dso_insupdmembership($membership_id, $player_id, $verein_id, $mtype_id, $v_passnr, $v_mstart, $v_mend)
{
global $dbi, $usertoken;
// CHECK ACCESS 2
$qV = sql_query('SELECT * from tverein WHERE vid=' . $verein_id, $dbi);
$aV = sql_fetch_array($qV, $dbi);
if ($usertoken['registermap'][$aV['verband_id']] < 3) {
return 'E50:P2:RightsMissing:' . $usertoken['registermap'][$aV['verband_id']];
}
// cre_INFO, date defaults ...
$upd_date = ls_getdate();
// check Values
if (!$verein_id > 0) {
die_red('Verein not set');
}
if (!$mtype_id > 0) {
die_red('Type not set');
}
if (!$player_id > 0) {
die_red('Player not set');
}
if (strlen($v_passnr) < 3) {
die_red('Pass Number not set');
}
if (!check_date($v_mstart)) {
$v_mstart = substr($upd_date, 0, 4) . '-01-01';
}
if (!check_date($v_mend)) {
$v_mend = substr($upd_date, 0, 4) . '-12-31';
}
/* CODE from the workflow ORM stuff ...
$p=new cPlayer;
$p->setDB($dbi);
$p->getbyID($player_id);
$p->saveMembershipVerein($v_verein,$v_mtype,$v_passnr,$v_mstart,$v_mend);
if (strlen($p->pError)>1){debug($p->pError);return 0;}else{return 1;}
*/
if ($membership_id > 0) {
$qry = "UPDATE tmembership SET mtype={$mtype_id},mvereinid={$verein_id},mpassnr='{$v_passnr}', mstart='{$v_mstart}',mend='{$v_mend}'," . "mcre_user='" . $usertoken['uname'] . "',mcre_date='{$upd_date}' where mpid={$player_id} and mid={$membership_id} limit 1";
} else {
$qry = 'INSERT into tmembership(mid,mpid,mtype,mpassnr,mstart,mend,mvereinid,mcre_user,mcre_date,mstatus,mflag)' . " VALUES(0,{$player_id},{$mtype_id},'{$v_passnr}','{$v_mstart}','{$v_mend}',{$verein_id},'" . $usertoken['uname'] . "','{$upd_date}',0,0)";
}
if (!($presult = sql_query($qry, $dbi))) {
return '<font color=red>E71:DB error on MembershipRecord save possible constraint violation</font>';
}
# // In any case we store the KEYVAL directly into the player record ...
# // and we make sure the player is marked as active ...
$keyfield = dso_getPassKeyFieldForType($mtype_id);
$sql = "update tplayer set {$keyfield}=\"{$v_passnr}\",pactive=1 where pid={$player_id}";
if (!($ans = sql_query($sql, $dbi))) {
return 'Database error on keyfield save ...';
}
dsolog(1, $usertoken['uname'], 'Created Membership for pid: (' . $player_id . ')');
if ($presult == 1) {
return 'Membership Saved';
} else {
return 'E88:saving ';
}
}
示例2: split_date
function split_date($date)
{
if (check_date($date)) {
$res = preg_match_all("/^([^\\.]+)\\.([^\\.]+)\\.([^\n]+)\n/", "{$date}\n", $parts, PREG_PATTERN_ORDER);
return array($parts[1][0], $parts[2][0], $parts[3][0]);
}
return '';
}
示例3: change_tpl_flag
function change_tpl_flag($reconcile_id)
{
global $Ajax;
if (!check_date() && check_value("rec_" . $reconcile_id)) {
// temporary fix
return false;
}
if (get_post('bank_date') == '') {
// new reconciliation
$Ajax->activate('bank_date');
}
$_POST['bank_date'] = date2sql(get_post('reconcile_date'));
$reconcile_value = check_value("rec_" . $reconcile_id) ? "'" . $_POST['bank_date'] . "'" : 'NULL';
update_reconciled_values($reconcile_id, $reconcile_value, $_POST['reconcile_date'], input_num('end_balance'), $_POST['bank_account']);
$Ajax->activate('reconciled');
$Ajax->activate('difference');
return true;
}
示例4: get_day_ajax
public function get_day_ajax()
{
if (!$this->input->is_ajax_request()) {
show_404();
}
$this->load->helper('date');
$vdata = array('status' => 0, 'msg' => '没有任何数据');
if ($date = $this->input->get('dt', TRUE) and check_date($date)) {
$day_start = day_unix(strtotime($date));
} else {
// 当天
$day_start = day_unix(time());
}
$day_end = $day_start + 60 * 60 * 24;
$where = 'timeline between ' . $day_start . ' and ' . $day_end;
if ($list = $this->model->get_all($where, "*")) {
$vdata['status'] = 1;
$vdata['msg'] = "已经返回数据!";
$vdata['list'] = $list;
}
$this->output->set_content_type('application/json')->set_output(json_encode($vdata));
}
示例5: elseif
$nb_erreur++;
}
}
if (!isset($_POST['summary']) or $_POST['summary'] == "") {
$page['erreur'][$nb_erreur]['message'] = $lang['news']['E_empty_summary'];
$nb_erreur++;
}
if (!isset($_POST['text']) or $_POST['text'] == "") {
$page['erreur'][$nb_erreur]['message'] = $lang['news']['E_empty_text'];
$nb_erreur++;
}
/* date */
if (!isset($_POST['release']) or $_POST['release'] == "") {
$page['erreur'][$nb_erreur]['message'] = $lang['news']['E_empty_release'];
$nb_erreur++;
} elseif (!check_date($_POST['release'])) {
$page['erreur'][$nb_erreur]['message'] = $lang['news']['E_invalid_release'];
$nb_erreur++;
}
if (isset($_POST['release_time']) and !empty($_POST['release_time']) and !check_hour($_POST['release_time'])) {
$page['erreur'][$nb_erreur]['message'] = $lang['news']['E_invalid_release_time'];
$nb_erreur++;
}
$_POST['member'] = $_SESSION['session_member_id'];
if ($nb_erreur == 0) {
if (empty($_POST['release_time'])) {
$_POST['release_time'] = '00:00';
}
$_POST['release'] = convert_date_sql($_POST['release']);
$_POST['release'] .= " " . $_POST['release_time'];
/* cas d'un premier add */
示例6: intval
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*
* $Id$
*/
$customerid = intval($_GET['customerid']);
if (!$LMS->CustomerExists($customerid)) {
$SESSION->redirect('?m=customerlist');
}
if (isset($_GET['cutoffstop'])) {
if ($_GET['cutoffstop'] == '') {
$cutoffstop = 0;
} elseif (check_date($_GET['cutoffstop'])) {
list($y, $m, $d) = explode('/', $_GET['cutoffstop']);
if (checkdate($m, $d, $y)) {
$cutoffstop = mktime(23, 59, 59, $m, $d, $y);
}
}
// excluded groups check
if (!$DB->GetOne('SELECT 1 FROM customerassignments a
JOIN excludedgroups e ON (a.customergroupid = e.customergroupid)
WHERE e.userid = lms_current_user() AND a.customerid = ?', array($customerid))) {
$DB->Execute('UPDATE customers SET cutoffstop = ? WHERE id = ?', array($cutoffstop, $customerid));
}
}
$SESSION->redirect('?' . $SESSION->get('backto'));
示例7: elseif
with the same email who just wants to activate its account
elseif(isset($_POST['email']) AND !empty($_POST['email']))
{
$sgbd = sql_connect();
$sql_verif_email = sql_replace($sql['member']['verif_member_email'],$_POST);
$res = sql_query($sql_verif_email);
$nb_res = sql_num_rows($res);
sql_free_result($res);
sql_close($sgbd);
if($nb_res!="0") {
$page['erreur'][$nb_erreur]['message']=$lang['member']['E_choisi_email']; $nb_erreur++;
}
}
*/
# date of birth
if (isset($_POST['date_birth']) and !empty($_POST['date_birth']) and !check_date($_POST['date_birth'])) {
$page['erreur'][$nb_erreur]['message'] = $lang['member']['E_invalid_date_birth'];
$nb_erreur++;
}
# login
if (!isset($_POST['login_member']) or empty($_POST['login_member'])) {
$page['erreur'][$nb_erreur]['message'] = $lang['member']['E_empty_login'];
$nb_erreur++;
} elseif (!check_login($_POST['login_member'])) {
$page['erreur'][$nb_erreur]['message'] = $lang['member']['E_invalid_login'];
$nb_erreur++;
} elseif (isset($_POST['login']) and !empty($_POST['login'])) {
$sgbd = sql_connect();
$sql_verif_login = sql_replace($sql['member']['verif_member_login'], $_POST);
$res = sql_query($sql_verif_login);
$nb_res = sql_num_rows($res);
示例8: array
if ($nb_match_empty != 0) {
$page['erreur'][$nb_error]['message'] = $lang['match']['E_empty_matchs_club_visitor'];
$nb_error++;
}
}
# we check that the date is not empty
if (isset($id_date)) {
$nb_match_empty = 0;
$nb_invalid = 0;
$nb_no_season = 0;
$date_found = array();
for ($i = 0; $i < $nb_match; $i++) {
# the match has no name
if (empty($_POST['data'][$i][$id_date])) {
$nb_match_empty++;
} elseif (!check_date($_POST['data'][$i][$id_date])) {
array_push($date_found, $_POST['data'][$i][$id_date]);
$nb_invalid++;
} else {
// we try to match with the season
foreach ($season_list as $id_season => $value) {
if (convert_date_sql($_POST['data'][$i][$id_date]) >= $value['date_start'] and convert_date_sql($_POST['data'][$i][$id_date]) <= $value['date_end']) {
$season[$i] = $id_season;
}
}
if (!isset($season[$i])) {
$nb_no_season++;
}
}
}
if ($nb_match_empty != 0) {
示例9: round
$cl = 'ff4f00&to=ffffff';
}
print '<td background="./themes/svg_gradient.php?from=' . $cl . '">' . $i['count'] . ' / ' . $i['h_count'] . ' (' . round($p) . ' %)</td>';
print '<td>' . money_format("%i", $i['cena']) . ' руб.</td>';
$t = $i['cena'] * $i['count'];
$tt = $tt + $t;
//print '<td>'.$t.' руб.</td>';
print '<td>' . money_format("%i", $t) . ' руб.</td>';
// выделить цветом до оканчания срока годности
$d2 = strtotime($i['date_end']) - 604800;
// неделя
$d3 = strtotime($i['date_end']);
if ($d1 > $d2) {
print '<td background="./themes/svg_gradient.php?from=ff0000&to=ffffff" title="Срок годности скоро закончиться">' . check_date($i['date_end'], $user->date_format) . '</td>';
} else {
print '<td>' . check_date($i['date_end'], $user->date_format) . '</td>';
}
print '<td><a href="apteka_traffic.php?id=' . $i['id'] . '"><img src="./themes/img/b_tblexport.png" title="Переместить в отеделение"></a> | <a href="#" onclick="del_j(\'' . $i['id'] . '\')"><img src="./themes/img/b_drop.png" title="Удалить"></a></td>';
print '<td>' . $i['polka'] . '</td><td>' . $i['icheika'] . '</td>';
print '</tr>';
$j++;
}
print '<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="hovr">Общее: ' . money_format("%i", $tt) . ' руб. </td>
<td></td>
示例10: prepare_input
$params['tag_keywords'] = prepare_input($_POST['tag_keywords']);
}
if (isset($_POST['tag_description'])) {
$params['tag_description'] = prepare_input($_POST['tag_description']);
}
if (isset($_POST['page_title'])) {
$params['page_title'] = prepare_input($_POST['page_title']);
}
if (isset($_POST['page_text'])) {
$params['page_text'] = prepare_input($_POST['page_text'], false, 'low');
}
if (isset($_POST['menu_link'])) {
$params['menu_link'] = prepare_input($_POST['menu_link']);
}
$params['menu_id'] = isset($_POST['menu_id']) ? prepare_input($_POST['menu_id']) : '0';
$params['page_key'] = create_seo_url(prepare_input($_POST['page_title']));
$params['language_id'] = isset($_POST['language_id']) ? prepare_input($_POST['language_id']) : '';
$params['finish_publishing'] = isset($_POST['finish_publishing']) && check_date($_POST['finish_publishing']) ? prepare_input($_POST['finish_publishing']) : '0000-00-00';
if ($objPage->PageCreate($params, $copy_to_other_langs)) {
$msg = draw_success_message(_PAGE_CREATED, false);
$objSession->SetMessage('notice', $msg);
header('location: index.php?admin=pages' . (Application::Get('type') != '' ? '&type=' . Application::Get('type') : '') . '&mg_language_id=' . $params['language_id']);
exit;
} else {
$msg = draw_important_message($objPage->error, false);
}
}
if ($msg == '') {
$msg = draw_message(_ALERT_REQUIRED_FILEDS, false);
}
}
示例11: intval
$where[] = 'rttickets.state != ' . RT_RESOLVED;
} else {
$where[] = 'rttickets.state = ' . intval($status);
}
}
if ($datefrom) {
if (check_date($datefrom)) {
list($year, $month, $day) = explode('/', $datefrom);
$datefrom = mktime(0, 0, 0, $month, $day, $year);
} else {
$datefrom = 0;
}
$where[] = 'rttickets.createtime >= ' . $datefrom;
}
if ($dateto) {
if (check_date($dateto)) {
list($year, $month, $day) = explode('/', $dateto);
$dateto = mktime(0, 0, 0, $month, $day, $year);
} else {
$dateto = 0;
}
$where[] = 'rttickets.createtime <= ' . $dateto;
}
$list = $DB->GetAllByKey('SELECT rttickets.id, createtime, customerid, subject, requestor, ' . $DB->Concat('UPPER(c.lastname)', "' '", 'c.name') . ' AS customername ' . (!empty($_POST['contacts']) || !empty($_GET['contacts']) ? ', address, (SELECT ' . $DB->GroupConcat('contact', ',', true) . '
FROM customercontacts WHERE customerid = c.id AND (customercontacts.type & ' . (CONTACT_MOBILE | CONTACT_FAX | CONTACT_LANDLINE) . ' > 0 ) GROUP BY customerid) AS phones,
(SELECT ' . $DB->GroupConcat('contact', ',', true) . '
FROM customercontacts WHERE customerid = c.id AND (customercontacts.type & ' . CONTACT_EMAIL . ' = ' . CONTACT_EMAIL . ') GROUP BY customerid) AS emails ' : '') . 'FROM rttickets
LEFT JOIN rtticketcategories tc ON tc.ticketid = rttickets.id
LEFT JOIN customeraddressview c ON (customerid = c.id)
WHERE 1 = 1 ' . (isset($where) ? ' AND ' . implode(' AND ', $where) : '') . ' ORDER BY createtime', 'id');
if ($list && $extended) {
示例12: trim
{
$phone = trim($val['phone']);
$name = trim($val['name']);
$type = !empty($val['type']) ? array_sum($val['type']) : NULL;
$customerdata['contacts'][$idx]['type'] = $type;
if($name && !$phone)
$error['contact'.$idx] = trans('Phone number is required!');
elseif($phone)
$contacts[] = array('name' => $name, 'phone' => $phone, 'type' => $type);
}
if ($customerdata['cutoffstop'] == '')
$cutoffstop = 0;
elseif (check_date($customerdata['cutoffstop'])) {
list ($y, $m, $d) = explode('/', $customerdata['cutoffstop']);
if (checkdate($m, $d, $y))
$cutoffstop = mktime(23, 59, 59, $m, $d, $y);
else
$error['cutoffstop'] = trans('Incorrect date of cutoff suspending!');
} else
$error['cutoffstop'] = trans('Incorrect date of cutoff suspending!');
$hook_data = $LMS->executeHook(
'customeredit_validation_before_submit',
array(
'customerdata' => $customerdata,
'error' => $error
)
);
示例13: check_consultation
function check_consultation()
{
if (strlen($_POST['c_title']) < 20) {
//Short Consultation Title
return '5@0';
} else {
if (empty($_POST['c_num'])) {
// No Post Num
return '4@0';
} else {
if ($_POST['c_num'] > 100) {
$cons_id = build_consultation();
return '3@' . $cons_id;
} else {
if (!check_date()) {
$cons_id = build_consultation();
return '2@' . $cons_id;
}
}
}
}
$cons_id = build_consultation();
return '1@' . $cons_id;
}
示例14: page_crew
//.........这里部分代码省略.........
// har vi tilgang til å gjøre noe med denne blokkeringen?
if (!access::has($type['access'])) {
ess::$b->page->add_message('Du har ikke tilgang til denne typen blokkering. (' . htmlspecialchars($type['title']) . ')', "error");
$type = false;
}
}
}
// vise en type blokkering?
if ($type) {
redirect::store(page_min_side::addr(NULL, "b=blokk&t={$type_id}"));
// sjekk om det er en aktiv blokkering for denne typen
$active = blokkeringer::check($type_id, page_min_side::$active_user->id);
if ($active) {
// hent informasjon om blokkeringen
$info = blokkeringer::get_info($active['ub_id']);
}
// handling: legg til blokkering
if (isset($_POST['add']) && $active) {
ess::$b->page->add_message("Det er allerede en blokkering på brukeren som varer til " . ess::$b->date->get($active['ub_time_expire'])->format() . ".", "error");
} elseif (isset($_POST['add'])) {
// kontroller verdier
$date_type = isset($_POST['date_type']) && $_POST['date_type'] == "abs" ? "abs" : "rel";
$rel_weeks = intval(postval("rel_weeks"));
$rel_days = intval(postval("rel_days"));
$rel_hours = intval(postval("rel_hours"));
$rel_mins = intval(postval("rel_mins"));
$abs_date = postval("abs_date");
$abs_time = postval("abs_time");
// sjekk type og verdiene
$expire = false;
// bestemt dato/tidspunkt
if ($date_type == "abs") {
// kontroller datoen
if (!($abs_date_m = check_date($abs_date, "%y-%m-%d"))) {
ess::$b->page->add_message('Datoen du skrev inn er ikke gyldig.', "error");
} elseif (!($abs_time_m = check_date($abs_time, "%h:%i:%s"))) {
ess::$b->page->add_message('Tidspunktet du skrev inn er ikke gyldig.', "error");
} else {
// ok
$date = ess::$b->date->get();
$date->setTime($abs_time_m[1], $abs_time_m[2], $abs_time_m[3]);
$date->setDate($abs_date_m[1], $abs_date_m[2], $abs_date_m[3]);
$expire = $date->format("U");
}
} else {
// sjekk uker
if ($rel_weeks < 0 || $rel_weeks > 9) {
ess::$b->page->add_message('Antall uker kan ikke være under 0 eller over 9.', "error");
} elseif ($rel_days < 0 || $rel_days > 6) {
ess::$b->page->add_message('Antall dager kan ikke være under 0 eller over 6.', "error");
} elseif ($rel_hours < 0 || $rel_hours > 23) {
ess::$b->page->add_message('Antall timer kan ikke være under 0 eller over 23.', "error");
} elseif ($rel_mins < 0 || $rel_mins > 59) {
ess::$b->page->add_message('Antall minutter kan ikke være under 0 eller over 59.', "error");
} else {
// ok
$expire = time() + $rel_weeks * 604800 + $rel_days * 86400 + $rel_hours * 3600 + $rel_mins * 60;
}
}
// sjekke videre?
if ($expire) {
// sjekk at datoen er minst 1 min fremover i tid
if ($expire < time() + 60) {
ess::$b->page->add_message('Du kan ikke legge til en blokkering for mindre enn 1 minutt.', "error");
} else {
// kontroller begrunnelse og intern informasjon
示例15: while
}
/* leave this month alone */
if ($month === $nmonth) {
return false;
}
if ($month < $nmonth) {
/* we'll always keep the first of every month */
if ($day === '01') {
return false;
}
/* we keep weeklies for 3 months */
if ($month > $nmonth - 3 && in_array($day, $wdays)) {
return false;
}
/* we've filtered out what's to be kept */
return true;
}
/* return anything we don't know about */
return false;
}
if ($dir = @opendir("/local/backup")) {
while (($file = readdir($dir)) !== false && ($file != '.' || $file != '..')) {
$str = str_replace('mirrors.', '', $file);
$str = str_replace('repository.', '', $str);
$str = str_replace('.tar.bz2', '', $str);
if (check_date($str)) {
`rm -f /local/backup/{$file}`;
}
}
closedir($dir);
}