Example #1
0
 /**
  * Updates a particular model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id the ID of the model to be updated
  */
 public function actionUpdate($id)
 {
     $horario = Horario::model()->findByPk($id);
     if (isset($_POST['Horario'])) {
         $horario->attributes = $_POST['Horario'];
         $horario->hora_inicio = date('Gi', strtotime($horario->hora_inicio));
         $horario->hora_fin = date('Gi', strtotime($horario->hora_fin));
         if ($horario->save()) {
             Yii::app()->user->setFlash('success', Horarios::getDiaSemana($horario->dia_semana) . ' ' . Horarios::hora($horario->hora_inicio) . ' guardado con éxito');
             $pgPrograma = PgPrograma::model()->with('pagina')->findByPk($horario->pg_programa_id);
             $this->redirect(array('programas/view', 'id' => $pgPrograma->pagina->micrositio_id));
         }
         //if($horario->save())
     }
     //if(isset($_POST['Horario']))
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     $this->render('modificar', array('model' => $horario));
 }
Example #2
0
 public function inicia_horarios_esquecidos()
 {
     $horarios_esquecidos = new Horarios();
     //echo '<script> del(); limCamp();</script>';//limpando campos login e senha
     $date = strtotime('+30 days');
     // echo "<script>alert('".date('d/m/Y', $date)."');</script>";
     $data_30 = date('Y/m/d', $date);
     $dias = explode('/', $data_30);
     $funcionarios = new Funcionario();
     $funcionarios = $funcionarios->get_all_id_func();
     $data = date('Y-m-d');
     for ($dia = 0; $dia <= 10; $dia++) {
         // conta 10 dias pra frente, e adiciona os registros na tabela
         $date_mais_um = strtotime($data . '+' . $dia . ' days');
         $data_atual = date('Y-m-d', $date_mais_um);
         for ($aux = 0; $aux < count($funcionarios); $aux++) {
             if ($horarios_esquecidos->not_exists($data_atual, $funcionarios[$aux][0])) {
                 $horarios_esquecidos->cadHorariosEsquecidos($data_atual, $funcionarios[$aux][0]);
                 $horarios_esquecidos->insertHorariosEsquecidosBd();
                 // echo "<script>alert('Não Existe,\\n****** ATENÇÃO ******\\nAVISAR CASO APAREÇA ESSA MENSAGEM!!!!');</script>";
             } else {
                 // echo "<script>alert('existe: ".$data_atual."');</script>";
             }
         }
         // echo "<script>alert('".$dia."');</script>";
     }
 }
