Jump to content

glow

Members
  • Posts

    47
  • Joined

  • Last visited

Everything posted by glow

  1. Thank you for your post, i thought the same, can I pay you to modify that file as you have explained?
  2. And here is a screenshot showing the the item and price rows. i took this screen shot from a sample order notification email.
  3. I have this Shopping cart that allows for the creation of products with product sizes and so if a customer purchases a shirt which regular price is $10 but he/she chooses a large size which is marked @ $12 then of course the shopping cart then charges $12 - then the customer receives a purchase notification email defining the purchase of the $12 size large shirt, and thats all fine except that currently the notification email defines the shirt with $0.00 price in a row and in another row it defines the shirt size with the $12.00 price. So it basically defines the product twice, and i don't want it to do that. I want the product price and size to all be included in the same row. Attached is the .php file that needs the modification. I had a developer tell me that it could not be done. Can someone please have a look at this file and tell me if its true that what I want cannot be done! - all i want to do is merge those two rows together. I've attached the php that is responsible for writing the tables containing the purchased items. orderSaveAjax.php
  4. Hey thanks for your help, that worked out nicely. I hate joomla i'm just helping out a friend : )
  5. I simply copied that example code from the link you provided and add it to my php page.
  6. Adding "session_start()" to the top of the script gives errors also.
  7. I tried this but it didn't work: <?php date_default_timezone_set('America/Los_Angeles'); $script_tz = date_default_timezone_get(); if (strcmp($script_tz, ini_get('date.timezone'))){ echo 'Script timezone differs from ini-set timezone.'; } else { echo 'Script timezone and ini-set timezone match.'; } ?>
  8. Thank you for your links but this still goes over my head , I wish I understood more of it but I'm not there yet. So in my joomla.php it shows this code in line 103: ----------------------------------------------------- $now = date( 'Y-m-d H:i', time() ); DEFINE( '_CURRENT_SERVER_TIME', $now ); DEFINE( '_CURRENT_SERVER_TIME_FORMAT', '%Y-%m-%d %H:%M:%S' ); and this code in line 436: $now = date( 'Y-m-d H:i:s', time() ); $this->set( 'now', $now ); ---------------------------------------------------------- so what should go in their place? thanks you
  9. Hi I'm in need of help with some errors that the admin page of my cms is spitting out, I'm very new to php but I'm great understanding directions so any help that anyone can provide will be greatly appreciated. These are the errors being displayed: Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/mysite/public_html/includes/joomla.php on line 437 Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/mysite/public_html/includes/joomla.php:437) in /home/mysite/public_html/includes/joomla.php on line 808 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/mysite/public_html/includes/joomla.php:437) in /home/mysite/public_html/includes/joomla.php on line 808 I've attached the php file giving the errors, I hope someone can help me. Thanks in advance. Jude
  10. Thank you Adam for your help .
  11. As an alternative if there is no solution can we through php or CSS or javascript perhaps "exclude" the other elements inside the div from having their opacity affected? - is that possible?
  12. Hi, I just forwarded your info to my developer and he says that he is not able to convert: Hex to RGB and so apparently that's what is causing the problem.
  13. Hi Adam and thank you for posting I should of been more specific I want the opacity to affect:( .product_cont ) only. wil the above code you posted help with that?
  14. Hi my shopping cart has an image background whos opacity I want to be able to change so I had someone work on it and they managed to apply opacity to the whole section not just the back ground so now when opacity is set to 50% the opacity is being applied to not only the background but but it is being applied to the product tittle, product description, price, add to cart button, basically opacity is being added to everything. He says that it is unnavoidable because the opacity isbeing adde to the div that contains all of the shopping cart elements and so they too will have their opacity affected. So I was wondering if their is a way to apply opacity to the div and only affect the background and not the other elemnts in the div? here is the code sample <div style="background-image:url(<?= $bg ?>);background-color:<?= $color ?>" class="product_cont"> <h1 class="product_cat"><?= $category->name; ?></h1> <table width="100%"> <?php while ($product_query->have_posts()): $product_query->the_post(); $product_meta = get_post_meta(get_the_ID(), 'mac', TRUE); @extract($product_meta); $variety = @array_filter($variety); ?> <tr> <td width="10%" style="margin-left:20px;vertical-align:middle;"> <?php the_post_thumbnail(array(50, 50)); ?> </td> <td width="65%"> <span class="product_title" ><?php the_title(); ?></span> <p class="product_description"> <?= substr(get_the_content(), 0, 60); ?> </p> </td> <td width="10%"> <?php $product_price = get_post_meta(get_the_ID(), 'product_price', TRUE); $product_meta = get_post_meta(get_the_ID(), 'mac', TRUE); @extract($product_meta); echo "<p class='product_price'>$" . @number_format($product_price, 2) . "</p>" ?> </td> <td style="text-align:center;" width="15%"><button data-product="<?php the_ID(); ?>" class="add_cart_btn"><?= (!empty($acb_button_btn_text))? $acb_button_btn_text:"Add To Cart" ?></button></td> </tr> <div title="Add Item" style="display:none;" id="dialog-<?php the_ID(); ?>"> <form method="POST"> <input type="hidden" name="action" value="add_to_cart"> <input type="hidden" name="macp_cart[product_id]" value="<?php the_ID(); ?>"> <!-- Variety/Size --> <?php if ($variety != NULL): ?> <div style="width:100%;display:block;"> <p style="font-weight:bold;margin:0px;">Size</p> <input checked type="radio" name="macp_cart[variety]" value="<?php the_ID() ?>" /> Normal Price <br> <?php foreach ($variety as $key => $vrt) { if (!empty($vrt)) { $variety_post = get_post($key); $variety_meta = get_post_meta($key, 'mac', TRUE); echo "<input type='radio' name='macp_cart[variety]' value='$key' /> " . $variety_post->post_title . " <small>($$vrt)</small><br>"; } } ?> </div> <?php endif; ?> <!-- Product Option --> <?php if ($option != NULL): ?> <div style="width:100%;display:block;"> <p style="font-weight:bold;margin:0px;">Product Options</p> <?php $check = "checked"; foreach ($option as $key => $opt) { $option_post = get_post($key); $option_meta = get_post_meta($key, 'mac', TRUE); echo "<input $check type='radio' name='macp_cart[option]' value='$key' /> " . $option_post->post_title . " <small>($" . $option_meta['product_price'] . ")</small><br>"; $check = ""; } ?> </div> <?php endif; ?> <!-- Product Extra --> <?php if ($extra != NULL): ?> <div style="width:100%;display:block;"> <p style="font-weight:bold;margin:0px;">Product Extra</p> <?php foreach ($extra as $key => $ext) { $extra_post = get_post($key); $extra_meta = get_post_meta($key, 'mac', TRUE); echo "<input type='checkbox' name='macp_cart[extra][]' value='$key' /> " . $extra_post->post_title . " <small>($" . $extra_meta['product_price'] . ")</small><br>"; } ?> </div> <?php endif; ?> <div style="width:100%;display:block;margin:0px;"> <label for="user_note">Note.</label><br><textarea name="macp_cart[note]" id="user_note"></textarea> <br> <label for="qty">Quantity: </label><br><input type="text" name="macp_cart[qty]" id="qty" value="1"> <br> <input style="margin-top:10px;" type="submit" value="<?= (!empty($acb_button_btn_text))? $acb_button_btn_text:"Add To Cart" ?>"> </div> </form> </div> <?php endwhile; ?> </table> </div> And this is the CSS: <style> <?php $style_opt = get_option('ma_cp_style'); if (is_array($style_opt)) { extract($style_opt); } $cat_title_style = explode('|', $cat_title_font_type); $title_style = explode('|', $title_font_type); $dp_font_type = explode('|', $dp_font_type); $pp_font_type = explode('|', $pp_font_type); $cat_title_style[0] = str_replace(' ', '+', $cat_title_style[0]); $title_style[0] = str_replace(' ', '+', $title_style[0]); $dp_font_type[0] = str_replace(' ', '+', $dp_font_type[0]); $pp_font_type[0]= str_replace(' ', '+', $pp_font_type[0]); ?> @import url(<?= $title_style[0] ?>); @import url(<?= $cat_title_style[0] ?>); @import url(<?= $dp_font_type[0] ?>); @import url(<?= $pp_font_type[0] ?>); .product_cat{ font-family: <?= $cat_title_style[1] ?> !important; font-size:<?= $cat_title_font_size ?> !important; color:<?= $cat_title_font_color ?> !important; text-shadow: <?php extract($cat_title_shadow); echo "$h_shadow $v_shadow $blur $color !important"; ?> } .product_title{ font-family: <?= $title_style[1] ?> !important; font-size:<?= $title_font_size ?> !important; color:<?= $title_font_color ?> !important; } .product_description{ font-family: <?= $dp_font_type[1] ?> !important; font-size:<?= $dp_font_size ?>px !important; color:<?= $dp_font_color ?> !important; } .add_cart_btn{ background-color: <?= $acb_button_color ?> !important; border-radius: <?= $acb_button_radius ?> !important; box-shadow: <?php extract($acb_button_shadow); echo "$h_shadow $v_shadow $blur $speard $color !important"; ?>; color: <?= $acb_button_text_color ?>; } .add_cart_btn:hover{ background:none; background-color: <?= $acb_button_color_hover ?> !important; border-radius: <?= $acb_button_radius_hover ?> !important; box-shadow: <?php extract($acb_button_shadow_hover); echo "$h_shadow $v_shadow $blur $speard $color !important"; ?>; color: <?= $acb_button_text_color_hover ?> !important; } .product_cont{ background-image: url(<?= $cat_background_image ?>); border-radius: <?= $cat_background_container_radius ?> !important; box-shadow:<?php extract($cat_background_container_shodow); echo "$h_shadow $v_shadow $blur $speard $color !important"; ?> ; width: <?= (empty($cat_background_container_width))?"100%":$cat_background_container_width ?> !important; height: <?= (empty($cat_background_container_height))?"100%":$cat_background_container_height ?> !important; background-color: <?= $cat_background_container_color ?> !important; opacity: <?= (empty($cat_background_container_opacity) || $cat_background_container_opacity == "0")?'1':$cat_background_container_opacity/100 ?> !important; } .product_price{ font-family: <?= $pp_font_type[1] ?> !important; font-size:<?= $pp_font_size ?>px !important; color:<?= $pp_font_color ?> !important; } .product_cont table,.product_cont table td,.product_cont table tr{ border:none !important; } </style> Thank you for any help that anyone can provide. Glow
  15. lol ...I'm afraid you lost me there I'm just starting with php.
  16. Hi Guru, yes they are all numeric.
  17. Hi can someone tell me by looking at this php file why the delete function attached to the delete button is not working? <?php //session_start(); require('../includes/db-connection.php'); include('../modules/general_functions.php'); include('../modules/db_functions.php'); ini_set('session.cache_limiter',''); if (!session_is_registered('admin_login')) { header('location:login.php'); } if(isset($_REQUEST['beg'])){ $beg = $_REQUEST['beg']; }else{ $beg = 0; } $Sno = $beg + 1; $tablename = "orders"; $tablename2 = "order_items"; $_tablename = "orders"; if(count($_POST)){ $_orderby = sql_replace(trim($_POST['orderby'])); $_isDel = $_POST['delete']; $_isApprove = $_POST['approve']; $_isDisApprove = $_POST['disapprove']; //$_tablename = "mcblogs";// Retrieving Classified Table Name //If Delete button is pressed. if($_isDel){ $_ids = $_POST['ids']; $total = count($_ids); if($total){ for($i=0; $i<$total; $i++) { $_tids .= $_ids[$i] . ","; } $_tids = substr($_tids, 0, -1); if($_tids) { $sql = "DELETE FROM $tablename2 where order_id in ($_tids)"; mysql_query($sql); $sql = "DELETE FROM $_tablename where order_id in ($_tids)"; if(mysql_query($sql)) { $_SESSION['flag'] = 'Delete'; //$error = "Content(s) approved successfully. "; } $_tids = ""; } } else{ $error = "Please check some Content(s) to approve"; } } //If Approve button is pressed. if($_isApprove){ $_ids = $_POST['ids']; $total = count($_ids); if($total){ for($i=0; $i<$total; $i++){ $_tids .= $_ids[$i] . ","; } $_tids = substr($_tids, 0, -1); if($_tids){ $sql = "Update $_tablename set status='Delivered' where order_id in ($_tids)"; if(mysql_query($sql)){ $error = "Content(s) approved successfully. "; } $_tids = ""; } } else{ $error = "Please check some Content(s) to approve"; } } //If Disapprove button is pressed. if($_isDisApprove){ $_ids = $_POST['ids']; $total = count($_ids); if($total){ for($i=0; $i<$total; $i++){ $_tids .= $_ids[$i] . ","; } $_tids = substr($_tids, 0, -1); if($_tids){ $sql = "Update $_tablename set status='Pending' where order_id in ($_tids)"; if(mysql_query($sql)){ $error = "Content(s) disapproved successfully. "; } $_tids = ""; } } else{ $error = "Please check some Content(s) to disapprove"; } } } if(isset($_POST['act'])){ if($_POST['act'] == 'Del') { $condition=array("clid" => $_POST['id']); $rs= select_table($tablename,$condition); if ($rs[0]) { $_SESSION["flag"] = 'Not_Deleted'; } else{ $condition=array("oid" => $_POST['id']); delete_table($tablename,$condition); } } } /*$total_query = "select * from orders, order_items where orders.order_id = order_items.order_id GROUP By orders.order_id";*/ /*$total_query = "SELECT COUNT(distinct a.order_id) as tot_rec FROM ".$tablename." as a,".$tablename2." as b WHERE a.order_id=b.order_id GROUP By a.order_id";*/ $total_query = "SELECT COUNT(distinct order_id) as tot_rec FROM `order` WHERE status ='Completed'"; $total_result = mysql_query($total_query); $total_res = mysql_fetch_array($total_result); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>..:: Mahatma Gandhi - Admin Panel ::..</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="style.css" rel="stylesheet" type="text/css"> <script language="JavaScript"> function find_crewtype() { document.frm.searchr.value=''; document.frm.searcht.value=''; document.frm.act.value=""; document.frm.beg.value=0; document.frm.submit(); } function find_users(st) { document.frm.searchr.value=st; document.frm.searcht.value=''; document.frm.act.value=""; document.frm.beg.value=0; document.frm.submit(); } function find_usersa() { document.frm.searchr.value=''; document.frm.searcht.value=''; document.frm.act.value=""; document.frm.beg.value=0; document.frm.submit(); } function find_userst() { document.frm.searchr.value=''; document.frm.act.value=""; document.frm.beg.value=0; document.frm.submit(); } function view_record(id) { document.frm.id.value=id; document.frm.action = "detail_orders.php?oid="+id; document.frm.submit(); } function add_record(id) { document.frm.action = "add_orders.php"; document.frm.submit(); } var records_per_page = 30; function prev(beg1) { document.frm.beg.value = (beg1*1)-records_per_page; document.frm.submit(); } /////////////////////////////////////////////////////////////////////////////////////////// function next(beg1) { document.frm.beg.value = (beg1*1)+records_per_page; document.frm.submit(); } /////////////////////////////////////////////////////////////////////////////////////////// function gotopage() { var abc = document.frm.jumppage.selectedIndex; var val = document.frm.jumppage[abc*1].value; document.frm.beg.value = ((val*1)*records_per_page)-records_per_page; document.frm.submit(); } /////////////////////////////////////////////////////////////////////////////// function delete_record(id, beg) { var buttonOk; buttonOk = confirm("Are you sure you want to delete this record ?"); if(buttonOk) { document.frm.id.value=id; document.frm.act.value="Del"; document.frm.action = "orders.php"; document.frm.submit(); } } ////////////////////////////////////////// function CheckAll(){ for (var c=0; c<document.frm.elements.length; c++){ var e = document.frm.elements[c]; if (e.name != 'selectUnselecrAll') e.checked = document.frm.selectUnselecrAll.checked; } } </script> </head> <body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0"> <table width="90%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="10" colspan="3"><?php include('header.php'); ?></td> </tr> <tr> <td width="28%" valign="top" class="bgcontents"><?php include('left.php'); ?></td> <td width="2%"></td> <td width="70%" class="bgcontents" valign="top"> <form name="frm" method="post" enctype="multipart/form-data"> <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> </td> </tr> <tr> <td><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="100%" height="25" class="page_heading">Orders Management</td> </tr> <tr> <td height="10"></td> </tr> <?php if($_SESSION['flag'] == 'Delete') { ?> <tr> <td class="text-red">Record deleted successfully</td> </tr> <?php } else if($_SESSION['flag'] == 'Update') { ?> <tr> <td class="text-red">Record Updated successfully</td> </tr> <?php } else if ($_SESSION['flag']=='Add') { ?> <tr> <td class="text-red">Record Added successfully</td> </tr> <?php } $_SESSION['flag']=''; ?> <tr><td height="10px"></td></tr> <tr><td> </td></tr> <tr class="row_bg" height="25px"> <td align="left" height="15" valign="top" class="sub_heading"> <input type="checkbox" name="selectUnselecrAll" onClick="CheckAll();">Select All to <input type="submit" name="approve" value=" Approve " class="button-nml" onclick="return confirm('Are you sure you want to Approve!');"> <input type="submit" name="disapprove" value=" Disapprove " class="button-nml" onclick="return confirm('Are you sure you want to Disapprove!');"> <input type="submit" name="delete" value=" Delete " class="button-nml" onclick="return confirm('Are you sure you want to Delete!');"> </td> </tr> <tr> <td> <table width="100%"> <tr><td width="50%"> </td> <td width="50%" align="right" class="sub_heading"><b>Total Records :<?php echo $total_res['tot_rec']; ?></b></td></tr></table> </td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="sub_heading"> <tr class="theading_bg"> <td width="6%">S.No</td> <td width="7%">Select</td> <td width="18%" height="30px">Client Name</td> <!--<td width="14%" height="30px">Contact No </td> <td width="22%">E-mail</td>--> <td width="21%">Order Date</td> <td width="19%">Delivery Time</td> <td width="9%" align="center">Price</td> <td width="10%" align="center">Status</td> <td width="10%" align="center">Details</td> </tr> <?php $records_per_page = 30; /* $cat_query="SELECT sum(b.oprice*b.oqty) as rs, sum(b.oqty) as p,a.*,b.* FROM ".$tablename." as a,".$tablename2." as b WHERE a.oid=b.oid"; $cat_query .= " GROUP By a.oid ";*/ /*$cat_query = "select * from orders, order_items where orders.order_id = order_items.order_id and orders.payment_status = 1 GROUP By orders.order_id";*/ $cat_query = "select * from `order`, order_product where `order`.order_id = order_product.order_id and `order`.status = 'Completed' GROUP By `order`.order_id"; // print_r ($cat_query); //exit; $res_query= mysql_query($cat_query); $total_rec= mysql_num_rows($res_query); if(isset($_REQUEST['beg'])){ $beg = $_REQUEST['beg']; }else{ $beg = 0; } $end = 0; if($total_rec >= 1) { $total_pages = ceil($total_rec/$records_per_page); $current_page = floor($beg/$records_per_page) +1; if($beg < $total_rec) { if($beg + $records_per_page < $total_rec) $end = $beg + $records_per_page; else $end = $total_rec; } $cat_query .= " ORDER BY `order`.order_id DESC LIMIT $beg,$records_per_page"; } $cat_result = mysql_query($cat_query); if(mysql_num_rows($cat_result) > 0) { while($cat_res = mysql_fetch_array($cat_result)) { $clientID = $cat_res['customer_id']; $QryClient = mysql_query("select * from client where id = '".$clientID."'"); $RslClient = mysql_fetch_array($QryClient); ?> <tr> <td height="30"><strong><?php echo $Sno; ?>.</strong></td> <td><input type="checkbox" name="ids[]" value ="<?php echo $cat_res["order_id"]; ?>"></td> <?php /*?><a href="mailto:<?php echo $cat_res['email']; ?>" class="left-nav"><?php echo $cat_res['email']; ?></a><?php */?> <td><?php echo $RslClient['fname']." ".$RslClient['lname']; ?></td> <?php /*?><td><?php echo $RslClient['phone']; ?></td><?php */?> <?php /*?><td><?php echo $RslClient['email']; ?></td><?php */?> <td><?php echo $cat_res['order_date']; ?></td> <td><?php echo $cat_res['delivery_time']; ?></td> <td align="center"><?php echo $currency_symbol["currencySymbol"]." ".$cat_res['total_price']; ?></td> <td align="center"><?php if ($cat_res['status'] == 'Completed') echo "Paid"; else echo "Not Paid"; ?> </td> <td align="center"><table width="80%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center"><a href="javascript:view_record('<?php echo $cat_res['order_id']; ?>')" onClick="javascript:view_record('<?php echo $cat_res['order_id']; ?>')"><img src="../images/view-detail.png" width="30" height="30" title="View Details" border="0"></a></td> </tr> </table></td> </tr> <tr> <td height="1" colspan="10" bgcolor="#225544"></td> </tr> <?php $Sno++; } } else { echo '<tr><td colspan="7" height="30">No records.</td></tr>'; } ?> <tr> <td colspan="10"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%"><input name="sno" type="hidden" id="sno" value="<?php echo $Sno; ?>"> <input type="hidden" name="beg" value="<?php echo $beg; ?>"></td> <td width="40%"> </td> </tr> <tr> <td></td> <td align="right" class="sub_heading"><b>Total Records :<?php echo $total_res['tot_rec']; ?></b></td> </tr> </table></td> </tr> <tr> <td colspan="10"> </td> </tr> <tr> <td colspan="10"> <?php if($total_res['tot_rec'] > $records_per_page) { ?> <table width="37%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr class="bodyTextBold"> <td width="32%" align="center"><?php if($beg > 0) echo "<a href=\"javascript:prev('$beg')\" class=\"left-nav\"> <<Back </a></td>"; ?> <td width="29%" class="body-text"><div align="right">Page <SELECT name="jumppage" class="button-nml" onChange="gotopage()"> <?php for($x=1; $x <= $total_pages; $x++) { if($x==$current_page) { echo "<OPTION value=\"$x\" selected>$x</OPTION>"; } else { echo "<OPTION value=\"$x\">$x</OPTION>"; } } ?> </SELECT> </div></td> <td width="22%" class="sub_heading"> of <?php echo $total_pages; ?> </td> <td width="17%"><?php if($end < $total_rec) echo "<a href=\"javascript:next($beg)\" class=\"left-nav\">Next>></a>"; ?> </td> </tr> </table> <?php }?> </td> </tr> <tr> <td colspan="10"> </td> </tr> </table></td> </tr> </table></td> </tr> </table> <input name="id" type="hidden"> <input name="act" type="hidden" value=""> </form></td> </tr> <tr> <td height="10" colspan="3"><?php include('bottom.php'); ?></td> </tr> </table> </body> </html> in comparison to this other php page where the same delete function is working <?php error_reporting(0); session_start(); ini_set('session.cache_limiter',''); if (!session_is_registered('admin_login')) { header('location:login.php'); } require('../includes/db-connection.php'); include('../modules/general_functions.php'); include('../modules/db_functions.php'); $Sno = $beg + 1; $tablename = "products"; $tablenamec = "cataloge"; $_tablename = "products"; if(count($_POST)){ $_orderby = sql_replace(trim($_POST['orderby'])); $_isDel = $_POST['delete']; $_isApprove = $_POST['approve']; $_isDisApprove = $_POST['disapprove']; //$_tablename = "mcblogs";// Retrieving Classified Table Name //If Delete button is pressed. if($_isDel){ $_ids = $_POST['ids']; $total = count($_ids); if($total){ for($i=0; $i<$total; $i++){ $_tids .= $_ids[$i] . ","; } $_tids = substr($_tids, 0, -1); if($_tids){ $sql = "DELETE FROM $_tablename where id in ($_tids)"; if(mysql_query($sql)){ $_SESSION['flag'] = 'Delete'; //$error = "Content(s) approved successfully. "; } $_tids = ""; } } else{ $error = "Please check some Content(s) to approve"; } } //If Approve button is pressed. if($_isApprove){ $_ids = $_POST['ids']; $total = count($_ids); if($total){ for($i=0; $i<$total; $i++){ $_tids .= $_ids[$i] . ","; } $_tids = substr($_tids, 0, -1); if($_tids){ $sql = "Update $_tablename set status='1' where id in ($_tids)"; if(mysql_query($sql)){ $error = "Content(s) approved successfully. "; } $_tids = ""; } } else{ $error = "Please check some Content(s) to approve"; } } //If Disapprove button is pressed. if($_isDisApprove){ $_ids = $_POST['ids']; $total = count($_ids); if($total){ for($i=0; $i<$total; $i++){ $_tids .= $_ids[$i] . ","; } $_tids = substr($_tids, 0, -1); if($_tids){ $sql = "Update $_tablename set status='0' where id in ($_tids)"; if(mysql_query($sql)){ $error = "Content(s) disapproved successfully. "; } $_tids = ""; } } else{ $error = "Please check some Content(s) to disapprove"; } } } if($_POST['act'] == 'Del') { $condition=array("id" => $_POST['id']); $rs= select_table($tablename,$condition); if ($rs[0]) { $_SESSION["flag"] = 'Not_Deleted'; } else{ $condition=array("id" => $_POST['id']); delete_table($tablename,$condition); } } if ($_POST['searcht']) $total_query = "SELECT COUNT(*) as tot_rec FROM ".$tablename." as a,".$tablenamec." as b WHERE a.parentid=b.id AND a.heading LIKE '%".$_POST['searcht']."%'"; else if ($_POST['searchr']) $total_query = "SELECT COUNT(*) as tot_rec FROM ".$tablename." as a,".$tablenamec." as b WHERE a.parentid=b.id AND a.heading LIKE '".$_POST['searchr']."%'"; else $total_query = "SELECT COUNT(*) as tot_rec FROM ".$tablename." as a,".$tablenamec." as b WHERE a.parentid=b.id"; $total_result = mysql_query($total_query); $total_res = mysql_fetch_array($total_result); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>..:: Mahatma Gandhi - Admin Panel ::..</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="style.css" rel="stylesheet" type="text/css"> <script language="JavaScript"> function find_crewtype() { document.frm.searchr.value=''; document.frm.searcht.value=''; document.frm.act.value=""; document.frm.beg.value=0; document.frm.submit(); } function find_users(st) { document.frm.searchr.value=st; document.frm.searcht.value=''; document.frm.act.value=""; document.frm.beg.value=0; document.frm.submit(); } function find_usersa() { document.frm.searchr.value=''; document.frm.searcht.value=''; document.frm.act.value=""; document.frm.beg.value=0; document.frm.submit(); } function find_userst() { document.frm.searchr.value=''; document.frm.act.value=""; document.frm.beg.value=0; document.frm.submit(); } function update_record(id) { document.frm.id.value=id; document.frm.action = "update_products.php"; document.frm.submit(); } function add_record(id) { document.frm.action = "add_products.php"; document.frm.submit(); } var records_per_page = 30; function prev(beg1) { document.frm.beg.value = (beg1*1)-records_per_page; document.frm.submit(); } /////////////////////////////////////////////////////////////////////////////////////////// function next(beg1) { document.frm.beg.value = (beg1*1)+records_per_page; document.frm.submit(); } /////////////////////////////////////////////////////////////////////////////////////////// function gotopage() { var abc = document.frm.jumppage.selectedIndex; var val = document.frm.jumppage[abc*1].value; document.frm.beg.value = ((val*1)*records_per_page)-records_per_page; document.frm.submit(); } /////////////////////////////////////////////////////////////////////////////// function delete_record(id, beg) { var buttonOk; buttonOk = confirm("Are you sure you want to delete this record ?"); if(buttonOk) { document.frm.id.value=id; document.frm.act.value="Del"; document.frm.action = "products.php"; document.frm.submit(); } } ////////////////////////////////////////// function CheckAll(){ for (var c=0; c<document.frm.elements.length; c++){ var e = document.frm.elements[c]; if (e.name != 'selectUnselecrAll') e.checked = document.frm.selectUnselecrAll.checked; } } </script> </head> <body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0"> <table width="90%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="10" colspan="3"><?php include('header.php'); ?></td> </tr> <tr> <td width="28%" valign="top" class="bgcontents"><?php include('left.php'); ?></td> <td width="2%"></td> <td width="70%" class="bgcontents" valign="top"> <form name="frm" method="post" enctype="multipart/form-data"> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> </td> </tr> <tr> <td><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="100%" height="25" class="page_heading">Products Management</td> </tr> <tr> <td height="10"></td> </tr> <?php if($_SESSION['flag'] == 'Delete') { ?> <tr> <td class="text-red">Product deleted successfully</td> </tr> <?php } else if($_SESSION['flag'] == 'Update') { ?> <tr> <td class="text-red">Product Updated successfully</td> </tr> <?php } else if ($_SESSION['flag']=='Add') { ?> <tr> <td class="text-red">Product Added successfully</td> </tr> <?php } $_SESSION['flag']=''; ?> <tr><td height="10px"></td></tr> <tr><td height="10px"></td></tr> <tr class="row_bg" height="25px"><td align="center"><input name="btn" type="button" class="button-nml" value="Add New Record" onClick="javascript:add_record(<?php echo $_REQUEST['uid']; ?>);"> <input type="text" name="searcht" class="input-nml" value="<?php echo $_REQUEST['searcht']; ?>"><input type="button" class="button-nml" value="Go" onClick="find_userst()"> <input type="button" class="button-nml" value="Show all" onClick="find_usersa()"> </td></tr> <tr><td> </td></tr> <tr><td align="center"> <?php // get_alphabetical();?> <input name="searchr" type="hidden" value="<?php echo $_REQUEST['searchr']?>"> <input name="orderr" type="hidden" value="<?php echo $_REQUEST['orderr']?>"> </td></tr> <tr><td> </td></tr> <tr class="row_bg" height="25px"> <td align="left" height="15" valign="top" class="sub_heading"> <table width="100%"><tr><td width="60%" align="left" class="sub_heading"> <input type="checkbox" name="selectUnselecrAll" onClick="CheckAll();">Select All to <input type="submit" name="approve" value=" Approve " class="button-nml" onclick="return confirm('Are you sure you want to Approve!');"> <input type="submit" name="disapprove" value=" Disapprove " class="button-nml" onclick="return confirm('Are you sure you want to Disapprove!');"> <input type="submit" name="delete" value=" Delete " class="button-nml" onclick="return confirm('Are you sure you want to Delete!');"> </td><td width="40%" align="right" class="sub_heading"></td> </tr> </table> </td> </tr> <tr> <td> <table width="100%"> <tr><td width="50%"> </td> <td width="50%" align="right" class="sub_heading"><b>Total Records :<?php echo $total_res['tot_rec']; ?></b></td></tr></table> </td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="sub_heading"> <tr class="theading_bg"> <td width="6%">S.No</td> <td width="7%">Select</td> <td width="18%" height="30">Product Image </td> <td width="32%" height="30">(Category) Product name </td> <td width="12%" align="center">Price</td> <td width="12%">Status</td> <td width="13%" align="center">Action</td> </tr> <?php $records_per_page = 30; if ($_POST['searcht']) $cat_query = "SELECT a.id,b.heading,a.heading,a.status,a.price,a.medium_price,a.extra_large,a.large_price,a.image,a.product_id FROM ".$tablename." as a,".$tablenamec." as b WHERE a.parentid=b.id AND a.heading LIKE '%".$_POST['searcht']."%'"; else if ($_POST['searchr']) $cat_query = "SELECT a.id,b.heading,a.heading,a.status,a.price,a.medium_price,a.large_price,a.extra_large,a.image,a.product_id FROM ".$tablename." as a,".$tablenamec." as b WHERE a.parentid=b.id AND a.heading LIKE '".$_POST['searchr']."%'"; else $cat_query="SELECT a.id,b.heading,a.heading,a.status,a.price,a.medium_price,a.large_price,a.extra_large,a.image,a.product_id FROM ".$tablename." as a,".$tablenamec." as b WHERE a.parentid=b.id"; $res_query= mysql_query($cat_query); $total_rec= mysql_num_rows($res_query); $beg = $_REQUEST['beg']; if($beg == '') $beg = 0; $end = 0; if($total_rec >= 1) { $total_pages = ceil($total_rec/$records_per_page); $current_page = floor($beg/$records_per_page) +1; if($beg < $total_rec) { if($beg + $records_per_page < $total_rec) $end = $beg + $records_per_page; else $end = $total_rec; } $cat_query .= " ORDER BY a.id ASC LIMIT $beg,$records_per_page"; } $cat_result = mysql_query($cat_query); if(mysql_num_rows($cat_result) > 0) { $Sno=1; while($cat_res = mysql_fetch_array($cat_result)) { ?> <tr> <td height="85"><strong><?php echo $Sno; // addslashes($cat_res['product_id']); ?>.</strong></td> <td><input type="checkbox" name="ids[]" value ="<?php echo $cat_res[0]; ?>"></td> <td> <?php if($cat_res['image']!='') { ?> <img src="../products/thumb/<?php echo $cat_res['image']; ?>" border="0"> <?php } ?> </td> <td>(<?php echo $cat_res[1]; ?>) <br /><?php echo $cat_res[2]; ?></td> <td align="center"><?php echo $currency_symbol['currencySymbol'].$cat_res["price"]."&nbsp(S)"; ?><br/><?php echo $currency_symbol['currencySymbol'].$cat_res["medium_price"]."&nbsp(M)"; ?><br/><?php echo $currency_symbol['currencySymbol'].$cat_res["large_price"]."&nbsp(L)"; ?><br/><?php echo $currency_symbol['currencySymbol'].$cat_res["extra_large"]."&nbsp(L+)"; ?></td> <td><?php if ($cat_res['status']) echo "Active"; else echo "In-Active"; ?> </td> <td align="center"><table width="80%" border="0" cellspacing="0" cellpadding="0"> <tr> <!-- onClick="javascript:update_record('<?php //$cat_res['id']?>')"--> <td align="center"><a href="javascript:update_record('<?php echo $cat_res['id']?>')" ><img src="../images/edit.png" width="30" height="30" border="0"></a></td> <!-- <a href="update_products.php?prod_id=<?php //echo $cat_res['id']; ?>"><img src="../_layout/images/edit.png" width="30" height="30" border="0"></a> --> </tr> </table></td> </tr> <tr> <td height="1" colspan="9" bgcolor="#225544"></td> </tr> <?php $Sno++; } } else { echo '<tr><td colspan="9" height="30" align="center"><font color="#FF0000">No records Found.</font></td></tr>'; } ?> <tr> <td colspan="9"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%"><input name="sno" type="hidden" id="sno" value="<?php echo $Sno; ?>"> <input type="hidden" name="beg" value="<?php echo $beg; ?>"></td> <td width="40%"> </td> </tr> <tr> <td></td> <td align="right" class="sub_heading"><b>Total Records :<?php echo $total_res['tot_rec']; ?></b></td> </tr> </table></td> </tr> <tr> <td colspan="9"> </td> </tr> <tr> <td colspan="9"> <?php if($total_res['tot_rec'] > $records_per_page) { ?> <table width="37%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr class="bodyTextBold"> <td width="32%" align="center"><?php if($beg > 0) echo "<a href=\"javascript:prev('$beg')\" class=\"left-nav\"> <<Back </a></td>"; ?> <td width="29%" class="body-text"> <div align="right"> <SELECT name="jumppage" class="button-nml" onChange="gotopage()"> <?php for($x=1; $x <= $total_pages; $x++) { if($x==$current_page) { echo "<OPTION value=\"$x\" selected>$x</OPTION>"; } else { echo "<OPTION value=\"$x\">$x</OPTION>"; } } ?> </SELECT> </div> </td> <td width="22%" class="sub_heading"> of <?php echo $total_pages; ?> </td> <td width="17%"><?php if($end < $total_rec) echo "<a href=\"javascript:next($beg)\" class=\"left-nav\">Next>></a>"; ?> </td> </tr> </table> <?php }?> </td> </tr> <tr> <td colspan="9"> </td> </tr> </table></td> </tr> </table></td> </tr> </table> <input name="id" type="hidden"> <input name="act" type="hidden"> </form></td> </tr> <tr> <td height="10" colspan="3"><?php include('bottom.php'); ?></td> </tr> </table> </body> </html> the firts php code sample with non working delete function comes from Order.php and the second php sample with working delete function comes from products.php. Both come from the same shop script any help would be appreciated.
  18. hi and thank you both for your responces. I'm just starting to learn php so some of your suggestion maybe alien to me still. Any code samples would go along way and hugely appreciated. Regarding the "include" i already tried including the the php page with the tab and it wont shot up. the script that creates the tabs came wih an an example of how to include your own php pages i just edited the code to add my php page and it wont show up. But even if i can get it to show up I'm just looking to display only a portion of that php page. this is the include code that I used: <?php include($DOCUMENT_ROOT . "/admin/inc/settings.php"); ?> and i get this error: Notice: Undefined variable: DOCUMENT_ROOT in C:\Program Files\EasyPHP-12.1\www\examples\innertabs.php on line 1 Warning: include(/admin/inc/settings.php): failed to open stream: No such file or directory in C:\Program Files\EasyPHP-12.1\www\examples\innertabs.php on line 1 Warning: include(): Failed opening '/admin/inc/settings.php' for inclusion (include_path='.;C:\php\pear') in C:\Program Files\EasyPHP-12.1\www\examples\innertabs.php on line 1 Im working localy by the way. Thanks again.
  19. Hi Im not sure if "includes" would be the solution to this but I need to include a piece of php code inside a tab in a nother page. this is the php code sample: <td class="grid"> <p>Additional Administrator Login</p> </td> <td class="grid"> <p>Username <input type="text" name="admin_username" value="<?php echo $userXML[0]["username"]; ?>" /></p> <p>Password <input type="text" name="admin_password" value="<?php echo $userXML[0]["password"]; ?>" /></p> </td> </tr> the php code comes from the same domain. Any help would be appreciated, I've been at this for days now.
  20. Ok let me further explain, currently my index file calls a .ptl file at opening like this: define( "MAINAREA", FALSE ); require( "dbconnect.php" ); require( "includes/functions.php" ); require( "includes/clientareafunctions.php" ); $pagetitle = $_LANG['globalsystemname']; $breadcrumbnav = "<a href=\"index.php\">".$_LANG['globalsystemname']."</a>"; $templatefile = "content"; $pageicon = ""; initialiseClientArea( $pagetitle, $pageicon, $breadcrumbnav ); $result = select_query( "tblannouncements", "", array( "published" => "on" ), "date", "DESC", "0,3" ); while ( $data = mysql_fetch_array( $result ) ) { $id = $data['id']; $date = $data['date']; $title = $data['title']; $announcement = $data['announcement']; $result2 = select_query( "tblannouncements", "", array( "parentid" => $id, "language" => $_SESSION['Language'] ) ); $data = mysql_fetch_array( $result2 ); if ( $data['title'] ) { $title = $data['title']; } if ( $data['announcement'] ) { $announcement = $data['announcement']; } $date = fromMySQLDate( $date ); $announcements[] = array( "id" => $id, "date" => $date, "title" => $title, "urlfriendlytitle" => getModRewriteFriendlyString( $title ), "text" => $announcement ); } $smartyvalues['announcements'] = $announcements; $smartyvalues['seofriendlyurls'] = $CONFIG['SEOFriendlyUrls']; outputMAINtArea( $templatefile ); ?> the ("$templatefile = "content" line does the .tpl file loading which is fine the only problem is thatinstead of that "content" tpl file i need it to load this php file: /products.php?do=groups&groupid=2. So i figure if somehow I can get this php file to be included within the tpl file I could get it loading through there, unless there is a much direct way. thank you
  21. Hi I'm in a need of help here, I need to inluded this: "http://site.com/products.php?do=groups&groupid=2" in a a tpl file. Any way that this can be done? an example would be greatly appreciate it. cheers
  22. Thanks you for responding and yes I'm using mysql bu I have no clue as to how to add that field and most tutorials that i find are to add columns. Care to help with some instructions?
  23. I got some instructions by my developers to add a field to a table, and I have no clue how, these are instructions: " In mysql: add a field in the products table called "folder". It will be varchar(200) " can someone please explain to my less developed brain how to do this? Thanks
  24. I'm in need of a solution perhaps with javascript to pre cache my web page content. which is basically 8 swf files. I need these to load into the browser prior to the page being served. I understand that the best solution would be with preloders wthin the swf files themselves but I've been through this already with flash developers and this has not helped. I tested with an html code that reloads the page and that did the trick, but the problem was that the code went into an infinite loop reloading the page every time and I need a solution that reloads the page just ones, and I mean just reload and not refresh because I'm not looking for fresh content but the old content is what I need to stay in the cache. Any help would be appreciated. This issue is driving crazy. :-\
×
×
  • 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.