Jo, presne to jsi mel videt :) Ja teda pouzivam i,j,k,... male L spis ne, protoze vypada jako i a 1. "i" jako index nebo osovy kriz x,y,z, i,j,k.
Příspěvky odeslané z IP adresy 2001:718:2601:26c:508e:71...–
peter
peter
Neni mi jasny smysl
<input type='hidden' name=".$row['ID']." />
To by asi melo smyl, kdybys mel vic formularu. Takhle postaci kdyz to pouzijes misto odpoved[$i], ne?
peter
Nic z toho nepouzivam. Viz Kit. Pisi primo prikazy pro vytvoreni struktury.
Pro prezentaci treti ne-programatorske osobe bych zvolil nastroj, ktery sql prikazy umi prevest na grafy. Opacny nastroj se spis hodi pro nauceni se prikazu pro studenta.
Ty prikazy jsou naprosto presne, minimalni a lze zapsat sloupce pod sebe. Cili mezi tim grafem je jedinej rozdil, propojeni klicu.
CREATE TABLE `s_user` (
`iduser` int(10) unsigned NOT NULL auto_increment,
`status` tinyint(4) NOT NULL default '1',
`nick` varchar(40) NOT NULL default '',
`psw` varchar(40) NOT NULL default '',
`role` int(10) unsigned NOT NULL default '0',
`logdate` date NOT NULL default '0000-00-00',
`loguser` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`iduser`),
INDEX `nick`(`nick`),
INDEX `psw` (`psw`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
peter
Zjednodusil jsem to. Sis na sablony mel udelat funkci, te predat $row, abys to mel prehlednejsi. Tak schvalne, jestli tam ted vidis to, co vidim ja?
<?php
define('_INDEX_CALL', true);
require("config.php");
require_once(_ABS_PATH . "mpdf60/mpdf.php");
$mpdf = new mPDF('utf-8', 'A4');
$mpdf->useOnlyCoreFonts = true;
$mpdf->SetDisplayMode('fullpage');
//$mpdf->SetAutoFont(0);
// CSS soubor
$stylesheet = file_get_contents(_ABS_PATH . 'css/bootstrap.min.css');
require_once(_ABS_PATH . "system/lib/database.class.php");
$database = new database($host, $user, $db_name, $password);
$database_obj = new database($host, $user, $db_name, $password);
$query = "SELECT * FROM `orders__order` WHERE `orders_flag` =3 LIMIT 0, 10";
$database->query = $query;
$database->set_query();
if ($database->result) {
ob_start();
$i = 1;
while ($row = mysql_fetch_object($database->result)) {
echo 'x';
echo $row->number;
echo 'x';
echo $row->updated;
echo 'x';
echo $row->payment_name;
echo 'x';
echo $row->fak_name_surname;
echo 'x';
echo $row->fak_street_cp;
echo 'x';
echo $row->fak_town;
echo 'x';
echo $row->fak_psc;
echo 'x';
echo $row->fak_country;
echo 'x';
echo $row->fak_telephone;
echo 'x';
$i = 1;
$query_obj = "SELECT * FROM `orders__items` WHERE `order_id` =" . $row->id;
$database_obj->query = $query_obj;
$database_obj->set_query();
while ($obj = mysql_fetch_object($database_obj->result)) {
$price_dph = $obj->price * (1 + $obj->shop_vat / 100);
echo 'y';
echo $obj->name;
echo 'y';
echo round($price_dph);
echo 'y';
echo $obj->amount;
echo 'y';
echo $sub = round($price_dph * ($obj->amount)); // kdo vi, co to vypise...
echo 'y';
$i++;
}
echo 'z';
echo $subtotal = $row->price - ($row->payment_price + $row->delivery_price);
echo 'z';
echo $row->payment_price;
echo 'z';
echo $row->delivery_price;
echo 'z';
echo $row->price;
echo 'z';
$html = ob_get_contents();
ob_end_clean();
$mpdf->WriteHTML($stylesheet, 1);
$mpdf->WriteHTML($html, 2);
$name = _ABS_PATH . "temp/order_" . $row->number . '.pdf';
$mpdf->Output($name, "F");
$i++;
}
}
ob_end_flush();
?>