11 |
if (count($row) <= 0) $auth = false; |
if (count($row) <= 0) $auth = false; |
12 |
if ($auth) { |
if ($auth) { |
13 |
$row = $row[0]; |
$row = $row[0]; |
14 |
if ($PHP_AUTH_PW != $row[0]) $auth = false; |
if (substr($row[0], 0, 5) == "auth_") { |
15 |
|
switch (strtoupper(substr($row[0], 5))) { |
16 |
|
case "POP3": |
17 |
|
include("auth_POP3.php"); |
18 |
|
$pop = new POP3(); |
19 |
|
$pop->connect("intranet.pliva.hr"); |
20 |
|
$ret = $pop->checklogin($PHP_AUTH_USER, $PHP_AUTH_PW); |
21 |
|
$pop->quit(); |
22 |
|
if (!$ret) $auth = false; |
23 |
|
break; |
24 |
|
default: $auth = false; break; |
25 |
|
} |
26 |
|
} else { |
27 |
|
$pw = md5($PHP_AUTH_USER.$PHP_AUTH_PW); |
28 |
|
if ($pw != $row[0]) $auth = false; |
29 |
|
} |
30 |
|
# if ($PHP_AUTH_PW != $row[0]) $auth = false; |
31 |
} |
} |
32 |
} |
} |
33 |
if (!$auth) { |
if (!$auth || $relogin == $PHP_AUTH_USER) { |
34 |
Header("WWW-Authenticate: Basic realm=\"fcproducts\""); |
Header("WWW-Authenticate: Basic realm=\"fcproducts\""); |
35 |
Header("HTTP/1.0 401 Unauthorized"); |
Header("HTTP/1.0 401 Unauthorized"); |
36 |
echo "<HTML><B>No access.</B></HTML>\n"; |
echo "<HTML><B>No access.</B></HTML>\n"; |
37 |
exit; |
exit; |
38 |
} |
} |
39 |
if (!$id) { echo "<HTML><B>No product ID!</B></HTML>\n"; exit; } |
# if (!$id) { echo "<HTML><B>No product ID!</B></HTML>\n"; exit; } |
40 |
|
DBOpen(); |
41 |
|
if (!$id) { |
42 |
|
$id = 1; |
43 |
|
$row = DBQuery("SELECT MIN(product_id) FROM products"); |
44 |
|
if ($row[0]) $id = $row[0][0]; |
45 |
|
} |
46 |
$error = ""; |
$error = ""; |
47 |
$msg = false; |
$msg = false; |
48 |
$err = 0; |
$err = 0; |
|
DBOpen(); |
|
49 |
$row = DBQuery("SELECT market,production,purchasing,economics,risks,competition,potential,portfolio,sales,quality,dosage,evaluation,comment FROM user_product WHERE (product_id=$id) AND (login='$PHP_AUTH_USER')"); |
$row = DBQuery("SELECT market,production,purchasing,economics,risks,competition,potential,portfolio,sales,quality,dosage,evaluation,comment FROM user_product WHERE (product_id=$id) AND (login='$PHP_AUTH_USER')"); |
|
if (is_array($row[0]) && count($row[0]) > 0) bool_fix($row[0]); |
|
50 |
list($ok_market, $ok_production, $ok_purchasing, $ok_economics, |
list($ok_market, $ok_production, $ok_purchasing, $ok_economics, |
51 |
$ok_risks, $ok_competition, $ok_potential, $ok_portfolio, |
$ok_risks, $ok_competition, $ok_potential, $ok_portfolio, |
52 |
$ok_sales, $ok_quality, $ok_dosage, $ok_evaluation, |
$ok_sales, $ok_quality, $ok_dosage, $ok_evaluation, |
53 |
$ok_comment) = $row[0]; |
$ok_comment) = array(-1, -1, -1, -1, -1, -1, -1, -1, -1, |
54 |
|
-1, -1, -1, -1); |
55 |
|
if (is_array($row[0])) { |
56 |
|
bool_fix($row[0]); |
57 |
|
list($ok_market, $ok_production, $ok_purchasing, |
58 |
|
$ok_economics, $ok_risks, $ok_competition, |
59 |
|
$ok_potential, $ok_portfolio, $ok_sales, $ok_quality, |
60 |
|
$ok_dosage, $ok_evaluation, $ok_comment) = $row[0]; |
61 |
|
} |
62 |
if ($save) { |
if ($save) { |
63 |
$error = ""; |
$error = ""; |
64 |
$q = array(); |
$q = array(); |
155 |
} |
} |
156 |
$row = DBQuery("SELECT naziv FROM products WHERE (product_id=$id)"); |
$row = DBQuery("SELECT naziv FROM products WHERE (product_id=$id)"); |
157 |
list($product_name) = $row[0]; |
list($product_name) = $row[0]; |
|
DBClose(); |
|
158 |
?> |
?> |
159 |
<HTML> |
<HTML> |
160 |
<HEAD> |
<HEAD> |
161 |
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> |
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> |
162 |
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> |
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> |
163 |
<LINK REL="StyleSheet" HREF="style.css"> |
<?php |
164 |
|
$ns_ua = "Mozilla/4."; |
165 |
|
$old_netscape = (substr($HTTP_USER_AGENT, 0, strlen($ns_ua)) == $ns_ua) ? |
166 |
|
true : false; |
167 |
|
if ($old_netscape) $old_netscape = strstr($HTTP_USER_AGENT, "MSIE") ? false : true; |
168 |
|
if ($old_netscape) echo "<LINK REL=\"StyleSheet\" HREF=\"style-ns.css\">\n"; |
169 |
|
else echo "<LINK REL=\"StyleSheet\" HREF=\"style.css\">\n"; |
170 |
|
?> |
171 |
<TITLE><?= $product_name ?></TITLE> |
<TITLE><?= $product_name ?></TITLE> |
172 |
<?php if ($msg): ?> |
<?php if ($msg): ?> |
173 |
<META HTTP-EQUIV="Refresh" CONTENT="1; URL=?id=<?= $id ?>"> |
<META HTTP-EQUIV="Refresh" CONTENT="1; URL=?id=<?= $id ?>"> |
187 |
</TD></TR></TABLE> |
</TD></TR></TABLE> |
188 |
</TD></TR></TABLE> |
</TD></TR></TABLE> |
189 |
<?php else: ?> |
<?php else: ?> |
|
<FORM ENCTYPE="multipart/form-data" METHOD="post" ACTION="<?= $PHP_SELF ?>"> |
|
190 |
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2" WIDTH="100%" HEIGHT="100%"> |
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2" WIDTH="100%" HEIGHT="100%"> |
191 |
<TR> |
<TR> |
192 |
<TD ALIGN="left" VALIGN="top" ROWSPAN="2" WIDTH="33%" HEIGHT="1%"><TABLE BORDER="0" CELLSPACING="0"><TR><TD CLASS="title1"><B>FINE CHEMICALS</B></TD></TR></TABLE></TD> |
<TD ALIGN="left" VALIGN="top" WIDTH="33%" HEIGHT="1%"><TABLE BORDER="0" CELLSPACING="0"><TR><TD CLASS="title1"><B>FINE CHEMICALS</B></TD></TR></TABLE></TD> |
193 |
<TD ALIGN="center" VALIGN="top" ROWSPAN="2" WIDTH="33%" HEIGHT="1%"><TABLE BORDER="0" CELLSPACING="0"><TR><TD CLASS="title2"><B><?= $product_name ?></B></TD></TR></TABLE></TD> |
<TD ALIGN="center" VALIGN="top" ROWSPAN="2" WIDTH="33%" HEIGHT="1%"><TABLE BORDER="0" CELLSPACING="0"><TR><TD CLASS="title2"><B><?= $product_name ?></B></TD></TR></TABLE></TD> |
194 |
<TD ALIGN="right" VALIGN="top" WIDTH="33%" HEIGHT="1%"><TABLE BORDER="0" CELLSPACING="0"><TR><TD CLASS="title3"><B>PRODUCT MATRIX</B></TD></TR></TABLE></TD> |
<TD ALIGN="right" VALIGN="top" WIDTH="33%" HEIGHT="1%" COLSPAN="2"><TABLE BORDER="0" CELLSPACING="0"><TR><TD CLASS="title3"><B>PRODUCT MATRIX</B></TD></TR></TABLE></TD> |
195 |
</TR> |
</TR> |
196 |
<TR><TD ALIGN="right" VALIGN="middle" HEIGHT="1%"><B>Date of last change:</B> <?php $tmp = getlastmod(); echo date("F d, Y.", $tmp)." at ".date("H:i:s", $tmp); ?></TD></TR> |
<FORM ENCTYPE="multipart/form-data" METHOD="post" ACTION="<?= $PHP_SELF ?>"> |
197 |
<TR><TD COLSPAN="3" ALIGN="center" HEIGHT="1%"><HR WIDTH="100%" SIZE="2"></TD></TR> |
<TR><TD ALIGN="left" VALIGN="bottom"><HR WIDTH="100%" SIZE="1" NOSHADE><INPUT TYPE="submit" NAME="change" VALUE="Change" CLASS="button"> product to <SELECT NAME="id" ONCHANGE="document.forms[0].submit();"><?php |
198 |
|
$row = DBQuery("SELECT product_id,naziv FROM products ORDER BY naziv"); |
199 |
|
while (list($key, $val) = each($row)) { |
200 |
|
list($_id, $name) = $val; |
201 |
|
$selected = ($id == $_id) ? " SELECTED" : ""; |
202 |
|
echo "<OPTION VALUE=\"$_id\"$selected>$name</OPTION>\n"; |
203 |
|
} |
204 |
|
?></SELECT></TD><TD ALIGN="right" VALIGN="bottom" HEIGHT="1%" COLSPAN="2"><B>Date of last change:</B> <?php $tmp = getlastmod(); echo date("F d, Y.", $tmp)." at ".date("H:i:s", $tmp); ?></TD></TR> |
205 |
|
</FORM> |
206 |
|
<TR><TD COLSPAN="4" ALIGN="center" HEIGHT="1%"><HR WIDTH="100%" SIZE="2"></TD></TR> |
207 |
|
<FORM ENCTYPE="multipart/form-data" METHOD="post" ACTION="<?= $PHP_SELF ?>"> |
208 |
<TR> |
<TR> |
209 |
|
|
210 |
<TD WIDTH="33%" ALIGN="center" VALIGN="top"> |
<TD WIDTH="33%" ALIGN="center" VALIGN="top"> |
234 |
</TABLE> |
</TABLE> |
235 |
</TD> |
</TD> |
236 |
|
|
237 |
<TD WIDTH="33%" ALIGN="center" VALIGN="top"> |
<TD WIDTH="33%" ALIGN="center" VALIGN="top" COLSPAN="2"> |
238 |
<TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%"> |
<TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%"> |
239 |
<TR><TD CLASS="cell3" ALIGN="center" VALIGN="middle" HEIGHT="1%"><B>Quality and Regulations</B></TD></TR> |
<TR><TD CLASS="cell3" ALIGN="center" VALIGN="middle" HEIGHT="1%"><B>Quality and Regulations</B></TD></TR> |
240 |
<TR><?php if ($ok_quality >= 0): ?><TD CLASS="cell1" ALIGN="left" VALIGN="top"> |
<TR><?php if ($ok_quality >= 0): ?><TD CLASS="cell1" ALIGN="left" VALIGN="top"> |
277 |
</TABLE> |
</TABLE> |
278 |
</TD> |
</TD> |
279 |
|
|
280 |
<TD WIDTH="33%" ALIGN="center" VALIGN="top"> |
<TD WIDTH="33%" ALIGN="center" VALIGN="top" COLSPAN="2"> |
281 |
<TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%"> |
<TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%"> |
282 |
<TR><TD CLASS="cell3" ALIGN="center" VALIGN="middle" HEIGHT="1%"><B>Dosage Form Market</B></TD></TR> |
<TR><TD CLASS="cell3" ALIGN="center" VALIGN="middle" HEIGHT="1%"><B>Dosage Form Market</B></TD></TR> |
283 |
<TR><?php if ($ok_dosage >= 0): ?><TD CLASS="cell1" ALIGN="left" VALIGN="top"> |
<TR><?php if ($ok_dosage >= 0): ?><TD CLASS="cell1" ALIGN="left" VALIGN="top"> |
313 |
</TABLE> |
</TABLE> |
314 |
</TD> |
</TD> |
315 |
|
|
316 |
<TD WIDTH="33%" ROWSPAN="2" ALIGN="center" VALIGN="top"> |
<TD WIDTH="33%" ROWSPAN="2" ALIGN="center" VALIGN="top" COLSPAN="2"> |
317 |
<TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%"> |
<TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%"> |
318 |
<TR><TD CLASS="cell3" ALIGN="center" VALIGN="middle" HEIGHT="1%"><SPAN CLASS="red"><B>Product Evaluation</B></SPAN></TD></TR> |
<TR><TD CLASS="cell3" ALIGN="center" VALIGN="middle" HEIGHT="1%"><SPAN CLASS="red"><B>Product Evaluation</B></SPAN></TD></TR> |
319 |
<TR><?php if ($ok_evaluation >= 0): ?><TD CLASS="cell2" ALIGN="left" VALIGN="top"> |
<TR><?php if ($ok_evaluation >= 0): ?><TD CLASS="cell2" ALIGN="left" VALIGN="top"> |
332 |
<TD WIDTH="33%" ROWSPAN="3" ALIGN="center" VALIGN="top"> |
<TD WIDTH="33%" ROWSPAN="3" ALIGN="center" VALIGN="top"> |
333 |
<TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%"> |
<TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%"> |
334 |
<TR><TD CLASS="cell3" ALIGN="center" VALIGN="middle" HEIGHT="1%"><B>Sales: realisation&plan / Price trend</B></SPAN></TD></TR> |
<TR><TD CLASS="cell3" ALIGN="center" VALIGN="middle" HEIGHT="1%"><B>Sales: realisation&plan / Price trend</B></SPAN></TD></TR> |
335 |
<TR><TD CLASS="cell1" ALIGN="center" VALIGN="middle" HEIGHT="100%"><?php if ($ok_sales >= 0): ?><?php if ($edit && $ok_sales > 0): ?><B>Please choose an image to display here.</B><BR><BR><INPUT TYPE="file" CLASS="file" NAME="sales_img" VALUE="<?= $info_sales ?>"><BR><SMALL><I><B>NOTE:</B> The previously specified image will be used if no image is specified.</I></SMALL><?php elseif ($sales_img): ?><IMG SRC="img/<?= $sales_img ?>" BORDER="0"><?php else: ?> <?php endif; ?><?php else: ?><?= $msg_no_data ?><?php endif; ?></TD></TR> |
<TR><TD CLASS="cell1" ALIGN="center" VALIGN="middle" HEIGHT="100%"><?php if ($ok_sales >= 0): ?><?php if ($edit && $ok_sales > 0): ?><B>Please choose an image to display here.</B><BR><BR><INPUT TYPE="file" CLASS="file" NAME="sales_img" VALUE="<?= $info_sales ?>"><BR><SMALL><I><B>NOTE:</B> The previously specified image will be used if no image is specified.</I></SMALL><?php elseif ($sales_img): ?><IMG SRC="img/<?= $sales_img ?>" BORDER="0" ALT=""><?php else: ?> <?php endif; ?><?php else: ?><?= $msg_no_data ?><?php endif; ?></TD></TR> |
336 |
</TABLE> |
</TABLE> |
337 |
</TD> |
</TD> |
338 |
|
|
354 |
</TABLE> |
</TABLE> |
355 |
</TD> |
</TD> |
356 |
|
|
357 |
<TD WIDTH="33%" ROWSPAN="2" ALIGN="center" VALIGN="top"> |
<TD WIDTH="33%" ROWSPAN="2" ALIGN="center" VALIGN="top" COLSPAN="2"> |
358 |
<TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%"> |
<TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%"> |
359 |
<TR><TD CLASS="cell2" ALIGN="left" VALIGN="top"><B>Comments</B><BR><?php if ($ok_comment >= 0): ?><?php if ($edit && $ok_comment > 0): ?><TEXTAREA NAME="comment" WRAP="virtual" CLASS="ta2"><?= $comment ?></TEXTAREA><?php else: ?><BLOCKQUOTE><?php |
<TR><TD CLASS="cell2" ALIGN="left" VALIGN="top"><B>Comments</B><BR><?php if ($ok_comment >= 0): ?><?php if ($edit && $ok_comment > 0): ?><TEXTAREA NAME="comment" WRAP="virtual" CLASS="ta2"><?= $comment ?></TEXTAREA><?php else: ?><BLOCKQUOTE><?php |
360 |
$out = str_replace("&", "&", $comment); |
$out = str_replace("&", "&", $comment); |
363 |
$out = str_replace(">", ">", $out); |
$out = str_replace(">", ">", $out); |
364 |
$out = ereg_replace("\r?\n", "<BR>", $out); |
$out = ereg_replace("\r?\n", "<BR>", $out); |
365 |
echo $out; |
echo $out; |
366 |
?></BLOCKQUOTE><?php endif; ?><?php else: ?><BR><BR><BR><BR><P CLASS="center"><?= $msg_no_data ?></P><?php endif; ?></TD></TR> |
?></BLOCKQUOTE><?php endif; ?><?php else: ?><BR><BR><BR><P CLASS="center"><?= $msg_no_data ?></P><?php endif; ?></TD></TR> |
367 |
</TABLE> |
</TABLE> |
368 |
</TD> |
</TD> |
369 |
|
|
370 |
</TR> |
</TR> |
371 |
<TR> |
<TR> |
372 |
|
|
373 |
<TD WIDTH="33%"> |
<TD WIDTH="33%" HEIGHT="1%"> |
374 |
<TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%"> |
<TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%"> |
375 |
<TR><TD CLASS="cell3" ALIGN="center" VALIGN="middle" HEIGHT="1%"><B>Risks</B></TD></TR> |
<TR><TD CLASS="cell3" ALIGN="center" VALIGN="middle" HEIGHT="1%"><B>Risks</B></TD></TR> |
376 |
<TR><?php if ($ok_risks >= 0): ?><TD CLASS="cell1" ALIGN="left" VALIGN="middle"> |
<TR><?php if ($ok_risks >= 0): ?><TD CLASS="cell1" ALIGN="left" VALIGN="middle"> |
384 |
|
|
385 |
</TR> |
</TR> |
386 |
<TR> |
<TR> |
387 |
<TD ALIGN="left" VALIGN="top"><?php if ($error): ?><FONT COLOR="#FF0000" SIZE="2"><B><?= $error ?></B><?php else: ?> <?php endif; ?></TD> |
<TD ALIGN="left" VALIGN="top" COLSPAN="2"><?php if ($error): ?><FONT COLOR="#FF0000" SIZE="2"><B><?= $error ?></B><?php else: ?> <?php endif; ?></TD> |
388 |
<TD COLSPAN="2" ALIGN="right"><?php if ($edit): ?><INPUT TYPE="submit" CLASS="button" VALUE="Cancel"> <INPUT TYPE="submit" CLASS="button" NAME="save" VALUE="Save"><?php else: ?><INPUT TYPE="hidden" NAME="edit" VALUE="1"><INPUT TYPE="submit" CLASS="button" VALUE="Edit..."><?php endif; ?></TD> |
<TD ALIGN="left" VALIGN="middle"><SMALL CLASS="info"> Logged in as <B><?= $PHP_AUTH_USER ?></B>. [<A HREF="?relogin=<?= $PHP_AUTH_USER ?>" CLASS="logout">Logout</A>]</SMALL></TD> |
389 |
|
<TD ALIGN="right"><?php if ($edit): ?><INPUT TYPE="submit" CLASS="button" VALUE="Cancel"> <INPUT TYPE="submit" CLASS="button" NAME="save" VALUE="Save"><?php else: ?><INPUT TYPE="hidden" NAME="edit" VALUE="1"><INPUT TYPE="submit" CLASS="button" VALUE="Edit..."><?php endif; ?></TD> |
390 |
</TR> |
</TR> |
391 |
</TABLE> |
</TABLE> |
392 |
</TD></TR> |
</TD></TR> |
|
</TABLE> |
|
393 |
<INPUT TYPE="hidden" NAME="id" VALUE="<?= $id ?>"></FORM> |
<INPUT TYPE="hidden" NAME="id" VALUE="<?= $id ?>"></FORM> |
394 |
|
</TABLE> |
395 |
<?php endif; ?> |
<?php endif; ?> |
396 |
</BODY> |
</BODY> |
397 |
|
<?php DBClose(); ?> |
398 |
</HTML> |
</HTML> |