本文整理汇总了PHP中jddayofweek函数的典型用法代码示例。如果您正苦于以下问题:PHP jddayofweek函数的具体用法?PHP jddayofweek怎么用?PHP jddayofweek使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了jddayofweek函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getweekday
function getweekday($params)
{
$params_thang_nam = explode('/', $params);
$params = $params_thang_nam[0];
$thang = $params_thang_nam[1];
$nam = $params_thang_nam[2];
$jd = cal_to_jd(CAL_GREGORIAN, $thang, $params, $nam);
$day = jddayofweek($jd, 0);
switch ($day) {
case 0:
$thu = "Chủ nhật";
break;
case 1:
$thu = "Thứ hai";
break;
case 2:
$thu = "Thứ ba";
break;
case 3:
$thu = "Thứ tư";
break;
case 4:
$thu = "Thứ năm";
break;
case 5:
$thu = "Thứ sáu";
break;
case 6:
$thu = "Thứ bảy";
break;
}
return $thu;
}
开发者ID:shopgolf,项目名称:abc,代码行数:33,代码来源:bookinglib.php
示例2: __construct
function __construct($month = null, $year = null)
{
$this->month = $month | date('n');
$this->year = $year | date('Y');
$this->dim = cal_days_in_month(CAL_GREGORIAN, $this->month, $this->year);
$this->msw = jddayofweek(cal_to_jd(CAL_GREGORIAN, $this->month, 1, $this->year));
}
开发者ID:rev087,项目名称:kennel,代码行数:7,代码来源:calendar.php
示例3: incrementViewCount
private function incrementViewCount($id)
{
$this->Post->updateAll(array('Post.viewed' => 'Post.viewed+1'), array('Post.id' => $id));
$this->loadModel('PostTrend');
$day = jddayofweek(cal_to_jd(CAL_GREGORIAN, date("m"), date("d"), date("Y")), 1);
$this->PostTrend->updateAll(array('PostTrend.' . $day => 'PostTrend.' . $day . '+1'), array('PostTrend.post_id' => $id));
}
开发者ID:CHrycyna,项目名称:StMarysWebsite_2.0,代码行数:7,代码来源:PostsController.php
示例4: calculateDOW
function calculateDOW($input)
{
$int_date = $this->formatDate($input);
if ($int_date) {
return jddayofweek($int_date, 1);
} else {
return "Invalid Date";
}
}
开发者ID:r-hills,项目名称:Day_Of_Week,代码行数:9,代码来源:DOW.php
示例5: getWeekday
function getWeekday($user_input)
{
//Converts user input to array
$date = explode("/", $user_input);
//Insert array to appropriate are to format to julian day
$jul_date = cal_to_jd(CAL_GREGORIAN, (int) $date[0], (int) $date[1], (int) $date[2]);
//Whats the date?
$output = jddayofweek($jul_date, 1);
return $output;
}
开发者ID:anniehoogendoorn,项目名称:WeekdayFinder,代码行数:10,代码来源:WeekdayFinder.php
示例6: executeCargarReservaciones
public function executeCargarReservaciones(sfWebRequest $request)
{
date_default_timezone_set("America/Guayaquil");
$dia = jddayofweek(cal_to_jd(CAL_GREGORIAN, date("m"), date("d"), date("Y")), 0);
// $tDesde=time()-600;
// $tHasta=time()-540;
// $hDesde=date('H:i:s',$tDesde);
// $hHasta=date('H:i:s',$tHasta);
switch ($dia) {
case '1':
$reservacion = Doctrine_Core::getTable('reservacion')->createQuery('c')->where('c.lunes=?', true)->execute();
break;
case '2':
$reservacion = Doctrine_Core::getTable('reservacion')->createQuery('c')->where('c.martes=?', true)->execute();
break;
case '3':
$reservacion = Doctrine_Core::getTable('reservacion')->createQuery('c')->where('c.miercoles=?', true)->execute();
break;
case '4':
$reservacion = Doctrine_Core::getTable('reservacion')->createQuery('c')->where('c.jueves=?', true)->execute();
break;
case '5':
$reservacion = Doctrine_Core::getTable('reservacion')->createQuery('c')->where('c.viernes=?', true)->execute();
break;
case '6':
$reservacion = Doctrine_Core::getTable('reservacion')->createQuery('c')->where('c.sabado=?', true)->execute();
break;
case '0':
$reservacion = Doctrine_Core::getTable('reservacion')->createQuery('c')->where('c.domingo=?', true)->execute();
break;
default:
break;
}
$dataJson = array();
foreach ($reservacion as $reser) {
if ($reser->getHorario1()) {
if (Operaciones::esHoraReservacion($reser->getHorario1(), date('H:i:s'))) {
$dataJson[] = array('id' => $reser->getId(), 'barrio' => $reser->getCodigo()->getSector()->getNombre(), 'calle1' => $reser->getCodigo()->getCalle1(), 'calle2' => $reser->getCodigo()->getCalle2(), 'cliente' => $reser->getCodigo()->getNombreCliente(), 'hora' => $reser->getHorario1(), 'codigo' => $reser->getCodigo()->getNumero(), 'idcodigo' => $reser->getCodigo()->getId(), 'idsector' => $reser->getCodigo()->getBarrio(), 'latitud' => $reser->getCodigo()->getLatitud(), 'longitud' => $reser->getCodigo()->getLongitud(), 'referencia' => $reser->getCodigo()->getObservacion());
}
}
if ($reser->getHorario2()) {
if (Operaciones::esHoraReservacion($reser->getHorario2(), date('H:i:s'))) {
$dataJson[] = array('id' => $reser->getId(), 'barrio' => $reser->getCodigo()->getSector()->getNombre(), 'calle1' => $reser->getCodigo()->getCalle1(), 'calle2' => $reser->getCodigo()->getCalle2(), 'cliente' => $reser->getCodigo()->getNombreCliente(), 'hora' => $reser->getHorario2(), 'codigo' => $reser->getCodigo()->getNumero(), 'idcodigo' => $reser->getCodigo()->getId(), 'idsector' => $reser->getCodigo()->getBarrio(), 'latitud' => $reser->getCodigo()->getLatitud(), 'longitud' => $reser->getCodigo()->getLongitud(), 'referencia' => $reser->getCodigo()->getObservacion());
}
}
if ($reser->getHorario3()) {
if (Operaciones::esHoraReservacion($reser->getHorario3(), date('H:i:s'))) {
$dataJson[] = array('id' => $reser->getId(), 'barrio' => $reser->getCodigo()->getSector()->getNombre(), 'calle1' => $reser->getCodigo()->getCalle1(), 'calle2' => $reser->getCodigo()->getCalle2(), 'cliente' => $reser->getCodigo()->getNombreCliente(), 'hora' => $reser->getHorario3(), 'codigo' => $reser->getCodigo()->getNumero(), 'idcodigo' => $reser->getCodigo()->getId(), 'idsector' => $reser->getCodigo()->getBarrio(), 'latitud' => $reser->getCodigo()->getLatitud(), 'longitud' => $reser->getCodigo()->getLongitud(), 'referencia' => $reser->getCodigo()->getObservacion());
}
}
}
return $this->renderText(json_encode($dataJson));
}
开发者ID:edulima1989,项目名称:Sistema-Radiotaxi,代码行数:53,代码来源:actions.class.php
示例7: checkCalendar
function checkCalendar($date)
{
//Explodes input string into array.
$straight_date = explode('-', $date);
//Converts array into Julian Day number.
$jd_date = cal_to_jd(CAL_GREGORIAN, $straight_date[1], $straight_date[2], $straight_date[0]);
//Converts Julian Day into day of week.
$day_of_week = jddayofweek($jd_date, 1);
if ($day_of_week == "Monday") {
return $day_of_week . "; that sucks!";
} else {
return $day_of_week;
}
}
开发者ID:kylepratuch,项目名称:calendar_day,代码行数:14,代码来源:Calendar.php
示例8: buscarPromo
public static function buscarPromo($codigo_plan)
{
$fecha_compra = Formatos::fechaHoraActual();
$codigo_comercio = Persona::numeroComercio();
$dia_semana = jddayofweek(cal_to_jd(CAL_GREGORIAN, date("m"), date("d"), date("Y")));
$empresa = 1;
$sucursal = 1;
$sql = "\n\t\t\t\tSELECT TOP 1\n\t\t\t\t\t tarjetas_planes_promocion.nombre_plan as nombre,\n\t\t\t\t\t tarjetas_planes_promocion.vigencia_hasta as vencimiento\n\t\t\t\t FROM tarjetas_planes_promocion\n\t\t\t\t WHERE nro_empresa = {$empresa}\n\t\t\t\t\tAND nro_sucursal = {$sucursal}\n\t\t\t\t\tAND tarjetas_planes_promocion.codigo_plan = {$codigo_plan}\n\t\t\t\t\tAND Isnull( comercios_todos, 0 ) = 1\n\t\t\t\t\tAND (( IsNull( domingo\t, 0 ) \t= 1 AND 1 = {$dia_semana} ) or \n\t\t\t\t\t\t ( IsNull( lunes\t, 0 ) \t= 1 AND 2 = {$dia_semana} ) or \n\t\t\t\t\t\t ( IsNull( martes\t, 0 ) \t= 1 AND 3 = {$dia_semana} ) or \n\t\t\t\t\t\t ( IsNull( miercoles, 0 ) \t= 1 AND 4 = {$dia_semana} ) or \n\t\t\t\t\t\t ( IsNull( jueves\t, 0 ) \t= 1 AND 5 = {$dia_semana} ) or \n\t\t\t\t\t\t ( IsNull( viernes\t, 0 ) \t= 1 AND 6 = {$dia_semana} ) or \n\t\t\t\t\t\t ( IsNull( sabado\t, 0 ) \t= 1 AND 7 = {$dia_semana} ) ) \n\t\t\t\t\tAND vigencia_desde <= '{$fecha_compra}'\n\t\t\t\t\tAND vigencia_hasta >= '{$fecha_compra}'\n\t\t\t\t\tAND isnull(habilitado,0) = 1\n\n\t\t\t\tUNION ALL\n\n\t\t\t\tSELECT\n\t\t\t\t\t tarjetas_planes_promocion.nombre_plan AS nombre,\n\t\t\t\t\t tarjetas_planes_promocion.vigencia_hasta AS vencimiento\n\n\t\t\t\t FROM tarjetas_planes_comercios\n\t\t\t\t JOIN tarjetas_planes_promocion ON\n\t\t\t\t\t\t( tarjetas_planes_comercios.nro_empresa \t = tarjetas_planes_promocion.nro_empresa AND\n\t\t\t\t\t\t tarjetas_planes_comercios.nro_sucursal \t = tarjetas_planes_promocion.nro_sucursal \t AND\n\t\t\t\t\t\t tarjetas_planes_comercios.codigo_plan \t = tarjetas_planes_promocion.codigo_plan \t AND\n\t\t\t\t\t\t tarjetas_planes_comercios.vigencia_desde = tarjetas_planes_promocion.vigencia_desde AND\n\t\t\t\t\t\t tarjetas_planes_comercios.cod_promocion\t = tarjetas_planes_promocion.cod_promocion\t )\n\n\t\t\t\t WHERE tarjetas_planes_comercios.nro_empresa \t\t= {$empresa}\n\t\t\t\t\tAND tarjetas_planes_comercios.nro_sucursal \t\t= {$sucursal}\n\t\t\t\t\tAND tarjetas_planes_comercios.codigo_comercio \t= {$codigo_comercio}\n\n\t\t\t\t\tAND tarjetas_planes_comercios.codigo_plan \t\t= {$codigo_plan}\n\t\t\t\t\tAND (( IsNull( tarjetas_planes_promocion.domingo\t, 0 ) = 1 AND 1 = {$dia_semana} ) or \n\t\t\t\t\t\t ( IsNull( tarjetas_planes_promocion.lunes\t\t, 0 ) = 1 AND 2 = {$dia_semana} ) or \n\t\t\t\t\t\t ( IsNull( tarjetas_planes_promocion.martes\t, 0 ) = 1 AND 3 = {$dia_semana} ) or \n\t\t\t\t\t\t ( IsNull( tarjetas_planes_promocion.miercoles\t, 0 ) = 1 AND 4 = {$dia_semana} ) or \n\t\t\t\t\t\t ( IsNull( tarjetas_planes_promocion.jueves\t, 0 ) = 1 AND 5 = {$dia_semana} ) or \n\t\t\t\t\t\t ( IsNull( tarjetas_planes_promocion.viernes\t, 0 ) = 1 AND 6 = {$dia_semana} ) or \n\t\t\t\t\t\t ( IsNull( tarjetas_planes_promocion.sabado\t, 0 ) = 1 AND 7 = {$dia_semana} ) ) \n\n\t\t\t\t\tAND tarjetas_planes_comercios.vigencia_desde <= '{$fecha_compra}'\n\t\t\t\t\tAND tarjetas_planes_comercios.vigencia_hasta >= '{$fecha_compra}'\n\t\t\t\t\tAND isnull(tarjetas_planes_comercios.habilitado,0) = 1\n\t\t\t\t AND isnull(tarjetas_planes_promocion.habilitado,0) = 1\n\t\t";
$datos = DB::select($sql);
if (count($datos) <= 0) {
return 'no hay';
}
return $datos;
}
开发者ID:robertomiguel,项目名称:autorizador,代码行数:14,代码来源:TarjetaPlanPromocion.php
示例9: contains
public function contains(\DateTime $dateTime)
{
$value = ($this->day < 0) ? -1 : 1;
$compare = clone $dateTime();
$dayOfWeek = jddayofweek(cal_to_jd(CAL_GREGORIAN,
$dateTime->format('m'),
$dateTime->format('j'),
$dateTime->format('Y')));
return ($this->day == $dayOfWeek) &&
($compare->add((-1 * $this->day) . ' days')->format('m') != $dateTime->format('m')) &&
($compare->setDate($dateTime->getTimestamp())->add((-1 * $this->day) + $value)->format('m') == $dateTime->format('m'));
}
开发者ID:regisg27,项目名称:CalendarBundle,代码行数:15,代码来源:DayOfTheMonth.php
示例10: contains
public function contains(\DateTime $dateTime)
{
if ($this->ignoreDay) {
if ($this->day > 0) {
return $dateTime->format('j') == $this->day;
} else {
$calendarDays = cal_days_in_month(CAL_GREGORIAN, $dateTime->format('Y'), $dateTime->format('m'));
return $calendarDays + 1 + $this->day === $dateTime->format('j');
}
} else {
$value = $this->day < 0 ? -1 : 1;
$compare = clone $dateTime();
$dayOfWeek = jddayofweek(cal_to_jd(CAL_GREGORIAN, $dateTime->format('m'), $dateTime->format('j'), $dateTime->format('Y')));
return $this->day == $dayOfWeek && $compare->add(-1 * $this->day . ' days')->format('m') != $dateTime->format('m') && $compare->setDate($dateTime->getTimestamp())->add(-1 * $this->day + $value)->format('m') == $dateTime->format('m');
}
}
开发者ID:robzienert,项目名称:TemporalExpression,代码行数:16,代码来源:DayOfTheMonth.php
示例11: index
public function index()
{
$year = date("Y", time());
$month = date("n", time());
$day = date("j", time());
$noOfThisWeek = jddayofweek(cal_to_jd(CAL_GREGORIAN, date("m"), date("d"), date("Y")), 0);
if ($noOfThisWeek == 0) {
$noOfThisWeek = 7;
}
$plus = 7 - $numOfday;
$by = $noOfThisWeek - 1;
$today_beginSec = mktime(0, 0, 0, $month, $day, $year);
$today_lastSec = mktime(24, 0, 0, $month, $day, $year);
$yestday_beginSec = mktime(0, 0, 0, $month, $day - 1, $year);
$yestday_lastSec = mktime(24, 0, 0, $month, $day - 1, $year);
$this_week_beginSec = mktime(0, 0, 0, $month, $day - $by, $year);
$this_week_endSec = mktime(24, 0, 0, $month, $day + $plus, $year);
$this_month_beginSec = mktime(0, 0, 0, $month, 1, $year);
$this_month_endSec = mktime(0, 0, 0, $month + 1, 1, $year);
$this_year_beginSec = mktime(0, 0, 0, 1, 1, $year);
$this_year_endSec = mktime(0, 0, 0, 1, 1, $year + 1);
$Inqueue = M("Inqueue");
$Okin = M("Okin");
$results_inqueue = $Inqueue->select();
$results_okin_today = $Okin->where("`out_time` > {$today_beginSec} AND `out_time` < {$today_lastSec}")->select();
$results_okin_yestoday = $Okin->where("`out_time` > {$yestday_beginSec} AND `out_time` < {$yestday_lastSec}")->select();
$results_okin_this_week = $Okin->field('user_numb,user_name,sum(delay_time),avg(delay_time),count(user_numb)')->group('user_numb')->where("`out_time` > {$this_week_beginSec} AND `out_time` < {$this_week_endSec}")->select();
$results_okin_this_month = $Okin->field('user_numb,user_name,sum(delay_time),avg(delay_time),count(user_numb)')->group('user_numb')->where("`out_time` > {$this_month_beginSec} AND `out_time` < {$this_month_endSec}")->select();
$results_okin_this_year = $Okin->field('user_numb,user_name,sum(delay_time),avg(delay_time),count(user_numb)')->group('user_numb')->where("`out_time` > {$this_year_beginSec} AND `out_time` < {$this_year_endSec}")->select();
//var_dump($results_okin_this_month);
$this->assign('title', '签到统计');
$this->assign('results_inqueue', $results_inqueue);
$this->assign('results_okin_today', $results_okin_today);
$this->assign('results_okin_yestoday', $results_okin_yestoday);
$this->assign('results_okin_this_week', $results_okin_this_week);
$this->assign('results_okin_this_month', $results_okin_this_month);
$this->assign('results_okin_this_year', $results_okin_this_year);
$this->display('index');
}
开发者ID:Rusion-Wayne,项目名称:sign-in-system,代码行数:39,代码来源:CountController.class.php
示例12: render
/**
* render calendar called in view via helper
* @param mixed $date
* @param Array $options
*/
public function render($date = null, $options = array())
{
$calendar = $this->parsed($date);
$this->buildConfig($options);
$container = new DomBuilder('div', array('id' => $this->style['div']));
for ($month = 0; $month < $this->displayedMonth; $month++) {
$monthDays = cal_days_in_month(CAL_GREGORIAN, $calendar->format('n'), $calendar->format('Y'));
if ($calendar->format('j') != 1) {
$calendar->sub(new \DateInterval("P{$calendar->format('j')}D"))->add(new \DateInterval("P1D"));
}
$firstDay = $calendar->format('N');
$weeks = ceil(($monthDays + $firstDay) / 7);
$table = new DomBuilder('table', array('class' => $this->style['table']));
$th = $table->addChild('thead')->addChild('tr', array('class' => $this->style['title']))->addChild('th', array('colspan' => 7, 'class' => $this->style['title']));
$th->content = $calendar->format('F Y');
$days = $table->get('thead')->addChild('tr');
for ($day = 0; $day < 7; $day++) {
$cell = $days->addChild('th');
$cell->content = $this->abbreviate ? jddayofweek($day, 2) : jddayofweek($day, 1);
}
for ($week = 0; $week < $weeks; $week++) {
$weekdate = $table->addChild('tr');
for ($day = 0; $day < 7; $day++) {
$cellNumber = $week * 7 + $day;
$class = $calendar->format('d-m-Y') == date('d-m-Y') ? $this->style['current'] : null;
$cell = $weekdate->addChild('td', array('class' => $class));
if ($cellNumber + 1 >= $firstDay && $cellNumber + 1 < $monthDays + $firstDay) {
$cell->content = $this->renderCell($calendar);
$calendar->add(new \DateInterval("P1D"));
}
}
}
$container->addChild($table);
}
return $container->render();
}
开发者ID:ncud,项目名称:sagalaya,代码行数:41,代码来源:Calendar.php
示例13: mktime
<?php
$nombre = "ayer.html";
$ayer = mktime(0, 0, 0, date("m"), date("d") - 1, date("Y"));
$today = date('Ymd', $ayer);
$dayweek = jddayofweek(cal_to_jd(CAL_GREGORIAN, date("m"), date("d") - 1, date("Y")), 0);
include 'include.php';
?>
开发者ID:ncasola,项目名称:LecturaQuotidiana,代码行数:8,代码来源:manana.php
示例14: getWeekDays
/**
* Given a string representation of a set of weekdays, returns an array of
* possible dates.
*/
function getWeekDays($str, $month, $year)
{
$daysInMonth = $this->daysinmonth($month, $year);
if (strstr($str, ",")) {
$tmp1 = explode(",", $str);
$count = count($tmp1);
for ($i = 0; $i < $count; $i++) {
//Loop through each comma-separated value
if (strstr($tmp1[$i], "-")) {
//If there's a range in this place, expand that too
$tmp2 = explode("-", $tmp1[$i]);
for ($j = $start; $j <= $tmp2[1]; $j++) {
for ($n = 1; $n <= $daysInMonth; $n++) {
if ($j == jddayofweek(gregoriantojd($month, $n, $year), 0)) {
$ret[] = $n;
}
}
}
} else {
//Otherwise, just add the value
for ($n = 1; $n <= $daysInMonth; $n++) {
if ($tmp1[$i] == jddayofweek(gregoriantojd($month, $n, $year), 0)) {
$ret[] = $n;
}
}
}
}
} else {
if (strstr($str, "-")) {
//There might only be a range, no comma sep values at all. Just loop these
$range = explode("-", $str);
for ($i = $start; $i <= $range[1]; $i++) {
for ($n = 1; $n <= $daysInMonth; $n++) {
if ($i == jddayofweek(gregoriantojd($month, $n, $year), 0)) {
$ret[] = $n;
}
}
}
} else {
//Otherwise, it's a single value
for ($n = 1; $n <= $daysInMonth; $n++) {
if ($str == jddayofweek(gregoriantojd($month, $n, $year), 0)) {
$ret[] = $n;
}
}
}
}
return $ret;
}
开发者ID:rabble,项目名称:Ushahidi_Web,代码行数:53,代码来源:CronParser.php
示例15: strtotime
$tiempo_alquiler=$miconexion->consulta_lista();
$Hora = strtotime($_POST['hora_partido']) + (60 *60 * $tiempo_alquiler[0]);
$hora_fin = "".date('H:i:s',$Hora);
$centro = $_POST['id_centro'];
$fecha_partido = $_POST['fecha_partido'];
$hora_partido = $_POST['hora_partido'];
$sql = 'select count(*) from partidos where id_centro="'.$centro.'" and estado_partido = 1 and id_partido != "'.$_POST['id_partido'].'" and FECHA_PARTIDO = "'.$fecha_partido.'" and
((("'.$hora_partido.'" >= hora_partido and "'.$hora_partido.'" < hora_fin) and ("'.$hora_fin.'" > hora_partido and "'.$hora_fin.'" >= hora_fin))
or (("'.$hora_partido.'" <= hora_partido and "'.$hora_partido.'" > hora_fin) and ("'.$hora_fin.'" > hora_partido and "'.$hora_fin.'" <= hora_fin))
or (hora_partido > "'.$hora_partido.'" AND hora_partido < "'.$hora_fin.'" ))';
if($miconexion->consulta($sql)){
$compr=$miconexion->consulta_lista();
if ($compr[0]=="0") {
$dias= array("0"=>'Domingo',"1"=>'Lunes',"2"=>'Martes',"3"=>'Miercoles',"4"=>'Jueves',"5"=>'Viernes',"6"=>'Sabado');
$i = strtotime($_POST['fecha_partido']);
$dia_fecha = jddayofweek(cal_to_jd(CAL_GREGORIAN, date("m",$i),date("d",$i), date("Y",$i)) , 0 );
$miconexion->consulta('select count(*) from horarios_centros where id_centro="'.$centro.'" and dia="'.$dias[$dia_fecha].'" and
("'.$hora_partido.'" >= hora_inicio AND "'.$hora_partido.'" < hora_fin)
AND
("'.$hora_fin.'" >= hora_inicio AND "'.$hora_fin.'" < hora_fin)');
$compr=$miconexion->consulta_lista();
if ($compr[0]!="0") {
$columnas[count($columnas)] = "hora_fin";
$lista[count($lista)] = $hora_fin;
$sql=$miconexion->sql_actualizar($bd,$lista,$columnas);
if($miconexion->consulta($sql)){
$sql = "insert into notificaciones (id_user, id_partido, fecha_not, visto, responsable, tipo, mensaje)
values ('".$tiempo_alquiler[1]."','".$_POST['id_partido']."','".date('Y-m-d H:i:s', time())."','0','".$_SESSION['id']."','cambios',' ha solicitado reservar el ".$_POST['fecha_partido']." a las ".date('g:i a', strtotime($_POST['hora_partido']))." para el partido')";
$miconexion->consulta($sql);
echo '<script>
$.get("../datos/cargarNotificaciones.php");
开发者ID:jncorrea,项目名称:gop,代码行数:31,代码来源:actualizar_evento.php
示例16: onLoad
public function onLoad($param)
{
parent::onLoad($param);
$idSolicitud = $_REQUEST['id'];
$this->dbConexion = Conexion::getConexion($this->Application, "dbpr");
Conexion::createConfiguracion();
$consulta = "SELECT s.id_solicitud as solicitud,s.titular as titularr ,s.antiguedad as antiguedad,DATE_FORMAT(t.fec_ingre,'%Y/%m/%d') AS creada,t.numero AS num_tit, t.nombre AS titular, st.cve_sindicato AS tit_cve_sind, st.sindicato AS tit_sind, TIMESTAMPDIFF(YEAR, t.fec_ingre, CURDATE()) AS tit_ant,\n\t\t\t\t\taval1, a1.nombre AS aval1_n, sa1.cve_sindicato AS aval1_cve_sind, sa1.sindicato AS aval1_sind, TIMESTAMPDIFF(YEAR, a1.fec_ingre, CURDATE()) AS aval1_ant,\n\t\t\t\t\taval2, a2.nombre AS aval2_n, sa2.cve_sindicato AS aval2_cve_sind, sa2.sindicato AS aval2_sind, TIMESTAMPDIFF(YEAR, a2.fec_ingre, CURDATE()) AS aval2_ant,\n\t\t\t\t\t(SELECT representante FROM CATSINDICATOS WHERE cve_sindicato = tit_cve_sind) as SindicatoRpre\n\t\t\t\t\t,DATE_FORMAT(s.firma,'%d/%m/%Y') AS firma, importe, plazo, tasa, saldo_anterior, descuento\n\t\t\t\t\t,(SELECT CASE tipo_nomi\n WHEN tipo_nomi = 'S' THEN 'SEMANAL' \n WHEN tipo_nomi = 'Q' THEN 'QUINCENAL'\n ELSE 'NO HAY TIPO DE NOMINA' END AS mesto_utovara\n\t\t\tFROM empleados WHERE numero = s.titular) as TipoNominaTit\n\t\t\t\t\t\n\t\tFROM Solicitud s \n\t\tLEFT JOIN sujetos AS t ON t.numero = s.titular\n\t\tLEFT JOIN catsindicatos st ON st.cve_sindicato = s.cve_sindicato\n\t\tLEFT JOIN sujetos AS a1 ON a1.numero= s.aval1\n\t\tLEFT JOIN catsindicatos sa1 ON sa1.cve_sindicato = s.cve_sind_Aval1\n\t\tLEFT JOIN sujetos AS a2 ON a2.numero = s.aval2\n\t\tLEFT JOIN catsindicatos sa2 ON sa2.cve_sindicato = s.cve_sind_Aval2\n\t\tWHERE s.id_solicitud = (SELECT MAX(id_solicitud) AS id_solicitud FROM Solicitud WHERE titular = :idSolicitud)";
$comando = $this->dbConexion->createCommand($consulta);
$comando->bindValue(":idSolicitud", $idSolicitud);
$result = $comando->query()->readAll();
foreach ($result as $rows) {
$VarSolicitante = $rows['solicitud'];
$VarClaveSindicato = $rows['tit_cve_sind'];
$VarRepreSindicato = $rows['SindicatoRpre'];
$Solicitud = $rows['titular'];
$VarSolicitud = $rows['titularr'];
$VarFechadeIngreso = $rows['creada'];
$VarAntiguedad = $rows['antiguedad'];
$VarSindicato = $rows['tit_sind'];
$VarFirmAvales = $rows['firma'];
$Aval1 = $rows['aval1'];
$Aval2 = $rows['aval2'];
$VarAval1 = $rows['aval1_n'];
$VarAval2 = $rows['aval2_n'];
$VarPlazo = $rows['plazo'];
$Importe = $rows['importe'];
$creada = $rows['creada'];
$TipoNomina = $rows['TipoNominaTit'];
}
$VarImporte = number_format($Importe, 2);
$mes = date("n");
$meses = 11 - $mes;
$consultaDirec = "SELECT Nombre_completo FROM cat_director WHERE anio = YEAR(NOW())";
$comando = $this->dbConexion->createCommand($consultaDirec);
$result = $comando->query()->readAll();
foreach ($result as $rows) {
$VarDirector = $rows['Nombre_completo'];
}
$fecha = date('Y/m/j');
$i = strtotime($fecha);
$dia = jddayofweek(cal_to_jd(CAL_GREGORIAN, date("m", $i), date("d", $i), date("Y", $i)), 0);
if ($dia >= 4) {
$nuevafecha = strtotime('+4 day', strtotime($fecha));
$nuevafecha = date('j/m/Y', $nuevafecha);
} else {
$nuevafecha = strtotime('+1 day', strtotime($fecha));
$nuevafecha = date('j/m/Y', $nuevafecha);
}
$datetime1 = date_create($creada);
$datetime2 = date_create($fecha);
$AntLetras = date_diff($datetime1, $datetime2);
$AntLetra = $AntLetras->format('%Y Años %m Meses %d Dias');
$hoy = date("Y-m-d H:i:s");
$this->lblNumSolicitante->Text = $VarSolicitante;
$this->lblSolicitante->Text = $VarSolicitud . " - " . $Solicitud;
$this->lblFechadeIngreso->Text = $VarFechadeIngreso;
$this->lblAntiguedad->Text = $AntLetra;
$this->lblTipoNomina->Text = $TipoNomina;
$this->lblSindicato->Text = $VarSindicato;
$this->lblAval1->Text = $Aval1 . " - " . $VarAval1;
$this->lblAval2->Text = $Aval2 . " - " . $VarAval2;
$this->lblfirmAvales->Text = $nuevafecha;
$this->lblmeses->Text = $meses;
$this->lblimporte->Text = $VarImporte;
$this->lbldirector->Text = $VarDirector;
}
开发者ID:algerion,项目名称:prestamos,代码行数:66,代码来源:solicitudes.php
示例17: getDiaFecha
function getDiaFecha($fecha)
{
$i = strtotime($fecha);
$dia = jddayofweek(cal_to_jd(CAL_GREGORIAN, date("m", $i), date("d", $i), date("Y", $i)));
switch ($dia) {
case 0:
return 'domingo';
case 1:
return 'lunes';
case 2:
return 'martes';
case 3:
return 'miercoles';
case 4:
return 'jueves';
case 5:
return 'viernes';
case 5:
return 'sabado';
}
}
开发者ID:javuureivaj,项目名称:eXTend-Framework-PHP,代码行数:21,代码来源:XTCore.php
示例18: foreach
<tr><th colspan="7">Lectures</th></tr>
<?php
foreach ($section['lect'] as $lecture) {
echo '<tr><td colspan="3"></td><td>' . $lecture->room . '</td><td>' . my_time($lecture->start) . '</td><td>' . my_time($lecture->end) . '</td><td>' . jddayofweek($lecture->weekday - 1 % 7, 1) . '</td></tr>';
}
if ($section['tuts']) {
echo '<tr><th colspan="7">Tutorials</th></tr>';
foreach ($section['tuts'] as $tutorial) {
echo '<tr><td>' . $tutorial->letter . '</td><td>' . $tutorial->instructor . '</td><td>' . $tutorial->capacity . '</td><td>' . $tutorial->room . '</td><td>' . my_time($tutorial->start) . '</td><td>' . my_time($tutorial->end) . '</td><td>' . jddayofweek($tutorial->weekday - 1 % 7, 1) . '</td></tr>';
}
}
if ($section['labs']) {
echo '<tr><th colspan="7">Laboratories</th></tr>';
foreach ($section['labs'] as $laboratory) {
echo '<tr><td>' . $laboratory->letter . '</td><td>' . $laboratory->instructor . '</td><td>' . $laboratory->capacity . '</td><td>' . $laboratory->room . '</td><td>' . my_time($laboratory->start) . '</td><td>' . my_time($laboratory->end) . '</td><td>' . jddayofweek($laboratory->weekday - 1 % 7, 1) . '</td></tr>';
}
}
?>
</tbody>
</table>
</div>
<?php
}
?>
<?php
开发者ID:ghiobi,项目名称:AnotherOne,代码行数:31,代码来源:result.php
示例19: onDayFrequency
/**
* Whether the $datetime is
*
* @param DateTime $dateTime
*
* @throws \Exception
* @throws \UnexpectedValueException
* @return boolean
*/
protected function onDayFrequency(DateTime $dateTime)
{
if ($this->frequency == self::FREQUENCY_DAILY || !$this->dayFrequency->count() || !$this->days->count()) {
return true;
}
// This needs $interval integrated as well... yay.
while ($this->days->next()) {
$day = $this->days->current();
while ($this->dayFrequency->next()) {
switch ($this->frequency) {
case self::FREQUENCY_WEEKLY:
$compare = jddayofweek(cal_to_jd(CAL_GREGORIAN, $dateTime->format('m'), $dateTime->format('j'), $dateTime->format('Y')));
break;
case self::FREQUENCY_MONTHLY:
throw new \Exception('Not implemented');
break;
case self::FREQUENCY_YEARLY:
$compare = $dateTime->format('z');
break;
default:
throw new \UnexpectedValueException("The provided frequency `{$this->frequency}` is invalid");
}
if ($compare === $day) {
return true;
}
}
}
return false;
}
开发者ID:pguso,项目名称:CalendarBundle,代码行数:38,代码来源:Recurrence.php
示例20: deliveryDate
function deliveryDate()
{
//lay ngay hien tai bang so
$str = @date("d-m-Y-g:i a");
$currentDay = date_to_int($str);
//@strtotime(date("d-m-Y-g:i a"));
$totalDay = 1 * 24 * 60 * 60;
//1 ngay: 1*24*60*60
$h = @date("g");
//lay gio
$m = @date("a");
// lay buoi sang hay buoi chieu
// am la buoi chieu tu 1->12 toi
//pm la tu 1->12 chua
if ($m == 'pm') {
//nay du kien giao hang la---------------
$tongngay = $currentDay + $totalDay;
$toado = explode("-", int_to_dateNoH($tongngay));
$jd = cal_to_jd(CAL_GREGORIAN, $toado[1], $toado[0], $toado[2]);
$day = jddayofweek($jd, 0);
switch ($day) {
case 0:
$thu = DSUNDAY;
break;
case 1:
$thu = DMONDAY;
break;
case 2:
$thu = DTUEDAY;
break;
case 3:
$thu = DWDNESDAY;
break;
case 4:
$thu = DTHUDAY;
break;
case 5:
$thu = DFRIDAY;
break;
case 6:
$thu = DSATUDAY;
break;
}
$ngaygiaohang = $thu . ', ' . int_to_dateNoH($tongngay) . ': 3 ' . _dH . ' 30 ' . DMINUTES;
} elseif ($m == 'am' and $h < 7) {
$toado = explode("-", int_to_dateNoH($currentDay));
$jd = cal_to_jd(CAL_GREGORIAN, $toado[1], $toado[0], $toado[2]);
$day = jddayofweek($jd, 0);
switch ($day) {
case 0:
$thu = DSUNDAY;
break;
case 1:
$thu = DMONDAY;
break;
case 2:
$thu = DTUEDAY;
break;
case 3:
$thu = DWDNESDAY;
break;
case 4:
$thu = DTHUDAY;
break;
case 5:
$thu = DFRIDAY;
break;
case 6:
$thu = DSATUDAY;
break;
}
$ngaygiaohang = $thu . ', ' . int_to_dateNoH($currentDay) . ': 3 ' . _dH . ' 30 ' . DMINUTES;
} else {
$toado = explode("-", int_to_dateNoH($tongngay));
$jd = cal_to_jd(CAL_GREGORIAN, $toado[1], $toado[0], $toado[2]);
$day = jddayofweek($jd, 0);
switch ($day) {
case 0:
$thu = DSUNDAY;
break;
case 1:
$thu = DMONDAY;
break;
case 2:
$thu = DTUEDAY;
break;
case 3:
$thu = DWDNESDAY;
break;
case 4:
$thu = DTHUDAY;
break;
case 5:
$thu = DFRIDAY;
break;
case 6:
$thu = DSATUDAY;
break;
}
$ngaygiaohang = $thu . ', ' . int_to_date($tongngay) . ': 8 ' . _dH . ' 30 ' . DMINUTES;
//.........这里部分代码省略.........
开发者ID:bestwishforyou95,项目名称:tiennam,代码行数:101,代码来源:func.lib.php
注:本文中的jddayofweek函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论