0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
pages
/
[
Home
]
File: view_cart.php
<? require('js/script.js'); ?> <link href="../css/style.css" rel="stylesheet" type="text/css"> <p>Edit this area through <span style="color: #800000"><b>Admin > Web content Management > View_cart</b></span></p> <? $temptable=session_id(); if($_GET['action']=="update") { //echo $bx= "quantity_".$_GET['action_id']."<br>"; //echo $_POST['rate'.$_GET[ echo $q_update="update ".$temptable." set quantity='".$_GET[$bx]."' where temp_id='".$_GET['action_id']."'"; $r_update=mysql_query($q_update); exit(); if(!$r_update) { echo mysql_error(); } else { ?> <SCRIPT language="JavaScript"> window.location="index.php?page=view_cart"; </SCRIPT> <? } } if($_GET['action']=="del") { $q_delete="delete from ".$temptable." where temp_id='".$_GET['action_id']."'"; $r_delete=mysql_query($q_delete); ?> <SCRIPT language="JavaScript"> window.location="index.php?page=view_cart"; </SCRIPT> <? } $q_data="select * from `".$temptable."`"; $r_data=mysql_query($q_data); ?> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="all-borders"> <tr> <td align="left" valign="top"><form name="form1" method="post" action="index.php?page=checkout_step1"> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr align="left" valign="middle" class="create-catalog-header"> <td width="135" height="32">Product Image</td> <td width="115">Catagory</td> <td width="115">Product Name</td> <td width="80">Rate</td> <td width="60">Quantity</td> <td width="90">Price</td> <td>Action</td> </tr> <? $n=0; $total_price=0; if(@mysql_num_rows($r_data)>0) { while($row_data=@mysql_fetch_array($r_data,MYSQL_BOTH)) { if($n%2==0) { $bg="#EAFFEF"; } else { $bg="#EAF0FF"; } $q_catalog="select * from catalog where catalog_id=".$row_data['catalog_id']; $r_catalog=mysql_query($q_catalog); $row_catalog=mysql_fetch_array($r_catalog); $q_product="select * from product_details where product_id=".$row_data['product_id']; $r_product=mysql_query($q_product); $row_product=mysql_fetch_array($r_product); ?> <tr align="left" valign="middle"> <td height="25" bgcolor="<?=$bg?>" class="left-links"> <img src="<?=$row_product['product_main_image_path']?>" width="125" height="75"> </td> <td bgcolor="<?=$bg?>" class="left-links"> <?=$row_catalog['catalog_name']?> </td> <td bgcolor="<?=$bg?>" class="left-links"> <?=$row_product['product_name']?> </td> <td bgcolor="<?=$bg?>" class="left-links">$ <?=$row_data['rate']?> <input name="rate_<?=$row_data['temp_id']?>" type="hidden" id="rate_<?=$row_data['temp_id']?>" value="<?=$row_data['rate']?>"> <input name="weight_<?=$row_data['temp_id']?>2" type="hidden" id="weight_<?=$row_data['temp_id']?>" value="<?=$row_data['per_product_weight']?>"> </td> <td align="left" bgcolor="<?=$bg?>"> <input name="quantity_<?=$row_data['temp_id']?>" type="text" size="3" value="<?=$row_data['quantity']?>" onKeyPress="check_num()"></td> <td align="left" bgcolor="<?=$bg?>" class="left-links">$ <?=$row_data['price']?> </td> <td align="center" bgcolor="<?=$bg?>"><font size="1"><img src="images/update.gif" alt="Update Quantity" width="16" height="16" border="0" onClick="update_cart(<?=$row_data['temp_id']?>)" onMouseOver="this.style.cursor='hand';" onMouseOut="this.style.cursor='auto'"><font color="#006600">Update</font> <a href="index.php?page=view_cart&&action=del&&action_id=<?=$row_data['temp_id']?>"><img src="images/icon_delete.gif" alt="Delete This Item" width="15" height="16" border="0"><font color="#FF0000">Delete</font></a></font></td> </tr> <? $n++; $total_price=$total_price+$row_data['price']; } } else { ?> <script language="JavaScript" type="text/javascript"> window.location='index.php'; </script> <? } ?> <tr align="left" valign="middle"> <td height="25" class="left-links"> </td> <td class="left-links"> </td> <td class="left-links"> </td> <td colspan="2" align="right" class="left-links"><font color="#000033">Total Price </font></td> <td align="left" class="left-links">$ <?=number_format($total_price,2)?> </td> <td align="center" valign="top" ><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top" class="left-links">Payment Options</td> </tr> <tr> <td height="25" align="left" valign="middle"> <input type="radio" name="radiobutton" value="radiobutton" onClick="op(1)"> <span class="left-links"><font color="#000033">Lease </font></span></td> </tr> <tr> <td height="25" align="left" valign="middle"><input type="radio" name="radiobutton" value="radiobutton" onClick="op(2)"> <span class="left-links"><font color="#000033">Paypal </font></span></td> </tr> <tr> <td height="25" align="left" valign="middle"><input type="radio" name="radiobutton" value="radiobutton" onClick="op(3)"> <span class="left-links"><font color="#000033">Credit Card </font></span></td> </tr> <tr id="t1" style="display:none"> <td height="25" align="center" valign="middle"><img src="images/iwantlease.jpg" width="125" height="30" onMouseOver="this.style.cursor='pointer'" onClick="page(3)"></td> </tr> <tr id="t2" style="display:none"> <td height="25" align="center" valign="middle"><img src="images/payviapaypal.jpg" width="125" height="30" onMouseOver="this.style.cursor='pointer'" onclick="page(1)"></td> </tr> <tr id="t3" style="display:none"> <td height="25" align="center" valign="middle"><img src="images/crecitcardpayment.jpg" width="125" height="30" onMouseOver="this.style.cursor='pointer'" onclick="page(2)"></td> </tr> </table> </td> </tr> </table> </form></td> </tr> </table> <script language="JavaScript" type="text/javascript"> function op(id) { //alert(id); var i; for(i=1;i<=3;i++) { if(i==id) { if(document.getElementById('t'+i).style.display=='none') { document.getElementById('t'+i).style.display=''; } } else { document.getElementById('t'+i).style.display='none'; } } } function page(p) { var p_option; if(p==1) { p_option="paypal"; } else if(p==2) { p_option="creditcard"; } else if(p==3) { p_option="lease"; } window.location="index.php?page=checkout_step1&&p_option="+p_option; } </script>