echo '<th ' . $sort . '>' . $aHeading[$i]->ad_text . $span . '</th>';
}
?>
</tr>
<?php 
$e = 0;
foreach ($array as $row) {
    $e++;
    if ($e % 2 == 0) {
        echo '<tr class="odd">';
    } else {
        echo '<tr class="even">';
    }
    $fiche = new Fiche($cn);
    $fiche->id = $row['f_id'];
    $fiche->getAttribut();
    $detail = HtmlInput::card_detail($fiche->strAttribut(ATTR_DEF_QUICKCODE));
    echo td($detail);
    foreach ($fiche->attribut as $attr) {
        $sort = "";
        if ($attr->ad_type != 'select') {
            if ($attr->ad_type == "date") {
                // format YYYYMMDD
                $sort = 'sorttable_customkey="' . format_date($attr->av_text, "DD.MM.YYYY", "YYYYMMDD") . '"';
            }
            echo td($attr->av_text, 'style="padding: 0 10 1 10;white-space:nowrap;" ' . $sort);
        } else {
            $value = $cn->make_array($attr->ad_extra);
            $row_content = "";
            for ($e = 0; $e < count($value); $e++) {
                if ($value[$e]['value'] == $attr->av_text) {
示例#2
0
    $e = $fiche_def->get_by_type();
    $o = 0;
    //  Heading
    $fiche_def->GetAttribut();
    foreach ($fiche_def->attribut as $attribut) {
        if ($o == 0) {
            printf("%s", $attribut->ad_text);
            $o = 1;
        } else {
            printf(";%s", $attribut->ad_text);
        }
    }
    printf("\n");
    $o = 0;
    // Details
    foreach ($e as $fiche) {
        $detail = new Fiche($cn, $fiche['f_id']);
        $detail->getAttribut();
        foreach ($detail->attribut as $dattribut) {
            if ($o == 0) {
                printf("%s", $dattribut->av_text);
                $o = 1;
            } else {
                printf(";%s", $dattribut->av_text);
            }
        }
        printf("\n");
        $o = 0;
    }
}
exit;
示例#3
0
 function get_by_category($p_cat)
 {
     $sql = "select f_id,ad_value\n             from\n             fiche join fiche_def  using(fd_id)\n\t     join fiche_detail using(f_id)\n             where ad_id=1 and frd_id=\$1 order by 2 ";
     $Ret = $this->cn->exec_sql($sql, array($p_cat));
     if (($Max = Database::num_row($Ret)) == 0) {
         return null;
     }
     $all[0] = new Fiche($this->cn);
     for ($i = 0; $i < $Max; $i++) {
         $row = Database::fetch_array($Ret, $i);
         $t = new Fiche($this->cn, $row['f_id']);
         $t->getAttribut();
         $all[$i] = $t;
     }
     return $all;
 }
示例#4
0
 function GetByDef($p_frd_id, $p_offset = -1, $p_search = "", $p_order = '')
 {
     switch ($p_order) {
         case 'name':
             $order = ' order by name';
             break;
         case 'f_id':
             $order = 'order by f_id';
             break;
         default:
             $order = '';
     }
     if ($p_offset == -1) {
         $sql = "select *\n                 from\n                 fiche join fiche_Def using (fd_id) join vw_fiche_name using(f_id)\n                 where frd_id=" . $p_frd_id . " {$p_search} " . $order;
     } else {
         $limit = $_SESSION['g_pagesize'] != -1 ? "limit " . $_SESSION['g_pagesize'] : "";
         $sql = "select *\n                 from\n                 fiche join fiche_Def using (fd_id) join vw_fiche_name using(f_id)\n                 where frd_id=" . $p_frd_id . " {$p_search} {$order}  " . $limit . " offset " . $p_offset;
     }
     $Ret = $this->cn->exec_sql($sql);
     if (($Max = Database::num_row($Ret)) == 0) {
         return;
     }
     $all[0] = new Fiche($this->cn);
     for ($i = 0; $i < $Max; $i++) {
         $row = Database::fetch_array($Ret, $i);
         $t = new Fiche($this->cn, $row['f_id']);
         $t->getAttribut();
         $all[$i] = clone $t;
     }
     return $all;
 }