Example #3
0
function get_esquecidos($data, $tipo, $data2)
{
    // echo 'Aguarde...';
    $horario = new Horarios();
    $array = $horario->get_registros_esquecidos($data, $tipo, $data2);
    $config = new Config();
    $TEMP_LIMIT_ATRASO = $config->get_config("temp_limit_atraso", $_SESSION['id_empresa']);
    // tempo limite de atraso ou adiantamento aceito
    // echo "<script>alert('".count($array)."');</script>";
    if (count($array) > 0) {
        // verifica se existe registro
        echo '<div class="content-right" id="content-right">
                    <div class="box-atrasos" style="">';
        echo '<div class="cont" style="margin-left:480px;"><a name="exibe_box_sem_registros" onclick="oculta(this.name)"><img width="20px" src="../images/icon-fechar.png" onmouseover="info(\'pop1\')" onmouseout="fecharInfo(\'pop1\')"></a>
                              <div id="pop1" class="pop" style="display:none">
                                  <div id="titulo1" class="title-info-config"><span>Informações</span></div>
                                  <div id="content1" class="content-info">Clique para ocultar esse bloco, você pode exibi-lo novamente a qualquer momento em:<br /><b>Configurações > Layout</b></div>   
                              </div>
                         </div>';
        echo '<table class="table-atrasos" border="0" style="box-shadow:0px 0px 5px #ccc;">';
        // echo '<tr><td colspan="4"><img src="../images/rel.png"></td></tr>';
        // if($tipo == 0){
        echo '<tr><td colspan="4">';
        echo '<a href="principal" style="font-size:12px">Ver hoje</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="principal?desc=mes" style="font-size:12px">Ver mês inteiro</a>&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="exibe_oculta(\'intervalo_datas\')" style="cursor: pointer; font-size:12px">Ver por período</a>&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="exibe_oculta(\'funcionario\')" style="cursor: pointer;font-size:12px">Ver por funcionário</a>';
        echo '<br />';
        if ($tipo == 0) {
            echo '<span style="color:#aaa">Exibindo registros de hoje ' . date("d/m/Y") . '</span><br />';
        } else {
            if ($tipo == 1) {
                echo '<span style="color:#aaa">Exibindo registros para o mês ' . date("m/Y") . '</span><br />';
            } else {
                echo '<span style="color:#aaa">Exibindo registros de ' . date("d/m/Y", strtotime($data)) . ' até ' . date("d/m/Y", strtotime($data2)) . '</span><br />';
            }
        }
        echo '</td></tr>';
        // }else{
        //      echo '<tr><td colspan="4">'.date("m/Y").'<br />'. '<a href="principal" style="font-size:12px">Ver hoje</a>&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="exibe_oculta(\'intervalo_datas\')" style="font-size:12px">Ver por período</a>'.'</td></tr>';
        // }
        echo '<tr id="intervalo_datas" style="display:none; ">
                                <td colspan="4">
                                    <form name="dataini_datafim" action="principal" method="POST">
                                      <span>Inicio: </span> <input  onclick="carregaMascaras()" type="date" name="ini" id="ini" style="border: 1px solid#cdcdcd; border-radius: 5px">&nbsp;&nbsp;<span>Fim: </span><input  onclick="carregaMascaras()" id="fim" name="fim" style="border: 1px solid#cdcdcd; border-radius: 5px" type="date"> <input type="submit" value="Buscar">
                                    <form>
                                </td>
                              </tr>';
        echo '<tr id="funcionario" style="display:none; ">
                                <td colspan="4">
                                    <form name="nome_func" action="principal" method="POST">
                                      <span>Nome: </span> <input type="text" name="funcionario" style="padding-left:5px;border: 1px solid#cdcdcd; border-radius: 5px"> <input type="submit" value="Buscar">
                                    <form>
                                </td>
                              </tr>';
        echo '<tr><td colspan="4"><b>Atenção</b></td></tr>';
        echo '<tr><td colspan="4"><span>Os funcionários abaixo esqueceram ou não bateram o ponto</span></td></tr>';
        $title = 'Clique para justificar o atraso';
        $funcionario = new Funcionario();
        $turno = new Turno();
        $table_color = 0;
        // para fazer a tabela zebrada
        $total_registros = 0;
        echo '<tr>
                         <td colspan="4">';
        echo '<div style="overflow-y: scroll; height: 190px;">';
        echo '<table style="text-align:center; width:100%" border="0">';
        echo '<tr><td><b>Funcionário</b></td><td><b>Tipo</b></td>';
        if ($tipo == 1) {
            echo '<td><b>Data</b></td>';
        }
        echo '</tr>';
        for ($aux = 0; $aux < count($array); $aux++) {
            /*
              $array[$aux][0] -> 'id'
              $array[$aux][1] -> 'data'
              $array[$aux][2] -> 'id_funcionario'
              $array[$aux][3] -> 'tipo_1'
              $array[$aux][4] -> 'tipo_2'
              $array[$aux][5] -> 'tipo_3'
              $array[$aux][6] -> 'tipo_0'
            */
            $nome_turno_funcionario = $funcionario->get_nome_by_id($array[$aux][2]);
            $turno = $turno->getTurnoById($nome_turno_funcionario[1]);
            $hora = strtotime(date('H:i:s'));
            $hora_turno['ini_exp'] = strtotime($turno->ini_exp) + $TEMP_LIMIT_ATRASO * 60;
            $hora_turno['ini_alm'] = strtotime($turno->ini_alm) + $TEMP_LIMIT_ATRASO * 60;
            $hora_turno['fim_alm'] = strtotime($turno->fim_alm) + $TEMP_LIMIT_ATRASO * 60;
            $hora_turno['fim_exp'] = strtotime($turno->fim_exp) + $TEMP_LIMIT_ATRASO * 60;
            // echo $hora;
            if ($array[$aux][3] == 0 && ($hora > $hora_turno['ini_exp'] || strtotime($data) < strtotime($array[$aux][1]))) {
                //tipo_1
                if (date('D', strtotime($array[$aux][1])) != 'Sun' && date('D', strtotime($array[$aux][1])) != 'Sat') {
                    if ($table_color % 2 == 0) {
                        echo '<tr style="background-color:#eee">';
                        $table_color++;
                    } else {
                        echo '<tr style="background-color:#dedede">';
                        $table_color++;
                    }
                } else {
                    echo '<tr style="background-color:rgba(250,10,10,0.3)">';
                }
                echo '<td class="rows-content"><a href="principal?desc=sem_registros&tipo=1&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . $nome_turno_funcionario[0] . '</b></a></td><td class="rows-content"><a href="principal?desc=sem_registros&tipo=1&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>Inicio expediente</b></a></td>';
                if ($tipo == 1 || $tipo == 3) {
                    echo '<td class="rows-content"><a href="principal?desc=sem_registros&tipo=1&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . date('d/m/Y', strtotime($array[$aux][1])) . '</b></a></td>';
                }
                echo '</tr>';
                $total_registros++;
            }
            if ($array[$aux][4] == 0 && ($hora > $hora_turno['ini_alm'] || strtotime($data) < strtotime($array[$aux][1])) && $turno->sem_hor_almoco != '1') {
                //tipo_2
                if (date('D', strtotime($array[$aux][1])) != 'Sun' && date('D', strtotime($array[$aux][1])) != 'Sat') {
                    if ($table_color % 2 == 0) {
                        echo '<tr style="background-color:#eee">';
                        $table_color++;
                    } else {
                        echo '<tr style="background-color:#dedede">';
                        $table_color++;
                    }
                } else {
                    echo '<tr style="background-color:rgba(250,10,10,0.3)">';
                }
                echo '<td class="rows-content"><a href="principal?desc=sem_registros&tipo=2&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . $nome_turno_funcionario[0] . '</b></a></td><td class="rows-content"><a href="principal?desc=sem_registros&tipo=2&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>Inicio Almoço</b></a></td>';
                if ($tipo == 1 || $tipo == 3) {
                    echo '<td class="rows-content"><a href="principal?desc=sem_registros&tipo=2&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . date('d/m/Y', strtotime($array[$aux][1])) . '</b></a></td>';
                }
                echo '</tr>';
                $total_registros++;
            }
            if ($array[$aux][5] == 0 && ($hora > $hora_turno['fim_alm'] || strtotime($data) < strtotime($array[$aux][1])) && $turno->sem_hor_almoco != '1') {
                //tipo_3
                if (date('D', strtotime($array[$aux][1])) != 'Sun' && date('D', strtotime($array[$aux][1])) != 'Sat') {
                    if ($table_color % 2 == 0) {
                        echo '<tr style="background-color:#eee">';
                        $table_color++;
                    } else {
                        echo '<tr style="background-color:#dedede">';
                        $table_color++;
                    }
                } else {
                    echo '<tr style="background-color:rgba(250,10,10,0.3)">';
                }
                echo '<td class="rows-content"><a href="principal?desc=sem_registros&tipo=3&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . $nome_turno_funcionario[0] . '</b></a></td><td class="rows-content"><a href="principal?desc=sem_registros&tipo=3&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>Fim Almoço</b></a></td>';
                if ($tipo == 1 || $tipo == 3) {
                    echo '<td class="rows-content"><a href="principal?desc=sem_registros&tipo=3&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . date('d/m/Y', strtotime($array[$aux][1])) . '</b></a></td>';
                }
                echo '</tr>';
                $total_registros++;
            }
            if ($array[$aux][6] == 0 && ($hora > $hora_turno['fim_exp'] || strtotime($data) < strtotime($array[$aux][1]))) {
                //tipo_0
                if (date('D', strtotime($array[$aux][1])) != 'Sun' && date('D', strtotime($array[$aux][1])) != 'Sat') {
                    if ($table_color % 2 == 0) {
                        echo '<tr style="background-color:#eee">';
                        $table_color++;
                    } else {
                        echo '<tr style="background-color:#dedede">';
                        $table_color++;
                    }
                } else {
                    echo '<tr style="background-color:rgba(250,10,10,0.3)">';
                }
                echo '<td class="rows-content"><a href="principal?desc=sem_registros&tipo=0&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . $nome_turno_funcionario[0] . '</b></a></td><td class="rows-content"><a href="principal?desc=sem_registros&tipo=0&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>Fim expediente</b></a></td>';
                if ($tipo == 1 || $tipo == 3) {
                    echo '<td class="rows-content"><a href="principal?desc=sem_registros&tipo=0&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . date('d/m/Y', strtotime($array[$aux][1])) . '</b></a></td>';
                }
                echo '</tr>';
                $total_registros++;
            }
        }
        echo '</table>';
        echo '</div>';
        echo '</td></tr>';
        if ($total_registros > 0) {
            echo '<tr><td colspan="4" style="text-align: right; padding-top: 5px; color:#555; font-size: 12px;">';
            if ($tipo == 1) {
                echo '<div style="border-radius: 50%; border: 1px solid#555; float:left; height: 11px; width:11px; background-color:rgba(250,10,10,0.3)"></div><div style="float:left; margin-left: 5px;"> Sábados e domingos</div>';
            }
            echo 'Clique para corrigir </td></tr>';
            echo "<script>document.getElementById('content-right').style.display='block'</script>";
        } else {
            echo '<tr><td colspan="4" style="padding-top: 15px; color:#555; font-size: 12px;">Nenhum horário registrado!</td></tr>';
        }
        echo '<div class="cont" style="color:#f33;font-size:15px;  text-align:left"><b>' . $total_registros . '</b></div>';
        echo '</table>';
    } else {
        //fim if count($array) > 0
        echo '<div class="content-right" id="content-right">
                    <div class="box-atrasos" style="">';
        echo '<table class="table-atrasos" border="0" style="box-shadow:0px 0px 5px #ccc;">';
        // echo '<tr><td colspan="4"><img src="../images/rel.png"></td></tr>';
        // if($tipo == 0){
        echo '<tr><td colspan="4">';
        echo '<a href="principal" style="font-size:12px">Ver hoje</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="principal?desc=mes" style="font-size:12px">Ver mês inteiro</a>&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="exibe_oculta(\'intervalo_datas\')" style="cursor: pointer;font-size:12px">Ver por período</a>&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="exibe_oculta(\'intervalo_datas\')" style="cursor: pointer;font-size:12px">Ver por funcionário</a>';
        echo '<br />';
        if ($tipo == 0) {
            echo '<span style="color:#aaa">Exibindo registros de hoje ' . date("d/m/Y") . '</span><br />';
        } else {
            if ($tipo == 1) {
                echo '<span style="color:#aaa">Exibindo registros para o mês ' . date("m/Y") . '</span><br />';
            } else {
                echo '<span style="color:#aaa">Exibindo registros de ' . date("d/m/Y", strtotime($data)) . ' até ' . date("d/m/Y", strtotime($data2)) . '</span><br />';
            }
        }
        echo '</td></tr>';
        $total_registros = 0;
        echo '<tr>
                         <td colspan="4">';
        echo 'NENHUM REGISTRO FOI ENCONTRADO NESSE PERÍODO';
        echo '</td></tr>';
        echo '<div class="cont" style="color:#f33;font-size:15px;  text-align:left"><b>' . $total_registros . '</b></div>';
        echo '</table>';
        echo '</div></div>';
    }
    echo '</div>
            </div>';
}
<?php

