Exemple #1
0
function affichage_liste_bulletins_tableau($res)
{
    global $charset, $msg;
    print "<table cellpadding='2' class='exemplaires' width='100%'><tr><th><b>" . $msg[bull_numero] . "</b></th><th><b>" . $msg[bull_mention_date] . "</b></th><th><b>" . $msg['etat_collection_title'] . "</b></th></tr>";
    $odd_even = 1;
    while ($tableau = mysql_fetch_array($res)) {
        if ($odd_even == 0) {
            $pair_impair = "odd";
            $odd_even = 1;
        } else {
            if ($odd_even == 1) {
                $pair_impair = "even";
                $odd_even = 0;
            }
        }
        $tr_javascript = " class='{$pair_impair}' onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='./index.php?lvl=bulletin_display&id=" . $tableau['bulletin_id'] . "';\" style='cursor: pointer' ";
        print "<tr {$tr_javascript}><td><table width='100%'><tr><td style='border:none;width:16px'>" . ($tableau['nbexplnum'] != 0 ? $tableau['nbexplnum'] > 1 ? "<img src='./images/globe_rouge.png' />" : "<img src='./images/globe_orange.png' />" : "") . "</td><td style='border:none;'>" . $tableau['bulletin_numero'] . "</td></tr></table>";
        print "</td><td>";
        if ($tableau['mention_date']) {
            print pmb_bidi(" " . $tableau['mention_date'] . "\n");
        } elseif ($tableau['date_date']) {
            print pmb_bidi(" " . formatdate($tableau['date_date']) . "\n");
        }
        print "</td><td>";
        if ($tableau['bulletin_titre']) {
            print pmb_bidi(" " . htmlentities($tableau['bulletin_titre'], ENT_QUOTES, $charset) . "\n");
        }
        print "</td></tr>";
    }
    print "</table><br /><br />";
}
function list_out_sets()
{
    global $msg, $charset;
    global $connector_out_set_types_msgs;
    $sets = new connector_out_sets();
    $current_type = 0;
    $tableheader = "<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>" . $msg["admin_connecteurs_sets_setcaption"] . "</th>\n\t\t\t\t\t<th>" . $msg["admin_connecteurs_sets_settype"] . "</th>\n\t\t\t\t\t<th>" . $msg["admin_connecteurs_sets_setadditionalinfo"] . "</th>\n\t\t\t\t\t<th>" . $msg["admin_connecteurs_setcateg_latestcacheupdate"] . "</th>\n\t\t\t\t\t<th>" . $msg["admin_connecteurs_setcateg_manualupdate"] . "</th>\n\t\t\t\t</tr>";
    $tablefooter = '</table>';
    $parity = 1;
    foreach ($sets->sets as &$aset) {
        if ($current_type != $aset->type) {
            print $current_type != 0 ? $tablefooter : '';
            print "<h1>" . htmlentities($msg[$connector_out_set_types_msgs[$aset->type]], ENT_QUOTES, $charset) . "</h1>";
            print $tableheader;
            $current_type = $aset->type;
        }
        $pair_impair = $parity++ % 2 ? 'even' : 'odd';
        $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='./admin.php?categ=connecteurs&sub=out_sets&action=edit&id={$aset->id}';\" ";
        print "<tr style='cursor: pointer' class='{$pair_impair}' {$tr_javascript}>";
        print "<td>" . htmlentities($aset->caption, ENT_QUOTES, $charset) . "</td>";
        print "<td>" . htmlentities($msg[$connector_out_set_types_msgs[$aset->type]], ENT_QUOTES, $charset) . "</td>";
        print "<td>" . htmlentities($aset->get_third_column_info(), ENT_QUOTES, $charset) . "</td>";
        $date_caption = strtotime($aset->cache->last_updated_date) ? formatdate($aset->cache->last_updated_date, 1) : $msg["admin_connecteurs_setcateg_latestcacheupdate_never"];
        print "<td>" . htmlentities($date_caption, ENT_QUOTES, $charset) . "</td>";
        print "<td align=\"center\">" . "<input type='button' class='bouton_small' value='" . htmlentities($msg["admin_connecteurs_setcateg_updatemanually"], ENT_QUOTES, $charset) . "' onClick='document.location=\"admin.php?categ=connecteurs&sub=out_sets&action=manual_update&id={$aset->id}\"'/>" . "</td>";
        print "</tr>";
    }
    if (!count($sets->sets)) {
        print '<tr><td colspan="2">' . $msg["admin_connecteurs_sets_nosets"] . '</td></tr>';
    }
    print $tablefooter;
    print "<br /><hr /><input class='bouton' type='button' value=' {$msg['admin_connecteurs_set_add']} ' onClick=\"document.location='./admin.php?categ=connecteurs&sub=out_sets&action=add'\" />";
}
function format_date($value)
{
    if ($value == "") {
        return "";
    }
    return formatdate($value);
}
Exemple #4
0
function expl_list($type, $id)
{
    global $dbh;
    global $msg;
    $requete = "SELECT exemplaires.*, pret.*, docs_location.*, docs_section.*, docs_statut.*";
    $requete .= " FROM exemplaires, docs_location, docs_section, docs_statut";
    $requete .= " LEFT JOIN pret ON exemplaires.expl_id=pret.pret_idexpl";
    // selon le type de données d'origine : ouvrage ou bulletin d'un périodique
    // on adapte la requête
    switch ($type) {
        case 'b':
            $requete .= " WHERE expl_bulletin='{$id}'";
            break;
        case 'm':
        default:
            $requete .= " WHERE expl_notice='{$id}'";
            break;
    }
    $requete .= " AND exemplaires.expl_location=docs_location.idlocation";
    $requete .= " AND exemplaires.expl_section=docs_section.idsection ";
    $requete .= " AND exemplaires.expl_statut=docs_statut.idstatut ";
    $requete .= " AND section_visible_opac = 1 ";
    $requete .= " AND statut_visible_opac = 1 ";
    // récupération du nombre d'exemplaires
    $res = mysql_query($requete, $dbh);
    $compteur = 0;
    while ($expl = mysql_fetch_object($res)) {
        $compteur = $compteur + 1;
        $expl_liste .= "<tr><td>";
        $expl_liste .= $expl->expl_cb . "&nbsp;";
        $expl_liste .= "</td><td><strong>";
        $expl_liste .= $expl->expl_cote . "&nbsp;";
        $expl_liste .= "</strong></td><td>";
        $expl_liste .= $expl->location_libelle . "&nbsp;";
        $expl_liste .= "</td><td>";
        $expl_liste .= $expl->section_libelle . "&nbsp;";
        $situation = "";
        if ($expl->statut_libelle_opac != "") {
            $situation .= $expl->statut_libelle_opac . "<br />";
        }
        if ($expl->pret_flag) {
            if ($expl->pret_retour) {
                // exemplaire sorti
                $situation .= "<strong>{$msg['out_until']} " . formatdate($expl->pret_retour) . '</strong>';
            } else {
                // exemplaire disponible
                $situation .= "<strong>{$msg['available']}</strong>&nbsp;";
            }
        } else {
            $situation .= "<strong>{$msg['exclu']}</strong>";
        }
        $expl_liste .= "</td><td>{$situation} &nbsp;</td>";
        $expl_liste .= "</tr>";
    }
    // affichage de la liste d'exemplaires calculées ci-dessus
    if ($compteur == 0) {
        $expl_liste = "<tr class=even><td colspan=5>" . $msg["no_expl"] . "</td></tr>";
    }
    print pmb_bidi($expl_liste);
}
function affichage_liste_bulletins_depliable($res)
{
    global $charset, $dbh;
    $resultat_aff = "";
    while ($tableau = pmb_mysql_fetch_array($res)) {
        $sql = "SELECT COUNT(1) FROM explnum WHERE explnum_bulletin='" . $tableau["bulletin_id"] . "'";
        $result = @pmb_mysql_query($sql, $dbh);
        $count = pmb_mysql_result($result, 0, 0);
        $titre = "";
        if ($count) {
            $titre .= '<img src="' . get_url_icon('attachment.png') . '">';
        }
        $titre .= $tableau['bulletin_numero'];
        if ($tableau['mention_date']) {
            $titre .= pmb_bidi(" (" . $tableau['mention_date'] . ")\n");
        } elseif ($tableau['date_date']) {
            $titre .= pmb_bidi(" (" . formatdate($tableau['date_date']) . ")\n");
        }
        if ($tableau['bulletin_titre']) {
            $titre .= pmb_bidi(" : " . htmlentities($tableau['bulletin_titre'], ENT_QUOTES, $charset) . "\n");
        }
        //	($id,$titre,$contenu,$maximise=0) {
        $resultat_aff .= gen_plus("bull_id_" . $tableau['bulletin_id'], $titre, get_bulletin_list_func($tableau['bulletin_id']));
    }
    print $resultat_aff;
}
Exemple #6
0
function list_connectors_out()
{
    global $msg, $charset;
    $conns = new connecteurs_out();
    print "\n\t<script type='text/javascript' >\n\t\tfunction show_sources(id) {\n\t\t\tif (document.getElementById(id).style.display=='none') {\n\t\t\t\tdocument.getElementById(id).style.display='';\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdocument.getElementById(id).style.display='none';\n\t\t\t}\n\t\t} \n\t</script>\n\t<table>\n\t\t<tr>\n\t\t\t<th>&nbsp;</th>\n\t\t\t<th>" . $msg["connector_out_service"] . "</th>\n\t\t\t<th>" . $msg["connector_out_sources"] . "</th>\n\t\t\t<th>&nbsp;</th>\n\t\t</tr>";
    $pair_impair = 0;
    $parity = 0;
    foreach ($conns->connectors as $aconn) {
        $pair_impair = $parity++ % 2 ? "even" : "odd";
        $comment = $aconn->comment;
        $sign = $aconn->name . " : " . $comment . " - ";
        $sign .= "Auteur : " . $aconn->author . " - " . $aconn->org . " - ";
        $sign .= formatdate($aconn->date);
        $n_sources = count($aconn->sources);
        $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" ";
        print "<tr class='{$pair_impair}' {$tr_javascript} style='cursor: pointer' title='" . htmlentities($sign, ENT_QUOTES, $charset) . "' alter='" . htmlentities($sign, ENT_QUOTES, $charset) . "' id='tr" . $aconn->id . "'><td>" . ($n_sources ? "<img src='images/plus.gif' class='img_plus' onClick='if (event) e=event; else e=window.event; e.cancelBubble=true; if (e.stopPropagation) e.stopPropagation(); show_sources(\"" . addslashes($aconn->path) . "\"); '/>" : "&nbsp;") . "</td><td onmousedown=\"if (event) e=event; else e=window.event; if (e.srcElement) target=e.srcElement; else target=e.target; if (target.nodeName!='IMG') document.location='./admin.php?categ=connecteurs&sub=out&action=edit&id=" . $aconn->id . "';return false;\">" . htmlentities($aconn->comment, ENT_QUOTES, $charset) . "</td>\n\t\t<td onmousedown=\"if (event) e=event; else e=window.event; if (e.srcElement) target=e.srcElement; else target=e.target; if (target.nodeName!='IMG') document.location='./admin.php?categ=connecteurs&sub=out&action=edit&id=" . $aconn->id . "';return false;\">" . sprintf($msg["connecteurs_count_sources"], $n_sources) . "</td><td style='text-align:right'><input type='button' value='" . $msg["connector_out_sourceadd"] . "' class='bouton_small' onClick='document.location=\"admin.php?categ=connecteurs&sub=out&action=source_add&connector_id=" . $aconn->id . "\"'/></td></tr>\n";
        print "<tr class='{$pair_impair}' style='display:none' id='" . $aconn->path . "'><td>&nbsp;</td><td colspan='3'><table style='border:1px solid'>";
        $parity_source = 0;
        foreach ($aconn->sources as $asource) {
            $pair_impair_source = $parity_source++ % 2 ? "even" : "odd";
            $tr_javascript_source = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair_source}'\" onmousedown=\"if (event) e=event; else e=window.event; if (e.srcElement) target=e.srcElement; else target=e.target; if (target.nodeName!='INPUT') document.location='./admin.php?categ=connecteurs&sub=out&action=source_edit&connector_id=" . $aconn->id . "&source_id=" . $asource->id . "';return false;\" ";
            print "<tr style='cursor: pointer' class='{$pair_impair_source}' {$tr_javascript_source}>\n\t\t\t\t<td>" . htmlentities($asource->name, ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td>" . htmlentities(substr($asource->comment, 0, 60), ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td></td><td></td></tr>";
        }
        print "</table></td></tr>";
    }
    print "</table>";
}
Exemple #7
0
 function gen_print_transactions($data, $tpl = '')
 {
     global $msg, $pmb_gestion_devise;
     $default_template = "@!{{biblio.name}}!\r\n{{biblio.adr1}}\r\n{{biblio.town}}\r\n{{biblio.phone}}\r\n{{biblio.email}}\r\n\r\n" . $msg["fpdf_edite"] . " " . formatdate(date("Y-m-d", time())) . "\n\r\nEmprunteur:\r\n{% for empr in empr_list %}\r\n{{empr.name}} {{empr.fistname}}\r\n{% endfor %}\r\n\n{% for data in empr_list %}\n" . $msg["transactype_ticket_solde"] . "{{compte_autre.solde}} " . $pmb_gestion_devise . "\n{% endfor %}\n\n\r\nVA @";
     if (!$tpl) {
         $tpl = $default_template;
     }
     return H2o::parseString($tpl)->render($data);
 }
 public function get_notice_id()
 {
     global $pmb_keyword_sep;
     $notice_id = 0;
     $this->data = array();
     $this->data['tit1'] = $this->data['tit4'] = $this->data['authors'] = $this->data['co_authors'] = $this->data['code'] = $this->data['npages'] = $this->data['year'] = $this->data['index_l'] = $this->data['url'] = $this->data['thumbnail_content'] = $this->data['publisher'] = $this->data['n_resume'] = "";
     if ($this->mimetype == "application/epub+zip") {
         //pour les ebook, on gère ca directement ici !
         $this->data['tit1'] = $this->metas['title'][0];
         $this->data['authors'] = $this->metas['creator'];
         $this->data['co_authors'] = $this->metas['contributor'];
         if ($this->metas['identifier']['isbn']) {
             $this->data['code'] = \formatISBN($this->metas['identifier']['isbn'], 13);
         } else {
             if ($this->metas['identifier']['ean']) {
                 $this->data['code'] = \EANtoISBN($this->metas['identifier']['ean']);
                 $this->data['code'] = \formatISBN($code, 13);
             }
         }
         if ($this->metas['identifier']['uri']) {
             $this->data['url'] = \clean_string($this->metas['identifier']['uri']);
         }
         $this->data['publisher'] = $this->metas['publisher'][0];
         $this->data['year'] = $this->metas['date'][0]['value'];
         if (strlen($this->data['year']) && strlen($this->data['year']) != 4) {
             $this->data['year'] = \formatdate(detectFormatDate($this->data['year']));
         }
         $this->data['lang'] = $this->metas['language'];
         $this->data['n_resume'] = implode("\n", $this->metas['description']);
         $this->data['keywords'] = implode($pmb_keyword_sep, $this->metas['subject']);
         $this->data['thumbnail_content'] = $this->metas['thumbnail_content'];
     } else {
         foreach ($this->map['meta'] as $map_field => $map) {
             foreach ($this->metas as $meta_field => $meta_value) {
                 if ($map_field == $meta_field) {
                     if (method_exists($this, $map['function'])) {
                         $this->data[$map['field']] = $this->{$map}['function']($this->data[$map['field']], $meta_value, $map['params']);
                     } else {
                         $this->data[$map['field']] = $meta_value;
                     }
                     break;
                 }
             }
         }
     }
     if (!$this->data['tit1']) {
         $this->data['tit1'] = $this->name;
     }
     $notice_id = $this->create_notice();
     $notice_id = $this->dedoublonne($notice_id);
     return $notice_id;
 }
 public function getCheckoutListShippings($adv_user)
 {
     $jshopConfig = JSFactory::getConfig();
     $cart = $this->getCart();
     $shippingmethod = JSFactory::getTable('shippingMethod', 'jshop');
     $shippingmethodprice = JSFactory::getTable('shippingMethodPrice', 'jshop');
     $id_country = $this->getAnyIdCountry($adv_user);
     if (!$id_country) {
         $this->setError(_JSHOP_REGWARN_COUNTRY);
         return false;
     }
     if ($jshopConfig->show_delivery_time_checkout) {
         $deliverytimes = JSFactory::getAllDeliveryTime();
         $deliverytimes[0] = '';
     }
     if ($jshopConfig->show_delivery_date) {
         $deliverytimedays = JSFactory::getAllDeliveryTimeDays();
     }
     $sh_pr_method_id = $cart->getShippingPrId();
     $active_shipping = intval($sh_pr_method_id);
     $payment_id = $cart->getPaymentId();
     $shippings = $shippingmethod->getAllShippingMethodsCountry($id_country, $payment_id);
     foreach ($shippings as $key => $value) {
         $shippingmethodprice->load($value->sh_pr_method_id);
         if ($jshopConfig->show_list_price_shipping_weight) {
             $shippings[$key]->shipping_price = $shippingmethodprice->getPricesWeight($value->sh_pr_method_id, $id_country, $cart);
         }
         $prices = $shippingmethodprice->calculateSum($cart);
         $shippings[$key]->calculeprice = $prices['shipping'] + $prices['package'];
         $shippings[$key]->delivery = '';
         $shippings[$key]->delivery_date_f = '';
         if ($jshopConfig->show_delivery_time_checkout) {
             $shippings[$key]->delivery = $deliverytimes[$value->delivery_times_id];
         }
         if ($jshopConfig->show_delivery_date) {
             $day = $deliverytimedays[$value->delivery_times_id];
             if ($day) {
                 $shippings[$key]->delivery_date = getCalculateDeliveryDay($day);
                 $shippings[$key]->delivery_date_f = formatdate($shippings[$key]->delivery_date);
             }
         }
         if ($value->sh_pr_method_id == $active_shipping) {
             $params = $cart->getShippingParams();
         } else {
             $params = array();
         }
         $shippings[$key]->form = $shippingmethod->loadShippingForm($value->shipping_id, $value, $params);
     }
     return $shippings;
 }
