本文整理汇总了PHP中AMA_DataHandler类的典型用法代码示例。如果您正苦于以下问题:PHP AMA_DataHandler类的具体用法?PHP AMA_DataHandler怎么用?PHP AMA_DataHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AMA_DataHandler类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: videoroom_info
public function videoroom_info($id_course_instance, $tempo_avvio = NULL, $interval = NULL)
{
$dh = $GLOBALS['dh'];
$error = $GLOBALS['error'];
$debug = $GLOBALS['debug'];
$root_dir = $GLOBALS['root_dir'];
$http_root_dir = $GLOBALS['http_root_dir'];
$video_roomAr = $dh->get_videoroom_info($id_course_instance, $tempo_avvio, $interval);
if (AMA_DataHandler::isError($video_roomAr) || !is_array($video_roomAr)) {
// FIXME: prima restituiva una stringa di testo
$this->full = 0;
/*
$this->id_room = 1;
$this->id_tutor = 7;
$this->id = 1;
$this->descrizione_videochat = "descrizione";
// $this->tempo_avvio = $video_roomAr['tempo_avvio'];
// $this->tempo_fine = $video_roomAr['tempo_fine'];
$this->tipo_videochat = "pubblica";
*/
} else {
$this->id_room = $video_roomAr['id_room'];
$this->id_tutor = $video_roomAr['id_tutor'];
$this->id = $video_roomAr['id'];
$this->id_istanza_corso = $video_roomAr['id_istanza_corso'];
$this->descrizione_videochat = $video_roomAr['descrizione_videochat'];
$this->tempo_avvio = $video_roomAr['tempo_avvio'];
$this->tempo_fine = $video_roomAr['tempo_fine'];
$this->tipo_videochat = $video_roomAr['tipo_videochat'];
$this->full = 1;
}
}
开发者ID:eguicciardi,项目名称:ada,代码行数:32,代码来源:videoroom_classes_OLD.inc.php
示例2: add_request
function add_request($user_id, $type = 0)
{
// insert user_id, date, type into table "requests"
$date = AMA_DataHandler::date_to_ts("now");
$token = sha1($date);
// o altro algoritmo
$status = ADA_REQUEST_STATUS_SET;
// insert $date, $userid, $token, $type, $status
// if ok:
return $token;
}
开发者ID:eguicciardi,项目名称:ada,代码行数:11,代码来源:forget_functions.inc.php
示例3: loadSupportedLanguagesInSession
/**
* function loadSupportedLanguagesInSession: used to load ADA supported languages for
* user interface messages translation into a session variable.
*
* @return TRUE if there arn't errors, ADA_Error object otherwise
*/
public static function loadSupportedLanguagesInSession()
{
unset($_SESSION['sess_ada_supported_languages']);
$common_dh = $GLOBALS['common_dh'];
$supported_languages = array();
$supported_languages = $common_dh->find_languages();
if (AMA_DataHandler::isError($supported_languages)) {
// FIXME: qui si verifica questo errore anche quando c'è un errore di connessione al database.
$errObj = new ADA_Error($supported_languages, 'No languages for user interface translation were found.', 'Translator');
}
$_SESSION['sess_ada_supported_languages'] = $supported_languages;
return TRUE;
}
开发者ID:eguicciardi,项目名称:ada,代码行数:19,代码来源:translator_class.inc.php
示例4: __construct
function __construct($id_banner = 0)
{
# constructor
/*
$user_prefHa = $this->get_user_pref();
//$node_keys is a list of keywords tha can be used to select a banner
//$node_keysAr = $this->get_node_keys();
//$node_keys = implode(",",$node_keysAr);
*/
$dh = $GLOBALS['dh'];
//$layoutObj = $GLOBALS['layoutObj'];
$out_fields_ar = array();
$module = "";
$keywords = "";
$client = "";
$bannerListAr = $dh->find_banner_list($out_fields_ar, $module, $keywords, $client);
$id_banner = $bannerListAr[0][0];
$bannerAr = $dh->get_banner($id_banner);
//$path = $layoutObj->template_dir."img/banners/";
$path = "layout/clear/img/banners/";
// TODO: replace
if (AMA_DataHandler::isError($bannerAr)) {
$this->error_msg = ADA_ERR_BANNER;
$this->html_code = "<!-- BANNER NOT FOUND-->\n<!-- END BANNER -->\n";
} else {
$this->id_banner = $bannerAr['id_banner'];
$this->id_client = $bannerAr['id_client'];
$this->http_address = $bannerAr['address'];
$this->img = ROOT_DIR . $path . $bannerAr['image'];
$this->impressions = $bannerAr['impressions'];
$this->acquired_impressions = $bannerAr['a_impressions'];
$this->from = $bannerAr['date_from'];
$this->to = $bannerAr['date_to'];
$this->keywords = $bannerAr['keywords'];
$this->module = $bannerAr['module'];
$this->id_course = $bannerAr['id_course'];
$this->html_code = "<!-- BANNER -->\n<a href=\"" . $this->http_address . "\" target=_blank><img src=\"" . $this->img . "\" alt=\"" . $this->alt . "\" width=\"" . $this->width . "\" height=\"" . $this->height . "\" border=\"0\"></a>\n<!-- END BANNER -->\n";
}
}
开发者ID:eguicciardi,项目名称:ada,代码行数:40,代码来源:banner.inc.php
示例5: videoroom_info
public function videoroom_info($id_course_instance, $tempo_avvio = NULL, $interval = NULL)
{
$dh = $GLOBALS['dh'];
$error = $GLOBALS['error'];
$debug = isset($GLOBALS['debug']) ? $GLOBALS['debug'] : null;
$root_dir = $GLOBALS['root_dir'];
$http_root_dir = $GLOBALS['http_root_dir'];
$video_roomAr = $dh->get_videoroom_info($id_course_instance, $tempo_avvio, $interval);
if (AMA_DataHandler::isError($video_roomAr) || !is_array($video_roomAr)) {
$this->full = 0;
} else {
$this->id_room = $video_roomAr['id_room'];
$this->id_tutor = $video_roomAr['id_tutor'];
$this->id = $video_roomAr['id'];
$this->id_istanza_corso = $video_roomAr['id_istanza_corso'];
$this->descrizione_videochat = $video_roomAr['descrizione_videochat'];
$this->tempo_avvio = $video_roomAr['tempo_avvio'];
$this->tempo_fine = $video_roomAr['tempo_fine'];
$this->tipo_videochat = $video_roomAr['tipo_videochat'];
$this->full = 1;
}
}
开发者ID:eguicciardi,项目名称:ada,代码行数:22,代码来源:videoroom.classes.inc.php
示例6: add_chatroomFN
public static function add_chatroomFN($chatroom_ha, $tester_dsn = null)
{
$dh = $GLOBALS['dh'];
/*
* Check if was assigned a course instance to this chatroom. If it wasn't,
* use course instance from request or from session.
*/
if (!isset($chatroom_ha['id_course_instance']) || empty($chatroom_ha['id_course_instance'])) {
//get $id_course_instance from the REQUEST variables
if (!empty($_REQUEST['id_course_instance'])) {
$id_course_instance = $_REQUEST['id_course_instance'];
} elseif (!empty($_SESSION['sess_id_course_instance'])) {
$id_course_instance = $_SESSION['sess_id_course_instance'];
}
$chatroom_ha['id_course_instance'] = $id_course_instance;
}
// get the user_id form the session variables
$sess_id_user = $_SESSION['sess_id_user'];
// get the course title form the GLOBAL variables
$course_title = $GLOBALS['course_title'];
/*
* Check if was assigned a chat owner: if it wasn't, get this course's tutor
* and set him as chat owner
*/
if (!isset($chatroom_ha['id_chat_owner']) || empty($chatroom_ha['id_chat_owner'])) {
$id_tutor = $dh->course_instance_tutor_get($chatroom_ha['id_course_instance']);
if (!AMA_DataHandler::isError($id_tutor)) {
$chatroom_ha['id_chat_owner'] = $id_tutor;
}
}
if (!empty($chatroom_ha['chat_type'])) {
$chatroom_ha['chat_type'] = $chatroom_ha['chat_type'];
} else {
$chatroom_ha['chat_type'] = CLASS_CHAT;
}
if (!empty($chatroom_ha['chat_title'])) {
$chatroom_ha['chat_title'] = $chatroom_ha['chat_title'];
} else {
$chatroom_ha['chat_title'] = addslashes($course_title);
}
if (!empty($chatroom_ha['chat_topic'])) {
$chatroom_ha['chat_topic'] = $chatroom_ha['chat_topic'];
} else {
$chatroom_ha['chat_topic'] = addslashes($course_title);
}
// MOVED TO LINE 446
// if (isset($chatroom_ha['id_chat_owner'])) {
// $chatroom_ha['id_chat_owner']=$chatroom_ha['id_chat_owner'];
// }
// else {
// $chatroom_ha['id_chat_owner']= $id_tutor;
// }
if (!empty($chatroom_ha['start_time'])) {
$chatroom_ha['start_time'] = $chatroom_ha['start_time'];
} else {
$chatroom_ha['start_time'] = time();
}
// check again this field
if (isset($chatroom_ha['end_time'])) {
$chatroom_ha['end_time'] = $chatroom_ha['end_time'];
} else {
$chatroom_ha['end_time'] = time() + SHUTDOWN_CHAT_TIME;
}
if (!empty($chatroom_ha['welcome_msg'])) {
$chatroom_ha['welcome_msg'] = $chatroom_ha['welcome_msg'];
} else {
$chatroom_ha['welcome_msg'] = addslashes(translateFN("Benvenuti nella chat di ADA.Ricordatevi di uscire correttamente dalla chat usando l'apposita funzionalita'"));
}
if (!empty($chatroom_ha['max_users'])) {
$chatroom_ha['max_users'] = $chatroom_ha['max_users'];
} else {
$chatroom_ha['max_users'] = DEFAULT_MAX_USERS;
}
// MOVED TO LINE 422
// // check again this field
// if(isset($chatroom_ha['id_course_instance'])) {
// $chatroom_ha['id_course_instance']=$chatroom_ha['id_course_instance'];
// }
// else {
// $chatroom_ha['id_course_instance']= $id_course_instance;
// }
// write to db and returns the id of the chatroom $id_chatroom.
// if (isset($this)) {
// $this->chatroom_ha = $chatroom_ha;
// }
$cdh = self::obtainChatDataHandlerInstance();
$result = $cdh->add_chatroom($chatroom_ha);
return $result;
}
开发者ID:eguicciardi,项目名称:ada,代码行数:89,代码来源:ChatRoom.inc.php
示例7: getNodeData
function getNodeData($id_node)
{
$nodeObj = read_node_from_DB($id_node);
if (AMA_DataHandler::isError($nodeObj)) {
return $nodeObj;
}
$node_data = array('id' => $id_node, 'name' => $nodeObj->name, 'title' => $nodeObj->title, 'text' => $nodeObj->text, 'type' => $nodeObj->type, 'level' => $nodeObj->level, 'parent_id' => $nodeObj->parent_id, 'position' => $nodeObj->position, 'order' => $nodeObj->ordine, 'version' => $nodeObj->version, 'color' => $nodeObj->color, 'bgcolor' => $nodeObj->bgcolor, 'correctness' => $nodeObj->correctness, 'copyright' => $nodeObj->copyright, 'n_contacts' => $nodeObj->contacts, 'icon' => $nodeObj->icon, 'id_node_author' => $nodeObj->author['id'], 'creation_date' => $nodeObj->creation_date, 'id_instance' => $nodeObj->instance);
if ($nodeObj->type == ADA_LEAF_WORD_TYPE or $nodeObj->type == ADA_GROUP_WORD_TYPE) {
$node_data['hyphenation'] = $nodeObj->hyphenation;
$node_data['grammar'] = $nodeObj->grammar;
$node_data['semantic'] = $nodeObj->semantic;
$node_data['notes'] = $nodeObj->notes;
$node_data['examples'] = $nodeObj->examples;
$node_data['ex_language'] = $nodeObj->language;
}
return $node_data;
}
开发者ID:eguicciardi,项目名称:ada,代码行数:17,代码来源:editnode_funcs.inc.php
示例8: array
// $mh = MessageHandler::instance(MultiPort::getDSN($tester));
// using the previous MH if exists
//if (!isset($mh))
$mh = MessageHandler::instance(MultiPort::getDSN($tester));
// prepare message to send
$destinatari = array($username);
$message3_ha = array();
$message3_ha['titolo'] = $titolo;
$message3_ha['testo'] = $testo;
$message3_ha['destinatari'] = $destinatari;
$message3_ha['data_ora'] = "now";
$message3_ha['tipo'] = ADA_MSG_MAIL;
$message3_ha['mittente'] = $adm_uname;
// delegate sending to the message handler
$res3 = $mh->send_message($message3_ha);
if (AMA_DataHandler::isError($res3)) {
// $errObj = new ADA_Error($res,translateFN('Impossibile spedire il messaggio'),
//NULL,NULL,NULL,$error_page.'?err_msg='.urlencode(translateFN('Impossibile spedire il messaggio')));
}
unset($mh);
$message = urlencode(translateFN("Servizio richiesto correttamente. Ti verrà inviato un messaggio contenente le proposte di appuntamento."));
} else {
// a real error
$message = urlencode(translateFN("Errore nella richiesta di servizio: 2"));
//$AMAErrorObject=NULL,$errorMessage=NULL, $callerName=NULL, $ADAErrorCode=NULL, $severity=NULL, $redirectTo=NULL, $delayErrorHandling=FALSE
$errorObj = new ADA_Error($res_presub, $message, NULL, NULL, NULL, $error_page . '?message=' . $message);
}
} else {
// id_course is null or was not set
$error_page = $userObj->getHomePage();
$message = urlencode(translateFN('Impossibile richiedere il servizio'));
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:subscribe.php
示例9: getAuthorMedia
public static function getAuthorMedia($id_course, $media_type = array())
{
$dh = $GLOBALS['dh'];
$course_ha = $dh->get_course($id_course);
if (AMA_DataHandler::isError($course_ha)) {
return $course_ha;
}
$id_author = $course_ha['id_autore'];
$author_media = $dh->get_risorse_autore($id_author, $media_type);
return $author_media;
}
开发者ID:eguicciardi,项目名称:ada,代码行数:11,代码来源:NodeEditing.inc.php
示例10: 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)) {
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:tutor_history_details.php
示例11: translateFN
* TODO: handle form generation for service with level = 4 and multiple users
* subscribed.
*/
$user_infoAr = $users_infoAr[0];
$id_user = $user_infoAr['id_utente_studente'];
$tutoredUserObj = MultiPort::findUser($id_user);
$service_infoAr['id_istanza_corso'] = $id_course_instance;
$service_infoAr['event_token'] = $event_token;
/*
* Check if an eguidance session with this event_token exists. In this case,
* use this data to fill the form.
*/
$eguidance_session_dataAr = $dh->get_eguidance_session_with_event_token($event_token);
if (!AMA_DataHandler::isError($eguidance_session_dataAr)) {
if ($is_popup) {
$eguidance_session_dataAr['is_popup'] = true;
}
$form = TutorModuleHtmlLib::getEditEguidanceDataForm($tutoredUserObj, $service_infoAr, $eguidance_session_dataAr);
} else {
$last_eguidance_session_dataAr = $dh->get_last_eguidance_session($id_course_instance);
if (AMA_DataHandler::isError($last_eguidance_session_dataAr)) {
$errObj = new ADA_Error($users_infoAr, translateFN("Errore nell'ottenimento dei dati della precedente sessione di eguidance"), NULL, NULL, NULL, $userObj->getHomePage());
}
if ($is_popup) {
$last_eguidance_session_dataAr['is_popup'] = true;
}
$form = TutorModuleHtmlLib::getEguidanceTutorForm($tutoredUserObj, $service_infoAr, $last_eguidance_session_dataAr);
}
}
$content_dataAr = array('user_name' => $user_name, 'user_type' => $user_type, 'status' => $status, 'dati' => $form->getHtml());
ARE::render($layout_dataAr, $content_dataAr);
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:eguidance_tutor_form.php
示例12: get_all_instancesFN
function get_all_instancesFN()
{
$dh = $GLOBALS['dh'];
$field_list_ar = array('nome', 'titolo');
$courses = $dh->get_courses_list($field_list_ar);
if (AMA_DataHandler::isError($courses)) {
$msg = $courses->getMessage();
$classi = $msg;
// header("Location: $error?err_msg=$msg");
} else {
$classe = array();
$field_list_ar = array('data_inizio', 'durata', 'data_inizio_previsto');
$num_cl = 0;
//inizializzazione numero classi
$corsi = count($courses);
for ($i = 0; $i < count($courses); $i++) {
$id_corso_tmp = $courses[$i][0];
$titolo_tmp = $courses[$i][2];
$db_data_ar = $dh->course_instance_get_list($field_list_ar, $id_corso_tmp);
if (AMA_DataHandler::isError($db_data_ar)) {
$dati = $db_data_ar->getMessage();
$classi = $dati;
// header("Location: course_instance.php?status=$dati");
} else {
for ($c = 0; $c < count($db_data_ar); $c++) {
$id_istance = $db_data_ar[$c][0];
if (!empty($id_istance)) {
$classe[$num_cl][0] = $id_corso_tmp;
$classe[$num_cl][1] = $titolo_tmp;
$classe[$num_cl][2] = $id_istance;
$data_inizio = $db_data_ar[$c][3];
$classe[$num_cl][3] = $data_inizio;
$num_cl++;
}
}
$classi = $classe;
}
}
}
return $classi;
}
开发者ID:eguicciardi,项目名称:ada,代码行数:41,代码来源:htmladmoutput.inc.php
示例13: 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);
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:send_event.php
示例14: translateFN
$msg = $res->getMessage();
// $dh->course_instance_student_presubscribe_remove($id_course_instance,$id_studente);
// header("Location: $error?err_msg=$msg");
$message_ha["testo"] = translateFN('Gentile') . " " . $firstname . ",\r\n" . translateFN("Si è verificato un errore nell'iscrizione al corso") . " " . $course_name . "\n\r\n\r";
$message_ha["testo"] .= $body_mail;
$message_ha["testo"] .= "\n\r\n\r" . translateFN('Per maggiori informazioni scrivi una mail a:') . " " . ADA_ADMIN_MAIL_ADDRESS;
$message_ha["testo"] .= "\n\r" . translateFN("Buono studio.");
$sender_email = ADA_ADMIN_MAIL_ADDRESS;
$recipients_emails_ar = array($payer_email);
} else {
// header("Location: $back_url?id_studente=$id_studente");
// Send mail to the user with his/her data.
$switcherTypeAr = array(AMA_TYPE_SWITCHER);
$extended_data = TRUE;
$switcherList = $dh->get_users_by_type($switcherTypeAr, $extended_data);
if (!AMA_DataHandler::isError($switcherList)) {
$switcher_email = $switcherList[0]['e_mail'];
} else {
$switcher_email = ADA_ADMIN_MAIL_ADDRESS;
}
$switcher_email = 'amministrazione@italicon';
// versione ICON
$notice_mail = sprintf(translateFN('Questa è una risposta automatica. Si prega di non rispondere a questa mail. Per informazioni scrivere a %s'), $switcher_email);
$message_ha["testo"] = $notice_mail . "\n\r\n\r";
$message_ha["testo"] .= translateFN('Gentile') . " " . $firstname . ",\r\n" . translateFN("grazie per esserti iscritto al corso") . " " . $course_name . "\n\r\n\r";
$message_ha["testo"] .= $body_mail;
//$message_ha["testo"] .= "\n\r\n\r". translateFN("Ti ricordiamo i tuoi dati di accesso.\n\r username: ") . $user_name . "\n\r" . translateFN("password:" . " " . $user_password);
$message_ha["testo"] .= "\n\r\n\r" . translateFN("Questo è l'indirizzo per accedere al corso: ") . "\n\r" . $http_root_dir . "\n\r";
$message_ha["testo"] .= "\n\r" . translateFN("Una volta fatto il login, potrai accedere al corso");
$message_ha["testo"] .= "\n\r" . translateFN("Buono studio!");
$message_ha["testo"] .= "\n\r" . translateFN("La segreteria dei Corsi di Lingua Italiana ICoN");
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:student_course_instance_subscribe_ipn.php
示例15: instance
/**
* calls and sets the parent instance method, and if !MULTIPROVIDER
* checks if module_login_providers table is in the provider db.
*
* If found, use the provider DB else use the common
*
* @param string $dsn
*/
static function instance($dsn = null)
{
if (!MULTIPROVIDER && is_null($dsn)) {
$dsn = MultiPort::getDSN($GLOBALS['user_provider']);
}
$theInstance = parent::instance($dsn);
if (is_null(self::$dbToUse)) {
self::$dbToUse = AMA_Common_DataHandler::instance();
if (!MULTIPROVIDER && !is_null($dsn)) {
// must check if passed $dsn has the module login tables
// execute this dummy query, if result is not an error table is there
$sql = 'SELECT NULL FROM `' . self::$PREFIX . 'providers`';
// must use AMA_DataHandler because we are not able to
// query AMALoginDataHandelr in this method!
$ok = AMA_DataHandler::instance($dsn)->getOnePrepared($sql);
if (!AMA_DB::isError($ok)) {
self::$dbToUse = $theInstance;
}
}
}
return $theInstance;
}
开发者ID:eguicciardi,项目名称:ada,代码行数:30,代码来源:AMALoginDataHandler.inc.php
示例16: array
} else {
$testersAr = array();
$tester_dataAr = array(array(translateFN('id'), $tester_infoAr[0]), array(translateFN('Nome'), $tester_infoAr[1]), array(translateFN('Ragione Sociale'), $tester_infoAr[2]), array(translateFN('Indirizzo'), $tester_infoAr[3]), array(translateFN('Città'), $tester_infoAr[4]), array(translateFN('Provincia'), $tester_infoAr[5]), array(translateFN('Nazione'), $tester_infoAr[6]), array(translateFN('Telefono'), $tester_infoAr[7]), array(translateFN('E-mail'), $tester_infoAr[8]), array(translateFN('Descrizione'), $tester_infoAr[11]), array(translateFN('Responsabile'), $tester_infoAr[9]), array(translateFN('Puntatore al database'), $tester_infoAr[10]));
//$tester_data = BaseHtmlLib::tableElement('',array(),$tester_dataAr);
$tester_data = AdminModuleHtmlLib::displayTesterInfo($id_tester, $tester_dataAr);
$services_dataAr = $common_dh->get_info_for_tester_services($id_tester);
if (AMA_Common_DataHandler::isError($services_dataAr)) {
$errObj = new ADA_Error($services_dataAr);
} else {
$tester_services = AdminModuleHtmlLib::displayServicesOnThisTester($id_tester, $services_dataAr);
}
$tester_dsn = MultiPort::getDSN($tester_infoAr[10]);
if ($tester_dsn != NULL) {
$tester_dh = AMA_DataHandler::instance($tester_dsn);
$users_on_this_tester = $tester_dh->count_users_by_type(array(AMA_TYPE_STUDENT, AMA_TYPE_AUTHOR, AMA_TYPE_TUTOR, AMA_TYPE_SWITCHER, AMA_TYPE_ADMIN));
if (AMA_DataHandler::isError($users_on_this_tester)) {
$errObj = new ADA_Error($users_on_this_tester);
} else {
$users_list_link = CDOMElement::create('div', 'id:tester_users');
$users_list_link->addChild(new CText(translateFN('Numero di utenti presenti sul tester: ') . $users_on_this_tester));
$link = CDOMElement::create('a', 'href:list_users.php?id_tester=' . $id_tester);
$link->addChild(new CText(translateFN('Lista utenti')));
$users_list_link->addChild($link);
}
}
}
} else {
/*
* non e' stato passato id_tester
*/
}
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:tester_profile.php
示例17: get_menu_children_recursive
/**
* @author giorgio 19/ago/2014
*
* recursively gets all the children of a given menu item
*
* @param number $tree_id the id of the menu tree to load
* @param number $parent_id the id of the parent to get children for
* @param AMA_DataHandler $dbToUse the data handler to be used, either Common or Tester
* @param boolean $get_all set it to true to get also disabled elements.
*
* @return array of found children or null if no children found
*
* @access private
*/
private function get_menu_children_recursive($tree_id = 0, $parent_id, $dbToUse, $get_all)
{
$sql = 'SELECT MI.*, MT.extraClass AS menuExtraClass FROM `menu_items` AS MI JOIN `menu_tree` AS MT ON ' . 'MI.item_id=MT.item_id WHERE MT.tree_id=? AND MT.parent_id=?';
if (!$get_all) {
$sql .= ' AND MI.enabledON!="' . Menu::NEVER_ENABLED . '"';
}
$sql .= ' ORDER BY MI.order ASC';
$res = $dbToUse->getAllPrepared($sql, array($tree_id, $parent_id), AMA_FETCH_ASSOC);
if (AMA_DB::isError($res) || count($res) <= 0 || $res === false) {
return null;
} else {
foreach ($res as $count => $element) {
$res[$count]['children'] = $this->get_menu_children_recursive($tree_id, $element['item_id'], $dbToUse, $get_all);
}
return $res;
}
}
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:ama.inc.php
示例18: get_visit_time
/**
* get_visit_time
* Fetches an associative array containing history information for nodes in $this->id_course_instance
* visited by student $this->id_student.
* Uses the fetched array to calculate $this->total_time time spent by student visiting
* the course instance.
*/
function get_visit_time()
{
$dh = $GLOBALS['dh'];
$visit_time = $dh->get_student_visit_time($this->id_student, $this->id_course_instance);
//verificare il controllo degli errori
if (AMA_DataHandler::isError($visit_time)) {
$errObj = new ADA_Error($visit_time, translateFN("Errore nella lettura dei dati"));
}
$nodes_time = 0;
if (isset($visit_time[0])) {
$n_session = $visit_time[0]['session_id'];
$n_start = $visit_time[0]['data_visita'];
$n_time_prec = $visit_time[0]['data_visita'];
} else {
$n_session = null;
$n_start = null;
$n_time_prec = null;
}
$num_nodi = count($visit_time);
foreach ($visit_time as $key => $val) {
// controlla se vi e' stato cambio del valore del session_id
if ($val['session_id'] != $n_session) {
$nodes_time = $nodes_time + ($n_time_prec - $n_start) + ADA_SESSION_TIME;
$n_session = $val['session_id'];
$n_start = $val['data_visita'];
$n_time_prec = $val['data_visita'];
//ora di entrata nel primo nodo visitato nella sessione
// assegna il valore di data uscita del "nodo precedente"
} else {
if ($key == $num_nodi - 1) {
$nodes_time = $nodes_time + $val['data_visita'] - $n_start;
} else {
$n_time_prec = $val['data_uscita'];
}
}
}
$this->total_time = $nodes_time;
unset($visit_time);
}
开发者ID:eguicciardi,项目名称:ada,代码行数:46,代码来源:history_class.inc.php
示例19: ADA_Error
} else {
if ($courseInstanceObj instanceof Course_instance && $courseInstanceObj->isFull()) {
$result = $dh->course_instance_tutor_get($courseInstanceObj->getId());
if (AMA_DataHandler::isError($result)) {
// FIXME: verificare che si venga redirezionati alla home page del'utente
$errObj = new ADA_Error($result, translateFN('Errore in lettura tutor'));
}
if ($result === false) {
$id_tutor_old = 'no';
} else {
$id_tutor_old = $result;
}
// array dei tutor
$field_list_ar = array('nome', 'cognome');
$tutors_ar = $dh->get_tutors_list($field_list_ar);
if (AMA_DataHandler::isError($tutors_ar)) {
$errObj = new ADA_Error($tutors_ar, translate('Errore in lettura dei tutor'));
}
$tutors = array();
$ids_tutor = array();
if ($id_tutor_old == 'no') {
$tutors['no'] = translateFN('Nessun tutor');
}
foreach ($tutors_ar as $tutor) {
$ids_tutor[] = $tutor[0];
$nome = $tutor[1] . ' ' . $tutor[2];
$link = CDOMElement::create('a');
$link->setAttribute('id', 'tooltip' . $tutor[0]);
$link->setAttribute('href', 'javascript:void(0);');
$link->addChild(new CText($nome));
$tutors[$tutor[0]] = $link->getHtml();
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:assign_tutor.php
示例20: 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 = '';
}
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:read_event.php
注:本文中的AMA_DataHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论