Image placement with echo '<img src="https:/.....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • grodiz
    New Member
    • May 2010
    • 1

    Image placement with echo '<img src="https:/.....

    Hi, I'm new to this forum and quite new to php. Im running a webshop based on Joomla and Virtuemart. Im currently working on adding pictures with the payment methods and for that I'm using php.
    I don't know if this place is the best to post this question but I thought I'll try any way.

    My problem is that I want to change the placement of the pictures. Right know there is a radio button where you can choose witch payment method you like and under that there is an picture for the payment. What I like to do is to have the radio button first and to the right Ill have the picture. Does any body know how I should code this?

    This is my code and is is at the bottom I have inserted the images I like to see (I have marked it with bold:

    Code:
    if( $nocc_payments &&  $cc_payments ) {
    	echo '<table><tr valign="top"><td width="50%">';
    }
            
    if ($cc_payments==true) { 
      	?>
    	<fieldset><legend><strong><?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_PAYMENT_CC') ?></strong></legend>
    		<table border="0" cellspacing="0" cellpadding="2" width="100%">
    		    <tr>
    		        <td colspan="2">
    		        	<?php $ps_payment_method->list_cc($payment_method_id, false) ?>
    		        </td>
    		    </tr>
    		    <tr>
    		        <td colspan="2"><strong>&nbsp;</strong></td>
    		    </tr>
    		    <tr>
    		        <td nowrap width="10%" align="right"><?php echo $VM_LANG->_('VM_CREDIT_CARD_TYPE'); ?>:</td>
    		        <td>
    		        <?php echo $ps_creditcard->creditcard_lists( $db_cc ); ?>
    		        <script language="Javascript" type="text/javascript"><!--
    				writeDynaList( 'class="inputbox" name="creditcard_code" size="1"',
    				orders, originalPos, originalPos, originalOrder );
    				//-->
    				</script>
    		<?php 
    		            $db_cc->reset();
    		            $payment_class = $db_cc->f("payment_class");
    		            $require_cvv_code = "YES";
    		            if(file_exists(CLASSPATH."payment/$payment_class.php") && file_exists(CLASSPATH."payment/$payment_class.cfg.php")) {
    		                require_once(CLASSPATH."payment/$payment_class.php");
    		                require_once(CLASSPATH."payment/$payment_class.cfg.php");
    		                $_PAYMENT = new $payment_class();
    		                if( defined( $_PAYMENT->payment_code.'_CHECK_CARD_CODE' ) ) {
    		                	$require_cvv_code = strtoupper( constant($_PAYMENT->payment_code.'_CHECK_CARD_CODE') );
    		                }
    		            }
    		?>      </td>
    		    </tr>
    		    <tr valign="top">
    		        <td nowrap width="10%" align="right">
    		        	<label for="order_payment_name"><?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_CONF_PAYINFO_NAMECARD') ?>:</label>
    		        </td>
    		        <td>
    		        <input type="text" class="inputbox" id="order_payment_name" name="order_payment_name" value="<?php if(!empty($_SESSION['ccdata']['order_payment_name'])) echo $_SESSION['ccdata']['order_payment_name'] ?>" autocomplete="off" />
    		        </td>
    		    </tr>
    		    <tr valign="top">
    		        <td nowrap width="10%" align="right">
    		        	<label for="order_payment_number"><?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_CONF_PAYINFO_CCNUM') ?>:</label>
    		        </td>
    		        <td>
    		        <input type="text" class="inputbox" id="order_payment_number" name="order_payment_number" value="<?php if(!empty($_SESSION['ccdata']['order_payment_number'])) echo $_SESSION['ccdata']['order_payment_number'] ?>" autocomplete="off" />
    		        </td>
    		    </tr>
    		<?php if( $require_cvv_code == "YES" ) { 
    					$_SESSION['ccdata']['need_card_code'] = 1;	
    			?>
    		    <tr valign="top">
    		        <td nowrap width="10%" align="right">
    		        	<label for="credit_card_code">
    		        		<?php echo vmToolTip( $VM_LANG->_('PHPSHOP_CUSTOMER_CVV2_TOOLTIP'), '', '', '', $VM_LANG->_('PHPSHOP_CUSTOMER_CVV2_TOOLTIP_TITLE') ) ?>:
    		        	</label>
    		        </td>		        		
    		        <td>
    		            <input type="text" class="inputbox" id="credit_card_code" name="credit_card_code" value="<?php if(!empty($_SESSION['ccdata']['credit_card_code'])) echo $_SESSION['ccdata']['credit_card_code'] ?>" autocomplete="off" />
    		        
    		        </td>
    		    </tr>
    		<?php } ?>
    		    <tr>
    		        <td nowrap width="10%" align="right"><?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_CONF_PAYINFO_EXDATE') ?>:</td>
    		        <td><?php 
    		        $ps_html->list_month("order_payment_expire_month", @$_SESSION['ccdata']['order_payment_expire_month']);
    		        echo "/";
    		        $ps_html->list_year("order_payment_expire_year", @$_SESSION['ccdata']['order_payment_expire_year']) ?>
    		       </td>
    		    </tr>
        	</table>
        </fieldset>
      <?php  
    }
    
    if( $nocc_payments &&  $cc_payments ) {
    	echo '</td><td width="50%">';
    }
    
    if ($nocc_payments==true) {
        if ($cc_payments==true) { 
        	$title = $VM_LANG->_('PHPSHOP_CHECKOUT_PAYMENT_OTHER');
        }
        else {
        	$title = $VM_LANG->_('PHPSHOP_ORDER_PRINT_PAYMENT_LBL');
        }
        	
       ?>
        <fieldset><legend><strong><?php echo $title ?></strong></legend>
    		<table border="0" cellspacing="0" cellpadding="2" width="100%">
    		    <tr>
    		        <td colspan="2"><?php 
    		            [B]$ps_payment_method->list_nocheck($payment_method_id,  false); 
    					     echo '<img src="https://www.payson.se/sites/all/files/images/external/payson-210x80.jpg">';
       echo '<br />';
            
    		            $ps_payment_method->list_bank($payment_method_id,  false);
    					echo '<br />';
    		            $ps_payment_method->list_paypalrelated($payment_method_id,  false);
    					echo '<img src="https://www.paypal.com/en_US/i/bnr/horizontal_solution_PPeCheck.gif"><br />';
    					 ?>[/B]
    		        </td>
    		    </tr>
    		 </table>
    	</fieldset>
    	<?php
    }
    
    if( $nocc_payments &&  $cc_payments ) {
    	echo '</td></tr></table>';
    }
      ?>
    Hope some understands what I like to do and can help. Sorry for my bad English.

    Regards
    Anni
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    if this is done on the client (in the browser) and not on the server, than you need JavaScript to do this.

    hint: look at document object and the onclick attribute.

    Dan

    Comment

    Working...