Exemple #10
0
function show_rapport()
{
    global $msg, $dbh, $base_path, $report_task, $report_error, $task_id, $type_task_id;
    $query_chk = "select id_tache from taches where id_tache=" . $task_id;
    $res_chk = mysql_query($query_chk, $dbh);
    if (mysql_num_rows($res_chk) == '1') {
        //date de génération du rapport
        $rs = mysql_query("select curdate()");
        $date_MySQL = mysql_result($rs, $row);
        $tasks = new taches();
        foreach ($tasks->types_taches as $type_tache) {
            if ($type_tache->id_type == $type_task_id) {
                require_once $base_path . "/admin/planificateur/" . $type_tache->name . "/" . $type_tache->name . ".class.php";
                eval("\$conn=new " . $type_tache->name . "(\"" . $base_path . "/admin/planificateur/" . $type_tache->name . "\");");
                $task_datas = $conn->get_report_datas($task_id);
                //affiche le rapport avec passage du template
                $report_task = str_replace("!!print_report!!", "<a onclick=\"openPopUp('./pdf.php?pdfdoc=rapport_tache&type_task_id={$type_task_id}&task_id=" . $task_id . "', 'Fiche', 500, 400, -2, -2, 'toolbar=no, dependent=yes, resizable=yes, scrollbars=yes')\" href=\"#\"><img src='" . $base_path . "/images/print.gif' alt='Imprimer...' /></a>", $report_task);
                $report_task = str_replace("!!type_tache_name!!", $type_tache->comment, $report_task);
                $report_task = str_replace("!!planificateur_task_name!!", $msg["planificateur_task_name"], $report_task);
                $report_task = str_replace("!!date_mysql!!", formatdate($date_MySQL), $report_task);
                $report_task = str_replace("!!libelle_date_generation!!", $msg["tache_date_generation"], $report_task);
                $report_task = str_replace("!!libelle_date_derniere_exec!!", $msg["tache_date_dern_exec"], $report_task);
                $report_task = str_replace("!!libelle_heure_derniere_exec!!", $msg["tache_heure_dern_exec"], $report_task);
                $report_task = str_replace("!!libelle_date_fin_exec!!", $msg["tache_date_fin_exec"], $report_task);
                $report_task = str_replace("!!libelle_heure_fin_exec!!", $msg["tache_heure_fin_exec"], $report_task);
                $report_task = str_replace("!!libelle_statut_exec!!", $msg["tache_statut"], $report_task);
                $report_task = str_replace("!!report_execution!!", $msg["tache_report_execution"], $report_task);
                $report_task = str_replace("!!id!!", $task_datas["id_tache"], $report_task);
                $report_task = str_replace("!!libelle_task!!", stripslashes($task_datas["libelle_tache"]), $report_task);
                $report_task = str_replace("!!date_dern_exec!!", formatdate($task_datas['start_at'][0]), $report_task);
                $report_task = str_replace("!!heure_dern_exec!!", $task_datas['start_at'][1], $report_task);
                $report_task = str_replace("!!date_fin_exec!!", formatdate($task_datas['end_at'][0]), $report_task);
                $report_task = str_replace("!!heure_fin_exec!!", $task_datas['end_at'][1], $report_task);
                $report_task = str_replace("!!status!!", $msg["planificateur_state_" . $task_datas["status"]], $report_task);
                $report_task = str_replace("!!percent!!", $task_datas["indicat_progress"], $report_task);
                $report_execution = $conn->show_report($task_datas["rapport"]);
                $report_task = str_replace("!!rapport!!", $report_execution, $report_task);
                ajax_http_send_response($report_task);
                return;
            }
        }
    } else {
        // contenu non disponible
        $report_task = "Contenu non disponible";
        ajax_http_send_response($report_error);
        //		ajax_http_send_error('400',$msg['error_message_invalid_date']);
        return;
    }
}
Exemple #11
0
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0)
{
    global $nb_per_page;
    global $base_url;
    global $caller;
    global $msg;
    global $charset;
    global $idaction;
    global $current_note;
    $user_input = str_replace('*', '%', $user_input);
    if ($user_input == "") {
        $req_count = "select count(1) from demandes_notes where num_action='" . $idaction . "' and id_note !='" . $current_note . "'";
    } else {
        $req_count = "select count(1) from demandes_notes where num_action='" . $idaction . "' and contenu like '%" . $user_input . "%' and id_note !='" . $current_note . "'";
    }
    $res = pmb_mysql_query($req_count, $dbh);
    $nbr_lignes = @pmb_mysql_result($res, 0, 0);
    if (!$page) {
        $page = 1;
    }
    $debut = ($page - 1) * $nb_per_page;
    if ($nbr_lignes) {
        // on lance la vraie requête
        if ($user_input == "") {
            $req = "select id_note, date_note, CONCAT(SUBSTRING(contenu,1,50),'','...') as note from demandes_notes where num_action='" . $idaction . "' and id_note !='" . $current_note . "'";
        } else {
            $req = "select id_note, date_note, CONCAT(SUBSTRING(contenu,1,50),'','...') as note from demandes_notes where num_action='" . $idaction . "' and contenu like '%" . $user_input . "%' and id_note !='" . $current_note . "'";
        }
        $res = pmb_mysql_query($req, $dbh);
        while ($note = pmb_mysql_fetch_object($res)) {
            print "<div class='row'>";
            print "<a href='#' onclick=\"set_parent('{$caller}', '{$note->id_note}', '" . htmlentities(addslashes($note->note), ENT_QUOTES, $charset) . "')\"> [" . htmlentities(formatdate($note->date_note), ENT_QUOTES, $charset) . '] ' . htmlentities($note->note, ENT_QUOTES, $charset) . "</a>";
            print "</div>";
        }
        pmb_mysql_free_result($res);
        // constitution des liens
        $nbepages = ceil($nbr_lignes / $nb_per_page);
        $suivante = $page + 1;
        $precedente = $page - 1;
    }
    print "<div class='row'>&nbsp;<hr /></div><div align='center'>";
    $url_base = $base_url . "&user_input=" . rawurlencode(stripslashes($user_input));
    $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
    print $nav_bar;
    print "</div>";
}
function bulletinage_bulletin($fiche, $x, $y, $link, $short = 0, $longmax = 99999)
{
    global $ourPDF;
    global $msg;
    global $pmb_pdf_font;
    $ourPDF->SetXY($x, $y);
    $ourPDF->setFont($pmb_pdf_font, '', 8);
    $ourPDF->multiCell(190, 3, formatdate($fiche['date_parution']), 0, 'L', 0);
    $ourPDF->SetXY($x + 20, $y);
    $ourPDF->setFont($pmb_pdf_font, '', 8);
    $titre = $fiche['libelle_notice'] . " / " . $fiche['libelle_abonnement'];
    $lgTitre = strlen($titre);
    if ($lgTitre > 110) {
        $titre = substr($titre, 0, 110) . "...";
    }
    $ourPDF->multiCell(120, 3, $titre . ". " . $fiche['cote'], 0, 'L', 0);
    $ourPDF->SetXY($x + 140, $y);
    $ourPDF->setFont($pmb_pdf_font, 'B', 8);
    $ourPDF->multiCell(190, 3, $fiche['libelle_numero'], 0, 'L', 0);
}
Exemple #13
0
function show_form($id, $type)
{
    global $dbh, $msg;
    if ($type == 'ask') {
        $title = $msg['demandes_question_form'];
        $btn = $msg['demandes_save_question'];
    } elseif ($type == 'info') {
        $title = $msg['demandes_info_form'];
        $btn = $msg['demandes_save_info'];
    } elseif ($type == 'rdv') {
        $title = $msg['demandes_rdv_form'];
        $btn = $msg['demandes_save_rdv'];
        $date = date('Ymd', time());
        $div_date = "\n\t\t<div class='row' >\n\t\t\t<label class='etiquette' >" . $msg['demandes_action_date_rdv'] . "</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<blockquote>\n\t\t\t\t<input type='hidden' id='date_rdv' name='date_rdv' value='{$date}' />\n\t\t\t\t<input type='button' class='bouton' id='date_rdv_btn' name='date_rdv_btn' value='" . formatdate($date) . "' onClick=\"window.open('./select.php?what=calendrier&caller=liste_action&date_caller={$date}&param1=date_rdv&param2=date_rdv_btn&auto_submit=NO&date_anterieure=YES', 'date_rdv', 'width=250,height=300,toolbar=no,dependent=yes,resizable=yes')\"/>\n\t\t\t</blockquote>\n\t\t</div>";
    }
    $display .= "\n\t\t<div class='row'>\n\t\t\t<h3>" . $title . "</h3>\n\t\t</div>";
    if ($div_date) {
        $display .= $div_date;
    }
    $display .= "\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' >" . $msg['demandes_action_sujet'] . "</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<blockquote>\n\t\t\t<input type='text' name='sujet' id='sujet' />\n\t\t\t</blockquote>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' >" . $msg['demandes_action_detail'] . "</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<blockquote>\n\t\t\t\t<textarea style='vertical-align:top' id='detail' name='detail' cols='50' rows='5'></textarea>\n\t\t\t</blockquote>\n\t\t</div>\t\t\t\t\n\t\t<input type='button' class='bouton' name='ask' id='ask' value='" . $btn . "' />\n\t\t<input type='button' class='bouton' name='cancel' id='cancel' value='" . $msg['demandes_cancel'] . "' />\n\t\t";
    ajax_http_send_response($display);
}
Exemple #14
0
function DoPrivateMessageBar()
{
    global $loguserid, $loguser;
    if ($loguserid) {
        $unread = FetchResult("select count(*) from {pmsgs} where userto = {0} and msgread=0 and drafting=0", $loguserid);
        $content = "";
        if ($unread) {
            $pmNotice = $loguser['usebanners'] ? "id=\"pmNotice\" " : "";
            $rLast = Query("select * from {pmsgs} where userto = {0} and msgread=0 order by date desc limit 0,1", $loguserid);
            $last = Fetch($rLast);
            $rUser = Query("select * from {users} where id = {0}", $last['userfrom']);
            $user = Fetch($rUser);
            $content .= format("\n\t\t" . __("You have {0}{1}. {2}Last message{1} from {3} on {4}."), Plural($unread, format(__("new {0}private message"), "<a href=\"" . actionLink("private") . "\">")), "</a>", "<a href=\"" . actionLink("showprivate", $last['id']) . "\">", UserLink($user), formatdate($last['date']));
        }
        if ($loguser['newcomments']) {
            $content .= format("\n\t\t" . __("You {0} have new comments in your {1}profile{2}."), $content != "" ? "also" : "", "<a href=\"" . actionLink("profile", $loguserid) . "\">", "</a>");
        }
        if ($content) {
            write("\n\t<div {0} class=\"outline margin header0 cell0 smallFonts\">\n\t\t{1}\n\t</div>\n", $pmNotice, $content);
        }
    }
}
Exemple #15
0
function bulletinage_abt($fiche, $x, $y, $link, $short = 0, $longmax = 99999)
{
    global $ourPDF;
    global $msg;
    global $pmb_pdf_font;
    $ourPDF->SetXY($x, $y);
    $ourPDF->setFont($pmb_pdf_font, '', 8);
    $ourPDF->multiCell(190, 8, formatdate($fiche['date']), 0, 'L', 0);
    $ourPDF->SetXY($x + 20, $y);
    $ourPDF->setFont($pmb_pdf_font, '', 8);
    $titre = $fiche['tit1'] . " / " . $fiche['abt_name'];
    $lgTitre = strlen($titre);
    if ($lgTitre > 140) {
        $titre = substr($titre, 0, 140) . "...";
    }
    $ourPDF->multiCell(180, 8, $titre . ". " . $fiche['cote'], 0, 'L', 0);
    /*	
    	$ourPDF->SetXY ($x+140,$y);
    	$ourPDF->setFont($pmb_pdf_font, 'B', 8);
    	$ourPDF->multiCell(190, 8, $fiche['libelle_numero'], 0, 'L', 0);
    */
}
Exemple #16
0
 }
 if ($coord_fac->tel1 != '') {
     $adr_fac .= $text_adr_fac_tel . " " . $coord_fac->tel1 . "\n";
 }
 if ($coord_fac->fax != '') {
     $adr_fac .= $text_adr_fac_fax . " " . $coord_fac->fax . "\n";
 }
 if ($coord_fac->email != '') {
     $adr_fac .= $text_adr_fac_email . " " . $coord_fac->email . "\n";
 }
 $ourPDF->setFontSize($fs_adr_fac);
 $ourPDF->SetXY($x_adr_fac, $y_adr_fac);
 $ourPDF->MultiCell($l_adr_fac, $h_adr_fac, $adr_fac, 0, 'L', 0);
 //Affichage numero facture et numero commande
 $numero = str_replace('!!numero!!', $fac->numero, $text_num_fac);
 $numero = str_replace('!!date!!', formatdate($fac->date_acte), $numero);
 $numero .= "\n" . $text_num_cde . " " . $cde->numero . "\n";
 $numero .= $text_fac_ref_fou . " " . $fac->reference;
 $ourPDF->SetFontSize($fs_num);
 $ourPDF->SetXY($x_num, $y_num);
 $ourPDF->MultiCell($l_num, $h_num, $numero, 0, 'L', 0);
 $ourPDF->Ln();
 //Affichage lignes facture
 $ourPDF->SetAutoPageBreak(false);
 $ourPDF->AliasNbPages();
 $ourPDF->SetFontSize($fs_tab);
 $ourPDF->SetFillColor(230);
 $ourPDF->Ln();
 $y = $ourPDF->GetY();
 $ourPDF->SetXY($x_tab, $y);
 $x_code = $x_tab;
