本文整理汇总了PHP中Agenda类的典型用法代码示例。如果您正苦于以下问题:PHP Agenda类的具体用法?PHP Agenda怎么用?PHP Agenda使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Agenda类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Class constructor
* Creates the page
*/
function __construct()
{
parent::__construct();
try {
TTransaction::open("sample");
$evento = new Agenda(R);
$evento->nome = "Curso Adianti framework";
$evento->lugar = "Progs Scholl alterado";
$evento->descricao = "Curso basico";
$evento->data_ev = date("Y-m-d");
$evento->hora_ev = date("h:m:");
$evento->store();
TTransaction::close();
} catch (Exception $e) {
echo $e->getMessage();
}
TPage::include_css('app/resources/styles.css');
$this->html = new THtmlRenderer('app/resources/wellcome.html');
// define replacements for the main section
$replace = array();
// replace the main section variables
$this->html->enableSection('main', $replace);
// add the template to the page
parent::add($this->html);
}
开发者ID:cbsistem,项目名称:Cursos,代码行数:29,代码来源:WellcomeView.class.php
示例2: actionCadastrar
public function actionCadastrar()
{
if ($this->request->isPostRequest) {
$cadastrarAgenda = new Agenda();
$cadastrarAgenda->agenda = $this->request->getPost('agenda');
$cadastrarAgenda->save();
}
}
开发者ID:jralison,项目名称:chrono,代码行数:8,代码来源:AgendaController.php
示例3: excluir
public function excluir()
{
$agenda = new Agenda();
$agenda->setCodigoAge(toNumero(GetVar('EventId')));
$agendaDAO = new AgendaDAO();
$return = $agendaDAO->excluir($agenda);
$result = $return ? 'Registro Excluido com sucesso.' : 'Erro ao Excluir Registro.';
echo json_encode(array("success" => is_string($return) ? false : $return, "msg" => is_string($return) ? $return : $result));
}
开发者ID:jhonleandres,项目名称:estagio,代码行数:9,代码来源:AgendaController.php
示例4: insert
public function insert($param)
{
switch ($_SERVER['REQUEST_METHOD']) {
case 'GET':
if (isset($_SESSION['user'])) {
$this->load->model("Activite");
$jour = substr($param, 0, 2);
$mois = substr($param, 2, 2);
$annee = substr($param, 4, 4);
$heureDebut = substr($param, 8, 2)[0] == '0' ? substr($param, 9, 1) . 'h' : substr($param, 8, 2) . 'h';
$heureFin = substr($param, 10, 2)[0] == '0' ? substr($param, 11, 1) . 'h' : substr($param, 10, 2) . 'h';
$activites = Activite::getAll();
$date = new \DateTime($annee . '-' . $mois . '-' . $jour);
setlocale(LC_TIME, 'fr_FR.utf8', 'fra');
$titre = ucfirst(strftime("%A", $date->getTimestamp())) . ' ' . $date->format('d') . ' ' . ucfirst(strftime("%B", $date->getTimestamp())) . ' - ' . $heureDebut . '-' . $heureFin;
$data['titre'] = $titre;
$data["hidden"] = $date->format('Y-m-d') . '|' . $heureDebut . ':' . $heureFin;
$data['activites'] = $activites;
$this->load->view("ajoutActiviteAgenda", $data);
} else {
$_SESSION['messagee'] = "Erreur, accès refusé";
header('Location: ' . BASEURL);
exit;
}
break;
case 'POST':
if (isset($_SESSION['user']) && isset($_POST['redondance']) && $_POST['redondance'] != null) {
$this->load->model("Agenda");
$dateHeure = preg_split('/[|]/', $_POST['dateDebut']);
$dateDebut = new \DateTime($dateHeure[0] . '00:00:01');
$redondance = $_POST['redondance'];
$dateFin = date_modify(new \DateTime($dateHeure[0] . '23:59:59'), "+ " . $redondance . ' week');
$hDebut = preg_split('/[:]/', $dateHeure[1])[0];
$heureMinuteSecondeDebut = preg_split('/h/', $hDebut);
$hFin = preg_split('/[:]/', $dateHeure[1])[1];
$heureMinuteSecondeFin = preg_split('/h/', $hFin);
$heureDebut = $heureMinuteSecondeDebut[1] != "" ? $heureMinuteSecondeDebut[0] . ':' . $heureMinuteSecondeDebut[1] . ':00' : $heureMinuteSecondeDebut[0] . ':00:00';
$heureFin = $heureMinuteSecondeFin[1] != "" ? $heureMinuteSecondeFin[0] . ':' . $heureMinuteSecondeFin[1] . ':00' : $heureMinuteSecondeFin[0] . ':00:00';
$idActivite = $_POST['activite'];
$jour = $dateDebut->format('N');
$ajoutActivite = new Agenda(null, $idActivite, $dateDebut->format("Y-m-d H:i:s"), $dateFin->format("Y-m-d H:i:s"), $jour, $heureDebut, $heureFin);
$ajoutActivite->create();
header('Location: ' . base_url() . '/index.php/agendaActivite/gestion');
exit;
}
break;
}
}
开发者ID:LaCongolexicomatisation,项目名称:CodeIgniter-3.0.3,代码行数:48,代码来源:agendaActivite.php
示例5: gestionAgendaActivite
public function gestionAgendaActivite()
{
$this->load->model("Activite");
$this->load->model("Agenda");
$data['listAgenda'] = Agenda::getAll();
$this->load->view("gestionAgendaActivite", $data);
}
开发者ID:LaCongolexicomatisation,项目名称:CodeIgniter-3.0.3,代码行数:7,代码来源:activites.php
示例6: emploiDuTemps
public function emploiDuTemps($id)
{
$this->load->helper("Date_helper");
$semaines = week2period(date("Y"), date("W"));
$this->load->model("Agenda");
$x = Agenda::getById($id);
$data['listAgenda'] = $x;
$tab = [];
foreach ($x as $y) {
$z = true;
$date = date('d-m-Y', strtotime($y->dateDebutActivite()));
$dateFin = date('d-m-Y', strtotime($y->dateFinActivite()));
while ($z == true) {
if ($date == $dateFin) {
$z = false;
}
$p = new \DateTime($date);
if ($p->format('N') == $y->jour()) {
$tab[] = str_replace('-', '', $date) . substr($y->horaireDebutActivite(), 0, 2) . substr($y->horaireFinActivite(), 0, 2);
}
//jddayofweek(gregoriantojd($mois,$jour,$annee));
$date = date('d-m-Y', strtotime($date . ' + 1 days'));
}
// $tab[]=$date;
// $date=date('d-m-Y', strtotime($date. ' + 1 days'));
// $tab[]=$date;
// $tab[]=$dateFin;
}
$data['semaines'] = $semaines;
$data['test'] = $tab;
$this->load->view("gestionInscription enfant", $data);
}
开发者ID:LaCongolexicomatisation,项目名称:CodeIgniter-3.0.3,代码行数:32,代码来源:enfantClient.php
示例7: show
/**
* Display a listing of the resource.
*
* @return Response
*/
public function show($id)
{
if (Payment::VeryPayment() == false) {
return View::make('clinic.payment.renews-payment');
}
$agenda = Agenda::where('doctor_id', $id)->first();
$CustomDay = CustomDay::where('agenda_id', $agenda->id)->get();
return View::make('clinic.doctors.customDay')->with('customddays', $CustomDay)->with('agendaID', $agenda->id);
}
开发者ID:jnicolasbc,项目名称:admin_swp_com,代码行数:14,代码来源:ClinicDoctorsCustomDaysController.php
示例8: getVeryAgenda
public static function getVeryAgenda($agenda_id)
{
$user = Sentry::getUser();
$doctor = Doctor::where('user_id', $user->id)->first();
$agenda = Agenda::find($agenda_id);
if ($agenda->doctor_id == $doctor->id) {
return true;
} else {
return false;
}
}
开发者ID:jnicolasbc,项目名称:admin_swp_com,代码行数:11,代码来源:Agenda.php
示例9: update
public function update($id)
{
$data = array("first_name" => Input::get("first_name"), "last_name" => Input::get("last_name"), "email" => Input::get("email"), "phone" => Input::get("phone"), "picture" => Input::file("picture"), "specialty_id" => Input::get("specialty_id"), "dating_duration" => Input::get("dating_duration"));
$rules = array("first_name" => 'required|min:1|max:255', "last_name" => 'required|min:1|max:100', "email" => 'required|min:1', "phone" => 'required|min:1|max:100', "specialty_id" => 'required|min:3|max:255', "dating_duration" => 'required|min:1|max:3', "picture" => 'mimes:jpeg,gif,png');
$messages = array('required' => 'El campo :attribute es obligatorio.', 'min' => 'El campo :attribute no puede tener menos de :min carácteres.', 'email' => 'El campo :attribute debe ser un email válido.', 'max' => 'El campo :attribute no puede tener más de :max carácteres.', 'numeric' => 'El campo :attribute debe contener solo numeros', 'mimes' => 'El formato de la imagen logo debe ser jpg, git, png');
$validation = Validator::make(Input::all(), $rules, $messages);
//si la validación falla redirigimos al formulario de registro con los errores
//y con los campos que nos habia llenado el usuario
if ($validation->fails()) {
return Redirect::to('/doctor/profile')->withErrors($validation)->withInput();
} else {
$doctor = Doctor::find($id);
$agenda = Agenda::where('doctor_id', $doctor->id)->first();
$agenda->dating_duration = Input::get("dating_duration");
$agenda->save();
$espes = explode(',', Input::get("specialty_id"));
$espeuok = '';
foreach ($espes as $espe) {
$very = Specialty::where('name_es', $espe)->first();
if ($very) {
$espeuok = $espeuok . ',' . $very->id;
}
}
$doctor->specialty_id = $espeuok;
$doctor->save();
$user = User::find($doctor->user_id);
$user->first_name = $data['first_name'];
$user->last_name = $data['last_name'];
$user->save();
$profile = Profile::where('user_id', $doctor->user_id)->first();
if (Input::file('picture') != NULL) {
//agrega imagen de logo
$file_logo = Input::file('picture');
$ext = Input::file('picture')->getClientOriginalExtension();
$nameIMG = date('YmdHis');
$logo = $nameIMG . '.' . $ext;
$logo = 'assets/doctor/images/profile_pic/profile_' . $logo;
$profile->picture = $logo;
}
$profile->phone = Input::get("phone");
$profile->save();
if ($profile) {
if (Input::file('picture') != NULL) {
$file_logo->move("assets/doctor/images/profile_pic/", $logo);
}
return Redirect::to('/doctor/profile')->withFlash_message("Guardado Exitosamente");
} else {
return Redirect::to('/doctor/profile')->withErrors("Error")->withInput();
}
}
}
开发者ID:jnicolasbc,项目名称:admin_swp_com,代码行数:51,代码来源:DoctorController.php
示例10: getConfigDay
public function getConfigDay()
{
if (Payment::VeryPayment() == false) {
return View::make('clinic.payment.renews-payment');
}
$doctor = Doctor::doctorLogin();
$agenda = Agenda::where('doctor_id', $doctor)->first()->id;
$configDay = Configday::where('agenda_id', $agenda)->get();
if ($configDay->isEmpty()) {
return View::make('clinic.doctor.config.ConfigDay')->with('agenda', $agenda);
} else {
return View::make('clinic.doctor.config.ConfigDay')->with('agenda', $agenda)->with('configDay', $configDay);
}
}
开发者ID:jnicolasbc,项目名称:admin_swp_com,代码行数:14,代码来源:PatientsController.php
示例11: mailCreation
function mailCreation($nom, $time, $idEvent)
{
include '../../../core/model/Mail.php';
$date = Agenda::timeToDate($time);
$nomSite = Config::getVal('nom');
$adresseSite = Config::getVal('adresse');
$expediteur = '"' . $nomSite . '"<robot@' . $adresseSite . '>';
$sujet = "Nouvel evenement sur " . $nomSite;
$arch = new Archiviste();
$user = new User();
$users = $arch->restituer($user);
foreach ($users as $user) {
$mail = $user->get('mail');
$notif = $user->get('notifEvent');
$login = $user->get('login');
if ($mail && $notif != 'n') {
$message = 'Bonjour ' . $login . ', <br />' . PHP_EOL . '<br />' . PHP_EOL . 'L\'évenement <b>' . $nom . '</b> a été ajouté sur le site ' . $nomSite . '. Il aura lieu le ' . $date . '<br />' . PHP_EOL . '<br />' . PHP_EOL . 'Pour y accéder, cliquez sur le lien suivant : <a href="http://' . $adresseSite . '/?mod=raidplanner&action=event&id=' . $idEvent . '">' . $nom . '</a><br />' . PHP_EOL . '<br />' . PHP_EOL . '<br />' . PHP_EOL . 'Si vous ne souhaitez plus recevoir ces notifications, consultez vos <a href="http://' . $adresseSite . '/?mod=raidplanner&action=options">options</a>.' . PHP_EOL . '<br />' . PHP_EOL . 'Ceci est un message automatique. Merci de ne pas y repondre. ';
Mail::envoyer($mail, $expediteur, $sujet, $message);
}
}
}
开发者ID:selenith,项目名称:plasmide,代码行数:21,代码来源:jQueryRaidplanner.php
示例12: agendas
public function agendas()
{
if (isset($_SESSION['user'])) {
if (Utilisateur::is_admin($_SESSION['user'])) {
$a = Agenda::get_all();
$users = array();
for ($i = 0; $i < count($a); $i++) {
$users[] = Utilisateur::get_by_id($a[$i]->idUtilisateur());
}
include 'views/adminAgenda.php';
} else {
$_SESSION['message']['type'] = 'error';
$_SESSION['message']['text'] = "Vous n'êtes pas administrateur";
include 'views/home.php';
}
} else {
$_SESSION['message']['type'] = 'error';
$_SESSION['message']['text'] = "You aren't connected";
include 'views/connexion.php';
}
}
开发者ID:x0nePeace,项目名称:aCalendar,代码行数:21,代码来源:admin.php
示例13: get_lang
// setting the name of the tool
$nameTools = get_lang('MyAgenda');
// the variables for the days and the months
// Defining the shorts for the days
$DaysShort = api_get_week_days_short();
// Defining the days of the week to allow translation of the days
$DaysLong = api_get_week_days_long();
// Defining the months of the year to allow translation of the months
$MonthsLong = api_get_months_long();
if (empty($_GET['id'])) {
api_not_allowed();
}
$id = explode('_', $_GET['id']);
$type = $id[0];
$id = $id[1];
$agenda = new Agenda();
$agenda->type = $type;
//course,admin or personal
if (isset($_GET['course_id'])) {
$course_info = api_get_course_info_by_id($_GET['course_id']);
if (!empty($course_info)) {
$agenda->set_course($course_info);
}
}
$event = $agenda->get_event($id);
if (!empty($event)) {
define('ICAL_LANG', api_get_language_isocode());
$ical = new vcalendar();
$ical->setConfig('unique_id', api_get_path(WEB_PATH));
$ical->setProperty('method', 'PUBLISH');
$ical->setConfig('url', api_get_path(WEB_PATH));
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:ical_export.php
示例14: date
include 'cabecera.php';
include 'clases/Consejero.class.php';
include 'clases/Agenda.class.php';
include 'menuIzquierda.php';
?>
<!-- info ================================================== -->
<div class="row">
<div class="page-header" style="text-align: center">
<h1>Postponer Sesión</h1>
</div>
<?php
$fecha = date('Y\\-m\\-d');
$agenda = new Agenda();
$sesiones = $agenda->buscarCreadasPendientes($_SESSION['usuario']);
if (count($sesiones) > 0) {
echo '<table class="table-condensed span7" style="margin: 0 10%">
<thead>
<tr>
<td><b>N°</b></td>
<td><b>Proximas sesiones:</b></td>
</tr>
</thead>
<tbody>';
for ($i = 0; $i < count($sesiones); $i++) {
$agenda->setId($sesiones[$i]['id_agenda']);
$resul = $agenda->obtenerDatos();
$consecutivo = $agenda->consecutivo($resul[0]['id_dependencia'], $resul[0]['id_tipo_consejo'], $resul[0]['fecha'], $resul[0]['anio'], $resul[0]['extraordinaria']);
echo '
开发者ID:rincedgar,项目名称:AgendaLuz,代码行数:30,代码来源:postponerSesion.php
示例15: WSEventsList
/**
* Get a list of events between two dates for the given username
* Function registered as service. Returns strings in UTF-8.
* @param string Username
* @param string User's API key (the user's API key)
* @param int Start date, in YYYYMMDD format
* @param int End date, in YYYYMMDD format
* @return array Events list
*/
function WSEventsList($username, $signature, $datestart = 0, $dateend = 0)
{
if (empty($username) or empty($signature)) {
return -1;
}
global $_configuration;
$info = api_get_user_info_from_username($username);
$user_id = $info['user_id'];
$list = UserManager::get_api_keys($user_id, 'dokeos');
$key = '';
foreach ($list as $key) {
break;
}
$local_key = $username . $key;
if (!api_is_valid_secret_key($signature, $local_key)) {
return -1;
// The secret key is incorrect.
}
$events_list = array();
$user_id = UserManager::get_user_id_from_username($username);
if ($user_id === false) {
return $events_list;
}
// Error in user id recovery.
$ds = substr($datestart, 0, 4) . '-' . substr($datestart, 4, 2) . '-' . substr($datestart, 6, 2) . ' 00:00:00';
$de = substr($dateend, 0, 4) . '-' . substr($dateend, 4, 2) . '-' . substr($dateend, 6, 2) . ' 00:00:00';
$events_list = Agenda::get_personal_agenda_items_between_dates($user_id, $ds, $de);
return $events_list;
}
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:38,代码来源:user_info.soap.php
示例16: filterByAgenda
/**
* Filter the query by a related Agenda object
*
* @param Agenda|PropelObjectCollection $agenda The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ProcedimientregrogramadoQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByAgenda($agenda, $comparison = null)
{
if ($agenda instanceof Agenda) {
return $this->addUsingAlias(ProcedimientregrogramadoPeer::AGENDA_ID, $agenda->getId(), $comparison);
} elseif ($agenda instanceof PropelObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this->addUsingAlias(ProcedimientregrogramadoPeer::AGENDA_ID, $agenda->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByAgenda() only accepts arguments of type Agenda or PropelCollection');
}
}
开发者ID:eddypre,项目名称:Quirofano,代码行数:22,代码来源:BaseProcedimientregrogramadoQuery.php
示例17: add_announcement
/**
* Adds an announcement to the database
* @param string Title of the announcement
* @param string Content of the announcement
* @param string Start date (YYYY-MM-DD HH:II: SS)
* @param string End date (YYYY-MM-DD HH:II: SS)
* @param int Whether the announcement should be visible to teachers (1) or not (0)
* @param int Whether the announcement should be visible to students (1) or not (0)
* @param int Whether the announcement should be visible to anonymous users (1) or not (0)
* @param string The language for which the announvement should be shown. Leave null for all langages
* @param int Whether to send an e-mail to all users (1) or not (0)
* @return mixed insert_id on success, false on failure
*/
public static function add_announcement($title, $content, $date_start, $date_end, $visible_teacher = 0, $visible_student = 0, $visible_guest = 0, $lang = null, $send_mail = 0, $add_to_calendar = false)
{
$original_content = $content;
$a_dateS = explode(' ', $date_start);
$a_arraySD = explode('-', $a_dateS[0]);
$a_arraySH = explode(':', $a_dateS[1]);
$date_start_to_compare = array_merge($a_arraySD, $a_arraySH);
$a_dateE = explode(' ', $date_end);
$a_arrayED = explode('-', $a_dateE[0]);
$a_arrayEH = explode(':', $a_dateE[1]);
$date_end_to_compare = array_merge($a_arrayED, $a_arrayEH);
$db_table = Database::get_main_table(TABLE_MAIN_SYSTEM_ANNOUNCEMENTS);
if (!checkdate($date_start_to_compare[1], $date_start_to_compare[2], $date_start_to_compare[0])) {
Display::display_normal_message(get_lang('InvalidStartDate'));
return false;
}
if (($date_end_to_compare[1] || $date_end_to_compare[2] || $date_end_to_compare[0]) && !checkdate($date_end_to_compare[1], $date_end_to_compare[2], $date_end_to_compare[0])) {
Display::display_normal_message(get_lang('InvalidEndDate'));
return false;
}
if (strlen(trim($title)) == 0) {
Display::display_normal_message(get_lang('InvalidTitle'));
return false;
}
$start = api_get_utc_datetime($date_start);
$end = api_get_utc_datetime($date_end);
$title = Database::escape_string($title);
$content = Database::escape_string($content);
//Fixing urls that are sent by email
$content = str_replace('src=\\"/home/', 'src=\\"' . api_get_path(WEB_PATH) . 'home/', $content);
$content = str_replace('file=/home/', 'file=' . api_get_path(WEB_PATH) . 'home/', $content);
$langsql = is_null($lang) ? 'NULL' : "'" . Database::escape_string($lang) . "'";
global $_configuration;
$current_access_url_id = 1;
if ($_configuration['multiple_access_urls']) {
$current_access_url_id = api_get_current_access_url_id();
}
$sql = "INSERT INTO " . $db_table . " (title,content,date_start,date_end,visible_teacher,visible_student,visible_guest, lang, access_url_id)\n\t\t\t\tVALUES ('" . $title . "','" . $content . "','" . $start . "','" . $end . "','" . $visible_teacher . "','" . $visible_student . "','" . $visible_guest . "'," . $langsql . ", " . $current_access_url_id . ")";
if ($send_mail == 1) {
SystemAnnouncementManager::send_system_announcement_by_email($title, $content, $visible_teacher, $visible_student, $lang);
}
$res = Database::query($sql);
if ($res === false) {
Debug::log_s(mysql_error());
return false;
}
if ($add_to_calendar) {
$agenda = new Agenda();
$agenda->setType('admin');
$agenda->add_event($date_start, $date_end, false, null, $title, $original_content);
}
return Database::insert_id();
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:66,代码来源:system_announcements.lib.php
示例18: importCalendarStatic
/**
* @param string $file
* @param bool $moveFile
*
* @return int
*/
private function importCalendarStatic($file, $moveFile = true)
{
$data = Import::csv_to_array($file);
if (!empty($data)) {
$this->logger->addInfo(count($data) . " records found.");
$eventsToCreate = array();
$errorFound = false;
foreach ($data as $row) {
$sessionId = null;
$externalSessionId = null;
if (isset($row['external_sessionID'])) {
$externalSessionId = $row['external_sessionID'];
$sessionId = SessionManager::get_session_id_from_original_id($externalSessionId, $this->extraFieldIdNameList['session']);
}
$courseCode = null;
if (isset($row['coursecode'])) {
$courseCode = $row['coursecode'];
}
$courseInfo = api_get_course_info($courseCode);
if (empty($courseInfo)) {
$this->logger->addInfo("Course '{$courseCode}' does not exists");
}
if (empty($sessionId)) {
$this->logger->addInfo("external_sessionID: " . $externalSessionId . " does not exists.");
}
$teacherId = null;
if (!empty($sessionId) && !empty($courseInfo)) {
$courseIncluded = SessionManager::relation_session_course_exist($sessionId, $courseInfo['code']);
if ($courseIncluded == false) {
$this->logger->addInfo("Course '{$courseCode}' is not included in session: {$sessionId}");
$errorFound = true;
} else {
$teachers = CourseManager::get_coach_list_from_course_code($courseInfo['code'], $sessionId);
// Getting first teacher.
if (!empty($teachers)) {
$teacher = current($teachers);
$teacherId = $teacher['user_id'];
} else {
$sessionInfo = api_get_session_info($sessionId);
$teacherId = $sessionInfo['id_coach'];
}
}
} else {
$errorFound = true;
}
if (empty($teacherId)) {
$errorFound = true;
$this->logger->addInfo("No teacher found in course code : '{$courseCode}' and session: '{$sessionId}'");
}
$date = $row['date'];
$startTime = $row['time_start'];
$endTime = $row['time_end'];
$title = $row['title'];
$comment = $row['comment'];
$color = isset($row['color']) ? $row['color'] : '';
$startDateYear = substr($date, 0, 4);
$startDateMonth = substr($date, 4, 2);
$startDateDay = substr($date, 6, 8);
$startDate = $startDateYear . '-' . $startDateMonth . '-' . $startDateDay . ' ' . $startTime . ":00";
$endDate = $startDateYear . '-' . $startDateMonth . '-' . $startDateDay . ' ' . $endTime . ":00";
if (!api_is_valid_date($startDate) || !api_is_valid_date($endDate)) {
$this->logger->addInfo("Verify your dates: '{$startDate}' : '{$endDate}' ");
$errorFound = true;
}
// If old events do nothing.
/*if (api_strtotime($startDate) < time()) {
continue;
}*/
if ($errorFound == false) {
$eventsToCreate[] = array('start' => $startDate, 'end' => $endDate, 'title' => $title, 'sender_id' => $teacherId, 'course_id' => $courseInfo['real_id'], 'session_id' => $sessionId, 'comment' => $comment, 'color' => $color, $this->extraFieldIdNameList['calendar_event'] => $row['external_calendar_itemID']);
}
}
if (empty($eventsToCreate)) {
$this->logger->addInfo("No events to add");
return 0;
}
$this->logger->addInfo("Ready to insert events");
$agenda = new Agenda();
$extraFieldValue = new ExtraFieldValue('calendar_event');
$extraFieldName = $this->extraFieldIdNameList['calendar_event'];
$externalEventId = null;
$extraField = new ExtraField('calendar_event');
$extraFieldInfo = $extraField->get_handler_field_info_by_field_variable($extraFieldName);
if (empty($extraFieldInfo)) {
$this->logger->addInfo("No calendar event extra field created: {$extraFieldName}");
return 0;
}
foreach ($eventsToCreate as $event) {
$update = false;
$item = null;
if (!isset($event[$extraFieldName])) {
$this->logger->addInfo("No external_calendar_itemID found. Skipping ...");
continue;
} else {
//.........这里部分代码省略.........
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:101,代码来源:import_csv.php
示例19: calcTotalSalary
private function calcTotalSalary()
{
$salaryPeriod = Agenda::getSalary($this->terms['date']);
$sum = $salaryPeriod['sum'];
$this->totalSalary = $this->totalMinutes / 60 * $sum;
}
开发者ID:cobicarmel,项目名称:agenda,代码行数:6,代码来源:class.agenda.php
示例20: prune
/**
* Exclude object from result
*
* @param Agenda $agenda Object to remove from the list of results
*
* @return AgendaQuery The current query, for fluid interface
*/
public function prune($agenda = null)
{
if ($agenda) {
$this->addUsingAlias(AgendaPeer::ID, $agenda->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
开发者ID:eddypre,项目名称:Quirofano,代码行数:14,代码来源:BaseAgendaQuery.php
注:本文中的Agenda类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论