Advertisement

01.14.2008 at 06:12AM PST, ID: 23080693
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

php code that is emty if cause

Asked by teera in PHP Scripting Language

Tags:

My code below when type  in Productcode colum it show like it can not go to  
elseif (isset($ProCode[$i]))  wheter you type or not type in        SerialNO colum it go to
 if (isset($serialno[$i]))  How can I increse condition if No type in SerialNO colum then go to elseif (isset($ProCode[$i]))Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
----------------------------------------------------------------
computerset.php
------------------------------------------------------------
 
<?php require_once('../Connections/host88.php'); 
 
mysql_select_db($database_host88, $host88);
$query_compart = "SELECT CompPartName FROM ComPart WHERE indicateCode < 3 ORDER BY indicateCode ASC, ComPart.CompPartName";
$compart = mysql_query($query_compart, $host88) or die(mysql_error());
$row_compart = mysql_fetch_assoc($compart);
$totalRows_compart = mysql_num_rows($compart);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style4 {color: #3333CC}
.style9 {color: #D4D0C8; font-size: 9px; }
-->
</style>
</head>
 
<body>
 
<form action="computerprice.php" method="post" class="style4" spry:content="<?php echo $row_compart['CompPartName']; ?>">
  <table width="200" border="1">
    <tr bgcolor="#FFFFCC">
      <td bordercolor="#CC0000"><span class="style9">Part</span></td>
      <td>Productcode</td>
      <td>SerialNO</td>
      <td>Description</td>
      <td>Price</td>
    </tr>
    <?php do { ?>
      <tr>
        <td height="26" bordercolor="#CC0000" bgcolor="#33CC33">          <span class="style9">
          <label>
          <input name="ProType[]" type="text" id="textfield2" value="<?php echo $row_compart['CompPartName']; ?>" readonly="readonly" />
          </label>
        </span> </td>
        <td><label>
          <input name="ProCode[]" type="text" id="textfield" size="12" maxlength="12" />
        </label></td>
        <td><label>
          <input name="serialno[]" type="text" id="textfield6" size="15" maxlength="15" />
        </label></td>
        <td><label>
          <input name="descrip[]" type="text" id="textfield7" size="50" maxlength="50" />
        </label></td>
        <td><input name="Price[]" type="text" id="textfield8" size="8" maxlength="8" /></td>
      </tr>
      <?php } while ($row_compart = mysql_fetch_assoc($compart)); ?>
    <tr align="right">
      <td bordercolor="#CC0000" bgcolor="#33CC33"><input name="ProType[]" type="text" id="textfield3" value="Remark1" readonly="readonly" /></td>
      <td align="left"><input name="ProCode[]" type="text" id="textfield9" size="12" maxlength="12" /></td>
      <td><input name="serialno[]" type="text" id="textfield12" size="15" maxlength="15" /></td>
      <td><input name="descrip[]" type="text" id="textfield15" size="50" maxlength="50" /></td>
      <td align="left"><input name="Price[]" type="text" id="textfield18" size="8" maxlength="8" /></td>
    </tr>
    <tr>
      <td bordercolor="#CC0000" bgcolor="#33CC33"><label>
        <input name="ProType[]" type="text" id="textfield4" value="Remark2" readonly="readonly" />
      </label></td>
      <td><input name="ProCode[]" type="text" id="textfield10" size="12" maxlength="12" /></td>
      <td><input name="serialno[]" type="text" id="textfield13" size="15" maxlength="15" /></td>
      <td><input name="descrip[]" type="text" id="textfield16" size="50" maxlength="50" /></td>
      <td><input name="Price[]" type="text" id="textfield19" size="8" maxlength="8" /></td>
    </tr>
    <tr>
      <td bordercolor="#CC0000" bgcolor="#33CC33"><input name="ProType[]" type="text" id="textfield5" value="Remark3" readonly="readonly" /></td>
      <td><input name="ProCode[]" type="text" id="textfield11" size="12" maxlength="12" /></td>
      <td><input name="serialno[]" type="text" id="textfield14" size="15" maxlength="15" /></td>
      <td><input name="descrip[]" type="text" id="textfield17" size="50" maxlength="50" /></td>
      <td><input name="Price[]" type="text" id="textfield20" size="8" maxlength="8" /></td>
    </tr>
    <tr>
      <td bordercolor="#CC0000" bgcolor="#33CC33">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td bordercolor="#CC0000" bgcolor="#33CC33">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><input type="submit" name="submit" id="button" value="Submit" /></td>
    </tr>
  </table>
  <p>
    <label></label>
  </p>
</form>
</body>
</html>
<?php
mysql_free_result($compart);
?>
 
----------------------------------------------------------------------------
computerprice.php
-----------------------------------------------------------------------------
 
<?php require_once('../Connections/host88.php'); 
  
$ProType = $_POST['ProType'];
$ProCode = $_POST['ProCode']; 
$serialno = $_POST['serialno'];
$descrip = $_POST['descrip'];
$Price = $_POST['Price'];  
?>
 
<form action="comsetprice.php" method="post" class="style4" >
  <table width="200" border="1">
    <tr bgcolor="#FFFFCC">
      <td bordercolor="#CC0000"><span class="style9">Part</span></td>
      <td>Productcode</td>
      <td>SerialNO</td>
      <td>Description</td>
      <td>Price</td>
    </tr>
  <?php for($i=0;$i<count($ProType);$i++) { 
 
 
	
if (isset($serialno[$i]))
 { 
 
mysql_select_db($database_host88, $host88);
$query_costunit = "SELECT `prddtl`.PCode, `prddtl`.SerialNo1, `prdmas`.Code, `prdmas`.Name,        `ivsdtl`.IsVat, `ivsdtl`.VatType, `ivsdtl`.UPrice, `ivsdtl`.TType   FROM    (AOL.prdmas `prdmas` INNER JOIN AOL.ivsdtl `ivsdtl`               ON (`prdmas`.Code = `ivsdtl`.PCode))        INNER JOIN           AOL.prddtl `prddtl`        ON (`prddtl`.PCode = `prdmas`.Code)  WHERE (`ivsdtl`.TType = 'P') AND prddtl.SerialNo1 = '$serialno[$i]' ORDER BY `ivsdtl`.TimeRec DESC LIMIT 0 , 2";
 
 
$costunit = mysql_query($query_costunit, $host88) or die(mysql_error());
$row_costunit = mysql_fetch_assoc($costunit);
$totalRows_costunit = mysql_num_rows($costunit);
 
 
mysql_free_result($costunit);
$procodema =  $row_costunit['PCode'];
$procodeName =  $row_costunit['Name'];
$procodeUPrice =  $row_costunit['UPrice'];
$IsVat =  $row_costunit['IsVat'];
$VatType =  $row_costunit['TType'];
 
 
 
      if ($IsVat == "Y" & $VatType == "E")
		{ 
			$Tprice =  $procodeUPrice * 1.07 ;
			
		} 
		else 
		{ 
			$Tprice =  $procodeUPrice  ;
		}
 
  } 
  
elseif (isset($ProCode[$i]))
 {
  echo "  somsak <BR> 11 $ProCode[$i] <BR> ";
  mysql_select_db($database_host88, $host88);
$query_costunit01 =  "SELECT `Code`,`PCode`,`UPrice`, `IsVat`, `VatType`  FROM `ivsdtl` 
WHERE (`PCode` = '$ProCode[$i]')  AND ( `TType` = 'P' ) ORDER BY `ivsdtl`.TimeRec DESC LIMIT 0 , 1";
 
$costunit01 = mysql_query($query_costunit01, $host88) or die(mysql_error());
$row_costunit = mysql_fetch_assoc($costunit01);
 
 
mysql_free_result($costunit01); 
$procodema = $row_costunit['PCode'];
$procodeUPrice =  $row_costunit['UPrice'];
$IsVat =  $row_costunit['IsVat'];
$VatType =  $row_costunit['TType'];
 
      if ($IsVat == "Y" & $VatType == "E")
		{ 
			$Tprice =  $procodeUPrice * 1.07 ;
			
		} 
		else 
		{ 
			$Tprice =  $procodeUPrice  ;
		}
 
} 
else
  { echo "c"; } 
	?>
      <tr>
        <td height="26" bordercolor="#CC0000" bgcolor="#33CC33">          <span class="style9">
          <label>
          <input name="ProType" type="text" id="textfield2" value="<?php echo $ProType[$i]; ?>" readonly="readonly" />
          </label>
        </span> </td>
        <td><label>
          <input name="ProCode" type="text" id="textfield" value="<?php echo $procodema; ?>" size="12" maxlength="12" />
        </label></td>
        <td><label>
          <input name="serialno" type="text" id="textfield6" value="<?php echo $serialno[$i]; ?>" size="15" maxlength="15" />
        </label></td>
        <td><label>
          <input name="descrip" type="text" id="textfield7" value="<?php echo $procodeName; ?>" size="50" maxlength="50" />
        </label></td> 
        <td><input name="Price" type="text" id="textfield8"  value="<?php echo $Tprice; ?>" size="8" maxlength="8" /></td>
      </tr>
      <?php    } ?>
    <tr>
      <td bordercolor="#CC0000" bgcolor="#33CC33">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td bordercolor="#CC0000" bgcolor="#33CC33">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><input type="submit" name="submit" id="button" value="Submit" /></td>
    </tr>
  </table>
  <p>
    <label></label>
  </p>
</form>
</body>
</html>
<?php
;
 
 
?>
[+][-]01.14.2008 at 07:20AM PST, ID: 20653495

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Scripting Language
Tags: php
Sign Up Now!
Solution Provided By: us111
Participating Experts: 1
Solution Grade: B
 
 
[+][-]01.14.2008 at 12:10PM PST, ID: 20656226

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.14.2008 at 12:15PM PST, ID: 20656268

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.14.2008 at 01:38PM PST, ID: 20657145

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.15.2008 at 12:47AM PST, ID: 20660979

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628