--- index.php 2001/06/06 03:18:29 1.1.1.1 +++ index.php 2001/06/21 10:07:13 1.11 @@ -3,6 +3,7 @@ $auth = true; if ($auth && (!isset($PHP_AUTH_USER) || !isset($PHP_AUTH_PW))) $auth = false; + if ($change) { $id = $new_id; $edit = false; } if ($auth) { include("conn.php"); DBOpen(); @@ -11,29 +12,57 @@ if (count($row) <= 0) $auth = false; if ($auth) { $row = $row[0]; - if ($PHP_AUTH_PW != $row[0]) $auth = false; + if (substr($row[0], 0, 5) == "auth_") { + switch (strtoupper(substr($row[0], 5))) { + case "POP3": + include("auth_POP3.php"); + $pop = new POP3(); + $pop->connect("intranet.pliva.hr"); + $ret = $pop->checklogin($PHP_AUTH_USER, $PHP_AUTH_PW); + $pop->quit(); + if (!$ret) $auth = false; + break; + default: $auth = false; break; + } + } else { + $pw = md5($PHP_AUTH_USER.$PHP_AUTH_PW); + if ($pw != $row[0]) $auth = false; + } + # if ($PHP_AUTH_PW != $row[0]) $auth = false; } } - if (!$auth) { + if (!$auth || $relogin == $PHP_AUTH_USER) { Header("WWW-Authenticate: Basic realm=\"fcproducts\""); Header("HTTP/1.0 401 Unauthorized"); echo "No access.\n"; exit; } - if (!$id) { echo "No product ID!\n"; exit; } + # if (!$id) { echo "No product ID!\n"; exit; } + DBOpen(); + if (!$id) { + $id = 1; + $row = DBQuery("SELECT MIN(product_id) FROM products"); + if ($row[0]) $id = $row[0][0]; + } $error = ""; $msg = false; $err = 0; - DBOpen(); $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]); list($ok_market, $ok_production, $ok_purchasing, $ok_economics, $ok_risks, $ok_competition, $ok_potential, $ok_portfolio, $ok_sales, $ok_quality, $ok_dosage, $ok_evaluation, - $ok_comment) = $row[0]; + $ok_comment) = array(-1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1); + if (is_array($row[0])) { + bool_fix($row[0]); + list($ok_market, $ok_production, $ok_purchasing, + $ok_economics, $ok_risks, $ok_competition, + $ok_potential, $ok_portfolio, $ok_sales, $ok_quality, + $ok_dosage, $ok_evaluation, $ok_comment) = $row[0]; + } if ($save) { $error = ""; - $q = array(); + $q = array("cas_no='$cas_no'"); if ($error == "" && $ok_market > 0) { if (!CheckURL($info_market)) { $error = "Invalid URL."; $err = 1; } if ($error == "") array_push($q, "link_market='$info_market',cust_existing='$cust_existing',cust_potential='$cust_potential',fc_price='$fc_price'"); @@ -111,7 +140,7 @@ } if ($error == "") $msg = true; else $edit = 1; } else { - $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 FROM products WHERE (product_id=$id)"); + $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)"); if (count($row) <= 0) { echo "No such product ID."; exit; } list($info_market, $info_production, $info_purchasing, $info_economics, $info_risks, $info_competition, @@ -123,18 +152,24 @@ $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) = $row[0]; + $m3, $sales_img, $risks, $cas_no) = $row[0]; } $row = DBQuery("SELECT naziv FROM products WHERE (product_id=$id)"); list($product_name) = $row[0]; - DBClose(); ?> - -<?= $product_name ?> +\n"; + else echo "\n"; +?> +<?= $product_name ?><?php if ($cas_no): ?> (CAS No: <?= $cas_no ?>)<?php endif; ?> @@ -156,16 +191,22 @@
- - - + + + - - + + -
FINE CHEMICALS
PRODUCT MATRIX
FINE CHEMICALS

CAS No:
CAS No:
PRODUCT MATRIX
Date of last change:

 
product to
Date of last change:

- +
BORDER="1"> = 0): ?> -
Market Position of Fine Chemicals
    @@ -178,21 +219,21 @@
- +
BORDER="1"> = 0): ?>
Competition
  • relevant competitors: 0): ?>
  • holders of the US DMF: 0): ?>
  • -
  • API market size 1999: 0): ?> t/US$
  • +
  • API market size 1999: 0): ?>
CLASS="error" > 0): ?>"more data" URL: more data 

- +
+BORDER="1"> = 0): ?>
Quality and Regulations
    @@ -209,7 +250,7 @@
- +
BORDER="1"> = 0): ?> -
Production
    @@ -222,7 +263,7 @@
- +
BORDER="1"> = 0): ?>
Therapeutic Potential
    @@ -234,8 +275,8 @@
- +
+BORDER="1"> = 0): ?>
Dosage Form Market
    @@ -251,7 +292,7 @@
- +
BORDER="1"> = 0): ?> -
Purchasing
    @@ -265,13 +306,13 @@
- +
BORDER="1">
= 0): ?>Rank in FC portfolio: 0): ?>
Share in FC portfolio: 0): ?>
- +
+BORDER="1"> = 0): ?> @@ -297,7 +338,7 @@ -
Product Evaluation
    @@ -287,9 +328,9 @@
- +
BORDER="1"> - +
Sales: realisation&plan / Price trend
= 0): ?> 0): ?>Please choose an image to display here.


NOTE: The previously specified image will be used if no image is specified. 
= 0): ?> 0): ?>Please choose an image to display here.


NOTE: The previously specified image will be used if no image is specified. 
- +
BORDER="1"> = 0): ?>
Product Economics
    @@ -311,8 +352,8 @@
- + -
+BORDER="1"> +?>


Comments
= 0): ?> 0): ?>
", ">", $out); $out = ereg_replace("\r?\n", "
", $out); echo $out; -?>




- + +
+BORDER="1"> = 0): ?> - - + + +
Risks
    @@ -341,13 +382,16 @@
      Logged in as .  [Logout] 
- + +