/[fcproducts]/index.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /index.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (hide annotations)
Thu Jun 21 09:59:50 2001 UTC (18 years, 3 months ago) by ravilov
Branch: MAIN
Changes since 1.8: +11 -11 lines
Added a "CAS No" field in the database and on the input form.

1 ravilov 1.1 <?
2     include("util.php");
3     $auth = true;
4     if ($auth && (!isset($PHP_AUTH_USER) || !isset($PHP_AUTH_PW)))
5     $auth = false;
6 ravilov 1.9 if ($change) { $id = $new_id; $edit = false; }
7 ravilov 1.1 if ($auth) {
8     include("conn.php");
9     DBOpen();
10     $row = DBQuery("SELECT password FROM users WHERE (login='$PHP_AUTH_USER')");
11     DBClose();
12     if (count($row) <= 0) $auth = false;
13     if ($auth) {
14     $row = $row[0];
15 ravilov 1.7 if (substr($row[0], 0, 5) == "auth_") {
16     switch (strtoupper(substr($row[0], 5))) {
17     case "POP3":
18     include("auth_POP3.php");
19     $pop = new POP3();
20     $pop->connect("intranet.pliva.hr");
21     $ret = $pop->checklogin($PHP_AUTH_USER, $PHP_AUTH_PW);
22     $pop->quit();
23     if (!$ret) $auth = false;
24     break;
25     default: $auth = false; break;
26     }
27     } else {
28     $pw = md5($PHP_AUTH_USER.$PHP_AUTH_PW);
29     if ($pw != $row[0]) $auth = false;
30     }
31     # if ($PHP_AUTH_PW != $row[0]) $auth = false;
32 ravilov 1.1 }
33     }
34 dpavlin 1.3 if (!$auth || $relogin == $PHP_AUTH_USER) {
35 ravilov 1.1 Header("WWW-Authenticate: Basic realm=\"fcproducts\"");
36     Header("HTTP/1.0 401 Unauthorized");
37     echo "<HTML><B>No access.</B></HTML>\n";
38     exit;
39     }
40 ravilov 1.4 # if (!$id) { echo "<HTML><B>No product ID!</B></HTML>\n"; exit; }
41     DBOpen();
42     if (!$id) {
43     $id = 1;
44     $row = DBQuery("SELECT MIN(product_id) FROM products");
45     if ($row[0]) $id = $row[0][0];
46     }
47 ravilov 1.1 $error = "";
48     $msg = false;
49     $err = 0;
50     $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')");
51     list($ok_market, $ok_production, $ok_purchasing, $ok_economics,
52     $ok_risks, $ok_competition, $ok_potential, $ok_portfolio,
53     $ok_sales, $ok_quality, $ok_dosage, $ok_evaluation,
54 ravilov 1.4 $ok_comment) = array(-1, -1, -1, -1, -1, -1, -1, -1, -1,
55     -1, -1, -1, -1);
56     if (is_array($row[0])) {
57     bool_fix($row[0]);
58     list($ok_market, $ok_production, $ok_purchasing,
59     $ok_economics, $ok_risks, $ok_competition,
60     $ok_potential, $ok_portfolio, $ok_sales, $ok_quality,
61     $ok_dosage, $ok_evaluation, $ok_comment) = $row[0];
62     }
63 ravilov 1.1 if ($save) {
64     $error = "";
65 ravilov 1.9 $q = array("cas_no='$cas_no'");
66 ravilov 1.1 if ($error == "" && $ok_market > 0) {
67     if (!CheckURL($info_market)) { $error = "Invalid URL."; $err = 1; }
68     if ($error == "") array_push($q, "link_market='$info_market',cust_existing='$cust_existing',cust_potential='$cust_potential',fc_price='$fc_price'");
69     }
70     if ($error == "" && $ok_competition > 0) {
71     if (!CheckURL($info_competition)) { $error = "Invalid URL."; $err = 2; }
72     if ($error == "") array_push($q, "link_competition='$info_competition',competitors='$competitors',holders='$holders',market_size='$market_size'");
73     }
74     if ($error == "" && $ok_quality > 0) {
75     if (!CheckURL($info_quality)) { $error = "Invalid URL."; $err = 3; }
76     if ($error == "") array_push($q, "link_quality='$info_quality',quality='$quality',registrations='$registrations',last_fda='$last_fda'");
77     }
78     if ($error == "" && $ok_production > 0) {
79     if (!CheckURL($info_production)) { $error = "Invalid URL."; $err = 4; }
80     if ($error == "") array_push($q, "link_production='$info_production',cap_nominal='$cap_nominal',cap_util='$cap_util'");
81     }
82     if ($error == "" && $ok_potential > 0) {
83     if (!CheckURL($info_potential)) { $error = "Invalid URL."; $err = 5; }
84     if ($error == "") array_push($q, "link_potential='$info_potential',ther_class='$ther_class',indication='$indication'");
85     }
86     if ($error == "" && $ok_dosage > 0) {
87     if (!CheckURL($info_dosage)) { $error = "Invalid URL."; $err = 6; }
88     if ($error == "") array_push($q, "link_dosage='$info_dosage',sales_1999='$sales_1999',launch_year='$launch_year'");
89     }
90     if ($error == "" && $ok_purchasing > 0) {
91     if (!CheckURL($info_purchasing)) { $error = "Invalid URL."; $err = 7; }
92     if ($error == "") array_push($q, "link_purchasing='$info_purchasing',mat_raw='$mat_raw',suppliers='$suppliers',mat_cost='$mat_cost'");
93     }
94     if ($error == "" && $ok_portfolio > 0) array_push($q, "fc_rank='$fc_rank',fc_share='$fc_share'");
95     if ($error == "" && $ok_evaluation > 0) array_push($q, "maturity='$maturity',comp_intensity='$comp_intensity',comp_position='$comp_position'");
96     if ($error == "" && $ok_economics > 0) {
97     if (!CheckURL($info_economics)) { $error = "Invalid URL."; $err = 8; }
98     if ($error == "") array_push($q, "link_economics='$info_economics',cogs='$cogs',op_income='$op_income',break_even='$break_even',m3='$m3'");
99     }
100     if ($error == "" && $ok_risks > 0) {
101     if (!CheckURL($info_risks)) { $error = "Invalid URL."; $err = 9; }
102     if ($error == "") array_push($q, "link_risks='$info_risks',risks='$risks'");
103     }
104     if ($error == "" && $ok_sales > 0) {
105     list($name, $tmp, $type) = array($HTTP_POST_FILES["sales_img"]["name"],
106     $HTTP_POST_FILES["sales_img"]["tmp_name"],
107     $HTTP_POST_FILES["sales_img"]["type"]);
108     if ($name) {
109     list($maj, $min) = split("/", $type);
110     if ($maj != "image") $error = "Only image files (GIF, JPEG, PNG) can be accepted.";
111     if ($error == "") {
112     $content = "";
113     $fp = fopen($tmp, "rb");
114     while (!feof($fp)) $content .= fgets($fp, 1024);
115     fclose($fp);
116     $md5 = md5($content);
117     $ext = "";
118     switch ($min) {
119     case "jpeg": case "jpg": $ext = ".jpg"; break;
120     case "gif": $ext = ".gif"; break;
121     case "png": $ext = ".png"; break;
122     default: $x = strlen($name); while ($name[$x - 1] != "." && --$x > 0); if ($x > 0) $ext = substr($name, $x); break;
123     }
124     if (!move_uploaded_file($tmp, "img/".$md5.$ext))
125     $error = "An error occured while uploading image.";
126     }
127     if ($error == "") {
128     $row = DBQuery("SELECT sales_img FROM products WHERE (product_id=$id)");
129     if ($row[0][0]) @unlink("img/".$row[0][0]);
130     array_push($q, "link_sales='$name',sales_img='$md5$ext'");
131     }
132     }
133     }
134     if ($error == "" && $ok_comment > 0) array_push($q, "comment='$comment'");
135     if ($error == "") {
136     if (count($q) > 0) $q = "UPDATE products SET ".join(",", $q)." WHERE (product_id=$id)";
137     else $q = "";
138     $ret = ($q != "") ? DBQuery($q) : array(1);
139     if ($ret[0] <= 0) $error = "Unable to update data.";
140     }
141     if ($error == "") $msg = true; else $edit = 1;
142     } else {
143 ravilov 1.9 $row = DBQuery("SELECT link_market,link_production,link_purchasing,link_economics,link_risks,link_competition,link_potential,link_quality,link_dosage,link_sales,comment,cust_potential,cust_existing,fc_price,competitors,holders,market_size,quality,registrations,last_fda,cap_nominal,cap_util,ther_class,indication,sales_1999,launch_year,mat_raw,suppliers,mat_cost,fc_rank,fc_share,maturity,comp_intensity,comp_position,cogs,op_income,break_even,m3,sales_img,risks,cas_no FROM products WHERE (product_id=$id)");
144 ravilov 1.1 if (count($row) <= 0) { echo "<HTML><B>No such product ID.</B></HTML>"; exit; }
145     list($info_market, $info_production, $info_purchasing,
146     $info_economics, $info_risks, $info_competition,
147     $info_potential, $info_quality, $info_dosage,
148     $info_sales, $comment, $cust_potential, $cust_existing,
149     $fc_price, $competitors, $holders, $market_size,
150     $quality, $registrations, $last_fda, $cap_nominal,
151     $cap_util, $ther_class, $indication, $sales_1999,
152     $launch_year, $mat_raw, $suppliers, $mat_cost,
153     $fc_rank, $fc_share, $maturity, $comp_intensity,
154     $comp_position, $cogs, $op_income, $break_even,
155 ravilov 1.9 $m3, $sales_img, $risks, $cas_no) = $row[0];
156 ravilov 1.1 }
157     $row = DBQuery("SELECT naziv FROM products WHERE (product_id=$id)");
158     list($product_name) = $row[0];
159     ?>
160     <HTML>
161     <HEAD>
162     <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
163     <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
164 dpavlin 1.3 <?php
165 ravilov 1.4 $ns_ua = "Mozilla/4.";
166     $old_netscape = (substr($HTTP_USER_AGENT, 0, strlen($ns_ua)) == $ns_ua) ?
167     true : false;
168     if ($old_netscape) $old_netscape = strstr($HTTP_USER_AGENT, "MSIE") ? false : true;
169     if ($old_netscape) echo "<LINK REL=\"StyleSheet\" HREF=\"style-ns.css\">\n";
170     else echo "<LINK REL=\"StyleSheet\" HREF=\"style.css\">\n";
171 dpavlin 1.3 ?>
172 ravilov 1.8 <TITLE><?= ereg_replace("\r?\n(.*)$", " (\\1)", $product_name); ?></TITLE>
173 ravilov 1.1 <?php if ($msg): ?>
174     <META HTTP-EQUIV="Refresh" CONTENT="1; URL=?id=<?= $id ?>">
175     <?php else: ?>
176     <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
177     <!-- // begin
178     // Empty for now...
179     // end -->
180     </SCRIPT>
181     <?php endif; ?>
182     </HEAD>
183     <BODY BGCOLOR="#FFFFFF" LINK="#000000" VLINK="#000000" ALINK="#FF0000">
184     <?php if ($msg): ?>
185     <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" HEIGHT="100%"><TR><TD ALIGN="center" VALIGN="middle">
186     <TABLE BORDER="5" BORDERCOLOR="#000000" CELLSPACING="0" CELLPADDING="20"><TR><TD>
187     <FONT COLOR="#008000" STYLE="font-size: 32px;"><B><TT>Data successfully saved.</TT></B></FONT>
188     </TD></TR></TABLE>
189     </TD></TR></TABLE>
190     <?php else: ?>
191 ravilov 1.9 <FORM ENCTYPE="multipart/form-data" METHOD="post" ACTION="<?= $PHP_SELF ?>">
192 ravilov 1.1 <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2" WIDTH="100%" HEIGHT="100%">
193     <TR>
194 ravilov 1.4 <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>
195 ravilov 1.9 <TD ALIGN="center" VALIGN="top" ROWSPAN="2" WIDTH="33%" HEIGHT="1%"><TABLE BORDER="0" CELLSPACING="0"><TR><TD CLASS="title2"><B><?= $product_name ?><?php if ($edit): ?><BR><SMALL>CAS No: <INPUT TYPE="text" CLASS="text" NAME="cas_no" VALUE="<?= $cas_no ?>"></SMALL><?php else: ?><?php if ($cas_no): ?><BR><SMALL>CAS No: <?= $cas_no ?></SMALL><?php endif; ?><?php endif; ?></B></TD></TR></TABLE></TD>
196 ravilov 1.4 <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>
197 ravilov 1.1 </TR>
198 ravilov 1.9 <TR><TD ALIGN="left" VALIGN="bottom"><?php if ($edit): ?>&nbsp;<?php else: ?><HR WIDTH="100%" SIZE="1" NOSHADE><INPUT TYPE="submit" NAME="change" VALUE="Change" CLASS="button"> product to <SELECT NAME="new_id" ONCHANGE="document.forms[0].elements['change'].click();"><?php
199 ravilov 1.4 $row = DBQuery("SELECT product_id,naziv FROM products ORDER BY naziv");
200     while (list($key, $val) = each($row)) {
201     list($_id, $name) = $val;
202 ravilov 1.8 $name = ereg_replace("\r?\n.*$", "", $name);
203 ravilov 1.4 $selected = ($id == $_id) ? " SELECTED" : "";
204     echo "<OPTION VALUE=\"$_id\"$selected>$name</OPTION>\n";
205     }
206 ravilov 1.9 ?></SELECT><?php endif; ?></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>
207 ravilov 1.4 <TR><TD COLSPAN="4" ALIGN="center" HEIGHT="1%"><HR WIDTH="100%" SIZE="2"></TD></TR>
208 ravilov 1.1 <TR>
209    
210     <TD WIDTH="33%" ALIGN="center" VALIGN="top">
211     <TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%">
212     <TR><TD CLASS="cell3" ALIGN="center" VALIGN="middle" HEIGHT="1%"><B>Market Position of Fine Chemicals</B></TD></TR>
213     <TR><?php if ($ok_market >= 0): ?><TD CLASS="cell1" ALIGN="left" VALIGN="top">
214     <UL>
215     <LI>customers: existing: <?php if ($edit && $ok_market > 0): ?><INPUT TYPE="text" CLASS="text" NAME="cust_existing" VALUE="<?= $cust_existing ?>"><?php else: ?><?= $cust_existing ?><?php endif; ?><BR>potential: <?php if ($edit && $ok_market > 0): ?><INPUT TYPE="text" CLASS="text" NAME="cust_potential" VALUE="<?= $cust_potential ?>"><?php else: ?><?= $cust_potential ?><?php endif; ?></LI>
216     <LI>FC price and trend: <?php if ($edit && $ok_market > 0): ?><INPUT TYPE="text" CLASS="text" NAME="fc_price" VALUE="<?= $fc_price ?>"><?php else: ?><?= $fc_price ?><?php endif; ?></LI>
217     </UL>
218     <P<?php if ($err == 1): ?> CLASS="error" <?php endif; ?>><?php if ($edit && $ok_market > 0): ?>&quot;<B>more data</B>&quot; URL: <INPUT TYPE="text" CLASS="text" NAME="info_market" VALUE="<?= $info_market ?>"><?php elseif ($info_market): ?><B><A HREF="<?= $info_market ?>">more data</A></B><?php else: ?>&nbsp;<?php endif; ?></P>
219     </TD><?php else: ?><TD CLASS="cell1" ALIGN="center" VALIGN="middle"><?= $msg_no_data ?></TD><?php endif; ?></TR>
220     </TABLE>
221     </TD>
222    
223     <TD WIDTH="33%" ALIGN="center" VALIGN="top">
224     <TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%">
225     <TR><TD CLASS="cell3" ALIGN="center" VALIGN="middle" HEIGHT="1%"><B>Competition</B></TD></TR>
226     <TR><?php if ($ok_competition >= 0): ?><TD CLASS="cell1" ALIGN="left" VALIGN="top">
227     <UL>
228     <LI>relevant competitors: <?php if ($edit && $ok_competition > 0): ?><INPUT TYPE="text" CLASS="text" NAME="competitors" VALUE="<?= $competitors ?>"><?php else: ?><?= $competitors ?><?php endif; ?></LI>
229     <LI>holders of the US DMF: <?php if ($edit && $ok_competition > 0): ?><INPUT TYPE="text" CLASS="text" NAME="holders" VALUE="<?= $holders ?>"><?php else: ?><?= $holders ?><?php endif; ?></LI>
230 ravilov 1.8 <LI>API market size 1999: <?php if ($edit && $ok_competition > 0): ?><INPUT TYPE="text" CLASS="text" NAME="market_size" VALUE="<?= $market_size ?>"><?php else: ?><?= $market_size ?><?php endif; ?></LI>
231 ravilov 1.1 </UL>
232     <P<?php if ($err == 2): ?> CLASS="error" <?php endif; ?>><?php if ($edit && $ok_competition > 0): ?>&quot;<B>more data</B>&quot; URL: <INPUT TYPE="text" CLASS="text" NAME="info_competition" VALUE="<?= $info_competition ?>"><?php elseif ($info_competition): ?><B><A HREF="<?= $info_competition ?>">more data</A></B><?php else: ?>&nbsp;<?php endif; ?></P>
233     </TD><?php else: ?><TD CLASS="cell1" ALIGN="center" VALIGN="middle"><?= $msg_no_data ?></TD><?php endif; ?></TR>
234     </TABLE>
235     </TD>
236    
237 ravilov 1.4 <TD WIDTH="33%" ALIGN="center" VALIGN="top" COLSPAN="2">
238 ravilov 1.1 <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>
240     <TR><?php if ($ok_quality >= 0): ?><TD CLASS="cell1" ALIGN="left" VALIGN="top">
241     <UL>
242     <LI>product quality: <?php if ($edit && $ok_quality > 0): ?><INPUT TYPE="text" CLASS="text" NAME="quality" VALUE="<?= $quality ?>"><?php else: ?><?= $quality ?><?php endif; ?></LI>
243     <LI>registration submissions: <?php if ($edit && $ok_quality > 0): ?><INPUT TYPE="text" CLASS="text" NAME="registrations" VALUE="<?= $registrations ?>"><?php else: ?><?= $registrations ?><?php endif; ?></LI>
244     <LI>date of last FDA inspection: <?php if ($edit && $ok_quality > 0): ?><INPUT TYPE="text" CLASS="text" NAME="last_fda" VALUE="<?= $last_fda ?>"><?php else: ?><?= $last_fda ?><?php endif; ?></LI>
245     </UL>
246     <P<?php if ($err == 3): ?> CLASS="error" <?php endif; ?>><?php if ($edit && $ok_quality > 0): ?>&quot;<B>more data</B>&quot; URL: <INPUT TYPE="text" CLASS="text" NAME="info_quality" VALUE="<?= $info_quality ?>"><?php elseif ($info_quality): ?><B><A HREF="<?= $info_quality ?>">more data</A></B><?php else: ?>&nbsp;<?php endif; ?></P>
247     </TD><?php else: ?><TD CLASS="cell1" ALIGN="center" VALIGN="middle"><?= $msg_no_data ?></TD><?php endif; ?></TR>
248     </TABLE>
249     </TD>
250    
251     </TR>
252     <TR>
253    
254     <TD WIDTH="33%" ALIGN="center" VALIGN="top">
255     <TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%">
256     <TR><TD CLASS="cell3" ALIGN="center" VALIGN="middle" HEIGHT="1%"><B>Production</B></TD></TR>
257     <TR><?php if ($ok_production >= 0): ?><TD CLASS="cell1" ALIGN="left" VALIGN="top">
258     <UL>
259     <LI>nominal capacity: <?php if ($edit && $ok_production > 0): ?><INPUT TYPE="text" CLASS="text" NAME="cap_nominal" VALUE="<?= $cap_nominal ?>"><?php else: ?><?= $cap_nominal ?><?php endif; ?></LI>
260     <LI>capacity utilisation: <?php if ($edit && $ok_production > 0): ?><INPUT TYPE="text" CLASS="text" NAME="cap_util" VALUE="<?= $cap_util ?>"><?php else: ?><?= $cap_util ?><?php endif; ?></LI>
261     </UL>
262     <P<?php if ($err == 4): ?> CLASS="error" <?php endif; ?>><?php if ($edit && $ok_production > 0): ?>&quot;<B>more data</B>&quot; URL: <INPUT TYPE="text" CLASS="text" NAME="info_production" VALUE="<?= $info_production ?>"></SPAN><?php elseif ($info_production): ?><B><A HREF="<?= $info_production ?>">more data</A></B><?php else: ?>&nbsp;<?php endif; ?></P>
263     </TD><?php else: ?><TD CLASS="cell1" ALIGN="center" VALIGN="middle"><?= $msg_no_data ?></TD><?php endif; ?></TR>
264     </TABLE>
265     </TD>
266    
267     <TD WIDTH="33%" ALIGN="center" VALIGN="top">
268     <TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%">
269     <TR><TD CLASS="cell3" ALIGN="center" VALIGN="middle" HEIGHT="1%"><B>Therapeutic Potential</B></TD></TR>
270     <TR><?php if ($ok_potential >= 0): ?><TD CLASS="cell1" ALIGN="left" VALIGN="top">
271     <UL>
272     <LI>therapeutic class: <?php if ($edit && $ok_potential > 0): ?><INPUT TYPE="text" CLASS="text" NAME="ther_class" VALUE="<?= $ther_class ?>"><?php else: ?><?= $ther_class ?><?php endif; ?></LI>
273     <LI>main indication: <?php if ($edit && $ok_potential > 0): ?><INPUT TYPE="text" CLASS="text" NAME="indication" VALUE="<?= $indication ?>"><?php else: ?><?= $indication ?><?php endif; ?></LI>
274     </UL>
275     <P<?php if ($err == 5): ?> CLASS="error" <?php endif; ?>><?php if ($edit && $ok_potential > 0): ?>&quot;<B>more data</B>&quot; URL: <INPUT TYPE="text" CLASS="text" NAME="info_potential" VALUE="<?= $info_potential ?>"></SPAN><?php elseif ($info_potential): ?><B><A HREF="<?= $info_potential ?>">more data</A></B><?php else: ?>&nbsp;<?php endif; ?></P>
276     </TD><?php else: ?><TD CLASS="cell1" ALIGN="center" VALIGN="middle"><?= $msg_no_data ?></TD><?php endif; ?></TR>
277     </TABLE>
278     </TD>
279    
280 ravilov 1.4 <TD WIDTH="33%" ALIGN="center" VALIGN="top" COLSPAN="2">
281 ravilov 1.1 <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>
283     <TR><?php if ($ok_dosage >= 0): ?><TD CLASS="cell1" ALIGN="left" VALIGN="top">
284     <UL>
285     <LI>sales 1999 and 5-year trend: <?php if ($edit && $ok_dosage > 0): ?><INPUT TYPE="text" CLASS="text" NAME="sales_1999" VALUE="<?= $sales_1999 ?>"><?php else: ?><?= $sales_1999 ?><?php endif; ?></LI>
286     <LI>originator &amp; year of launch: <?php if ($edit && $ok_dosage > 0): ?><INPUT TYPE="text" CLASS="text" NAME="launch_year" VALUE="<?= $launch_year ?>"><?php else: ?><?= $launch_year ?><?php endif; ?></LI>
287     </UL>
288     <P<?php if ($err == 6): ?> CLASS="error" <?php endif; ?>><?php if ($edit && $ok_dosage > 0): ?>&quot;<B>more data</B>&quot; URL: <INPUT TYPE="text" CLASS="text" NAME="info_dosage" VALUE="<?= $info_dosage ?>"></SPAN><?php elseif ($info_dosage): ?><B><A HREF="<?= $info_dosage ?>">more data</A></B><?php else: ?>&nbsp;<?php endif; ?></P>
289     </TD><?php else: ?><TD CLASS="cell1" ALIGN="center" VALIGN="middle"><?= $msg_no_data ?></TD><?php endif; ?></TR>
290     </TABLE>
291     </TD>
292    
293     </TR>
294     <TR>
295    
296     <TD WIDTH="33%" ROWSPAN="2" ALIGN="center" VALIGN="top">
297     <TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%">
298     <TR><TD CLASS="cell3" ALIGN="center" VALIGN="middle" HEIGHT="1%"><B>Purchasing</B></TD></TR>
299     <TR><?php if ($ok_purchasing >= 0): ?><TD CLASS="cell1" ALIGN="left" VALIGN="top">
300     <UL>
301     <LI>key intermediates/raw materials: <?php if ($edit && $ok_purchasing > 0): ?><INPUT TYPE="text" CLASS="text" NAME="mat_raw" VALUE="<?= $mat_raw ?>"><?php else: ?><?= $mat_raw ?><?php endif; ?></LI>
302     <LI>approved suppliers: <?php if ($edit && $ok_purchasing > 0): ?><INPUT TYPE="text" CLASS="text" NAME="suppliers" VALUE="<?= $suppliers ?>"><?php else: ?><?= $suppliers ?><?php endif; ?></LI>
303     <LI>material cost trend (standards): <?php if ($edit && $ok_purchasing > 0): ?><INPUT TYPE="text" CLASS="text" NAME="mat_cost" VALUE="<?= $mat_cost ?>"><?php else: ?><?= $mat_cost ?><?php endif; ?></LI>
304     </UL>
305     <P<?php if ($err == 7): ?> CLASS="error" <?php endif; ?>><?php if ($edit && $ok_purchasing > 0): ?>&quot;<B>more data</B>&quot; URL: <INPUT TYPE="text" CLASS="text" NAME="info_purchasing" VALUE="<?= $info_purchasing ?>"><?php elseif ($info_purchasing): ?><B><A HREF="<?= $info_purchasing ?>">more data</A></B><?php else: ?>&nbsp;<?php endif; ?></P>
306     </TD><?php else: ?><TD CLASS="cell1" ALIGN="center" VALIGN="middle"><?= $msg_no_data ?></TD><?php endif; ?></TR>
307     </TABLE>
308     </TD>
309    
310     <TD WIDTH="33%" ALIGN="center" VALIGN="top">
311     <TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%">
312     <TR><TD CLASS="cell2" ALIGN="center" VALIGN="middle"><?php if ($ok_portfolio >= 0): ?><B>Rank in FC portfolio: <?php if ($edit && $ok_portfolio > 0): ?><INPUT TYPE="text" CLASS="text2" NAME="fc_rank" VALUE="<?= $fc_rank ?>"><?php else: ?><?= $fc_rank ?><?php endif; ?><BR>Share in FC portfolio: <?php if ($edit && $ok_portfolio > 0): ?><INPUT TYPE="text" CLASS="text2" NAME="fc_share" VALUE="<?= $fc_share ?>"><?php else: ?><?= $fc_share ?><?php endif; ?></B><?php else: ?><?= $msg_no_data ?><?php endif; ?></TD></TR>
313     </TABLE>
314     </TD>
315    
316 ravilov 1.4 <TD WIDTH="33%" ROWSPAN="2" ALIGN="center" VALIGN="top" COLSPAN="2">
317 ravilov 1.1 <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>
319     <TR><?php if ($ok_evaluation >= 0): ?><TD CLASS="cell2" ALIGN="left" VALIGN="top">
320     <UL>
321     <LI><B>Maturity: <?php if ($edit && $ok_evaluation > 0): ?><INPUT TYPE="text" CLASS="text2" NAME="maturity" VALUE="<?= $maturity ?>"><?php else: ?><?= $maturity ?><?php endif; ?></B></LI>
322     <LI><B>Competitive intensity: <?php if ($edit && $ok_evaluation > 0): ?><INPUT TYPE="text" CLASS="text2" NAME="comp_intensity" VALUE="<?= $comp_intensity ?>"><?php else: ?><?= $comp_intensity ?><?php endif; ?></B></LI>
323     <LI CLASS="red"><B>Competitive position: <?php if ($edit && $ok_evaluation > 0): ?><INPUT TYPE="text" CLASS="text2" NAME="comp_position" VALUE="<?= $comp_position ?>"><?php else: ?><?= $comp_position ?><?php endif; ?></B></LI>
324     </UL>
325     </TD><?php else: ?><TD CLASS="cell2" ALIGN="center" VALIGN="middle"><?= $msg_no_data ?></TD><?php endif; ?></TR>
326     </TABLE>
327     </TD>
328    
329     </TR>
330     <TR>
331    
332     <TD WIDTH="33%" ROWSPAN="3" ALIGN="center" VALIGN="top">
333     <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&amp;plan / Price trend</B></SPAN></TD></TR>
335 ravilov 1.6 <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: ?>&nbsp;<?php endif; ?><?php else: ?><?= $msg_no_data ?><?php endif; ?></TD></TR>
336 ravilov 1.1 </TABLE>
337     </TD>
338    
339     </TR>
340     <TR>
341    
342     <TD WIDTH="33%" ALIGN="center" VALIGN="top">
343     <TABLE CLASS="table" CELLSPACING="0" CELLPADDING="1" WIDTH="100%" HEIGHT="100%">
344     <TR><TD CLASS="cell3" ALIGN="center" VALIGN="middle" HEIGHT="1%"><B>Product Economics</B></TD></TR>
345     <TR><?php if ($ok_economics >= 0): ?><TD CLASS="cell1" ALIGN="left" VALIGN="middle">
346     <UL>
347     <LI>% COGS: <?php if ($edit && $ok_economics > 0): ?><INPUT TYPE="text" CLASS="text" NAME="cogs" VALUE="<?= $cogs ?>"><?php else: ?><?= $cogs ?><?php endif; ?></LI>
348     <LI>% operating income: <?php if ($edit && $ok_economics > 0): ?><INPUT TYPE="text" CLASS="text" NAME="op_income" VALUE="<?= $op_income ?>"><?php else: ?><?= $op_income ?><?php endif; ?></LI>
349     <LI>break even point: <?php if ($edit && $ok_economics > 0): ?><INPUT TYPE="text" CLASS="text" NAME="break_even" VALUE="<?= $break_even ?>"><?php else: ?><?= $break_even ?><?php endif; ?></LI>
350     <LI>US$ /m<SUP>3</SUP>/ day: <?php if ($edit && $ok_economics > 0): ?><INPUT TYPE="text" CLASS="text" NAME="m3" VALUE="<?= $m3 ?>"><?php else: ?><?= $m3 ?><?php endif; ?></LI>
351     </UL>
352     <P<?php if ($err == 8): ?> CLASS="error" <?php endif; ?>><?php if ($edit && $ok_economics > 0): ?>&quot;<B>more data</B>&quot; URL: <INPUT TYPE="text" CLASS="text" NAME="info_economics" VALUE="<?= $info_economics ?>"><?php elseif ($info_economics): ?><B><A HREF="<?= $info_economics ?>">more data</A></B><?php else: ?>&nbsp;<?php endif; ?></P>
353     </TD><?php else: ?><TD CLASS="cell2" ALIGN="center" VALIGN="middle"><?= $msg_no_data ?></TD><?php endif; ?></TR>
354     </TABLE>
355     </TD>
356    
357 ravilov 1.4 <TD WIDTH="33%" ROWSPAN="2" ALIGN="center" VALIGN="top" COLSPAN="2">
358 ravilov 1.1 <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
360     $out = str_replace("&", "&amp;", $comment);
361     $out = str_replace(" ", "&nbsp;", $out);
362     $out = str_replace("<", "&lt;", $out);
363     $out = str_replace(">", "&gt;", $out);
364     $out = ereg_replace("\r?\n", "<BR>", $out);
365     echo $out;
366 ravilov 1.4 ?></BLOCKQUOTE><?php endif; ?><?php else: ?><BR><BR><BR><P CLASS="center"><?= $msg_no_data ?></P><?php endif; ?></TD></TR>
367 ravilov 1.1 </TABLE>
368     </TD>
369    
370     </TR>
371     <TR>
372    
373 ravilov 1.4 <TD WIDTH="33%" HEIGHT="1%">
374 ravilov 1.1 <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>
376     <TR><?php if ($ok_risks >= 0): ?><TD CLASS="cell1" ALIGN="left" VALIGN="middle">
377     <UL>
378     <LI>key risks: <?php if ($edit && $ok_risks > 0): ?><INPUT TYPE="text" CLASS="text" NAME="risks" VALUE="<?= $risks ?>"><?php else: ?><?= $risks ?><?php endif; ?></LI>
379     </UL>
380     <P<?php if ($err == 9): ?> CLASS="error" <?php endif; ?>><?php if ($edit && $ok_risks > 0): ?>&quot;<B>more data</B>&quot; URL: <INPUT TYPE="text" CLASS="text" NAME="info_risks" VALUE="<?= $info_risks ?>"><?php elseif ($info_risks): ?><B><A HREF="<?= $info_risks ?>">more data</A></B><?php else: ?>&nbsp;<?php endif; ?></P>
381     </TD><?php else: ?><TD CLASS="cell1" ALIGN="center" VALIGN="middle"><?= $msg_no_data ?></TD><?php endif; ?></TR>
382     </TABLE>
383     </TD>
384    
385     </TR>
386     <TR>
387 ravilov 1.4 <TD ALIGN="left" VALIGN="top" COLSPAN="2"><?php if ($error): ?><FONT COLOR="#FF0000" SIZE="2"><B><?= $error ?></B><?php else: ?>&nbsp;<?php endif; ?></TD>
388 ravilov 1.9 <TD ALIGN="left" VALIGN="middle"><?php if ($edit): ?>&nbsp;<?php else: ?><SMALL CLASS="info">&nbsp;&nbsp;Logged in as <B><?= $PHP_AUTH_USER ?></B>.&nbsp;&nbsp;[<A HREF="?relogin=<?= $PHP_AUTH_USER ?>" CLASS="logout">Logout</A>]</SMALL><?php endif; ?></TD>
389 ravilov 1.4 <TD ALIGN="right"><?php if ($edit): ?><INPUT TYPE="submit" CLASS="button" VALUE="Cancel">&nbsp;<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 ravilov 1.1 </TR>
391     </TABLE>
392     </TD></TR>
393 ravilov 1.9 <INPUT TYPE="hidden" NAME="id" VALUE="<?= $id ?>">
394 ravilov 1.1 </TABLE>
395 ravilov 1.9 </FORM>
396 ravilov 1.1 <?php endif; ?>
397     </BODY>
398 ravilov 1.4 <?php DBClose(); ?>
399 ravilov 1.1 </HTML>

  ViewVC Help
Powered by ViewVC 1.1.26