Exemple #17
0
  } else {
      print $this->currency;
  }
  ?>
 </td>
 <td>
  <?php 
  if ($row->coupon_start_date != '0000-00-00') {
      print formatdate($row->coupon_start_date);
  }
  ?>
 </td>
 <td>
  <?php 
  if ($row->coupon_expire_date != '0000-00-00') {
      print formatdate($row->coupon_expire_date);
  }
  ?>
 </td>
 <td class="center">
  <?php 
  if ($row->finished_after_used) {
      print _JSHOP_YES;
  } else {
      print _JSHOP_NO;
  }
  ?>
 </td>
 <td class="center">
  <?php 
  if ($row->for_user_id) {
Exemple #18
0
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: blocage.php,v 1.7 2015-04-03 11:16:23 jpermanne Exp $
$base_path = "..";
$base_auth = "CIRCULATION_AUTH";
$base_nobody = 1;
$base_nodojo = 1;
require_once $base_path . "/includes/init.inc.php";
$requete = "select * from empr where id_empr=" . $id_empr;
$resultat = pmb_mysql_query($requete);
$empr = pmb_mysql_fetch_object($resultat);
switch ($act) {
    case 'prolong':
        if ($date_prolong) {
            $requete = "update empr set date_fin_blocage='" . $date_prolong . "' where id_empr=" . $id_empr;
            pmb_mysql_query($requete);
        }
        break;
    case 'annul':
        $requete = "update empr set date_fin_blocage='0000-00-00' where id_empr=" . $id_empr;
        pmb_mysql_query($requete);
        break;
}
if (!$act) {
    print "<body class='circ'>";
    print "<form class='form-circ' name='blocage_form' method='post' action='./blocage.php?id_empr={$id_empr}'>";
    print pmb_bidi("<h3>" . $empr->empr_prenom . " " . $empr->empr_nom . "</h3>\n\t<div class='form-contenu'>\n\t\t<div class='row'>\n\t\t\t<input type='radio' name='act' value='prolong' id='prolong' checked><label for='prolong'>" . sprintf($msg["blocage_params_jusque"], "<input type='button' value='" . formatdate($empr->date_fin_blocage) . "' name='date_prolong_lib' class='bouton' onClick=\"openPopUp('../select.php?what=calendrier&caller=blocage_form&date_caller=" . str_replace("-", "", $empr->date_fin_blocage) . "&param1=date_prolong&param2=date_prolong_lib&auto_submit=NO', 'date_blocage', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes');\"/>") . "</label>\n\t\t\t<input type='hidden' name='date_prolong' value='" . $empr->date_fin_blocage . "'/>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<input type='radio' name='act' value='annul' id='annul'><label for='annul'>" . $msg["blocage_params_deblocage"] . "</label>\n\t\t</div>\n\t\t<div class='row'></div>\n\t</div>\n\t<div class='row'>\n\t\t<input type='submit' value='" . $msg["blocage_params_apply"] . "' class='bouton'/>&nbsp;<input type='button' class='bouton' value='" . $msg["76"] . "' onClick=\"self.close();\"/>\n\t</div>\n\t");
} else {
    echo "<script>opener.document.location='../circ.php?categ=pret&id_empr={$id_empr}'; self.close();</script>";
}
print "</body></html>";
Exemple #19
0
 function command_waiting($id_tache, $cmd = '')
 {
     global $dbh, $msg;
     $requete_sql = "select status, commande from taches where id_tache='" . $id_tache . "' and end_at='0000-00-00 00:00:00'";
     $result = mysql_query($requete_sql);
     if (mysql_num_rows($result) == "1") {
         $status = mysql_result($result, 0, "status");
         $commande = mysql_result($result, 0, "commande");
     } else {
         $status = '';
         $commande = 0;
     }
     // une commande a déjà été envoyée auparavant...
     if ($commande != '0') {
         $cmd = $commande;
     }
     if ($cmd != '') {
         //check command - la commande envoyée est vérifié par rapport au status
         foreach ($this->types_taches as $type_tache) {
             foreach ($type_tache->states as $state) {
                 if ($state["id"] == $status) {
                     foreach ($state["nextState"] as $nextState) {
                         foreach ($type_tache->commands as $command) {
                             if ($nextState["command"] == $command["name"]) {
                                 if ($command["id"] == $cmd) {
                                     mysql_query("update taches set commande=" . $cmd . ", next_state='" . constant($nextState["value"]) . "' where id_tache=" . $id_tache, $dbh);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     $rs = mysql_query("select t.start_at, t.commande, p.calc_next_date_deb, p.calc_next_heure_deb \n\t\t\tfrom taches t , planificateur p \n\t\t\twhere t.num_planificateur = p.id_planificateur \n\t\t\tand id_tache=" . $id_tache);
     $tpl = "<td id='commande_tache_" . $id_tache . "'>";
     if ($rs) {
         $row = mysql_fetch_object($rs);
         if ($row->start_at == '0000-00-00 00:00:00') {
             $tpl .= htmlentities(formatdate($row->calc_next_date_deb), ENT_QUOTES, $charset) . " " . htmlentities($row->calc_next_heure_deb, ENT_QUOTES, $charset);
         } else {
             if ($row->start_at != '0000-00-00 00:00:00' && $row->commande != NULL) {
                 $tpl .= utf8_normalize($msg["planificateur_command_{$row->commande}"]);
             }
         }
     }
     $tpl .= "</td>";
     return $tpl;
 }
Exemple #20
0
 function show_rdv_val_form()
 {
     global $form_communication, $dbh, $charset, $msg;
     $req_dmde = "select id_demande, titre_demande from demandes\n\t\t\tjoin demandes_actions on num_demande=id_demande\n\t\t\tjoin demandes_users du on du.num_demande=id_demande\n\t\t\tand type_action=4 \n\t\t\tand statut_action=2 \n\t\t\tand num_user='******' group by id_demande";
     $res_dmde = pmb_mysql_query($req_dmde, $dbh);
     if (pmb_mysql_num_rows($res_dmde)) {
         while ($dmde = pmb_mysql_fetch_object($res_dmde)) {
             $dmde_action = "onclick=document.location='./demandes.php?categ=gestion&act=see_dmde&iddemande=" . $dmde->id_demande . "'";
             $list .= "<tr id='demande_{$dmde->id_demande}' {$dmde_action} style='cursor: pointer'>";
             $list .= "<td colspan=8>" . htmlentities($dmde->titre_demande, ENT_QUOTES, $charset) . "</td>";
             $list .= "</tr>";
             $req_act = "select id_action, sujet_action,detail_action,date_action, deadline_action, temps_passe, cout, progression_action, actions_read_gestion \n\t\t\t\tfrom demandes_actions \n\t\t\t\twhere num_demande='" . $dmde->id_demande . "'\n\t\t\t\tand type_action=4 \n\t\t\t\tand statut_action=2";
             $res_act = pmb_mysql_query($req_act, $dbh);
             if (pmb_mysql_num_rows($res_act)) {
                 $parity = 1;
                 while ($com = pmb_mysql_fetch_object($res_act)) {
                     if ($parity % 2) {
                         $pair_impair = "even";
                     } else {
                         $pair_impair = "odd";
                     }
                     $parity += 1;
                     $tr_javascript = "onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='" . $pair_impair . "'\" ";
                     $action = "onclick=document.location='./demandes.php?categ=action&act=see&idaction=" . $com->id_action . "'";
                     $list .= "<tr class='{$pair_impair}' id='act_{$com->id_action}' {$tr_javascript} style='cursor: pointer'>\n\t\t\t\t\t \t\t<td>&nbsp;</td>\n\t\t\t\t\t \t\t<td {$action}>" . htmlentities($com->sujet_action, ENT_QUOTES, $charset) . "</td>\n\t\t\t\t\t\t\t<td {$action}>" . htmlentities($com->detail_action, ENT_QUOTES, $charset) . "</td>\t\t\t\t\n\t\t\t\t\t\t\t<td {$action}>" . htmlentities(formatdate($com->date_action), ENT_QUOTES, $charset) . "</td>\n\t\t\t\t\t\t\t<td {$action}>" . htmlentities($com->temps_passe . $msg['demandes_action_time_unit'], ENT_QUOTES, $charset) . "</td>\n\t\t\t\t\t\t\t<td {$action}><img src=\"./images/jauge.png\" height='15px' width=\"" . $com->progression_action . "%\" title='" . $com->progression_action . "%' /></td>\n\t\t\t\t\t\t\t<td><input type='checkbox' id='chk[" . $com->id_action . "]' name='chk[]' value='" . $com->id_action . "'></td>\n\t\t\t\t\t\t</tr>";
                 }
             } else {
                 $list = "<tr><td>" . htmlentities($msg['demandes_no_rdv_val'], ENT_QUOTES, $charset) . "</td></tr>";
             }
         }
     } else {
         $list = "<tr><td>" . htmlentities($msg['demandes_no_rdv_val'], ENT_QUOTES, $charset) . "</td></tr>";
     }
     $btn_action = "<input type='submit' class='bouton' name='val_rdv' id='val_rdv' value='" . $msg['demandes_action_valid_rdv'] . "' onclick='this.form.act.value=\"val_rdv\"'>";
     $form_communication = str_replace('!!btn_action!!', $btn_action, $form_communication);
     $form_communication = str_replace('!!form_title!!', $msg['demandes_menu_rdv_a_valide'], $form_communication);
     $form_communication = str_replace('!!liste_comm!!', $list, $form_communication);
     $form_communication = str_replace('!!action!!', 'demandes.php?categ=action&sub=rdv_val', $form_communication);
     print $form_communication;
 }
 function show()
 {
     $order_id = JRequest::getInt("order_id");
     $lang = JSFactory::getLang();
     $db = JFactory::getDBO();
     $jshopConfig = JSFactory::getConfig();
     $orders = $this->getModel("orders");
     $order = JTable::getInstance('order', 'jshop');
     $order->load($order_id);
     $orderstatus = JTable::getInstance('orderStatus', 'jshop');
     $orderstatus->load($order->order_status);
     $name = $lang->get("name");
     $order->status_name = $orderstatus->{$name};
     $id_vendor_cuser = getIdVendorForCUser();
     $shipping_method = JTable::getInstance('shippingMethod', 'jshop');
     $shipping_method->load($order->shipping_method_id);
     $name = $lang->get("name");
     $order->shipping_info = $shipping_method->{$name};
     $pm_method = JTable::getInstance('paymentMethod', 'jshop');
     $pm_method->load($order->payment_method_id);
     $order->payment_name = $pm_method->{$name};
     $order_items = $order->getAllItems();
     if ($jshopConfig->admin_show_vendors) {
         $tmp_order_vendors = $order->getVendors();
         $order_vendors = array();
         foreach ($tmp_order_vendors as $v) {
             $order_vendors[$v->id] = $v;
         }
     }
     $order->weight = $order->getWeightItems();
     $order_history = $order->getHistory();
     $lists['status'] = JHTML::_('select.genericlist', $orders->getAllOrderStatus(), 'order_status', 'class = "inputbox" size = "1" id = "order_status"', 'status_id', 'name', $order->order_status);
     $country = JTable::getInstance('country', 'jshop');
     $country->load($order->country);
     $field_country_name = $lang->get("name");
     $order->country = $country->{$field_country_name};
     $d_country = JTable::getInstance('country', 'jshop');
     $d_country->load($order->d_country);
     $field_country_name = $lang->get("name");
     $order->d_country = $d_country->{$field_country_name};
     $order->title = $jshopConfig->user_field_title[$order->title];
     $order->d_title = $jshopConfig->user_field_title[$order->d_title];
     $order->birthday = getDisplayDate($order->birthday, $jshopConfig->field_birthday_format);
     $order->d_birthday = getDisplayDate($order->d_birthday, $jshopConfig->field_birthday_format);
     $jshopConfig->user_field_client_type[0] = "";
     $order->client_type_name = $jshopConfig->user_field_client_type[$order->client_type];
     $order->order_tax_list = $order->getTaxExt();
     if ($order->coupon_id) {
         $coupon = JTable::getInstance('coupon', 'jshop');
         $coupon->load($order->coupon_id);
         $order->coupon_code = $coupon->coupon_code;
     }
     $tmp_fields = $jshopConfig->getListFieldsRegister();
     $config_fields = $tmp_fields["address"];
     $count_filed_delivery = $jshopConfig->getEnableDeliveryFiledRegistration('address');
     $display_info_only_product = 0;
     if ($jshopConfig->admin_show_vendors && $id_vendor_cuser) {
         if ($order->vendor_id != $id_vendor_cuser) {
             $display_info_only_product = 1;
         }
     }
     $display_block_change_order_status = $order->order_created;
     if ($jshopConfig->admin_show_vendors && $id_vendor_cuser) {
         if ($order->vendor_id != $id_vendor_cuser) {
             $display_block_change_order_status = 0;
         }
         foreach ($order_items as $k => $v) {
             if ($v->vendor_id != $id_vendor_cuser) {
                 unset($order_items[$k]);
             }
         }
     }
     $order->delivery_time_name = '';
     $order->delivery_date_f = '';
     if ($jshopConfig->show_delivery_time_checkout) {
         $deliverytimes = JSFactory::getAllDeliveryTime();
         $order->delivery_time_name = $deliverytimes[$order->delivery_times_id];
         if ($order->delivery_time_name == "") {
             $order->delivery_time_name = $order->delivery_time;
         }
     }
     if ($jshopConfig->show_delivery_date && !datenull($order->delivery_date)) {
         $order->delivery_date_f = formatdate($order->delivery_date);
     }
     $stat_download = $order->getFilesStatDownloads(1);
     JPluginHelper::importPlugin('jshoppingorder');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeDisplayOrderAdmin', array(&$order, &$order_items, &$order_history));
     $print = JRequest::getInt("print");
     $view = $this->getView("orders", 'html');
     $view->setLayout("show");
     $view->assign('config', $jshopConfig);
     $view->assign('order', $order);
     $view->assign('order_history', $order_history);
     $view->assign('order_items', $order_items);
     $view->assign('lists', $lists);
     $view->assign('print', $print);
     $view->assign('config_fields', $config_fields);
     $view->assign('count_filed_delivery', $count_filed_delivery);
     $view->assign('display_info_only_product', $display_info_only_product);
     $view->assign('current_vendor_id', $id_vendor_cuser);
     $view->assign('display_block_change_order_status', $display_block_change_order_status);
     $view->_tmp_ext_discount = '';
     $view->_tmp_ext_shipping_package = '';
     $view->assign('stat_download', $stat_download);
     if ($jshopConfig->admin_show_vendors) {
         $view->assign('order_vendors', $order_vendors);
     }
     JPluginHelper::importPlugin('jshoppingadmin');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeShowOrder', array(&$view));
     $view->displayShow();
 }
Exemple #22
0
 function get_perio($id)
 {
     //on simplifie les appels..
     if (strpos($id, "es") !== false) {
         return $this->get_perio_ex($id);
     }
     global $msg, $charset, $dbh;
     global $f_bull_deb_id, $opac_bull_results_per_page, $page, $opac_fonction_affichage_liste_bull, $bull_date_start, $bull_date_end;
     global $bull_num_deb;
     global $flag_no_get_bulletin;
     global $recherche_ajax_mode;
     //on surcharge pour l'affichage des périos en affichage django
     global $lvl;
     global $opac_notices_format;
     if ($opac_notices_format == AFF_ETA_NOTICES_TEMPLATE_DJANGO) {
         $lvl = 'notice_display';
     }
     $flag_no_get_bulletin = 1;
     $opac_notices_depliable = 0;
     $resultat_aff .= aff_notice($id, 0, 1, 0, "", 0, 0, 1, $recherche_ajax_mode);
     /*
     $notice = new notice_affichage($id) ;
     $notice->do_header();
     $notice->do_public();
     //$notice->do_isbd();
     $notice->genere_simple(0, 'PUBLIC') ;					
     $resultat_aff .= $notice->result;	
     */
     $requete = "SELECT notice_id, niveau_biblio,typdoc,opac_visible_bulletinage FROM notices WHERE notice_id='{$id}'  and (opac_visible_bulletinage&0x1) LIMIT 1";
     $res = @pmb_mysql_query($requete, $dbh);
     if ($obj = pmb_mysql_fetch_object($res)) {
         //Recherche dans les numéros
         $start_num = $bull_num_deb;
         if ($f_bull_deb_id) {
             $restrict_num = $this->compare_date($f_bull_deb_id);
             $restrict_date = "";
         } else {
             if ($start_num) {
                 $restrict_num = " and bulletin_numero like '%" . $start_num . "%' ";
                 $restrict_date = "";
             }
         }
         // Recherche dans les dates et libellés de période
         if (!$restrict_num) {
             $restrict_date = $this->compare_date($bull_date_start, $bull_date_end);
         }
         // nombre de références par pages (12 par défaut)
         if (!isset($opac_bull_results_per_page)) {
             $opac_bull_results_per_page = 12;
         }
         if (!$page) {
             $page = 1;
         }
         $debut = ($page - 1) * $opac_bull_results_per_page;
         $limiter = " LIMIT {$debut},{$opac_bull_results_per_page}";
         //Recherche par numéro
         $num_field_start = "\n\t\t\t<input type='hidden' name='f_bull_deb_id' id='f_bull_deb_id' />\n\t\t\t<input id='bull_num_deb' name='bull_num_deb' type='text' size='10' value='" . $start_num . "' onkeypress='if (event.keyCode==13){ show_perio({$id});}' />";
         //Recherche par date
         $deb_value = str_replace("-", "", $bull_date_start);
         $fin_value = str_replace("-", "", $bull_date_end);
         $date_deb_value = $deb_value ? formatdate($deb_value) : '...';
         $date_fin_value = $fin_value ? formatdate($fin_value) : '...';
         $date_debut = "\n\t\t\t<input type='hidden' id='bull_date_start' name='bull_date_start' value='{$bull_date_start}'/>\n\t\t\t<input type='button' class='bouton' id='date_deb_btn' name='date_deb_btn'  value='" . $date_deb_value . "' onClick=\"window.open('./select.php?what=calendrier&caller=form_values&date_caller=&param1=bull_date_start&param2=date_deb_btn&auto_submit=NO&date_anterieure=YES', 'date_fin', 'width=250,height=300,toolbar=no,dependent=yes,resizable=yes')\"/>\n\t\t\t<input type='button' class='bouton' name='del' value='X' onclick='this.form.date_deb_btn.value=\"...\";this.form.bull_date_start.value=\"\";' />\n\t\t";
         $date_fin = "\n\t\t\t<input type='hidden' id='bull_date_end' name='bull_date_end' value='{$bull_date_end}' />\n\t\t\t<input type='button' class='bouton' id='date_fin_btn' name='date_fin_btn' value='" . $date_fin_value . "' onClick=\"window.open('./select.php?what=calendrier&caller=form_values&date_caller=&param1=bull_date_end&param2=date_fin_btn&auto_submit=NO&date_anterieure=YES', 'date_fin', 'width=250,height=300,toolbar=no,dependent=yes,resizable=yes')\"/>\n\t\t\t<input type='button' class='bouton' name='del' value='X' onclick='this.form.date_fin_btn.value=\"...\";this.form.bull_date_end.value=\"\";' />\n\t\t";
         $bulletin_retard = $this->get_bulletin_retard($id);
         $tableau = "\t\t\n\t\t<a name='tab_bulletin'></a>\n\t\t<h3><span id='titre_exemplaires'>" . $msg["a2z_perio_list_bulletins"] . "</span></h3>\n\t\t<div id='form_search_bull'>\n\t\t\t\n\t\t\t\t<script src='./includes/javascript/ajax.js'></script>\n\t\t\t\t<form name=\"form_values\" action=\"./index.php?lvl=notice_display&id={$id}\" >\n\n\t\t\t\t\t<input type=\"hidden\" name=\"premier\" value=\"\">\n\n\t\t\t\t\t<input type=\"hidden\" id='page' name=\"page\" value=\"{$page}\">\n\n\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<td ><strong>" . $msg["search_per_bull_num"] . " : " . $msg["search_bull_exact"] . "</strong></td>\n\t\t\t\t\t\t\t<td >{$num_field_start}</td>\t\t\t\t\t\t\n\t\t\t\t\t\t\t<td >&nbsp;</td>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<td align='left' rowspan=2><input type='button' class='boutonrechercher' value='" . $msg["142"] . "' onclick='show_perio({$id});' /></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td ><strong>" . $msg["search_per_bull_date"] . " : " . $msg["search_bull_start"] . "</strong></td>\n\t\t\t\t\t\t\t<td>{$date_debut}</td>\n\t\t\t\t\t\t\t<td><strong>" . $msg["search_bull_end"] . "</strong> {$date_fin}</td>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t<div class='row'></div><br />\n\t\t</div>\n";
         $resultat_aff .= $tableau;
         //		$resultat_aff.= "<script type='text/javascript'>ajax_parse_dom();</script>";
         $resultat_aff .= $bulletin_retard;
         // A EXTERNALISER ENSUITE DANS un bulletin_list.inc.php
         //AVANT
         $requete = "SELECT bulletins.*,count(explnum_id) as nbexplnum FROM bulletins LEFT JOIN explnum ON explnum_bulletin = bulletin_id where bulletin_id in(\n\t\tSELECT bulletin_id FROM bulletins WHERE bulletin_notice='{$id}' {$restrict_num} {$restrict_date} and num_notice=0\n\t\t) or bulletin_id in(\n\t\tSELECT bulletin_id FROM bulletins,notice_statut, notices WHERE bulletin_notice='{$id}' {$restrict_num} {$restrict_date} \n\t\tand notice_id=num_notice\n\t\tand statut=id_notice_statut \n\t\tand((notice_visible_opac=1 and notice_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (notice_visible_opac_abon=1 and notice_visible_opac=1)" : "") . ")) \n\t\tGROUP BY bulletins.bulletin_id ";
         //MAINTENANT
         global $gestion_acces_active, $gestion_acces_empr_notice, $gestion_acces_empr_docnum, $opac_show_links_invisible_docnums;
         $join_docnum_noti = $join_docnum_bull = "";
         if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) {
             $ac = new acces();
             $dom_2 = $ac->setDomain(2);
             $join_noti = $dom_2->getJoin($_SESSION["id_empr_session"], 4, "bulletins.num_notice");
             $join_bull = $dom_2->getJoin($_SESSION["id_empr_session"], 4, "bulletins.bulletin_notice");
             if (!$opac_show_links_invisible_docnums) {
                 $join_docnum_noti = $dom_2->getJoin($_SESSION["id_empr_session"], 16, "bulletins.num_notice");
                 $join_docnum_bull = $dom_2->getJoin($_SESSION["id_empr_session"], 16, "bulletins.bulletin_notice");
             }
         } else {
             $join_noti = "join notices on bulletins.num_notice = notices.notice_id join notice_statut on notices.statut = notice_statut.id_notice_statut AND ((notice_visible_opac=1 and notice_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (notice_visible_opac_abon=1 and notice_visible_opac=1)" : "") . ")";
             $join_bull = "join notices on bulletins.bulletin_notice = notices.notice_id join notice_statut on notices.statut = notice_statut.id_notice_statut AND ((notice_visible_opac=1 and notice_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (notice_visible_opac_abon=1 and notice_visible_opac=1)" : "") . ")";
             if (!$opac_show_links_invisible_docnums) {
                 $join_docnum_noti = "join notices on bulletins.num_notice = notices.notice_id join notice_statut on notices.statut = notice_statut.id_notice_statut AND ((explnum_visible_opac=1 and explnum_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (explnum_visible_opac_abon=1 and explnum_visible_opac=1)" : "") . ")";
                 $join_docnum_bull = "join notices on bulletins.bulletin_notice = notices.notice_id join notice_statut on notices.statut = notice_statut.id_notice_statut AND ((explnum_visible_opac=1 and explnum_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (explnum_visible_opac_abon=1 and explnum_visible_opac=1)" : "") . ")";
             }
         }
         $join_docnum_explnum = "";
         if (!$opac_show_links_invisible_docnums) {
             if ($gestion_acces_active == 1 && $gestion_acces_empr_docnum == 1) {
                 $ac = new acces();
                 $dom_3 = $ac->setDomain(3);
                 $join_docnum_explnum = $dom_3->getJoin($_SESSION["id_empr_session"], 16, "explnum_id");
             } else {
                 $join_docnum_explnum = "join explnum_statut on explnum_docnum_statut=id_explnum_statut and ((explnum_visible_opac=1 and explnum_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (explnum_visible_opac_abon=1 and explnum_visible_opac=1)" : "") . ")";
             }
         }
         $requete_docnum_noti = "select bulletin_id, count(explnum_id) as nbexplnum from explnum join bulletins on explnum_bulletin = bulletin_id and explnum_notice = 0 " . $join_docnum_explnum . " where bulletin_notice = " . $id . " and explnum_bulletin in (select bulletin_id from bulletins " . $join_docnum_noti . " where bulletin_notice = " . $id . ") group by bulletin_id";
         $requete_docnum_bull = "select bulletin_id, count(explnum_id) as nbexplnum from explnum join bulletins on explnum_bulletin = bulletin_id and explnum_notice = 0 " . $join_docnum_explnum . " where bulletin_notice = " . $id . " and explnum_bulletin in (select bulletin_id from bulletins " . $join_docnum_bull . " where bulletin_notice = " . $id . ") group by bulletin_id";
         $requete_noti = "select bulletins.*,ifnull(nbexplnum,0) as nbexplnum from bulletins " . $join_noti . " left join ({$requete_docnum_noti}) as docnum_noti on bulletins.bulletin_id = docnum_noti.bulletin_id where bulletins.num_notice != 0 and bulletin_notice = " . $id . " {$restrict_num} {$restrict_date} GROUP BY bulletins.bulletin_id";
         $requete_bull = "select bulletins.*,ifnull(nbexplnum,0) as nbexplnum from bulletins " . $join_bull . " left join ({$requete_docnum_bull}) as docnum_bull on bulletins.bulletin_id = docnum_bull.bulletin_id where bulletins.num_notice = 0 and bulletin_notice = " . $id . " {$restrict_num} {$restrict_date} GROUP BY bulletins.bulletin_id";
         $requete = "select * from (" . $requete_noti . " union " . $requete_bull . ") as uni where 1 " . $restrict_num . " " . $restrict_date;
         $rescount1 = pmb_mysql_query($requete);
         $count1 = pmb_mysql_num_rows($rescount1);
         //si on recherche par date ou par numéro, le résultat sera trié par ordre croissant
         if ($restrict_num || $restrict_date) {
             $requete .= " ORDER BY date_date, bulletin_numero*1 ";
         } else {
             $requete .= " ORDER BY date_date DESC, bulletin_numero*1 DESC";
         }
         $requete .= $limiter;
         $res = @pmb_mysql_query($requete, $dbh);
         $count = pmb_mysql_num_rows($res);
         if ($count) {
             ob_start();
             if ($opac_fonction_affichage_liste_bull) {
                 eval("\$opac_fonction_affichage_liste_bull (\$res);");
             } else {
                 affichage_liste_bulletins_normale($res);
             }
             $resultat_aff .= ob_get_contents();
             ob_end_clean();
         } else {
             $resultat_aff .= "<strong>" . $msg["bull_no_found"] . "</strong>";
         }
         //$resultat_aff.= "<br />";
         // constitution des liens
         if (!$count1) {
             $count1 = $count;
         }
         $nbepages = ceil($count1 / $opac_bull_results_per_page);
         $url_page = "";
         //javascript:if (document.getElementById(\"onglet_isbd$id\")) if (document.getElementById(\"onglet_isbd$id\").className==\"isbd_public_active\") document.form_values.premier.value=\"ISBD\"; else document.form_values.premier.value=\"PUBLIC\"; document.form_values.page.value=!!page!!; document.form_values.submit()";
         $action = "show_perio({$id});return false;";
         if ($nbepages > 1) {
             $form = "<div class='row'></div>\n<div id='navbar_perio'><center>" . printnavbar_onclick($page, $nbepages, $url_page, $action) . "</center></div>";
         }
     }
     return $resultat_aff . $form;
 }
    case 'title':
        $ttf_label .= " &raquo; title for user {$ref_id}";
        break;
}
$ttf_title = $ttf_label;
// let's output a page to the user
require_once "include_header.php";
// start counting revisions
$revnum = 0;
// grab the revisions
$sql = "SELECT ttf_revision.*, ttf_user.username " . "FROM ttf_revision, ttf_user " . "WHERE ttf_revision.author_id = ttf_user.user_id " . "      && type='{$type}' && ref_id='{$ref_id}' " . "ORDER BY date ASC";
if (!($result = mysql_query($sql))) {
    showerror();
}
while ($rev = mysql_fetch_array($result)) {
    $date = formatdate($rev["date"]);
    if (isset($lastrev)) {
        $opcodes = FineDiff::getDiffOpcodes(output($lastrev), output($rev["body"]), FineDiff::$wordGranularity);
        $revbody = FineDiff::renderDiffToHTMLFromOpcodes(output($lastrev), $opcodes);
        $lastrev = $rev["body"];
    } else {
        $revbody = $rev["body"];
        $lastrev = $rev["body"];
    }
    echo "            <div class=\"contenttitle_sm\">\n";
    echo "                rev {$revnum}, rev_id {$rev["rev_id"]} by\n";
    echo "                <a class=\"link\" href=\"profile.php?user_id={$rev["author_id"]}\">" . output($rev["username"]) . "</a>";
    if (!empty($rev["ip"])) {
        echo "                ({$rev["ip"]})\n";
    }
    echo "                <span title=\"{$date[1]}\">{$date[0]}</span>\n";
Exemple #24
0
function electronic_ticket($id_empr, $cb_doc = "")
{
    global $dbh, $msg, $charset;
    global $PMBusernom;
    global $PMBuserprenom;
    global $PMBuseremail, $PMBuseremailbcc;
    $headers = "MIME-Version: 1.0\n";
    $headers .= "Content-type: text/html; charset=" . $charset . "\n";
    // info site
    global $biblio_name, $biblio_logo, $biblio_adr1, $biblio_adr2, $biblio_cp, $biblio_town, $biblio_state, $biblio_country, $biblio_phone, $biblio_email, $biblio_website, $biblio_commentaire;
    global $empr_electronic_loan_ticket_obj, $empr_electronic_loan_ticket_msg;
    $empr_electronic_loan_ticket_obj = str_replace("!!biblio_name!!", $biblio_name, $empr_electronic_loan_ticket_obj);
    $empr_electronic_loan_ticket_obj = str_replace("!!date!!", formatdate(today()), $empr_electronic_loan_ticket_obj);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_name!!", $biblio_name, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!date!!", formatdate(today()), $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_website!!", $biblio_website, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_phone!!", $biblio_phone, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_adr1!!", $biblio_adr1, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_adr2!!", $biblio_adr2, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_cp!!", $biblio_cp, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_town!!", $biblio_town, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_email!!", $biblio_email, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!biblio_commentaire!!", $biblio_commentaire, $empr_electronic_loan_ticket_msg);
    $message_resas = "";
    $message_prets = "";
    if ($cb_doc == "") {
        $rqt = "select expl_cb from pret, exemplaires where pret_idempr='" . $id_empr . "' and pret_idexpl=expl_id order by pret_date ";
        $req = mysql_query($rqt) or die($msg['err_sql'] . '<br />' . $rqt . '<br />' . mysql_error());
        $message_prets = $msg["prets_en_cours"];
        while ($data = mysql_fetch_array($req)) {
            $message_prets .= electronic_loan_ticket_expl_info($data['expl_cb']);
        }
        // Impression des réservations en cours
        $rqt = "select resa_idnotice, resa_idbulletin from resa where resa_idempr='" . $id_empr . "' ";
        $req = mysql_query($rqt) or die($msg['err_sql'] . '<br />' . $rqt . '<br />' . mysql_error());
        if (mysql_num_rows($req) > 0) {
            $message_resas = $msg["documents_reserves"];
            while ($data = mysql_fetch_array($req)) {
                $message_resas .= electronic_loan_ticket_not_bull_info_resa($id_empr, $data['resa_idnotice'], $data['resa_idbulletin']);
            }
        }
        // fin if résas
    } else {
        $message_prets = $msg["prets_en_cours"];
        $message_prets .= electronic_loan_ticket_expl_info($cb_doc);
    }
    $empr_electronic_loan_ticket_msg = str_replace("!!all_reservations!!", $message_resas, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!all_loans!!", $message_prets, $empr_electronic_loan_ticket_msg);
    $requete = "select id_empr, empr_mail, empr_nom, empr_prenom from empr where id_empr='{$id_empr}' ";
    $res = mysql_query($requete, $dbh);
    $empr = mysql_fetch_object($res);
    //remplacement nom et prenom
    $empr_electronic_loan_ticket_msg = str_replace("!!empr_name!!", $empr->empr_nom, $empr_electronic_loan_ticket_msg);
    $empr_electronic_loan_ticket_msg = str_replace("!!empr_first_name!!", $empr->empr_prenom, $empr_electronic_loan_ticket_msg);
    if ($empr->empr_mail) {
        // function mailpmb($to_nom="", $to_mail, $obj="", $corps="", $from_name="", $from_mail, $headers, $copie_CC="", $copie_BCC="", $faire_nl2br=0, $pieces_jointes=array()) {
        $res_envoi = @mailpmb($empr->empr_prenom . " " . $empr->empr_nom, $empr->empr_mail, $empr_electronic_loan_ticket_obj, $empr_electronic_loan_ticket_msg, $PMBuserprenom . " " . $PMBusernom, $PMBuseremail, $headers, "", $PMBuseremailbcc, 1, "");
    }
}
     case '1':
         $requete_empr = "SELECT id_empr, empr_nom, empr_prenom, empr_adr1 FROM empr where id_empr = '" . $orig . "' limit 1 ";
         $res_empr = pmb_mysql_query($requete_empr, $dbh);
         $row_empr = pmb_mysql_fetch_row($res_empr);
         $lib_orig = $row_empr[1];
         if ($row_empr[2]) {
             $lib_orig .= ", " . $row_empr[2];
         }
         break;
     case '2':
         $lib_orig = $orig;
         break;
 }
 $lib_orig = trim($lib_orig);
 $col1 = "";
 $col1 = formatdate($row->date_creation) . "\n" . $lib_orig;
 $col2 = "";
 if ($row->code != "") {
     $col2 = $row->code;
 }
 $col2 .= "\n" . $row->titre;
 $col3 = "";
 $col30 = "";
 $col31 = "";
 if (trim($row->auteur) != "") {
     $col30 = trim($row->auteur);
 }
 if (trim($row->editeur) != "") {
     $col31 = "[" . trim($row->editeur) . "]";
 }
 $col3 = $col30;
Exemple #26
0
 function replace_form()
 {
     global $bulletin_replace;
     global $msg, $dbh, $charset;
     global $include_path;
     global $deflt_notice_replace_keep_categories;
     global $bulletin_replace_categories, $bulletin_replace_category;
     global $thesaurus_mode_pmb;
     if (!$this->bulletin_id) {
         require_once "{$include_path}/user_error.inc.php";
         error_message($msg[161], $msg[162], 1, './catalog.php');
         return false;
     }
     $requete = "SELECT analysis_notice FROM analysis WHERE analysis_bulletin=" . $this->bulletin_id;
     $myQuery2 = pmb_mysql_query($requete, $dbh);
     if (pmb_mysql_num_rows($myQuery2)) {
         $del_depouillement = "<label class='etiquette' for='del'>" . $msg['replace_bulletin_checkbox'] . "</label><input value='1' yes='' name='del' id='del' type='checkbox' checked>";
     }
     $bulletin_replace = str_replace('!!old_bulletin_libelle!!', $this->bulletin_numero . " [" . formatdate($this->date_date) . "] " . htmlentities($this->mention_date, ENT_QUOTES, $charset) . " " . htmlentities($this->bulletin_titre, ENT_QUOTES, $charset), $bulletin_replace);
     $bulletin_replace = str_replace('!!bul_id!!', $this->bulletin_id, $bulletin_replace);
     $bulletin_replace = str_replace('!!serial_id!!', $this->serial_id, $bulletin_replace);
     $bulletin_replace = str_replace('!!del_depouillement!!', $del_depouillement, $bulletin_replace);
     if ($deflt_notice_replace_keep_categories && sizeof($this->b_categories)) {
         // categories
         $categories_to_replace = "";
         for ($i = 0; $i < sizeof($this->b_categories); $i++) {
             $categ_id = $this->b_categories[$i]["categ_id"];
             $categ = new category($categ_id);
             $ptab_categ = str_replace('!!icateg!!', $i, $bulletin_replace_category);
             $ptab_categ = str_replace('!!categ_id!!', $categ_id, $ptab_categ);
             if ($thesaurus_mode_pmb) {
                 $nom_thesaurus = '[' . $categ->thes->getLibelle() . '] ';
             } else {
                 $nom_thesaurus = '';
             }
             $ptab_categ = str_replace('!!categ_libelle!!', htmlentities($nom_thesaurus . $categ->catalog_form, ENT_QUOTES, $charset), $ptab_categ);
             $categories_to_replace .= $ptab_categ;
         }
         $bulletin_replace_categories = str_replace('!!bulletin_replace_category!!', $categories_to_replace, $bulletin_replace_categories);
         $bulletin_replace_categories = str_replace('!!nb_categ!!', sizeof($this->categories), $bulletin_replace_categories);
         $bulletin_replace = str_replace('!!bulletin_replace_categories!!', $bulletin_replace_categories, $bulletin_replace);
     } else {
         $bulletin_replace = str_replace('!!bulletin_replace_categories!!', "", $bulletin_replace);
     }
     print $bulletin_replace;
 }
Exemple #27
0
function show_bulletinage_info($bul_id, $lien_cart_ajout = 1, $lien_cart_suppr = 0, $flag_pointe = 0, $lien_pointe = 0)
{
    global $dbh, $msg, $charset;
    global $base_path;
    global $liste_script;
    global $liste_debut;
    global $liste_fin;
    global $bul_action_bar;
    global $bul_cb_form;
    global $selector_prop;
    global $url_base_suppr_cart;
    global $page, $nbr_lignes, $nb_per_page;
    global $idcaddie;
    $cart_click_bull = "onClick=\"openPopUp('./cart.php?object_type=BULL&item=!!item!!', 'cart', 600, 700, -2, -2, '{$selector_prop}')\"";
    //Calcul des variables pour la suppression d'items
    if ($nb_per_page) {
        $modulo = $nbr_lignes % $nb_per_page;
        if ($modulo == 1) {
            $page_suppr = !$page ? 1 : $page - 1;
        } else {
            $page_suppr = $page;
        }
        $nb_after_suppr = $nbr_lignes ? $nbr_lignes - 1 : 0;
    }
    $affichage_final = '';
    if ($bul_id) {
        if (SESSrights & CATALOGAGE_AUTH) {
            $myBul = new bulletinage($bul_id, 0, "./catalog.php?categ=serials&sub=bulletinage&action=explnum_form&bul_id={$bul_id}&explnum_id=!!explnum_id!!");
            // lien vers la notice chapeau
            $link_parent = "<a href=\"./catalog.php?categ=serials\">" . $msg[4010] . "</a>";
            $link_parent .= "<img src=\"./images/d.gif\" align=\"middle\" hspace=\"5\">";
            $link_parent .= "<a href=\"./catalog.php?categ=serials&sub=view&serial_id=";
            $link_parent .= $myBul->bulletin_notice . "\">" . $myBul->tit1 . '</a>';
            $link_parent .= "<img src=\"./images/d.gif\" align=\"middle\" hspace=\"5\">";
            if ($myBul->bulletin_numero) {
                $link_bulletin = $myBul->bulletin_numero . " ";
            }
            // affichage de la mention de date utile : mention_date si existe, sinon date_date
            $date_affichee = '';
            if ($myBul->mention_date) {
                $date_affichee = " (" . $myBul->mention_date . ")";
            } else {
                if ($myBul->date_date) {
                    $date_affichee = " [" . formatdate($myBul->date_date) . "]";
                }
            }
            $link_bulletin .= $date_affichee;
            $link_parent .= "<a href='./catalog.php?categ=serials&sub=bulletinage&action=view&bul_id={$bul_id}'>{$link_bulletin}</a>";
            $affichage_final .= "<div class='row'><div class='perio-barre'>" . $link_parent . "</div></div>";
            if ($lien_cart_ajout) {
                $cart_link = "<img src='./images/basket_small_20x20.gif' align='middle' alt='basket' title=\"{$msg[400]}\" {$cart_click_bull}>";
                $cart_link = str_replace('!!item!!', $bul_id, $cart_link);
                $cart_link .= "<span id='BULL_drag_" . $bul_id . "'  dragicon=\"{$base_path}/images/icone_drag_notice.png\" dragtext=\"" . htmlentities($link_bulletin, ENT_QUOTES, $charset) . "\" draggable=\"yes\" dragtype=\"notice\" callback_before=\"show_carts\" callback_after=\"\" style=\"padding-left:7px\"><img src=\"" . $base_path . "/images/notice_drag.png\"/></span>";
            } else {
                $cart_link = "";
            }
            if ($lien_cart_suppr) {
                if ($lien_pointe) {
                    if ($flag_pointe) {
                        $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $bul_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $bul_id . ");' style='cursor: pointer'/>";
                    } else {
                        $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $bul_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $bul_id . ");' style='cursor: pointer'/>";
                    }
                } else {
                    if ($flag_pointe) {
                        $marque_flag = "<img src='images/tick.gif'/>";
                    } else {
                        $marque_flag = "";
                    }
                }
                $cart_link .= "<a href='{$url_base_suppr_cart}&action=del_item&object_type=BULL&item={$bul_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg["caddie_icone_suppr_elt"] . "\" /></a> {$marque_flag}";
            }
        } else {
            $myBul = new bulletinage($bul_id, 0, '');
            $cart_link = '';
        }
        $bul_action_bar = str_replace('!!bul_id!!', $bul_id, $bul_action_bar);
        $bul_action_bar = str_replace('!!nb_expl!!', sizeof($myBul->expl), $bul_action_bar);
        $bul_isbd = $myBul->display;
        $javascript_template = "\n\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n    \t\t<img src=\"./images/plus.gif\" class=\"img_plus\" name=\"imEx\" id=\"el!!id!!Img\" title=\"" . $msg['admin_param_detail'] . "\" border=\"0\" onClick=\"expandBase('el!!id!!', true); return false;\" hspace=\"3\" />\n    \t\t<span class=\"notice-heada\">!!heada!!</span>\n    \t\t<br />\n\t\t</div>\n\t\t<div id=\"el!!id!!Child\" class=\"notice-child\" style=\"margin-bottom:6px;display:none;\">\n           \t\t!!ISBD!!\n \t\t</div>";
        $aff_expandable = str_replace('!!id!!', $bul_id, $javascript_template);
        $aff_expandable = str_replace('!!heada!!', $cart_link . " " . $bul_isbd, $aff_expandable);
        // affichage des exemplaires associés
        $list_expl = "<div class='exemplaires-perio'>";
        $list_expl .= "<h3>" . $msg[4012] . "</h3>";
        $list_expl .= "<div class='row'>" . get_expl($myBul->expl) . "</div></div>";
        $affichage_final .= $list_expl;
        // affichage des documents numeriques
        $aff_expl_num = $myBul->explnum;
        if ($aff_expl_num) {
            $list_expl = "<div class='exemplaires-perio'><h3>" . $msg['explnum_docs_associes'] . "</h3>";
            $list_expl .= "<div class='row'>" . $aff_expl_num . "</div></div>";
            $affichage_final .= $list_expl;
        }
        //affichage des dépouillements
        $liste = get_analysis($bul_id);
        if ($liste) {
            $liste_dep = $liste;
            $liste_dep .= $liste_fin;
            // inclusion du javascript inline
            $liste_dep .= $liste_script;
        } else {
            $liste_dep .= "<div class='row'>" . htmlentities($msg['bull_no_item'], ENT_QUOTES, $charset) . "</div>";
        }
        $affichage_final .= "\n\t\t\t<div class='depouillements-perio'>\n\t\t\t\t<h3>" . $msg[4013] . "</h3>\n\t\t\t\t<div class='row'>\n\t\t\t\t\t{$liste_dep}\n\t\t\t\t\t</div>\n\t\t\t\t</div>";
        // affichage des résas
        $aff_resa = resa_list(0, $bul_id, 0);
        if ($aff_resa) {
            $affichage_final .= "<h3>" . $msg['resas'] . "</h3>" . $aff_resa;
        }
    }
    $aff_expandable = str_replace('!!ISBD!!', $affichage_final, $aff_expandable);
    return $aff_expandable;
}
 function step5()
 {
     $checkout = JModelLegacy::getInstance('checkout', 'jshop');
     $checkout->checkStep(5);
     JPluginHelper::importPlugin('jshoppingcheckout');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onLoadCheckoutStep5', array());
     appendPathWay(_JSHOP_CHECKOUT_PREVIEW);
     $seo = JTable::getInstance("seo", "jshop");
     $seodata = $seo->loadData("checkout-preview");
     if ($seodata->title == "") {
         $seodata->title = _JSHOP_CHECKOUT_PREVIEW;
     }
     setMetaData($seodata->title, $seodata->keyword, $seodata->description);
     $cart = JModelLegacy::getInstance('cart', 'jshop');
     $cart->load();
     $session = JFactory::getSession();
     $jshopConfig = JSFactory::getConfig();
     $user = JFactory::getUser();
     if ($user->id) {
         $adv_user = JSFactory::getUserShop();
     } else {
         $adv_user = JSFactory::getUserShopGuest();
     }
     $sh_method = JTable::getInstance('shippingMethod', 'jshop');
     $shipping_method_id = $cart->getShippingId();
     $sh_method->load($shipping_method_id);
     $sh_mt_pr = JTable::getInstance('shippingMethodPrice', 'jshop');
     $sh_mt_pr->load($cart->getShippingPrId());
     if ($jshopConfig->show_delivery_time_checkout) {
         $deliverytimes = JSFactory::getAllDeliveryTime();
         $deliverytimes[0] = '';
         $delivery_time = $deliverytimes[$sh_mt_pr->delivery_times_id];
         if (!$delivery_time && $jshopConfig->delivery_order_depends_delivery_product) {
             $delivery_time = $cart->getDelivery();
         }
     } else {
         $delivery_time = '';
     }
     if ($jshopConfig->show_delivery_date) {
         $delivery_date = $cart->getDeliveryDate();
         if ($delivery_date) {
             $delivery_date = formatdate($cart->getDeliveryDate());
         }
     } else {
         $delivery_date = '';
     }
     $pm_method = JTable::getInstance('paymentMethod', 'jshop');
     $payment_method_id = $cart->getPaymentId();
     $pm_method->load($payment_method_id);
     $lang = JSFactory::getLang();
     $field_country_name = $lang->get("name");
     $invoice_info = array();
     $country = JTable::getInstance('country', 'jshop');
     $country->load($adv_user->country);
     $invoice_info['f_name'] = $adv_user->f_name;
     $invoice_info['l_name'] = $adv_user->l_name;
     $invoice_info['firma_name'] = $adv_user->firma_name;
     $invoice_info['street'] = $adv_user->street;
     $invoice_info['zip'] = $adv_user->zip;
     $invoice_info['state'] = $adv_user->state;
     $invoice_info['city'] = $adv_user->city;
     $invoice_info['country'] = $country->{$field_country_name};
     $invoice_info['home'] = $adv_user->home;
     $invoice_info['apartment'] = $adv_user->apartment;
     if ($adv_user->delivery_adress) {
         $country = JTable::getInstance('country', 'jshop');
         $country->load($adv_user->d_country);
         $delivery_info['f_name'] = $adv_user->d_f_name;
         $delivery_info['l_name'] = $adv_user->d_l_name;
         $delivery_info['firma_name'] = $adv_user->d_firma_name;
         $delivery_info['street'] = $adv_user->d_street;
         $delivery_info['zip'] = $adv_user->d_zip;
         $delivery_info['state'] = $adv_user->d_state;
         $delivery_info['city'] = $adv_user->d_city;
         $delivery_info['country'] = $country->{$field_country_name};
         $delivery_info['home'] = $adv_user->d_home;
         $delivery_info['apartment'] = $adv_user->d_apartment;
     } else {
         $delivery_info = $invoice_info;
     }
     $tmp_fields = $jshopConfig->getListFieldsRegister();
     $config_fields = $tmp_fields['address'];
     $count_filed_delivery = $jshopConfig->getEnableDeliveryFiledRegistration('address');
     $checkout_navigator = $this->_showCheckoutNavigation(5);
     $small_cart = $this->_showSmallCart(5);
     $view_name = "checkout";
     $view_config = array("template_path" => JPATH_COMPONENT . "/templates/" . $jshopConfig->template . "/" . $view_name);
     $view = $this->getView($view_name, getDocumentType(), '', $view_config);
     $view->setLayout("previewfinish");
     $dispatcher->trigger('onBeforeDisplayCheckoutStep5', array(&$sh_method, &$pm_method, &$delivery_info, &$cart, &$view));
     $lang = JSFactory::getLang();
     $name = $lang->get("name");
     $sh_method->name = $sh_method->{$name};
     $view->assign('sh_method', $sh_method);
     $view->assign('payment_name', $pm_method->{$name});
     $view->assign('delivery_info', $delivery_info);
     $view->assign('invoice_info', $invoice_info);
     $view->assign('action', SEFLink('index.php?option=com_jshopping&controller=checkout&task=step5save', 0, 0, $jshopConfig->use_ssl));
     $view->assign('config', $jshopConfig);
     $view->assign('delivery_time', $delivery_time);
     $view->assign('delivery_date', $delivery_date);
     $view->assign('checkout_navigator', $checkout_navigator);
     $view->assign('small_cart', $small_cart);
     $view->assign('count_filed_delivery', $count_filed_delivery);
     $dispatcher->trigger('onBeforeDisplayCheckoutStep5View', array(&$view));
     $view->display();
 }
Exemple #29
0
 function order()
 {
     $jshopConfig = JSFactory::getConfig();
     checkUserLogin();
     $db = JFactory::getDBO();
     $user = JFactory::getUser();
     $lang = JSFactory::getLang();
     JPluginHelper::importPlugin('jshoppingorder');
     $dispatcher = JDispatcher::getInstance();
     appendPathWay(_JSHOP_MY_ORDERS, SEFLink('index.php?option=com_jshopping&controller=user&task=orders', 0, 0, $jshopConfig->use_ssl));
     $seo = JTable::getInstance("seo", "jshop");
     $seodata = $seo->loadData("myorder-detail");
     if ($seodata->title == "") {
         $seodata->title = _JSHOP_MY_ORDERS;
     }
     setMetaData($seodata->title, $seodata->keyword, $seodata->description);
     $order_id = JRequest::getInt('order_id');
     $order = JTable::getInstance('order', 'jshop');
     $order->load($order_id);
     $dispatcher->trigger('onAfterLoadOrder', array(&$order, &$user));
     appendPathWay(_JSHOP_ORDER_NUMBER . ": " . $order->order_number);
     if ($user->id != $order->user_id) {
         JError::raiseError(500, "Error order number. You are not the owner of this order");
     }
     $order->items = $order->getAllItems();
     $order->weight = $order->getWeightItems();
     $order->status_name = $order->getStatus();
     $order->history = $order->getHistory();
     if ($jshopConfig->client_allow_cancel_order && $order->order_status != $jshopConfig->payment_status_for_cancel_client && !in_array($order->order_status, $jshopConfig->payment_status_disable_cancel_client)) {
         $allow_cancel = 1;
     } else {
         $allow_cancel = 0;
     }
     $order->birthday = getDisplayDate($order->birthday, $jshopConfig->field_birthday_format);
     $order->d_birthday = getDisplayDate($order->d_birthday, $jshopConfig->field_birthday_format);
     $shipping_method = JTable::getInstance('shippingMethod', 'jshop');
     $shipping_method->load($order->shipping_method_id);
     $name = $lang->get("name");
     $description = $lang->get("description");
     $order->shipping_info = $shipping_method->{$name};
     $pm_method = JTable::getInstance('paymentMethod', 'jshop');
     $pm_method->load($order->payment_method_id);
     $order->payment_name = $pm_method->{$name};
     if ($pm_method->show_descr_in_email) {
         $order->payment_description = $pm_method->{$description};
     } else {
         $order->payment_description = "";
     }
     $country = JTable::getInstance('country', 'jshop');
     $country->load($order->country);
     $field_country_name = $lang->get("name");
     $order->country = $country->{$field_country_name};
     $d_country = JTable::getInstance('country', 'jshop');
     $d_country->load($order->d_country);
     $field_country_name = $lang->get("name");
     $order->d_country = $d_country->{$field_country_name};
     $jshopConfig->user_field_client_type[0] = "";
     $order->client_type_name = $jshopConfig->user_field_client_type[$order->client_type];
     $order->delivery_time_name = '';
     $order->delivery_date_f = '';
     if ($jshopConfig->show_delivery_time_checkout) {
         $deliverytimes = JSFactory::getAllDeliveryTime();
         $order->delivery_time_name = $deliverytimes[$order->delivery_times_id];
         if ($order->delivery_time_name == "") {
             $order->delivery_time_name = $order->delivery_time;
         }
     }
     if ($jshopConfig->show_delivery_date && !datenull($order->delivery_date)) {
         $order->delivery_date_f = formatdate($order->delivery_date);
     }
     $order->order_tax_list = $order->getTaxExt();
     $show_percent_tax = 0;
     if (count($order->order_tax_list) > 1 || $jshopConfig->show_tax_in_product) {
         $show_percent_tax = 1;
     }
     if ($jshopConfig->hide_tax) {
         $show_percent_tax = 0;
     }
     $hide_subtotal = 0;
     if (($jshopConfig->hide_tax || count($order->order_tax_list) == 0) && $order->order_discount == 0 && $order->order_payment == 0 && $jshopConfig->without_shipping) {
         $hide_subtotal = 1;
     }
     $text_total = _JSHOP_ENDTOTAL;
     if (($jshopConfig->show_tax_in_product || $jshopConfig->show_tax_product_in_cart) && count($order->order_tax_list) > 0) {
         $text_total = _JSHOP_ENDTOTAL_INKL_TAX;
     }
     $tmp_fields = $jshopConfig->getListFieldsRegister();
     $config_fields = $tmp_fields["address"];
     $count_filed_delivery = $jshopConfig->getEnableDeliveryFiledRegistration('address');
     if ($jshopConfig->order_display_new_digital_products) {
         $product = JTable::getInstance('product', 'jshop');
         foreach ($order->items as $k => $v) {
             $product->product_id = $v->product_id;
             $product->setAttributeActive(unserialize($v->attributes));
             $files = $product->getSaleFiles();
             $order->items[$k]->files = serialize($files);
         }
     }
     $dispatcher->trigger('onBeforeDisplayOrder', array(&$order));
     $view_name = "order";
     $view_config = array("template_path" => JPATH_COMPONENT . "/templates/" . $jshopConfig->template . "/" . $view_name);
     $view = $this->getView($view_name, getDocumentType(), '', $view_config);
     $view->setLayout("order");
     $view->assign('order', $order);
     $view->assign('config', $jshopConfig);
     $view->assign('text_total', $text_total);
     $view->assign('show_percent_tax', $show_percent_tax);
     $view->assign('hide_subtotal', $hide_subtotal);
     $view->assign('image_path', $jshopConfig->live_path . "images");
     $view->assign('config_fields', $config_fields);
     $view->assign('count_filed_delivery', $count_filed_delivery);
     $view->assign('allow_cancel', $allow_cancel);
     $dispatcher->trigger('onBeforeDisplayOrderView', array(&$view));
     $view->display();
 }
Exemple #30
0
 function show_consult_form()
 {
     global $form_consult_dmde, $charset, $msg, $dbh;
     $form_consult_dmde = str_replace('!!form_title!!', htmlentities($this->titre_demande, ENT_QUOTES, $charset), $form_consult_dmde);
     $form_consult_dmde = str_replace('!!sujet_dmde!!', htmlentities($this->sujet_demande, ENT_QUOTES, $charset), $form_consult_dmde);
     $form_consult_dmde = str_replace('!!etat_dmde!!', htmlentities($this->workflow->getStateCommentById($this->etat_demande), ENT_QUOTES, $charset), $form_consult_dmde);
     $form_consult_dmde = str_replace('!!date_dmde!!', htmlentities(formatdate($this->date_demande), ENT_QUOTES, $charset), $form_consult_dmde);
     $form_consult_dmde = str_replace('!!date_butoir_dmde!!', htmlentities(formatdate($this->deadline_demande), ENT_QUOTES, $charset), $form_consult_dmde);
     $form_consult_dmde = str_replace('!!date_prevue_dmde!!', htmlentities(formatdate($this->date_prevue), ENT_QUOTES, $charset), $form_consult_dmde);
     $form_consult_dmde = str_replace('!!progression_dmde!!', htmlentities($this->progression . '%', ENT_QUOTES, $charset), $form_consult_dmde);
     for ($i = 0; $i < sizeof($this->users); $i++) {
         if ($i == sizeof($this->users) - 1) {
             $users .= htmlentities($this->users[$i]['nom'], ENT_QUOTES, $charset);
         } else {
             $users .= htmlentities($this->users[$i]['nom'], ENT_QUOTES, $charset) . " / ";
         }
     }
     $carac_empr = $this->getCaracEmpr($this->num_demandeur);
     $nom = $carac_empr['nom'];
     $cb = $carac_empr['empr_cb'];
     $nom_emprunteur = "";
     if (SESSrights & CIRCULATION_AUTH) {
         $nom_emprunteur = "<a href=\"circ.php?categ=pret&form_cb={$cb}\" >" . htmlentities($nom, ENT_QUOTES, $charset) . "</a>";
     }
     $form_consult_dmde = str_replace('!!demandeur!!', $nom_emprunteur ? $nom_emprunteur : $nom, $form_consult_dmde);
     $form_consult_dmde = str_replace('!!attribution!!', $users, $form_consult_dmde);
     $form_consult_dmde = str_replace('!!iddemande!!', $this->id_demande, $form_consult_dmde);
     $form_consult_dmde = str_replace('!!theme_dmde!!', htmlentities($this->theme_libelle, ENT_QUOTES, $charset), $form_consult_dmde);
     $form_consult_dmde = str_replace('!!type_dmde!!', htmlentities($this->type_libelle, ENT_QUOTES, $charset), $form_consult_dmde);
     //afficher la liste des boutons de changement d'état
     if ($this->etat_demande && $this->users) {
         $states = $this->workflow->getStateList($this->etat_demande);
         $states_btn = $this->getDisplayStateBtn($states);
         $form_consult_dmde = str_replace('!!btn_etat!!', $states_btn, $form_consult_dmde);
     } else {
         $form_consult_dmde = str_replace('!!btn_etat!!', "", $form_consult_dmde);
     }
     $notice = "<a onclick=\"show_notice('" . $this->num_notice . "')\" href='#'><img border='0' align='top' src='./images/search.gif' alt='" . htmlentities($msg['demandes_see_notice'], ENT_QUOTES, $charset) . "' title='" . htmlentities($msg['demandes_see_notice'], ENT_QUOTES, $charset) . "' /></a>";
     $form_consult_dmde = str_replace('!!icone!!', $notice, $form_consult_dmde);
     if ($this->users) {
         $req = "select count(1) as nb from demandes join demandes_actions on id_demande=num_demande join explnum_doc_actions on num_action=id_action where id_demande='" . $this->id_demande . "'";
         $res = mysql_query($req, $dbh);
         $docnum = mysql_fetch_object($res);
         if ($docnum->nb) {
             $btn_attach = "&nbsp;<input type='submit' class='bouton' value='" . $msg['demandes_attach_docnum'] . "' onClick='this.form.act.value=\"attach\" ; ' />";
         } else {
             $btn_attach = "";
         }
         $btn_notices = "<input type='submit' class='bouton' value='" . $msg['demandes_complete_notice'] . "' onClick='this.form.act.value=\"notice\" ; ' />" . $btn_attach . "&nbsp;<input type='submit' class='bouton' value='" . $msg['demandes_generate_rapport'] . "' onClick='this.form.act.value=\"rapport\" ; ' />";
         $form_consult_dmde = str_replace('!!btns_notice!!', $btn_notices, $form_consult_dmde);
     } else {
         $form_consult_dmde = str_replace('!!btns_notice!!', "", $form_consult_dmde);
     }
     print $form_consult_dmde;
     if ($this->users) {
         //Liste des actions
         $actions = new demandes_actions();
         $actions->show_list_actions($this->id_demande);
     }
 }