本文整理汇总了PHP中AMA_DataHandler::ts_to_date方法的典型用法代码示例。如果您正苦于以下问题:PHP AMA_DataHandler::ts_to_date方法的具体用法?PHP AMA_DataHandler::ts_to_date怎么用?PHP AMA_DataHandler::ts_to_date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AMA_DataHandler
的用法示例。
在下文中一共展示了AMA_DataHandler::ts_to_date方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
* Users (types) allowed to access this module.
*/
$allowedUsersAr = array(AMA_TYPE_TUTOR);
/**
* Get needed objects
*/
$neededObjAr = array(AMA_TYPE_TUTOR => array('layout', 'course', 'course_instance'));
require_once ROOT_DIR . '/include/module_init.inc.php';
$self = 'default';
include_once 'include/tutor_functions.inc.php';
include_once 'include/tutor.inc.php';
/*
* YOUR CODE HERE
*/
$id_course = $courseInstanceObj->id_corso;
$start_date = AMA_DataHandler::ts_to_date($courseInstanceObj->data_inizio, "%d/%m/%Y");
$history = '';
if ($id_course) {
// get object course
$courseObj = read_course_from_DB($id_course);
if (is_object($courseObj) && !AMA_dataHandler::isError($courseObj)) {
$course_title = $courseObj->titolo;
//title
$id_toc = $courseObj->id_nodo_toc;
//id_toc_node
} else {
$errObj = new ADA_error(translateFN("Corso non trovato"), translateFN("Impossibile proseguire."));
}
}
$studentObj = read_user_from_DB($id_student);
if (is_object($studentObj) && !AMA_dataHandler::isError($studentObj)) {
示例2: fwrite
// check that txn_id has not been previously processed
// check that receiver_email is your Primary PayPal email
// check that payment_amount/payment_currency are correct
// process payment
// $first_name = $keyarray['first_name'];
// $last_name = $keyarray['last_name'];
$item_name = $keyarray['item_name'];
$payment_amount = $keyarray['mc_gross'];
$payment_currency = $keyarray['mc_currency'];
$item_number = $keyarray['item_number'];
$txn_id = $keyarray['txn_id'];
$receiver_email = $keyarray['business'];
$payer_email = $keyarray['payer_email'];
$payment_status = $keyarray['payment_status'];
if ($receiver_email == $paypal_email_address && $payment_amount == $product_price && $payment_currency == $price_currency && $payment_status == 'Completed') {
$date = AMA_DataHandler::ts_to_date(time(), "%d/%m/%Y - %H:%M:%S");
$ipn_log .= "Paypal PDT DATA OK\n";
if ($debug == 1) {
fwrite($fpx, "Paypal PDT DATA OK - {$date}\n");
}
$first_name = $userObj->getFirstName();
$last_name = $userObj->getLastName();
// $body = translateFN("Hai effettuato il pagamento di") . " ". $payment_amount ." EUR ". translateFN('tramite Paypal' . "\n\r").
// $body .= translateFN('Questo addebito verrà visualizzato sull\'estratto conto della carta di credito o prepagata come pagamento a PAYPAL *Lynx s.r.l.');
$message_ha["testo"] = translateFN('Gentile') . " " . $first_name . ",\r\n" . translateFN("grazie per aver eseguito l'iscrizione al") . " " . $course_name . "\n\r\n\r";
// $message_ha["testo"] .= $body_mail;
//$message_ha["testo"] .= "\n\r\n\r". translateFN("I tuoi dati di accesso sono. username: ") . $username . "\n\r" . translateFN("password:" . " " . $password );
//$message_ha["testo"] .= "\n\r". translateFN("Buono studio.");
$message = nl2br($message_ha["testo"]);
$message .= "<br />" . translateFN('Ti abbiamo inviato una mail di conferma dell\'iscrizione. Cliccando sul link inserito nella mail potrai accedere al corso');
$message .= "<br />--------<br />" . translateFN('Dettagli di pagamento.');
示例3: get_student_dataFN
function get_student_dataFN($id_student, $id_instance)
{
$dh = $GLOBALS['dh'];
$http_root_dir = $GLOBALS['http_root_dir'];
$student_info_ha = $dh->_get_user_info($id_student);
// Get info of each student
if (AMA_DataHandler::isError($student_info_ha)) {
$msg = $student_info_ha->getMessage();
return $msg;
break;
}
$instance_course_ha = $dh->course_instance_get($id_instance);
// Get the instance courses data
if (AMA_DataHandler::isError($instance_course_ha)) {
$msg = $instance_course_ha->getMessage();
return $msg;
break;
}
$id_course = $instance_course_ha['id_corso'];
$start_date = AMA_DataHandler::ts_to_date($instance_course_ha['data_inizio'], ADA_DATE_FORMAT);
$info_course = $dh->get_course($id_course);
// Get title course
if (AMA_DataHandler::isError($info_course)) {
$msg = $info_course->getMessage();
return $msg;
break;
}
$course_title = $info_course['titolo'];
/*
global $debug;$debug=1;
mydebug(__LINE__,__FILE__,$student_info_ha);
$debug = 0;
*/
$name = $student_info_ha['nome'];
$name_desc = "<B>" . translateFN("Nome") . "</B>";
$surname = $student_info_ha['cognome'];
$surname_desc = "<B>" . translateFN("Cognome") . "</B>";
$email = $student_info_ha['email'];
$email_desc = "<B>" . translateFN("Email") . "</B>";
$phone_n = $student_info_ha['telefono'];
$phone_desc = "<B>" . translateFN("Telefono") . "</B>";
$user = $student_info_ha['username'];
$user_desc = "<B>" . translateFN("User Name") . "</B>";
$course_desc = "<B>" . translateFN("Titolo del Corso") . "</B>";
$start_desc = "<B>" . translateFN("Data di inizio") . "</B>";
$dati_stude[0]['name_desc'] = $name_desc;
$dati_stude[0]['name'] = $name;
$dati_stude[1]['surname_desc'] = $surname_desc;
$dati_stude[1]['surname'] = $surname;
$dati_stude[2]['email_desc'] = $email_desc;
$dati_stude[2]['email'] = $email;
$dati_stude[3]['phone_desc'] = $phone_desc;
$dati_stude[3]['phone'] = $phone_n;
$dati_stude[4]['user_desc'] = $user_desc;
$dati_stude[4]['user'] = $user;
$dati_stude[5]['course_desc'] = $course_desc;
$dati_stude[5]['course'] = $course_title;
$dati_stude[6]['start_desc'] = $start_desc;
$dati_stude[6]['start'] = $start_date;
$tObj = new Table();
// $tObj->initTable('0','center','0','1','100%','black','white','black','white');
$tObj->initTable('1', 'center', '0', '1', '', '', '', '', '', '1');
// Syntax: $border,$align,$cellspacing,$cellpadding,$width,$col1, $bcol1,$col2, $bcol2
$caption = translateFN("Studente selezionato: <B>") . $id_student . "</B> ";
// $summary = translateFN("Elenco dei corsi monitorati");
$summary = "";
// $tObj->setTable($dati_stude,$caption,$summary);
$tObj->setTable($dati_stude, $caption, $summary);
$student_info = $tObj->getTable();
return $student_info;
}
示例4: today_dateFN
$event_time = $ora_evento;
}
if (!isset($data_evento)) {
$event_date = today_dateFN();
} else {
$event_date = $data_evento;
}
/*
$event_time = today_timeFN();
$event_date = today_dateFN();
*/
$ada_address_book = EventsAddressBook::create($userObj);
$tester_TimeZone = MultiPort::getTesterTimeZone($sess_selected_tester);
$time = time() + get_timezone_offset($tester_TimeZone, SERVER_TIMEZONE);
/*
* Last access link
*/
if (isset($_SESSION['sess_id_course_instance'])) {
$last_access = $userObj->get_last_accessFN($_SESSION['sess_id_course_instance'], "UT", null);
$last_access = AMA_DataHandler::ts_to_date($last_access);
} else {
$last_access = $userObj->get_last_accessFN(null, "UT", null);
$last_access = AMA_DataHandler::ts_to_date($last_access);
}
if ($last_access == '' || is_null($last_access)) {
$last_access = '-';
}
$content_dataAr = array('user_name' => $user_name, 'user_type' => $user_type, 'user_level' => $user_level, 'titolo' => $titolo, 'testo' => isset($testo) ? trim($testo) : '', 'destinatari' => isset($destinatari) ? trim($destinatari) : '', 'course_title' => '<a href="../browsing/main_index.php">' . $course_title . '</a>', 'status' => $err_msg, 'timezone' => $tester_TimeZone, 'event_time' => $event_time, 'event_date' => $event_date, 'last_visit' => $last_access, 'rubrica' => $ada_address_book->getHtml(), 'status' => $err_msg);
$options_Ar = array('onload_func' => "load_addressbook();updateClock({$time});");
//$options_Ar .= array('onload_func' => "updateClock($time);");
ARE::render($layout_dataAr, $content_dataAr, NULL, $options_Ar);
示例5: get_class_reportFN
function get_class_reportFN($id_course, $order = "", $index_att = "", $type = 'HTML')
{
$dh = $GLOBALS['dh'];
$http_root_dir = $GLOBALS['http_root_dir'];
$debug = isset($GLOBALS['debug']) ? $GLOBALS['debug'] : null;
$npar = isset($GLOBALS['npar']) ? $GLOBALS['npar'] : null;
$hpar = isset($GLOBALS['hpar']) ? $GLOBALS['hpar'] : null;
$mpar = isset($GLOBALS['mpar']) ? $GLOBALS['mpar'] : null;
$epar = isset($GLOBALS['epar']) ? $GLOBALS['epar'] : null;
$bpar = isset($GLOBALS['mpar']) ? $GLOBALS['mpar'] : null;
$cpar = isset($GLOBALS['epar']) ? $GLOBALS['epar'] : null;
// default parameters for activity index are in configuration file
if (empty($npar)) {
$npar = NOTE_PAR;
}
// notes
if (!isset($hpar)) {
$hpar = HIST_PAR;
}
// history
if (!isset($mpar)) {
$mpar = MSG_PAR;
}
//messages
if (!isset($epar)) {
$epar = EXE_PAR;
}
// exercises
if (!isset($bpar)) {
$bpar = defined('BKM_PAR') ? BKM_PAR : null;
}
//bookmarks
if (!isset($cpar)) {
$cpar = defined('CHA_PAR') ? CHA_PAR : null;
}
// chat
$student_list_ar = $this->student_list;
$id_instance = $this->id;
if ($student_list_ar != 0) {
$info_course = $dh->get_course($id_course);
// Get title course
if (AMA_DataHandler::isError($info_course)) {
$msg = $info_course->getMessage();
return $msg;
}
$course_title = $info_course['titolo'];
$instance_course_ha = $dh->course_instance_get($id_instance);
// Get the instance courses data
if (AMA_DataHandler::isError($instance_course_ha)) {
$msg = $instance_course_ha->getMessage();
return $msg;
}
$start_date = AMA_DataHandler::ts_to_date($instance_course_ha['data_inizio'], ADA_DATE_FORMAT);
$num_student = -1;
$tot_history_count = 0;
$tot_exercises_score = 0;
$tot_exercises_number = 0;
$tot_added_notes = 0;
$tot_read_notes = 0;
$tot_message_count = 0;
$tot_message_count_in = 0;
$tot_message_count_out = 0;
$tot_bookmarks_count = 0;
$tot_chatlines_count_out = 0;
$tot_index = 0;
$tot_level = 0;
/**
* @author giorgio 27/ott/2014
*
* change to:
* $report_generation_TS = time();
*
* to have full date & time generation of report
* but be warned that table log_classi may grow A LOT!
*/
$report_generation_TS = dt2tsFN(today_dateFN());
if (MODULES_TEST) {
$tot_exercises_score_test = 0;
$tot_exercises_number_test = 0;
$tot_exercises_score_survey = 0;
$tot_exercises_number_survey = 0;
$test_db = AMATestDataHandler::instance(MultiPort::getDSN($_SESSION['sess_selected_tester']));
$test_score = $test_db->getStudentsScores($id_course, $id_instance);
}
foreach ($student_list_ar as $one_student) {
$num_student++;
//starts with 0
$id_student = $one_student['id_utente_studente'];
$student_level = $one_student['livello'];
$status_student = $one_student['status'];
$dati['id'] = $id_student;
$dati['level'] = $student_level;
$ymdhms = today_dateFN();
$utime = dt2tsFN($ymdhms);
$dati['date'] = $report_generation_TS;
if (!empty($id_student) and ($status_student == ADA_STATUS_SUBSCRIBED or $status_student == ADA_SERVICE_SUBSCRIPTION_STATUS_COMPLETED)) {
$studentObj = MultiPort::findUser($id_student);
//new Student($id_student,$id_instance);
if ($studentObj->full != 0) {
//==0) {
//.........这里部分代码省略.........
示例6: ADA_Error
/*
* Find the appointment
*/
$msg_ha = MultiPort::getUserAppointment($userObj, $msg_id);
if (AMA_DataHandler::isError($msg_ha)) {
$errObj = new ADA_Error($msg_ha, translateFN('Errore durante la lettura di un evento'), NULL, NULL, NULL, 'comunica/list_events.php?status=' . urlencode(translateFN('Errore durante la lettura')));
}
/**
* Conversione Time Zone
*/
$tester_TimeZone = MultiPort::getTesterTimeZone($tester);
$offset = get_timezone_offset($tester_TimeZone, SERVER_TIMEZONE);
$date_time = $msg_ha['data_ora'];
$date_time_zone = $date_time + $offset;
$zone = translateFN("Time zone:") . " " . $tester_TimeZone;
$Data_messaggio = AMA_DataHandler::ts_to_date($date_time_zone, "%d/%m/%Y - %H:%M:%S") . " " . $zone;
//$Data_messaggio = AMA_DataHandler::ts_to_date($msg_ha['data_ora'], "%d/%m/%Y - %H:%M:%S");
/*
* Check if the subject has an internal identifier and remove it
*/
$oggetto = ADAEventProposal::removeEventToken($msg_ha['titolo']);
$mittente = $msg_ha['mittente'];
$destinatario = str_replace(",", ", ", $msg_ha['destinatari']);
// $destinatario = $msg_ha['destinatari'];
$dest_encode = urlencode($mittente);
if (isset($message_text) && strlen($message_text) > 0) {
$testo = urlencode(trim($message_text));
} else {
$message_text = '';
$testo = '';
}
示例7: translateFN
}
} else {
$tutorFullName = translateFN('Nessun tutor');
}
$edit_link = BaseHtmlLib::link("edit_instance.php?id_course={$courseId}&id_course_instance={$instanceId}", $edit_img->getHtml());
// $view_link = BaseHtmlLib::link("view_instance.php?id=$instanceId", $view_img->getHtml());
$delete_link = BaseHtmlLib::link("delete_instance.php?id_course={$courseId}&id_course_instance={$instanceId}", translateFN('Delete instance'));
$actions = BaseHtmlLib::plainListElement('class:inline_menu', array($edit_link, $delete_link));
if ($instance[1] > 0) {
$start_date = AMA_DataHandler::ts_to_date($instance[1]);
} else {
$start_date = translateFN('Non iniziato');
}
$duration = sprintf("%d giorni", $instance[3]);
$scheduled = AMA_DataHandler::ts_to_date($instance[2]);
$end_date = AMA_DataHandler::ts_to_date($instance[4]);
$title = $instance[5];
$assign_tutor_link = BaseHtmlLib::link("assign_tutor.php?id_course={$courseId}&id_course_instance={$instanceId}", $tutorFullName);
$subscriptions_link = BaseHtmlLib::link("course_instance.php?id_course={$courseId}&id_course_instance={$instanceId}", translateFN('Lista studenti'));
$tbody_data[] = array($instanceId, $title, $scheduled, $duration, $start_date, $end_date, $assign_tutor_link, $subscriptions_link, $actions);
}
$data = BaseHtmlLib::tableElement('', $thead_data, $tbody_data);
} else {
$data = new CText(translateFN('Non sono state trovate istanze per il corso selezionato'));
}
} else {
$data = new CText(translateFN('Non sono state trovate istanze per il corso selezionato'));
}
$label = translateFN('Lista istanze del corso') . ' ' . $course_title;
$help = translateFN('Da qui il provider admin può vedere la lista delle istanze del corso selezionato');
$content_dataAr = array('user_name' => $user_name, 'user_type' => $user_type, 'status' => $status, 'label' => $label, 'help' => $help, 'edit_profile' => $userObj->getEditProfilePage(), 'data' => $data->getHtml(), 'module' => isset($module) ? $module : '', 'messages' => $user_messages->getHtml());
示例8: time
'Classe' => 'Classe',
'Pubblica'=>'Pubblica');
// $options_of_chat_types = array('Privata' => 'Privata');
}
*
*/
//get time and date and transform it to sting format
/*
* @todo: inserire controllo timezone
*/
$actual_date = time();
$actual_start_time = AMA_DataHandler::ts_to_date($actual_date, "%H:%M:%S");
$actual_start_day = AMA_DataHandler::ts_to_date($actual_date, "%d/%m/%y");
$default_end_date = time() + SHUTDOWN_CHAT_TIME;
$default_end_time = AMA_DataHandler::ts_to_date($default_end_date, "%H:%M:%S");
$default_end_day = AMA_DataHandler::ts_to_date($default_end_date, "%d/%m/%y");
// default max users numebr
$default_max_users = DEFAULT_MAX_USERS;
// default course instance value
if (!empty($sess_id_course_instance)) {
$id_course_instance = $sess_id_course_instance;
} else {
$id_course_instance = 0;
}
// array with data to build the form
$form_data = array(array('label' => 'Titolo *', 'type' => 'text', 'name' => 'chat_title', 'size' => '85', 'maxlenght' => '120'), array('label' => 'Argomento *', 'type' => 'text', 'name' => 'chat_topic', 'size' => '85', 'maxlength' => '120'), array('label' => 'Messaggio di benvenuto', 'type' => 'textarea', 'rows' => '1', 'cols' => '63', 'wrap' => 'physical', 'name' => 'welcome_msg'), array('label' => 'Proprietario *', 'type' => 'text', 'name' => 'chat_owner', 'value' => $user_uname, 'size' => '20', 'maxlength' => '20'), array('label' => 'Tipo *', 'type' => 'select', 'name' => 'chat_type', 'value' => $options_of_chat_types), array('label' => 'Numero utenti', 'type' => 'text', 'name' => 'max_users', 'size' => '3', 'maxlength' => '3', 'value' => $default_max_users), array('label' => 'Giorno di apertura<br>(gg/mm/aa)', 'type' => 'text', 'name' => 'start_day', 'size' => '8', 'maxlength' => '8', 'value' => $actual_start_day), array('label' => 'Ora di avvio<br>(oo:mm:ss)', 'type' => 'text', 'name' => 'start_time', 'size' => '8', 'maxlength' => '8', 'value' => $actual_start_time), array('label' => 'Giorno di chiusura<br>(gg/mm/aa)', 'type' => 'text', 'name' => 'end_day', 'size' => '8', 'maxlength' => '8', 'value' => $default_end_day), array('label' => 'Ora di termine<br>(oo:mm:ss)', 'type' => 'text', 'name' => 'end_time', 'size' => '8', 'maxlength' => '8', 'value' => $default_end_time), array('label' => 'Classe ID', 'type' => 'text', 'value' => $id_course_instance, 'name' => 'id_course_instance', 'size' => '11', 'maxlength' => '11'), array('label' => '', 'type' => 'submit', 'name' => 'invia', 'value' => 'Invia'), array('type' => 'reset', 'name' => 'reset', 'value' => 'Reset'));
//vito 14 gennaio 2009, eliminato ../comunica/
$f->initForm("create_chat.php", "POST", "", "create_chat_form");
$f->setForm($form_data);
$form = $f->getForm();
// ******************************************************
示例9: _get_last_accessFN
/**
*
* @param $id_course_instance
* @return array
*/
private function _get_last_accessFN($id_course_instance = "", $provider_dh, $return_dateonly = true)
{
// if used by student before entering a course, we must pass the DataHandler
if ($provider_dh == NULL) {
$provider_dh = $GLOBALS['dh'];
}
//$error = $GLOBALS['error'];
// $debug = $GLOBALS['debug'];
$sess_id_user = $_SESSION['sess_id_user'];
if (!isset($this->id_user)) {
$id_user = $sess_id_user;
} else {
$id_user = $this->id_user;
}
if ($id_course_instance) {
$last_visited_node = $provider_dh->get_last_visited_nodes($id_user, $id_course_instance, 10);
/*
* vito, 10 ottobre 2008: $last_visited_node è Array([0]=>Array([id_nodo], ...))
*/
if (!AMA_DB::isError($last_visited_node) && is_array($last_visited_node) && isset($last_visited_node[0])) {
$last_visited_time = $return_dateonly ? AMA_DataHandler::ts_to_date($last_visited_node[0]['data_uscita']) : $last_visited_node[0]['data_uscita'];
return array($last_visited_node[0]['id_nodo'], $last_visited_time);
} else {
return "-";
}
} else {
/*
* Sara, 2/07/2014
* return the last access between all instances course
*/
$serviceProviders = $this->getTesters();
if (!empty($serviceProviders) && is_array($serviceProviders)) {
$i = 0;
foreach ($serviceProviders as $Provider) {
$provider_dh = AMA_DataHandler::instance(MultiPort::getDSN($Provider));
$courseInstances_provider = $provider_dh->get_course_instances_for_this_student($this->getId());
if (AMA_DataHandler::isError($courseInstances_provider)) {
$courseInstances_provider = new ADA_Error($courseInstances_provider);
} else {
$istance_testerAr[$i] = array('istances' => $courseInstances_provider, 'provider' => $Provider);
}
$i++;
}
}
if (!empty($istance_testerAr)) {
$Max = 0;
$id_nodo = null;
foreach ($istance_testerAr as $istanceTs) {
$courseInstancesAr = $istanceTs['istances'];
$pointer = $istanceTs['provider'];
$tester = AMA_DataHandler::instance(MultiPort::getDSN($pointer));
foreach ($courseInstancesAr as $courseInstance) {
$id_instance = $courseInstance['id_istanza_corso'];
$last_access = $tester->get_last_visited_nodes($id_user, $id_instance, 10);
if (!AMA_DB::isError($last_access) && is_array($last_access) && count($last_access)) {
$last_accessAr = array($last_access[0]['id_nodo'], $last_access[0]['data_uscita']);
if ($last_accessAr[1] > $Max) {
$id_nodo = $last_accessAr[0];
$Max = $last_accessAr[1];
}
}
}
}
$Last_accessAr = array(0 => $id_nodo, 1 => $Max);
return $Last_accessAr;
} else {
return "-";
}
}
}
示例10: header
}
header("Location: list_messages.php?status={$status}");
exit;
}
// get message content
//$msg_ha = $mh->get_message($sess_id_user, $msg_id);
$msg_ha = MultiPort::getUserMessage($userObj, $msg_id);
if (AMA_DataHandler::isError($msg_ha)) {
$errObj = new ADA_Error($msg_ha, translateFN('Errore in lettura messaggio'), NULL, NULL, NULL, 'comunica/list_messages.php?status=' . urlencode(translateFN('Errore in lettura messaggio')));
}
$mittente = $msg_ha['mittente'];
/*
* usare $msg_ha['id_mittente'] e $sess_id_user per ottenere corso e istanza corso comuni.
* cosa fare se entrambe gli utenti sono iscritti a due classi?
*/
$Data_messaggio = AMA_DataHandler::ts_to_date($msg_ha['data_ora'], "%d/%m/%Y - %H:%M:%S");
$oggetto = $msg_ha['titolo'];
$destinatario = str_replace(",", ", ", $msg_ha['destinatari']);
$message_text = $msg_ha['testo'];
$node_title = "";
// empty
$dest_encode = urlencode($mittente);
$testo = urlencode(trim($message_text));
$oggetto_url = urlencode(trim($oggetto));
// Registrazione variabili per replay
$destinatari_replay = $mittente;
//
$_SESSION['destinatari_replay'] = $destinatari_replay;
$testo_replay = trim($message_text);
$_SESSION['testo_replay'] = $testo_replay;
$titolo_replay = trim($oggetto);
示例11: translateFN
case CLASS_CHAT:
$old_chat_type = translateFN("classe");
break;
case INVITATION_CHAT:
$old_chat_type = translateFN("privata");
break;
default:
}
// switch
$chat_room_HA['actual_chat_type'] = $old_chat_type;
//get time and date and transform it to sting format
//ts2dFN()
$old_start_time = AMA_DataHandler::ts_to_date($chatroom_old_ha['tempo_avvio'], "%H:%M:%S");
$old_start_day = AMA_DataHandler::ts_to_date($chatroom_old_ha['tempo_avvio']);
$old_end_time = AMA_DataHandler::ts_to_date($chatroom_old_ha['tempo_fine'], "%H:%M:%S");
$old_end_day = AMA_DataHandler::ts_to_date($chatroom_old_ha['tempo_fine']);
// different chat type options are available for admins and for tutors
// admin case
$chat_room_HA['start_day'] = $old_start_day;
$chat_room_HA['start_time'] = $old_start_time;
$chat_room_HA['end_day'] = $old_end_day;
$chat_room_HA['end_time'] = $old_end_time;
if ($id_profile == AMA_TYPE_SWITCHER) {
$options_of_chat_types = array('-- select --' => '-- select --', 'Privata' => 'Privata', 'Classe' => 'Classe', 'Pubblica' => 'Pubblica');
}
// tutor case
if ($id_profile == AMA_TYPE_TUTOR) {
$options_of_chat_types = array('-- select --' => '-- select --', 'Classe' => 'Classe');
}
$chat_room_HA['new_chat_type'] = $options_of_chat_types;
$chat_room_HA['chat_title'] = $chatroom_old_ha['titolo_chat'];
示例12: display_messages_as_form
private static function display_messages_as_form($data_Ar = array(), $message_type = ADA_MSG_SIMPLE, $testers_dataAr = array())
{
$common_dh = $GLOBALS['common_dh'];
$javascript_ok = check_javascriptFN($_SERVER['HTTP_USER_AGENT']);
$appointments_Ar = array();
if ($message_type == ADA_MSG_SIMPLE) {
$list_module = 'list_messages.php';
$read_module = 'read_message.php';
$del_img = CDOMElement::create('img', 'src:img/delete.png, name:del_icon');
$del_img->setAttribute('alt', translateFN('Rimuovi il messaggio'));
$del_text = translateFN('Cancella');
} else {
$list_module = 'list_events.php';
$read_module = 'read_event.php';
$del_text = '';
}
$order_by_author_link = CDOMElement::create('a', "href:{$list_module}?sort_field=id_mittente");
$order_by_author_link->addChild(new CText(translateFN('Autore')));
$order_by_time_link = CDOMElement::create('a', "href:{$list_module}?sort_field=data_ora");
$order_by_time_link->addChild(new CText(translateFN('Data ed ora')));
$order_by_subject_link = CDOMElement::create('a', "href:{$list_module}?sort_field=titolo");
$order_by_subject_link->addChild(new CText(translateFN('Oggetto')));
$order_by_priority_link = CDOMElement::create('a', "href:{$list_module}?sort_field=priorita");
$order_by_priority_link->addChild(new CText(translateFN('Priorità')));
$thead_data = array($order_by_author_link, $order_by_time_link, $order_by_subject_link, $order_by_priority_link, $del_text, translateFN('Letto'), '');
foreach ($data_Ar as $tester => $appointment_data_Ar) {
//$udh = UserDataHandler::instance(self::getDSN($tester));
//$tester_info_Ar = $common_dh->get_tester_info_from_pointer($tester);
$tester_id = $testers_dataAr[$tester];
// if (AMA_Common_DataHandler::isError($tester_info_Ar)) {
// /*
// * Return a ADA_Error with delayed error handling.
// */
// return new ADA_Error($tester_info_Ar,translateFN('Errore in ottenimento informazioni tester'),
// NULL,NULL,NULL,NULL,TRUE);
// }
$tester_TimeZone = MultiPort::getTesterTimeZone($tester);
$offset = get_timezone_offset($tester_TimeZone, SERVER_TIMEZONE);
foreach ($appointment_data_Ar as $appointment_id => $appointment_Ar) {
// trasform message content into variable names
$sender_id = $appointment_Ar[0];
$date_time = $appointment_Ar[1];
//$subject = $appointment_Ar[2];
/*
* Check if the subject has an internal identifier and remove it.
*/
//$subject = preg_replace('/[0-9]+#/','',$appointment_Ar[2],1);
$subject = ADAEventProposal::removeEventToken($appointment_Ar[2]);
$priority = $appointment_Ar[3];
$read_timestamp = $appointment_Ar[4];
$date_time_zone = $date_time + $offset;
$zone = translateFN("Time zone:") . " " . $tester_TimeZone;
$data_msg = AMA_DataHandler::ts_to_date($date_time_zone, "%d/%m/%Y - %H:%M:%S") . " " . $zone;
// $data_msg = AMA_DataHandler::ts_to_date($date_time, "%d/%m/%Y - %H:%M:%S");
// transform sender's id into sender's name
// $res_ar = $udh->find_users_list(array("username"), "id_utente=$sender_id");
// if (AMA_DataHandler::isError($res_ar)) {
// $sender_username = '';
// }
// else {
// $sender_username = $res_ar[0][1];
// }
$sender_username = $appointment_Ar[6];
//$msg_id = $tester_info_Ar[0].'_'.$appointment_id;
$msg_id = $tester_id . '_' . $appointment_id;
$url = HTTP_ROOT_DIR . '/comunica/' . $read_module . '?msg_id=' . $msg_id;
$subject_link = CDOMElement::create('a', "href:{$url}");
$subject_link->addChild(new CText($subject));
/*
* If this is a list of simple messages, then deleting is allowed.
* Otherwise it is disabled.
*/
if ($message_type == ADA_MSG_SIMPLE) {
$delete = CDOMElement::create('checkbox', "name:form[del][{$msg_id}],value:{$msg_id}");
$action_link = CDOMElement::create('a', "href:{$list_module}?del_msg_id={$msg_id}");
$action_link->addChild($del_img);
} else {
$delete = '';
$delete_link = '';
// PROVA, POI RIMETTERE A POSTO
$userObj = $_SESSION['sess_userObj'];
/*
if($userObj instanceof ADAPractitioner) {
$event_token = ADAEventProposal::extractEventToken($appointment_Ar[2]);
$href = HTTP_ROOT_DIR . '/tutor/eguidance_tutor_form.php?event_token=' . $event_token;
$action_link = CDOMElement::create('a', "href:$href");
$action_link->addChild(new CText(translateFN('View eguidance session data')));
}
*
*/
}
$read = CDOMElement::create('checkbox', "name:form[read][{$msg_id}],value:{$msg_id}");
if ($read_timestamp != 0) {
$read->setAttribute('checked', 'checked');
}
if (!isset($action_link)) {
$action_link = null;
}
$appointments_Ar[] = array($sender_username, $data_msg, $subject_link, $priority, $delete, $read, $action_link);
}
//.........这里部分代码省略.........
示例13: array
case 'summary':
$field_list_ar = array('id_nodo', 'data_visita');
$clause = "";
$dataHa = $dh->_find_ex_history_list($field_list_ar, $clause);
if (AMA_DataHandler::isError($dataHa)) {
$msg = $dataHa->getMessage();
print $msg;
//header("Location: $error?err_msg=$msg");
//exit;
}
$total_visits = 0;
$exercise_dataHa = array();
foreach ($dataHa as $exercise) {
$id_node = $exercise[1];
$data = $exercise[2];
$row = array(translateFN('Nodo') => "<a href=\"tutor_report.php?mode=zoom&id_node={$id_node}\">{$id_node} : {$nome} </a>", translateFN('Data') => AMA_DataHandler::ts_to_date($data));
array_push($exercise_dataHa, $row);
}
$tObj = new Table();
$tObj->initTable('0', 'right', '1', '0', '90%', '', '', '', '', '1', '0');
// Syntax: $border,$align,$cellspacing,$cellpadding,$width,$col1, $bcol1,$col2, $bcol2
$caption = translateFN("Esercizi eseguiti fino al {$ymdhms}");
$summary = translateFN("Elenco degli esercizi eseguiti");
$tObj->setTable($exercise_dataHa, $caption, $summary);
$tabled_exercise_dataHa = $tObj->getTable();
}
$banner = (include ROOT_DIR . '/include/banner.inc.php');
$help = translateFN('Da qui il Tutor può visualizzare il report.');
$status = translateFN('Visualizzazione del report');
$title = translateFN('ADA - Report del tutor');
$content_dataAr = array('banner' => $banner, 'data' => $tabled_exercise_dataHa, 'help' => $help, 'status' => $status, 'user_name' => $user_name, 'user_type' => $user_type, 'messages' => $user_messages->getHtml(), 'agenda' => $user_agenda->getHtml());
示例14: get_student_coursesFN
$courses_student = get_student_coursesFN($id_instance, $id_course, '', $type == 'xls' ? 'HTML' : 'FILE');
// build the caption
// 0. Get title course
$info_course = $dh->get_course($id_course);
if (AMA_DB::isError($info_course)) {
$course_title = '';
} else {
$course_title = $info_course['titolo'];
}
// 1. Get the instance courses data
$instance_course_ha = $dh->course_instance_get($id_instance);
if (AMA_DB::isError($instance_course_ha)) {
$start_date = '';
$instance_title = '';
} else {
$start_date = AMA_DataHandler::ts_to_date($instance_course_ha['data_inizio'], ADA_DATE_FORMAT);
$instance_title = $instance_course_ha['title'];
}
$caption = translateFN("Studenti del corso") . " <strong>{$course_title}</strong> - " . translateFN("Classe") . " " . $instance_title . " (" . $id_instance . ") - " . translateFN("Iniziato il ") . " <strong>{$start_date}</strong>";
// build up filename to be streamed out
$filename = 'course_' . $id_course . '_class_' . $id_instance . '.' . $type;
if ($type === 'pdf') {
require_once ROOT_DIR . '/include/PdfClass.inc.php';
$pdf = new PdfClass('landscape', strip_tags(html_entity_decode($courses_student['caption'])));
$pdf->addHeader(strip_tags(html_entity_decode($caption)), ROOT_DIR . '/layout/' . $userObj->template_family . '/img/header-logo.png', 14)->addFooter(translateFN("Report") . " " . translateFN("generato") . " " . translateFN("il") . " " . date("d/m/Y") . " " . translateFN("alle") . " " . date("H:i:s"));
// prepare header row
foreach ($courses_student[0] as $key => $val) {
// skip level up and down images, cannot be done in config file
// because it would remove cols from html too, and this is not good
if (preg_match('/img/', $val) !== 0) {
continue;
示例15: list_history_tests
/**
* function that return list of history test sent test or survey by student
*
* @global db $dh
*
* @param boolean $student if true switch scope from tutor to student
*
* @return array an array composed of 'html', 'path' and 'title' keys
*/
protected function list_history_tests($student = false)
{
$dh = $GLOBALS['dh'];
$historyTest = $dh->test_getHistoryTestJoined(array('id_nodo' => $this->test['id_nodo'], 'id_corso' => $this->courseObj->id, 'id_istanza_corso' => $this->course_instanceObj->id), $this->tipo);
if ($dh->isError($historyTest)) {
$this->returnError = true;
return;
}
$thead = array(sprintf(translateFN('%s Id'), $this->singolare), translateFN('Titolo'), translateFN('Punteggio'), translateFN('Punteggio Barriera'), translateFN('Consegnato'), translateFN('Tempo scaduto'), translateFN('Ripetibile'), translateFN('Data inizio'), translateFN('Data fine'), translateFN('Visualizza'));
$tbody = array();
if (!empty($historyTest)) {
foreach ($historyTest as $k => $r) {
$id_student = $r['id_utente'];
$tbody[$k][] = $k + 1;
$tbody[$k][] = $r['titolo'];
$tbody[$k][] = $r['punteggio_realizzato'];
$tbody[$k][] = $r['punteggio_minimo_barriera'];
$tbody[$k][] = $r['consegnato'] ? translateFN('Si') : translateFN('No');
$tbody[$k][] = $r['tempo_scaduto'] ? translateFN('Si') : translateFN('No');
$tbody[$k][] = $r['ripetibile'] ? translateFN('Si') : translateFN('No');
$tbody[$k][] = AMA_DataHandler::ts_to_date($r['data_inizio'], "%d/%m/%Y %H:%M:%S");
$tbody[$k][] = $r['data_fine'] > 0 ? AMA_DataHandler::ts_to_date($r['data_fine'], "%d/%m/%Y %H:%M:%S") : '---';
$tbody[$k][] = '<a href="' . $this->filepath . '?op=' . $this->what . '&id_course=' . $r['id_corso'] . '&id_course_instance=' . $r['id_istanza_corso'] . '&id_student=' . $r['id_utente'] . '&id_test=' . $r['id_nodo'] . '&id_history_test=' . $r['id_history_test'] . '"><img src="img/magnify.png" /></a>';
}
$caption = sprintf(translateFN('Tentativi effettuati dallo studente %s %s per il %s "%s"'), $this->student['cognome'], $this->student['nome'], $this->singolare, $this->test['titolo']);
$table = BaseHtmlLib::tableElement('', $thead, $tbody, $thead, $caption);
$html = $table->getHtml();
} else {
if ($student) {
$html = sprintf(translateFN('Non hai effettuato nessun %s'), $this->singolare);
} else {
$html = sprintf(translateFN('Lo studente selezionato non ha effettuato nessun %s'), $this->singolare);
}
}
$path = '<a href="' . $this->filepath . '?op=' . $this->what . '&id_course_instance=' . $this->course_instanceObj->id . '&id_course=' . $this->courseObj->id . '">' . translateFN('Valutazione') . ' ' . ucfirst($this->plurale) . '</a> > <a href="' . $this->filepath . '?op=' . $this->what . '&id_course_instance=' . $this->course_instanceObj->id . '&id_course=' . $this->courseObj->id . '&id_student=' . $id_student . '">' . $this->student['cognome'] . ' ' . $this->student['nome'] . '</a> > ' . $this->test['titolo'];
return array('html' => $html, 'path' => $path, 'title' => translateFN('Valutazione') . ' ' . ucfirst($this->plurale));
}