Example #1
0
 function html_inner()
 {
     $this->text->html();
     if (is_array($this->struct) && count($this->struct) > 0) {
         $this->subitems->html_head();
         $this->tbl->html_head();
         $struct = $this->struct;
         foreach ($struct as $name => $item) {
             $this->tr->css_style['background'] = string_to_color($item->text, 2);
             $this->tr->html_head();
             $this->td->html_head();
             $this->text->text = $item->text;
             $this->struct = $item->children;
             $this->id_alloc();
             $this->html();
             $this->struct = $struct;
             $this->td->html_tail();
             $this->tr->html_tail();
         }
         $this->tbl->html_tail();
         $this->subitems->html_tail();
     }
 }
Example #2
0
 function __construct()
 {
     parent::__construct();
     $this->etype = get_class($this);
     $rows = 100;
     $tbl = new dom_table_x(2, $rows);
     $this->append_child($tbl);
     $ir = rand();
     for ($k = 0; $k < $rows; $k++) {
         $css = string_to_color($ir, 1);
         $ir = $css . rand();
         $tc = bgcolor_to_color($css);
         $tbl->cells[$k][1]->css_style['background'] = $css;
         $tbl->cells[$k][1]->css_style['color'] = $tc;
         $t = new dom_statictext();
         $tbl->cells[$k][0]->append_child($t);
         $t->text = $k;
         $t = new dom_statictext();
         $tbl->cells[$k][1]->append_child($t);
         $t->text = $ir;
     }
 }
Example #3
0
 function html_inner()
 {
     global $sql;
     $r = $sql->fetch1($sql->query("SELECT count(1) FROM `" . TABLE_META_TREE_TMP . "`"));
     if ($r > 0) {
         $t = TABLE_META_TREE_TMP;
         $ins = new query_gen_ext('INSERT UPDATE');
         $ins->into->exprs[] = new sql_column(NULL, $t);
         unset($ins_vars);
     } else {
         $t = TABLE_META_TREE;
     }
     $new = new ddc_key();
     $new->attach(TABLE_META_TREE_TMP, $sql);
     $diff = $new->inheritance_update();
     if (is_array($diff)) {
         $this->tbl->html_head();
     }
     if (is_array($diff)) {
         foreach ($diff as $d) {
             $this->args['type'] = $d->type;
             $this->args['id'] = $d->id;
             $this->args['href'] = '';
             $this->args['name'] = $d->descr;
             $this->args['change'] = "";
             $this->args['apply'] = "apply";
             foreach ($d->row as $rk => $rv) {
                 $this->args['change'] .= $rk . "=" . $rv . ";";
                 if (isset($ins) && $d->type == '+') {
                     if (isset($ins_vars[$rk])) {
                         $ins_vars[$rk]->value = $rv;
                     } else {
                         $ins_vars[$rk] = new sql_immed($rv);
                         $ins->set->exprs[] = new sql_expression('=', array(new sql_column(NULL, NULL, $rk), $ins_vars[$rk]));
                     }
                 }
             }
             if (isset($ins) && $d->type == '+') {
                 $this->args['apply'] = $ins->result();
             } else {
                 $this->args['apply'] = "";
             }
             if (isset($ins) && ($d->type == '*q' || $d->type == '-q' || $d->type == '+q')) {
                 $this->args['apply'] = $d->row['query'];
             }
             //$this->args['meta_change']=$d->meta_change;
             //$this->args['change']=count($d->diff);
             $this->row->css_style['background'] = '';
             switch ($d->type) {
                 case '-':
                     $this->row->css_style['background'] = string_to_color('sql_table', 2);
                     break;
                 case '+':
                     $this->row->css_style['background'] = string_to_color('name', 2);
                     break;
                 case '*':
                     $this->row->css_style['background'] = 'yellow';
                     break;
             }
             $this->row->html();
             $this->row->id_alloc();
         }
     } else {
         $this->gen_error->text = $diff;
         $this->gen_error->html();
     }
     if (is_array($diff)) {
         $this->tbl->html_tail();
     }
 }
