/[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

Diff of /index.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by ravilov, Thu Jun 7 06:06:05 2001 UTC revision 1.9 by ravilov, Thu Jun 21 09:59:50 2001 UTC
# Line 3  Line 3 
3          $auth = true;          $auth = true;
4          if ($auth && (!isset($PHP_AUTH_USER) || !isset($PHP_AUTH_PW)))          if ($auth && (!isset($PHP_AUTH_USER) || !isset($PHP_AUTH_PW)))
5                  $auth = false;                  $auth = false;
6            if ($change) { $id = $new_id; $edit = false; }
7          if ($auth) {          if ($auth) {
8                  include("conn.php");                  include("conn.php");
9                  DBOpen();                  DBOpen();
# Line 61  Line 62 
62          }          }
63          if ($save) {          if ($save) {
64                  $error = "";                  $error = "";
65                  $q = array();                  $q = array("cas_no='$cas_no'");
66                  if ($error == "" && $ok_market > 0) {                  if ($error == "" && $ok_market > 0) {
67                          if (!CheckURL($info_market)) { $error = "Invalid URL."; $err = 1; }                          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'");                          if ($error == "") array_push($q, "link_market='$info_market',cust_existing='$cust_existing',cust_potential='$cust_potential',fc_price='$fc_price'");
# Line 139  Line 140 
140                  }                  }
141                  if ($error == "") $msg = true; else $edit = 1;                  if ($error == "") $msg = true; else $edit = 1;
142          } else {          } else {
143                  $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)");
144                  if (count($row) <= 0) { echo "<HTML><B>No such product ID.</B></HTML>"; exit; }                  if (count($row) <= 0) { echo "<HTML><B>No such product ID.</B></HTML>"; exit; }
145                  list($info_market, $info_production, $info_purchasing,                  list($info_market, $info_production, $info_purchasing,
146                          $info_economics, $info_risks, $info_competition,                          $info_economics, $info_risks, $info_competition,
# Line 151  Line 152 
152                          $launch_year, $mat_raw, $suppliers, $mat_cost,                          $launch_year, $mat_raw, $suppliers, $mat_cost,
153                          $fc_rank, $fc_share, $maturity, $comp_intensity,                          $fc_rank, $fc_share, $maturity, $comp_intensity,
154                          $comp_position, $cogs, $op_income, $break_even,                          $comp_position, $cogs, $op_income, $break_even,
155                          $m3, $sales_img, $risks) = $row[0];                          $m3, $sales_img, $risks, $cas_no) = $row[0];
156          }          }
157          $row = DBQuery("SELECT naziv FROM products WHERE (product_id=$id)");          $row = DBQuery("SELECT naziv FROM products WHERE (product_id=$id)");
158          list($product_name) = $row[0];          list($product_name) = $row[0];
# Line 187  Line 188 
188  </TD></TR></TABLE>  </TD></TR></TABLE>
189  </TD></TR></TABLE>  </TD></TR></TABLE>
190  <?php else: ?>  <?php else: ?>
191    <FORM ENCTYPE="multipart/form-data" METHOD="post" ACTION="<?= $PHP_SELF ?>">
192  <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2" WIDTH="100%" HEIGHT="100%">  <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2" WIDTH="100%" HEIGHT="100%">
193  <TR>  <TR>
194  <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>  <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  <TD ALIGN="center" VALIGN="top" ROWSPAN="2" WIDTH="33%" HEIGHT="1%"><TABLE BORDER="0" CELLSPACING="0"><TR><TD CLASS="title2"><B><?= ereg_replace("\r?\n(.*)$", "<BR><SMALL>\\1</SMALL>", $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 ?><?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  <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>  <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  </TR>  </TR>
198  <FORM ENCTYPE="multipart/form-data" METHOD="post" ACTION="<?= $PHP_SELF ?>">  <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
 <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  
199          $row = DBQuery("SELECT product_id,naziv FROM products ORDER BY naziv");          $row = DBQuery("SELECT product_id,naziv FROM products ORDER BY naziv");
200          while (list($key, $val) = each($row)) {          while (list($key, $val) = each($row)) {
201                  list($_id, $name) = $val;                  list($_id, $name) = $val;
# Line 202  Line 203 
203                  $selected = ($id == $_id) ? " SELECTED" : "";                  $selected = ($id == $_id) ? " SELECTED" : "";
204                  echo "<OPTION VALUE=\"$_id\"$selected>$name</OPTION>\n";                  echo "<OPTION VALUE=\"$_id\"$selected>$name</OPTION>\n";
205          }          }
206  ?></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>  ?></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>
 </FORM>  
207  <TR><TD COLSPAN="4" ALIGN="center" HEIGHT="1%"><HR WIDTH="100%" SIZE="2"></TD></TR>  <TR><TD COLSPAN="4" ALIGN="center" HEIGHT="1%"><HR WIDTH="100%" SIZE="2"></TD></TR>
 <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">
# Line 386  Line 385 
385  </TR>  </TR>
386  <TR>  <TR>
387  <TD ALIGN="left" VALIGN="top" COLSPAN="2"><?php if ($error): ?><FONT COLOR="#FF0000" SIZE="2"><B><?= $error ?></B><?php else: ?>&nbsp;<?php endif; ?></TD>  <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  <TD ALIGN="left" VALIGN="middle"><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></TD>  <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  <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>  <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  </TR>  </TR>
391  </TABLE>  </TABLE>
392  </TD></TR>  </TD></TR>
393  <INPUT TYPE="hidden" NAME="id" VALUE="<?= $id ?>"></FORM>  <INPUT TYPE="hidden" NAME="id" VALUE="<?= $id ?>">
394  </TABLE>  </TABLE>
395    </FORM>
396  <?php endif; ?>  <?php endif; ?>
397  </BODY>  </BODY>
398  <?php DBClose(); ?>  <?php DBClose(); ?>

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.26