옵션항목에 0도 표시되도록 수정

This commit is contained in:
chicpro
2014-02-10 11:58:04 +09:00
parent 264d2b26df
commit 9e36a64d33
4 changed files with 13 additions and 11 deletions

View File

@ -75,6 +75,8 @@ if($po_run) {
$opt_1 = $opt_val[0];
$opt_2 = $opt_val[1];
$opt_3 = $opt_val[2];
$opt_2_len = strlen($opt_2);
$opt_3_len = strlen($opt_3);
$opt_price = $row['io_price'];
$opt_stock_qty = $row['io_stock_qty'];
$opt_noti_qty = $row['io_noti_qty'];
@ -86,7 +88,7 @@ if($po_run) {
<label for="opt_chk_<?php echo $i; ?>" class="sound_only"></label>
<input type="checkbox" name="opt_chk[]" id="opt_chk_<?php echo $i; ?>" value="1">
</td>
<td class="opt-cell"><?php echo $opt_1; if ($opt_2) echo ' <small>&gt;</small> '.$opt_2; if ($opt_3) echo ' <small>&gt;</small> '.$opt_3; ?></td>
<td class="opt-cell"><?php echo $opt_1; if ($opt_2_len) echo ' <small>&gt;</small> '.$opt_2; if ($opt_3_len) echo ' <small>&gt;</small> '.$opt_3; ?></td>
<td class="td_numsmall">
<label for="opt_price_<?php echo $i; ?>" class="sound_only"></label>
<input type="text" name="opt_price[]" value="<?php echo $opt_price; ?>" id="opt_price_<?php echo $i; ?>" class="frm_input" size="9">
@ -119,10 +121,13 @@ if($po_run) {
$opt_2 = strip_tags(trim($opt2[$j]));
$opt_3 = strip_tags(trim($opt3[$k]));
$opt_2_len = strlen($opt_2);
$opt_3_len = strlen($opt_3);
$opt_id = $opt_1;
if($opt_2)
if($opt_2_len)
$opt_id .= chr(30).$opt_2;
if($opt_3)
if($opt_3_len)
$opt_id .= chr(30).$opt_3;
$opt_price = 0;
$opt_stock_qty = 0;
@ -150,7 +155,7 @@ if($po_run) {
<label for="opt_chk_<?php echo $i; ?>" class="sound_only"></label>
<input type="checkbox" name="opt_chk[]" id="opt_chk_<?php echo $i; ?>" value="1">
</td>
<td class="opt1-cell"><?php echo $opt_1; if ($opt_2) echo ' <small>&gt;</small> '.$opt_2; if ($opt_3) echo ' <small>&gt;</small> '.$opt_3; ?></td>
<td class="opt1-cell"><?php echo $opt_1; if ($opt_2_len) echo ' <small>&gt;</small> '.$opt_2; if ($opt_3_len) echo ' <small>&gt;</small> '.$opt_3; ?></td>
<td class="td_numsmall">
<label for="opt_price_<?php echo $i; ?>" class="sound_only"></label>
<input type="text" name="opt_price[]" value="<?php echo $opt_price; ?>" id="opt_price_<?php echo $i; ?>" class="frm_input" size="9">

View File

@ -90,7 +90,7 @@ if($ps_run) {
for($j=0; $j<$spl_count; $j++) {
$spl = strip_tags(trim($spl_val[$j]));
if($spl_subject && $spl) {
if($spl_subject && strlen($spl)) {
$spl_id = $spl_subject.chr(30).$spl;
$spl_price = 0;
$spl_stock_qty = 0;

View File

@ -971,7 +971,7 @@ function get_item_options($it_id, $subject)
$select .= '<option value="">선택</option>'.PHP_EOL;
for($k=0; $k<$opt_count; $k++) {
$opt_val = $opt[$k];
if($opt_val) {
if(strlen($opt_val)) {
$select .= '<option value="'.$opt_val.'">'.$opt_val.'</option>'.PHP_EOL;
}
}
@ -1036,7 +1036,7 @@ function get_item_supply($it_id, $subject)
if($opt_id[0] && !array_key_exists($opt_id[0], $options))
$options[$opt_id[0]] = array();
if($opt_id[1]) {
if(strlen($opt_id[1])) {
if($row['io_price'] >= 0)
$price = '&nbsp;&nbsp;+ '.number_format($row['io_price']).'원';
else

View File

@ -21,10 +21,7 @@ for($i=0; $row=sql_fetch_array($result); $i++) {
$val = explode(chr(30), $row['io_id']);
$key = $idx + 1;
if(!$val[$key])
continue;
if(in_array($val[$key], $opt))
if(!strlen($val[$key]))
continue;
$opt[] = $val[$key];