function _get_course_info($id_course)
{
    $common_dh = $GLOBALS['common_dh'];
    $serviceAr = $common_dh->get_service_info_from_course($id_course);
    if (!AMA_DataHandler::isError($serviceAr)) {
        $service_name = $serviceAr[1];
        $service_level = $serviceAr[3];
        $service_duration = $serviceAr[4];
        $service_max_meeting = $serviceAr[5];
        $service_max_meeting_time = $serviceAr[7] / 60;
    }
    $providerAr = $common_dh->get_tester_info_from_id_course($id_course);
    if (!AMA_DataHandler::isError($providerAr)) {
        $provider = $providerAr['puntatore'];
        $provider_dsn = MultiPort::getDSN($provider);
        $provider_name = $providerAr['nome'];
        $service_country = $providerAr['nazione'] . "/" . $providerAr['provincia'];
    }
    $provider_dh = AMA_DataHandler::instance($provider_dsn);
    $dataHa = $provider_dh->get_course($id_course);
    if (AMA_DataHandler::isError($dataHa) || !is_array($dataHa)) {
        $infomsg = $dataHa->getMessage();
        if ($dataHa->code == AMA_ERR_NOT_FOUND) {
            $service_description = translateFN("Il provider non fornisce attualmente questo servizio");
        }
        // header("Location: $error?err_msg=$msg");
        //return $infomsg;
    } else {
        if (!empty($dataHa['nome'])) {
            $course_infoHa = array();
            // 1.info from table modello_corso
            $service_title = $dataHa['titolo'];
            // $service_name = $dataHa['nome'];
            // 2. description of instance from table modello_corso
            $service_instance_description = $dataHa['descr'];
            // 3. full description from node id_nodo_iniziale
            $id_desc = $id_course . "_" . $dataHa['id_nodo_iniziale'];
            $user_level = "999";
            $nodeHa = $provider_dh->get_node_info($id_desc);
            if (AMA_DataHandler::isError($nodeHa)) {
                //	$errorObj = new ADA_error($nodeHa); //FIXME: mancano gli altri dati
                $service_description = translateFN("Il provider non fornisce attualmente questo servizio");
            } else {
                $service_description = $nodeHa['text'];
            }
        } else {
            $service_description = translateFN("Il provider non fornisce attualmente questo servizio");
        }
    }
    // check on level?
    /*
    if ($service_level > 1){
    	$require_link = "<a href=" . HTTP_ROOT_DIR .  "/browsing/registration.php?id_course=$id_course>" .translateFN('Richiedi'). "</a>";
    } else {
    	$require_link = "<a href=" . HTTP_ROOT_DIR .  "/browsing/view.php?id_course=$id_course&id_node=$id_desc>" .translateFN('Entra'). "</a>";
    }
    */
    if ($service_instance_description == NULL) {
        $service_instance_description = level2descriptionFN($service_level);
    }
    $service_div = CDOMElement::create('div', 'id:service_info');
    $thead_data = array(translateFN('Fornitore'), translateFN('Nome'), translateFN('Paese'), translateFN('Livello'), translateFN('Durata (gg)'), translateFN('Numero incontri'), translateFN('Durata incontro (minuti)'), translateFN('Descrizione servizio'), translateFN('Descrizione dettagliata'));
    $tbody_dataAr = array();
    $tbody_dataAr[] = array($provider_name, $service_name, $service_country, level2stringFN($service_level), $service_duration, $service_max_meeting, $service_max_meeting_time, $service_description, $service_instance_description);
    $element_attributes = "";
    $serviceTable = BaseHtmlLib::tableElement($element_attributes, $thead_data, $tbody_dataAr);
    $service_div->addChild($serviceTable);
    $service_data = $service_div->getHtml();
    return $service_data;
}
示例#2
0
 public function __construct($provider_dataHa, $courseAr, $nodeHa)
 {
     $this->implementorId = $courseAr['id_course'];
     // id_tester,nome,ragione_sociale,indirizzo,citta,provincia,nazione,telefono,e_mail,responsabile,puntatore
     $this->provider_id = $provider_dataHa['id_tester'];
     $this->provider_name = $provider_dataHa['nome'];
     $this->provider_country = $provider_dataHa['nazione'];
     $this->provider_department = $provider_dataHa['provincia'];
     $this->provider_desc = $provider_dataHa['descrizione'];
     $this->provider_e_mail = $provider_dataHa['e_mail'];
     $this->provider_phone = $provider_dataHa['telefono'];
     $this->provider_address = $provider_dataHa['indirizzo'];
     $this->provider_ragsoc = $provider_dataHa['ragione_sociale'];
     $this->provider_responsible = $provider_dataHa['responsabile'];
     $this->provider_city = $provider_dataHa['citta'];
     $this->provider_pointer = $provider_dataHa['puntatore'];
     $this->name = $courseAr['nome'];
     $this->title = $courseAr['titolo'];
     // $this->id_author = $courseAr['id_autore'];
     // $this->id_layout = $courseAr['id_layout'];
     if ($courseAr['descr'] == NULL) {
         $this->descr = level2descriptionFN($serviceAr[3]);
     } else {
         $this->descr = $courseAr['descr'];
     }
     $this->d_create = $courseAr['d_create'];
     $this->d_publish = $courseAr['d_publish'];
     $this->id_start_node = $courseAr['id_nodo_iniziale'];
     //  $this->id_toc_node = $courseAr['id_nodo_toc'];
     //  $this->media_path = $courseAr['media_path'];
     if ($nodeHa['text'] == NULL) {
         //	$errorObj = new ADA_error($nodeHa); //FIXME: mancano gli altri dati
         $this->description = translateFN("Not available");
     } else {
         $this->description = $nodeHa['text'];
     }
 }