include '../Datos/class.Horarios.php';
$clase = new Horarios($_POST['nom_horario'], 0);
$id = $clase->Consultar_id_horario();
/////actualizo
$clase = new Horarios($_POST['nom_new'], 0);
$nre = $clase->Consultar_nom_horario();
if ($nre == 0) {
    $clase = new Horarios($_POST['nom_new'], $id);
    $id = $clase->Modificar_horario();
    $caso = 0;
    echo $caso;
} else {
    if ($_POST['nom_new'] == $_POST['nom_horario']) {
        $caso = 0;
        echo $caso;
    } else {
        $caso = 1;
        echo $caso;
    }
}
Example #5
0
    echo '</table>';
    echo '<table  class="table-aniversariantes" border="0">';
    echo '<tr><td colspan="5"><b>Hoje</b><br /><span>' . date("d/m/Y") . '</span></td></tr>';
    // echo '<tr><td colspan="4"><b>Justificar atraso</b></td></tr>';
    echo '<tr><td colspan="5">' . $string . '</td></tr>';
    echo '<tr><td colspan="5" style="text-align:left; padding-left:10px; padding-top: 10px;"><b>Motivo do atraso:</b></td></tr>';
    echo '<tr><td colspan="5" style="text-align:left; padding-left:30px; color:#454545; "><div style="max-height:50px; height:50px; overflow-y:scroll">' . $horario->observacao_funcionario . '</div></td></tr>';
    echo '<tr><td colspan="5" style="text-align:left; padding-left:10px; padding-top: 10px;"><b>Justifique esse atraso:*</b></td></tr>';
    echo '<tr><td colspan="5"> <textarea id="observacao" name="observacao" style="width: 450px; height:50px; resize:none;"></textarea> </td></tr>';
    echo '<tr><td colspan="5" style="padding-top:5px"> <input type="submit" class="button" value="Salvar"> <input class="button" type="button" value="Cancelar" onclick="window.location.href=\'principal\'"> </td></tr>';
    echo '</table>';
    echo '</form>';
    echo '</div>
            </div> ';
} else {
    $horario = new Horarios();
    $array = $horario->get_atrasos(date("Y-m-d"));
    if (count($array) > 0) {
        echo '<div class="content-right" >
                <div class="box-atrasos" style="">';
        echo '<div class="cont" style="margin-left:480px;"><a name="exibe_box_atrasos" onclick="oculta(this.name)"><img width="20px" src="../images/icon-fechar.png" onmouseover="info(\'pop2\')" onmouseout="fecharInfo(\'pop2\')"></a>
                              <div id="pop2" class="pop" style="display:none">
                                  <div id="titulo2" class="title-info-config"><span>Informações</span></div>
                                  <div id="content2" class="content-info">Clique para ocultar esse bloco, você pode exibi-lo novamente a qualquer momento em:<br /><b>Configurações > Layout</b></div>   
                              </div>
                         </div>';
        echo '<div class="cont" style="color:#f33;font-size:15px;  text-align:left"><b>' . count($array) . '</b></div>';
        echo '<table class="table-atrasos" style="box-shadow:0px 0px 5px #ccc;">';
        echo '<tr>
                          <td colspan="4">
                            <div class="time">
Example #6
0
<?php

$this->pageTitle = 'Modificar horario ' . Horarios::getDiaSemana($model->dia_semana) . ' ' . Horarios::hora($model->hora_inicio);
$bc = array();
$bc['Padre'] = $this->createUrl('programas/view', array('id' => $model->pgPrograma->pagina->micrositio->id));
$bc[] = 'Editar';
$this->breadcrumbs = $bc;
?>
<div class="col-sm-12">
<?php 
echo $this->renderPartial('_form', array('model' => $model));
?>
</div>
Example #7
0
<?php 
Functions::getHead('Administrator');
//busca <head></head> da pagina, $title é o titulo da pagina
?>
<!-- <head>
	<title></title>
	<link rel="stylesheet" type="text/css" href="../css/bootstrap.css">
	<link rel="stylesheet" type="text/css" href="styles/style.css">
	
</head> -->

<?php 
// inicia a tabela de horarios esquecidos, a tabela de horarios esquecidos controla quem registrou ou não registrou o ponto eletronico,
// essa tabela mantem os registros sempre 10 dias a mais iniciando na data atual
// esse metodo verifica se existe um registro faltando nessa tabela e atualiza
Horarios::inicia_horarios_esquecidos();
?>

<body class="body-login">
	<!-- <div class='container'> -->
	<div style="margin: 0 auto; width:500px;">
		<div class='content' style="padding: 5; float:left">
			<img src="../images/logo-sgo.png" style="margin: 0 auto; width:350px;">
			<form type="submit" method="POST" action="loggar.php" > 
				<table class="tabelapadrao" id="table_login" border="0" style="width:250px;">
					<tr>
						<td><input class="form-control" style="text-align:center" placeholder="Usuário" type="text" name="id" id="id"></td>
					</tr>
					<tr>
						<td><input class="form-control" style="text-align:center" placeholder="Senha" type="password" name="pass" id="pass"></td>
					</tr>
Example #8
0
								<td rowspan="2">SAÍDA<BR />TARDE</td>
								<td rowspan="2">TOTAL HS NORMAIS</td>
								<td colspan="2">EXTRAS</td>
								<td rowspan="2">TOTAL HS EXTRAS</td>
								<td rowspan="2">ASSINATURA OU VISTO DO(A) EMPREGADO(A)</td>
							</tr>
							<tr>
								<td>SAÍDA</td>
								<td>RETORNO</td>
								<td style="border-color:#fff;"></td>
								<td style="border-color:#fff;"></td>
								<td>ENTRADA</td>
								<td>SAÍDA</td>
	
							</tr>';
            $horario = new Horarios();
            $data = $ano . '-' . $mes;
            // Ex: 2015-07
            $horarios = $horario->get_horario_by_func_and_data($funcionario->id, $data);
            //0123-56-89
            $array = array();
            for ($aux = 0; $aux < count($horarios); $aux++) {
                for ($dia = 1; $dia <= 31; $dia++) {
                    if ($dia < 10) {
                        $data = $ano . '-' . $mes . '-0' . $dia;
                    } else {
                        $data = $ano . '-' . $mes . '-' . $dia;
                    }
                    if ($data == $horarios[$aux][2]) {
                        if ($horarios[$aux][4] == 1) {
                            //entrando
 /**
  * Exclude object from result
  *
  * @param     Horarios $horarios Object to remove from the list of results
  *
  * @return    HorariosQuery The current query, for fluid interface
  */
 public function prune($horarios = null)
 {
     if ($horarios) {
         $this->addUsingAlias(HorariosPeer::ID, $horarios->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
Example #10
0
 public function get_minutos_ant($hora_turno, $hora_login)
 {
     $horario = new Horarios();
     $atraso = $horario->dif_horario($hora_login, $hora_turno);
     //retorna a diferença de horario
     $hora = explode("h", $atraso);
     // explode string para pegar minuto
     $hora_atraso = $hora[1];
     $minuto = explode("m", $hora_atraso);
     return $minuto[0];
 }
<?php

include '../Datos/class.Horarios.php';
$clase = new Horarios($_POST["nom_horario"], 0);
$nreg = $clase->Consultar_nom_horario();
if ($nreg == 0) {
    $clase = new Horarios($_POST["nom_horario"], 0);
    $clase->Nuevo_horario();
}
echo $nreg;
Example #12
0
<?php

$this->pageDesc = $contenido['pagina']->meta_descripcion != '' ? $contenido['pagina']->meta_descripcion : $contenido['contenido']->resena;
if (count($contenido['contenido']->fechaEspecials)) {
    ?>
<p><b>Fecha:</b> <?php 
    echo Horarios::fecha_especial($contenido['contenido']->fechaEspecials);
    ?>
</p>
<?php 
}
echo $contenido['contenido']->resena;
if ($contenido['contenido']->lugar != '') {
    ?>
<p><b>Lugar:</b> <?php 
    echo $contenido['contenido']->lugar;
    ?>
</p>
<?php 
}
if ($contenido['contenido']->presentadores != '') {
    ?>
<p><b>Presentadores:</b> <?php 
    echo $contenido['contenido']->presentadores;
    ?>
</p>
<?php 
}
Example #13
0
function get_esquecidos($data, $tipo)
{
    // echo 'Aguarde...';
    $horario = new Horarios();
    $array = $horario->get_registros_esquecidos($data, $tipo);
    $config = new Config();
    $TEMP_LIMIT_ATRASO = $config->get_config("temp_limit_atraso");
    // tempo limite de atraso ou adiantamento aceito
    // echo "<script>alert('".count($array)."');</script>";
    if (count($array) > 0) {
        // verifica se existe registro
        echo '<div class="content-right" id="content-right">
                    <div class="box-atrasos" style="width:96%">';
        echo '<table class="table-atrasos" border="0" style="box-shadow:0px 0px 5px #ccc;">';
        // echo '<tr><td colspan="4"><img src="../images/rel.png"></td></tr>';
        if ($tipo == 0) {
            echo '<tr><td colspan="4">' . date("d/m/Y") . '<br />' . '<a href="logado.php?desc=mes" style="font-size:12px">Ver mês inteiro</a>' . '</td></tr>';
        } else {
            echo '<tr><td colspan="4">' . date("m/Y") . '<br />' . '<a href="logado.php" style="font-size:12px">Ver hoje</a>' . '</td></tr>';
        }
        echo '<tr><td colspan="4"><b>Atenção</b></td></tr>';
        echo '<tr><td colspan="4"><span>Os funcionários abaixo esqueceram ou não bateram o ponto</span></td></tr>';
        $title = 'Clique para justificar o atraso';
        $funcionario = new Funcionario();
        $turno = new Turno();
        $table_color = 0;
        // para fazer a tabela zebrada
        $total_registros = 0;
        echo '<tr>
                         <td colspan="4">';
        echo '<div style="overflow-y: scroll; height: 190px;">';
        echo '<table style="text-align:center; width:100%" border="0">';
        echo '<tr><td><b>Funcionário</b></td><td><b>Tipo</b></td>';
        if ($tipo == 1) {
            echo '<td><b>Data</b></td>';
        }
        echo '</tr>';
        for ($aux = 0; $aux < count($array); $aux++) {
            /*
              $array[$aux][0] -> 'id'
              $array[$aux][1] -> 'data'
              $array[$aux][2] -> 'id_funcionario'
              $array[$aux][3] -> 'tipo_1'
              $array[$aux][4] -> 'tipo_2'
              $array[$aux][5] -> 'tipo_3'
              $array[$aux][6] -> 'tipo_0'
            */
            $nome_turno_funcionario = $funcionario->get_nome_by_id($array[$aux][2]);
            $turno = $turno->getTurnoById($nome_turno_funcionario[1]);
            // date_default_timezone_set('America/Sao_Paulo');
            $hora = strtotime(date('H:i:s'));
            $hora_turno['ini_exp'] = strtotime($turno->ini_exp) + $TEMP_LIMIT_ATRASO * 60;
            $hora_turno['ini_alm'] = strtotime($turno->ini_alm) + $TEMP_LIMIT_ATRASO * 60;
            $hora_turno['fim_alm'] = strtotime($turno->fim_alm) + $TEMP_LIMIT_ATRASO * 60;
            $hora_turno['fim_exp'] = strtotime($turno->fim_exp) + $TEMP_LIMIT_ATRASO * 60;
            // echo $hora;
            if ($array[$aux][3] == 0 && ($hora > $hora_turno['ini_exp'] || strtotime($data) < strtotime($array[$aux][1]))) {
                //tipo_1
                if (date('D', strtotime($array[$aux][1])) != 'Sun' && date('D', strtotime($array[$aux][1])) != 'Sat') {
                    if ($table_color % 2 == 0) {
                        echo '<tr style="background-color:#eee">';
                        $table_color++;
                    } else {
                        echo '<tr style="background-color:#dedede">';
                        $table_color++;
                    }
                } else {
                    echo '<tr style="background-color:rgba(250,10,10,0.3)">';
                }
                echo '<td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=1&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . $nome_turno_funcionario[0] . '</b></a></td><td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=1&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>Inicio expediente</b></a></td>';
                if ($tipo == 1) {
                    echo '<td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=1&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . date('d/m/Y', strtotime($array[$aux][1])) . '</b></a></td>';
                }
                echo '</tr>';
                $total_registros++;
            }
            if ($array[$aux][4] == 0 && ($hora > $hora_turno['ini_alm'] || strtotime($data) < strtotime($array[$aux][1])) && $turno->sem_hor_almoco != '1') {
                //tipo_2
                if (date('D', strtotime($array[$aux][1])) != 'Sun' && date('D', strtotime($array[$aux][1])) != 'Sat') {
                    if ($table_color % 2 == 0) {
                        echo '<tr style="background-color:#eee">';
                        $table_color++;
                    } else {
                        echo '<tr style="background-color:#dedede">';
                        $table_color++;
                    }
                } else {
                    echo '<tr style="background-color:rgba(250,10,10,0.3)">';
                }
                echo '<td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=2&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . $nome_turno_funcionario[0] . '</b></a></td><td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=2&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>Inicio Almoço</b></a></td>';
                if ($tipo == 1) {
                    echo '<td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=2&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . date('d/m/Y', strtotime($array[$aux][1])) . '</b></a></td>';
                }
                echo '</tr>';
                $total_registros++;
            }
            if ($array[$aux][5] == 0 && ($hora > $hora_turno['fim_alm'] || strtotime($data) < strtotime($array[$aux][1])) && $turno->sem_hor_almoco != '1') {
                //tipo_3
                if (date('D', strtotime($array[$aux][1])) != 'Sun' && date('D', strtotime($array[$aux][1])) != 'Sat') {
                    if ($table_color % 2 == 0) {
                        echo '<tr style="background-color:#eee">';
                        $table_color++;
                    } else {
                        echo '<tr style="background-color:#dedede">';
                        $table_color++;
                    }
                } else {
                    echo '<tr style="background-color:rgba(250,10,10,0.3)">';
                }
                echo '<td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=3&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . $nome_turno_funcionario[0] . '</b></a></td><td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=3&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>Fim Almoço</b></a></td>';
                if ($tipo == 1) {
                    echo '<td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=3&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . date('d/m/Y', strtotime($array[$aux][1])) . '</b></a></td>';
                }
                echo '</tr>';
                $total_registros++;
            }
            if ($array[$aux][6] == 0 && ($hora > $hora_turno['fim_exp'] || strtotime($data) < strtotime($array[$aux][1]))) {
                //tipo_0
                if (date('D', strtotime($array[$aux][1])) != 'Sun' && date('D', strtotime($array[$aux][1])) != 'Sat') {
                    if ($table_color % 2 == 0) {
                        echo '<tr style="background-color:#eee">';
                        $table_color++;
                    } else {
                        echo '<tr style="background-color:#dedede">';
                        $table_color++;
                    }
                } else {
                    echo '<tr style="background-color:rgba(250,10,10,0.3)">';
                }
                echo '<td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=0&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . $nome_turno_funcionario[0] . '</b></a></td><td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=0&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>Fim expediente</b></a></td>';
                if ($tipo == 1) {
                    echo '<td class="rows-content"><a href="logado.php?desc=sem_registros&tipo=0&id_func=' . $array[$aux][2] . '&data=' . $array[$aux][1] . '"><b>' . date('d/m/Y', strtotime($array[$aux][1])) . '</b></a></td>';
                }
                echo '</tr>';
                $total_registros++;
            }
        }
        echo '</table>';
        echo '</div>';
        echo '</td></tr>';
        if ($total_registros > 0) {
            echo '<tr><td colspan="4" style="text-align: right; padding-top: 5px; color:#555; font-size: 12px;">';
            if ($tipo == 1) {
                echo '<div style="border-radius: 50%; border: 1px solid#555; float:left; height: 11px; width:11px; background-color:rgba(250,10,10,0.3)"></div><div style="float:left; margin-left: 5px;"> Sábados e domingos</div>';
            }
            echo 'Clique para corrigir </td></tr>';
            echo "<script>document.getElementById('content-right').style.display='block'</script>";
        } else {
            echo '<tr><td colspan="4" style="padding-top: 15px; color:#555; font-size: 12px;">Nenhum horário registrado!</td></tr>';
        }
        echo '<div class="cont" style="color:#f33;font-size:15px;  text-align:center"><b>' . $total_registros . '</b></div>';
        echo '</table>';
    }
    //fim if count($array) > 0
    echo '</div>
            </div>';
}
Example #14
0
}
?>
		</ul>
	</div>
	<div class="col-sm-10">
		<h1>Programa <?php 
echo $model->nombre;
?>
</h1>
		<?php 
foreach (Yii::app()->user->getFlashes() as $key => $message) {
    echo '<div class="flash-' . $key . ' alert alert-info">' . $message . "</div>\n";
}
?>
		<?php 
$this->widget('zii.widgets.CDetailView', array('data' => array('programa' => $model, 'contenido' => $contenido), 'attributes' => array(array('name' => 'programa.nombre', 'label' => 'Programa'), array('name' => 'programa.url.slug', 'label' => 'URL', 'type' => 'raw', 'value' => l($model->url->slug, bu($model->url->slug), array('target' => '_blank'))), array('name' => 'contenido.resena', 'label' => 'Reseña', 'type' => 'html'), array('name' => 'programa.pagina.meta_descripcion', 'label' => 'Meta descripción'), array('name' => 'contenido.horario', 'label' => 'Horario', 'type' => 'raw', 'value' => Horarios::horario_parser($contenido->horario)), array('name' => 'programa.background', 'label' => 'Imagen', 'type' => 'raw', 'value' => l($model->background, bu('images/' . $model->background), array('target' => '_blank', 'class' => 'fancybox'))), array('name' => 'programa.background_mobile', 'label' => 'Imagen (Móviles)', 'type' => 'raw', 'value' => l($model->background_mobile, bu('images/' . $model->background_mobile), array('target' => '_blank', 'class' => 'fancybox'))), array('name' => 'programa.miniatura', 'label' => 'Imagen miniatura', 'type' => 'raw', 'value' => l($model->miniatura, bu('images/' . $model->miniatura), array('target' => '_blank', 'class' => 'fancybox'))), 'programa.creado', 'programa.modificado', array('name' => 'contenido.estado', 'label' => 'Estado', 'value' => $contenido->estado == 2 ? 'En emisión' : ($contenido->estado == 1 ? 'No se emite' : 'Desactivado')), array('name' => 'programa.destacado', 'label' => 'Destacado', 'type' => 'boolean'))));
?>
	</div>
</div>
<div class="row">
	<div class="col-sm-12">
	<?php 
if (Yii::app()->user->checkAccess('ver_paginas')) {
    $tabs_content['paginas'] = array('title' => 'Páginas', 'view' => '/pagina/_paginas', 'data' => array('paginas' => $paginas, 'model' => $model));
}
if (Yii::app()->user->checkAccess('ver_menus') || Yii::app()->user->checkAccess('ver_menu_item')) {
    $tabs_content['menu'] = array('title' => 'Menú', 'view' => '/menu/_menu', 'data' => array('menu' => $menu, 'model' => $model));
}
if (Yii::app()->user->checkAccess('ver_album_fotos')) {
    $tabs_content['fotos'] = array('title' => 'Álbumes de fotos', 'view' => '/albumfoto/_foto', 'data' => array('fotos' => $fotos, 'model' => $model));
}
<?php

include './Datos/class.Horarios.php';
$clase = new Horarios(0, 0);
$nreg = $clase->Consultar_horario();
//echo "este es el numero de registros: ".$nreg;
if ($nreg == 0) {
    header("Location: ./nuevo_horario_home.php");
}
<?php

include '../Datos/class.Horarios.php';
if (isset($_GET['nom_horario'])) {
    $clase = new Horarios(0, $_GET['nom_horario']);
    $clase->Iniciar_horario();
}
header("Location: ../home.php");
Example #17
0
 public static function fecha_especial($fechas)
 {
     date_default_timezone_set('America/Bogota');
     setlocale(LC_ALL, 'es_ES.UTF-8');
     $datos = array();
     $html = '';
     foreach ($fechas as $fecha) {
         $datos[] = array('fecha' => $fecha->fecha, 'hora_inicio' => $fecha->hora_inicio, 'hora_fin' => $fecha->hora_fin);
     }
     $te = 0;
     $previous = null;
     $c = count($datos);
     foreach ($datos as $dato) {
         $dant = $previous;
         $f = strtotime($dato['fecha']);
         $da = date('z', $f);
         $fant = strtotime($dant['fecha']);
         if (is_null($previous)) {
             $flag = true;
             $dan = $da - 1;
         } else {
             $flag = false;
             $dan = date('z', $fant);
         }
         $dp = $da - 1;
         if ($c == 1) {
             $html .= ucfirst(strftime('%A', $f)) . ' ' . date('d', $f) . ' de ' . ucfirst(strftime('%B', $f));
             $html .= ' de ' . '<time>' . Horarios::hora($dato['hora_inicio']) . '</time>';
             $html .= ' a ' . '<time>' . Horarios::hora($dato['hora_fin']) . '</time>';
             break;
         }
         if ($flag) {
             $html .= ucfirst(strftime('%A', $f)) . ' ' . date('d', $f) . ' de ' . ucfirst(strftime('%B', $f));
             if ($f !== $fant) {
                 $html .= ' de ' . '<time>' . Horarios::hora($dato['hora_inicio']) . '</time>';
                 $html .= ' a ' . '<time>' . Horarios::hora($dato['hora_fin']) . '</time>';
             }
         }
         if ($dp != $dan) {
             if ($f !== $fant) {
                 $html .= " al ";
                 $html .= ucfirst(strftime('%A', $fant)) . ' ' . date('d', $fant) . ' de ' . ucfirst(strftime('%B', $fant));
                 $html .= ' de ' . '<time>' . Horarios::hora($dato['hora_inicio']) . '</time>';
                 $html .= ' a ' . '<time>' . Horarios::hora($dato['hora_fin']) . '</time>';
                 $html .= "<br/><br/>";
                 $html .= ucfirst(strftime('%A', $f)) . ' ' . date('d', $f) . ' de ' . ucfirst(strftime('%B', $f));
             }
         }
         if ($dato === end($datos)) {
             if ($f !== $fant) {
                 $html .= " al ";
                 $html .= ucfirst(strftime('%A', $f)) . ' ' . date('d', $f) . ' de ' . ucfirst(strftime('%B', $f));
                 $html .= ' de ' . '<time>' . Horarios::hora($dato['hora_inicio']) . '</time>';
                 $html .= ' a ' . '<time>' . Horarios::hora($dato['hora_fin']) . '</time>';
             } else {
                 $html .= " y ";
                 $html .= ' de ' . '<time>' . Horarios::hora($dato['hora_inicio']) . '</time>';
                 $html .= ' a ' . '<time>' . Horarios::hora($dato['hora_fin']) . '</time>';
             }
         }
         $previous = $dato;
     }
     //$html = substr($html, 0, -2);
     $html = ucfirst(strtolower($html));
     return $html;
 }
Example #18
0
 $funcAux = new Funcionario();
 $atrasado = false;
 // se esta ou não atrasado
 $adiantado = false;
 // se esta ou não adiantado
 $tipo;
 if ($func->verifica_func($cpf, $pass)) {
     // verificando se senha e usuario correspondem
     // echo "<script>alert('verificou');</script>";
     $funcAux = $func->get_func_cpf($cpf);
     $id = $funcAux->id;
     //verificar horarios
     $turno = new Turno();
     //instanciando um novo turno
     $turno = $turno->getTurnoById($funcAux->id_turno);
     $horarios = new Horarios();
     //date_default_timezone_set('America/Sao_Paulo');
     $hora = date("H:i:s");
     $data = date("Y-m-d");
     /* 
     1 = iniciou o expediente
     
     2 = saiu pro almoco
     3 = encerrou o almoco
     
     0 = encerrou o expediente
     */
     $msg = "";
     $email_send = new Email();
     $supervisor = new Funcionario();
     if ($funcAux->id_supervisor != 0) {
Example #19
0
 public function run($args)
 {
     $horarios = Horario::model()->with('pgPrograma')->findAll(array('order' => 'dia_semana ASC, hora_inicio ASC', 'condition' => 'pgPrograma.estado = 2'));
     foreach ($horarios as $horario) {
         $pagina = Pagina::model()->findByPk($horario->pgPrograma->pagina_id);
         $micrositio_id = $pagina->micrositio_id;
         $tipo_emision_id = $horario->tipo_emision_id;
         $dia_semana = $horario->dia_semana;
         $hora_inicio = $horario->hora_inicio;
         $hora_fin = $horario->hora_fin;
         $estado = 1;
         date_default_timezone_set('America/Bogota');
         setlocale(LC_ALL, 'es_ES.UTF-8');
         $sts = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
         // set current date
         // parse about any English textual datetime description into a Unix timestamp
         $ts = $sts;
         // calculate the number of days since Monday
         $dow = date('w', $ts);
         $offset = $dow - 1;
         if ($offset < 0) {
             $offset = 6;
         }
         // calculate timestamp for the Monday
         $ts = $ts - $offset * 86400;
         $semana = array();
         // loop from Monday till Sunday
         for ($i = 0; $i < 7; $i++, $ts += 86400) {
             $semana[] = $ts;
         }
         $hora_inicio = $semana[$dia_semana - 1] + Horarios::hora_a_timestamp($hora_inicio);
         $hora_fin = $semana[$dia_semana - 1] + Horarios::hora_a_timestamp($hora_fin);
         /* PILAS AQUÍ, FESTIVO /**/
         $tts = mktime(0, 0, 0, date('m', $hora_inicio), date('d', $hora_inicio), date('Y', $hora_inicio));
         if ($tts == mktime(0, 0, 0, 3, 23, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 4, 2, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 4, 3, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 5, 1, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 5, 18, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 6, 8, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 6, 15, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 6, 29, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 7, 20, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 8, 7, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 8, 17, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 10, 12, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 11, 2, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 11, 16, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 12, 8, date('Y'))) {
             continue;
         }
         if ($tts == mktime(0, 0, 0, 12, 25, date('Y'))) {
             continue;
         }
         $p = new Programacion();
         if (!$p->exists(array('condition' => 'hora_inicio=' . $hora_inicio . ' AND hora_fin=' . $hora_fin . ' AND estado=1'))) {
             $p->micrositio_id = $micrositio_id;
             $p->hora_inicio = $hora_inicio;
             $p->hora_fin = $hora_fin;
             $p->tipo_emision_id = $tipo_emision_id;
             $p->estado = $estado;
             $p->save();
             if ($p) {
                 echo '+ Guardado ' . $pagina->nombre . ' ' . $hora_inicio . '<br />' . "\r\n";
             }
         } else {
             echo '- Existía ' . $pagina->nombre . '<br />' . "\r\n";
         }
     }
     return 0;
 }
Example #20
0
<?php

$this->pageTitle = 'Modificar horario ' . Horarios::getDiaSemana($model->dia_semana) . ' ' . Horarios::hora($model->hora_inicio);
?>
<h1>Modificar horario <?php 
echo Horarios::getDiaSemana($model->dia_semana) . ' ' . Horarios::hora($model->hora_inicio) . ' a ' . Horarios::hora($model->hora_fin);
?>
</h1>

<?php 
echo $this->renderPartial('_form', array('model' => $model));
Example #21
0
            <input name="Horario[hora_inicio]" type="text" value="<?php 
echo $model->hora_inicio ? Horarios::hora($model->hora_inicio, true) : '';
?>
" class="hora_inicio form-control" />
        </div>
		<?php 
echo $form->error($model, 'hora_inicio');
?>
	</div>
	<div class="form-group">
		<?php 
echo $form->label($model, 'hora_fin', array('class' => 'col-sm-2 control-label'));
?>
		<div class="col-sm-2">
            <input name="Horario[hora_fin]" type="text" value="<?php 
echo $model->hora_fin ? Horarios::hora($model->hora_fin, true) : '';
?>
" class="hora_fin form-control" />
        </div>
		<?php 
echo $form->error($model, 'hora_fin');
?>
	</div>
	<div class="form-group">
        <?php 
echo $form->label($model, 'tipo_emision_id', array('class' => 'col-sm-2 control-label'));
?>
        <div class="col-sm-2">
            <?php 
echo $form->dropDownList($model, 'tipo_emision_id', CHtml::listData(TipoEmision::model()->findAll(), 'id', 'nombre'), array('class' => 'form-control'));
?>
<?php

include '../Datos/class.Horarios.php';
$clase = new Horarios($_POST['nom_horario'], 0);
$id = $clase->Consultar_id_horario();
/////
$clase = new Horarios(0, $id);
$id = $clase->Eliminar_horario();
Example #23
0
<?php

$this->pageDesc = $contenido['pagina']->meta_descripcion != '' ? $contenido['pagina']->meta_descripcion : $contenido['contenido']->resena;
if ($contenido['contenido']->estado == 2 && !empty($contenido['contenido']->horario)) {
    ?>
<p>
	<strong class="horario-emision">
		<?php 
    echo Horarios::horario_parser($contenido['contenido']->horario);
    ?>
	</strong>
</p>
<?php 
}
echo $contenido['contenido']->resena;