Jump to content

Tmod

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Tmod

  1. Psycho & cyberRobot, Thanks for the code and recommendations, I tend to overthink things and am my own worst enemy, You simplified it and it works like a champ. I ended up changing the vs_yrmodsize code to the following and it changed the background on it as well to properly display depending on vs_brand. <div class="lvl1-4-6 brand<?php echo $row_rsStockDynoSh['vs_brand']?>"><?php echo $row_rsStockDynoSh['vs_yrmodsize']; ?> Once again thanks!! Tmod
  2. Hi, I am stuck here and would appreciate another set of eyes to look at this code and tell me why it isn't working. Basically what I am trying to do is change the background color based off the value returned, For example let's say Honda was returned I would want the background to be red, whereas with Kawasaki I would want a green background. I have tried various codes from the web and couldn't get them to accomplish what I was looking for. Anyway here is the code. <?php include('openL5_list_df_colors_include.php'); ?> <div class="lvl1-4-5"><?php echo $row_rsStockDynoFk['vs_brand']; ?></div> <div class="lvl1-4-6"><?php echo $row_rsStockDynoFk['vs_yrmodsize']; ?> Code from 'openL5_list_df_colors_include.php' <?php $color_hon = '#FFD9D5'; // red 210 = #FFC6BF . . . 220 = #FFD9D5 $color_husky = '#FED6F5'; // purple 210 = #FEC0F1 . . . 220 = #FED6F5 $color_kaw = '#D6F5D3'; // green 200 = #BCF0B9 . . . 215 = #D6F5D3 $color_ktm = '#FFE4CA'; // gold 200 = #FFD5AA . . . 215 = #FFE4CA $color_suz = '#FFFFD5'; // yellow 200 = #FFFFAA . . . 220 = #FFFFD5 $color_tm = '#D5FFFF'; // turq 200 = #AAFFFF . . . 220 = #D5FFFF $color_yam = '#DFDFFF'; // blue 215 = #CACAFF . . . 225 = #DFDFFF if ( $row_rsStockDynoSh['vs_brand'] == 'Honda' ) { $rowColor = $color_hon; }elseif ( $row_rsStockDynoSh['vs_brand'] == 'Husky' ) { $rowColor = $color_husky; }elseif ( $row_rsStockDynoSh['vs_brand'] == 'Kawasaki' ) { $rowColor = $color_kaw; }elseif ( $row_rsStockDynoSh['vs_brand'] == 'KTM' ) { $rowColor = $color_ktm; }elseif ( $row_rsStockDynoSh['vs_brand'] == 'Suzuki' ) { $rowColor = $color_suz; }elseif ( $row_rsStockDynoSh['vs_brand'] == 'TM' ) { $rowColor = $color_tm; }elseif ( $row_rsStockDynoSh['vs_brand'] == 'Yamaha' ) { $rowColor = $color_yam; }else{ $rowColor = '#FF95FF'; } ?> I am a newbie so take it easy on me. Thanks!!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.