Example #4
0
$sum = 0;
$nim = 0;
$skip = 0;
$lim = $skip + 100;
$lim_labels = $sql->fetch1($sql->query("SELECT `current` FROM `barcodes_counters` WHERE `id`=0"));
$lim_ribbon = $sql->fetch1($sql->query("SELECT `current` FROM `barcodes_counters` WHERE `id`=1"));
print "<div class=cr>";
print "<div class=cr_n>";
print htmlspecialchars("Наименование", ENT_QUOTES);
print "</div>";
print "<div class=cr_code>";
print htmlspecialchars("Код", ENT_QUOTES);
print "</div>";
print "<div class=cr_coun>";
print htmlspecialchars("Количество", ENT_QUOTES);
print "</div>";
print "</div>";
while ($row = $sql->fetcha($result)) {
    print "<div class=cr style='background-color:" . string_to_color($row['name'], 2) . ";'>";
    print "<div class=cr_n>";
    print htmlspecialchars($row['name'], ENT_QUOTES);
    print "</div>";
    print "<div class=cr_code>";
    print htmlspecialchars($row['code'], ENT_QUOTES);
    print "</div>";
    print "<div class=cr_coun>";
    print htmlspecialchars($row['count'], ENT_QUOTES);
    print "</div>";
    print "</div>";
}
print "</body></html>";
Example #5
0
 function html_inner()
 {
     global $sql;
     //output styles
     foreach ($this->col_by_id as $id => $e) {
         $this->style->exstyle['.c' . $id]['width'] = $this->rootnode->setting_val($id, $this->long_name . '._width', 50) . 'px';
         $this->resizers[$id]->attributes['onmouseup'] = "if(resizer.obj){ save_setting_value('" . $id . "','" . $this->long_name . "._width',resizer.obj.clientWidth);";
         //		$this->resizers[$id]->attributes['onmouseup'].="save_setting_value('".$id."','".$this->long_name."._height',resizer.obj.clientHeight);";
         $this->resizers[$id]->attributes['onmouseup'] .= "}";
         $this->resizers[$id]->css_class = 'c' . $id;
     }
     $this->style->html();
     $this->resizer->before_id = 'r';
     $this->resizer->after_id = '_resize_stylex';
     if (!$this->use_single) {
         //output captions using hr_names
         foreach ($this->col_by_id as $id => $e) {
             $this->resizers[$id]->css_style['background-color'] = string_to_color($e['name'], 1);
             $this->resizers[$id]->css_style['color'] = $e['sql_keyname'] == 'PRIMARY' ? 'red' : 'black';
             $this->captions[$id]->text = $e['hr_name'];
             $this->resizers[$id]->attributes['title'] = $e['name'];
         }
         $this->wc->html();
         //output data (set keys and oids coorectly
         $this->tbl->html_head();
         $this->fetchq->lim_count = $this->args['ed_count'];
         $this->fetchq->lim_offset = $this->args['ed_offset'];
     }
     $res = $sql->query($this->fetchq->result());
     while ($row = $sql->fetcha($res)) {
         foreach ($this->keys as $i => $k) {
             $this->keys[$i] = $row['c' . $i];
         }
         foreach ($row as $k => $v) {
             $this->args[$k] = $v;
         }
         if (!$this->use_single) {
             $this->tr->id_alloc();
         } else {
             $this->single->id_alloc();
         }
         foreach ($this->editors_by_id as $i => $c) {
             $c->bootstrap();
         }
         if (!$this->use_single) {
             $this->tr->html();
         } else {
             $this->single->html();
         }
     }
     if (!$this->use_single) {
         $this->tbl->html_tail();
     }
     //$this->rootnode->out(htmlspecialchars($this->fetchq->result()));
 }