// published by the Free Software Foundation.
//*********************************************************************
$vars = $this->vars;
//require_once("../inc/chklist.php");
//print "<font color=\"blue\">";
//$myChkList = new chklist($vars, "ID_COMMENTPROTO");
//print_r ($myChkList->getSelected ());
//			foreach ( $vars as $key=>$value )
//			{
//			print "<li>\$key $key => \$value $value</li>\n";
//			}
//Callback method de vérification
//print "</font>";
require_once "../inc/db_funcs.php";
$tmpDb = openDb();
$dirName = queryOneDb($tmpDb, "SELECT ATAB_REP_VCH FROM ATAB WHERE ATAB_NOMTBL_CKEY_VCH='" . $this->getVar("ATAB_NOMTBL_CKEY_VCH") . "'");
closeDb($tmpDb);
//Redirection Explications -------------------------------------
if (isset($vars['Explications'])) {
    require_once "HTML/Page.php";
    require_once "MOEUVREPROTO_def.php";
    require_once "../inc/html_settings.php";
    $page = new HTML_Page(array('lineend' => 'unix', 'doctype' => 'XHTML 1.0 Strict', 'language' => 'fr', 'cache' => 'false'));
    //	$page->addStyleSheet($css_style);
    $page->setTitle('Phpaie -(EXplications)-');
    // A modifier absolument 2 requêtes	suivantes à fusionner.
    $buffer = MOEUVREPROTO::fetchOne("MOEUVREPROTO_EXPLIC_TE", "where ATAB_NOMTBL_CKEY_VCH ='" . $this->getVar("ATAB_NOMTBL_CKEY_VCH") . "'", "");
    $ind = MOEUVREPROTO::fetchOne("ID_MOEUVREPROTO", "where ATAB_NOMTBL_CKEY_VCH ='" . $this->getVar("ATAB_NOMTBL_CKEY_VCH") . "'", "");
    $page->addBodyContent("<p align=\"center\"><font face=\"Arial\"><b><a href=\"Javascript:history.go(-1)\">retour</a></b></font></p>\n");
    $page->addBodyContent("<table border=\"0\" bgcolor=\"#CCCCFF\" width=\"100%\"><caption>Pr&eacute;sentation</caption><tbody><tr><td>[" . $this->getVar("ATAB_NOMTBL_CKEY_VCH") . "] (Package :" . $dirName . ")</td></tr></tbody></table>");
    $page->addBodyContent($buffer);
Example #2
0
 function fetchOne($nomtbl, $nomitem, $where_clause, $select_type)
 {
     include_once "db_funcs.php";
     $where_clause = strtoupper($where_clause);
     $nomtbl = strtoupper($nomtbl);
     $nomitem = strtoupper($nomitem);
     $nom_ndx = "";
     $nom_col = "";
     $nom_ali = "";
     // Construction de la requete : les alias sont détectés
     if (ereg("(.*)\\.(.*)", $nomitem, $r_nomitem)) {
         $nom_ali = $r_nomitem[1] . ".";
         $nom_col = $r_nomitem[2];
         $nom_ndx = "ID_" . ereg_replace("_[^_]*(_KEY|_CKEY)(_TI|_SI|_MI|_I|_BI|_F|_DO|_DE|_C|_DATE|_TIME|_CH|_VCH|_TE|_BL)\$", "", $r_nomitem[2]);
     } else {
         $nom_col = $nomitem;
         $nom_ndx = "ID_" . $nomtbl;
     }
     $ret = -1;
     if ($nom_col == "*") {
         $nom_col = $nom_ndx;
     }
     // Si aucun champ n'est rempli on les prend tous
     $sql_req = "SELECT {$select_type} {$nomitem} FROM {$nomtbl} {$where_clause}";
     //    print "<H2> $sql_req </H2>";
     $count_id = 0;
     $link = openDb();
     $ret = queryOneDb($link, $sql_req);
     closeDb($link);
     return $ret;
 }