Jump to content

paresh15

New Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by paresh15

  1. The error : <b>Warning</b>:Illegal string offset 'order_coupon_id' in <b>mydomain.com\my_order.php</b> on line <b>146</b>
  2. Hi, Please help to resolve this script. Default time zone is not working properly it shows time only in AM (PM is not working) and in the INDIAN time 7:00pm to 7:00am table never fetch any content. <div class="cart"> <table width="100%" height="100%" cellspacing="0" cellpadding="10"> <tbody> <tr style="margin: 5px; padding-bottom: 5px; background-color:#ececec; line-height:30px"> <td style="width: 10%;"> <span> Sr. No. </span> </td> <td style="width: 15%;"> <span> Order Id </span> </td> <td style="width: 35%;"> <span> Order Date / Time </span> </td> <td style="width: 10%;"> <span> Amount </span> </td> <td style="width: 35%;"> <span> Coupon Name </span> </td> <td style="width: 10%;"> <span> Action </span> </td> </tr> <tr> <td colspan="5" height="10"></td> </tr> <?php date_default_timezone_set("Asia/Dili"); $session_user_id = $_SESSION['userId']; $ordercount=1; $current_date = date('Y-m-d'); $order_id = $_SESSION['new_order_id']; $query = "select * from cs_order where order_id = '$order_id'"; if(!($result = mysql_query($query))) { echo $query.mysql_error(); exit; } $order_items = mysql_fetch_array($result); $order_transaction_id = $order_items['order_transaction_id']; $order_transaction_date = $order_items['order_transaction_date']; $order_currency_id = explode(", ", $order_items['order_currency_id']); $order_amount = $order_items['order_amount']; $order_coupon_id = explode(", ", $order_items['order_coupon_id']); $new_order_currency_id = $order_currency_id[0]; if(strtotime(date('Y-m-d', strtotime($order_transaction_date)))==strtotime($current_date)) { ?> <tr> <td style="width: 10%;"> <span> <?=$ordercount; ?> </span> </td> <td style="width: 10%;"> <span> <?=$order_transaction_id; ?> </span> </td> <td style="width: 25%;"> <span> <?=date('d M Y / h:i a', strtotime($order_transaction_date)); ?> </span> </td> <td style="width: 10%;"> <span> <?=$new_order_currency_id; ?> <?=$order_amount; ?> </span> </td> <td style="width: 25%;"> <span> <?php $user_id = $_SESSION['userId']; $current_date = date('Y-m-d'); $order_id = $_SESSION['new_order_id']; $query = "select * from cs_order as ord left join cs_countries as country on ord.order_country = country.country_id left join cs_states as state on ord.order_state = state. state_id left join cs_cities as city on ord.order_city = city. city_id where ord.order_id = '$order_id' and ord.order_user_id = '$user_id' and ord.order_transaction_date like '$current_date %:%:%'"; if(!($result = mysql_query($query))) { echo $query.mysql_error(); exit; } $total_invoice_amount = 0; while($invoice = mysql_fetch_assoc($result)) { $invoice_record[] = $invoice; } ?> <?php echo $invoice_record[0]['order_coupon_name']; ?> </span> </td> <td style="width: 15%;" align="center"> <span> <form action="" method="post" name="formGetcode"> <?php foreach($order_coupon_id as $coup_id) { $checkout_couponid = $coup_id['order_coupon_id']; $checkoutquery = "select * from cs_coupons as coup left join cs_company as comp on coup.coupons_store = comp.retailer_id where coup.coupons_id = '$checkout_couponid'"; if(!($checkoutresult = mysql_query($checkoutquery))) { echo $checkoutquery.mysql_error(); exit; } $coupon = mysql_fetch_array($checkoutresult); $checkout_couponurl = $coupon['coupons_website']; $coup_type = $coupon['coupons_type']; ?> <?php if($coup_type=='R') { ?> <button class="submit button" type="button" onclick="getCodePopup(<?=$checkout_couponid; ?>, '<?=$checkout_couponurl; ?>');" style="font-size:11px;width:86px;">Get Code</button> <?php } else { ?> <button class="submit button" type="button" onclick="getPrintPopup(<?=$checkout_couponid; ?>);" style="font-size:11px;width:86px;">Print Coupon</button> <?php } } ?> </form> </span> </td> </tr> <?php $ordercount++; } ?> <tr> <td colspan="5" height="20"></td> </tr> </tbody> </table> </div> </div><!--cart container close here--> And <script type="text/javascript"> function getCodePopup(str1, str2) { var cid = str1; var curl = str2; window.open('getcouponcode.php?id=' +cid, 'open_window', ' width=540, height=480, left=0, top=0'); window.open(curl,'_blank'); } function getPrintPopup(str1) { var cid = str1; window.open('printCoupon.php?id=' +cid, 'open_window1', ' width=640, height=320, left=0, top=0'); } </script> Pop Up code not fetching Coupon ID after number 9. Please help me to solve this. Thanks. Paresh
  3. Hi, I am working on coupon script which generate coupon. The coupon script have two types, one is redemption and second one is printable in the same process it send sms to customer. But issue is when it send SMS, sometime SMS works nice and lots of time SMS content got missing. I could not understand why it happening. Is it scripting issue or another? The script code as below: ---------------------------------------------------------------------------------------------------------- //Send coupon code to customer by SMS $smsparameters = "select * from cs_options where option_id in ('23','24','25','26')"; if(!($smsparametersresult = mysql_query($smsparameters))) { echo $smsparameters.mysql_error(); exit; } while($smsparametersrow = mysql_fetch_array($smsparametersresult)) { $smsparametersarray[] = $smsparametersrow['option_value']; } define('SMS_SERVICE_URL', $smsparametersarray[0]); define('KEY', $smsparametersarray[1]); define('USERNAME', $smsparametersarray[2]); define('PASSWORD', $smsparametersarray[3]); $automationquery = "select * from cs_automation where automation_id='6'"; if(!($automationresult = mysql_query($automationquery))) { echo $automationquery.mysql_error(); exit; } $automationrow = mysql_fetch_array($automationresult); $automationrow['automation_value']; if($automationrow['automation_value']=='1') { $sms_order_id = $_SESSION['new_order_id']; $current_date = date('Y-m-d'); $smsquery = "select * from cs_order as ord left join cs_customer as cust on ord.order_user_id = cust.customer_id where ord.order_id = '$sms_order_id'"; if(!($smsresult = mysql_query($smsquery))) { echo $smsquery.mysql_error(); exit; } $sms_items = mysql_fetch_assoc($smsresult); $order_coupon_id4 = explode(", ", $customer_email_items['order_coupon_id']); foreach($order_coupon_id4 as $coup_id) { $coupon_id = $coup_id['order_coupon_id']; $query = "select * from cs_coupons as coup inner join cs_company as comp on coup.coupons_store = comp.retailer_id inner join cs_payments_currency as curr on coup.coupons_currency_id = curr.currency_id inner join cs_countries as cont on comp.country = cont.country_id inner join cs_states as stat on comp.state = stat.state_id inner join cs_cities as citi on comp.city = citi.city_id inner join cs_area as aria on comp.local_area = aria.area_id where coup.coupons_id = '$coupon_id'"; if(!($result = mysql_query($query))) { echo $query.mysql_error(); exit; } $coupon = mysql_fetch_array($result); $coup_name = $coupon['coupons_name']; $coup_code = $coupon['coupons_code']; $custdiscount = $coupon['coupons_product_discount']; $coup_valid_date = date("d-m-Y", strtotime($coupon['coupons_exp_date'])); $couponcodeforsms = $sms_items['order_coupon_code']; $couponcodeforsms1 = explode(", ", $sms_items['order_coupon_code']); $smscount = count($couponcodeforsms1); $mobilenoforsms = $sms_items['customer_mobile']; $custnameforsms = ucwords($sms_items['customer_fname']); $company_name = $coupon['company_name']; $company_address = $coupon['city_name']; $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "".SMS_SERVICE_URL."?user=".USERNAME."&password=".PASSWORD."&phone=".urlencode($mobilenoforsms)."&text=".urlencode('Hi '.$custnameforsms.', Coupon from CrackMyDeal : '.$coup_code.', '.$custdiscount.'% off on '.$coup_name.' at '.$company_name.', '.$company_address.', Valid till '.$coup_valid_date.'. T&C Apply.')."&type=t&senderid=".KEY.""); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); } } ---------------------------------------------------------------------------------------------------------------- The SMS which works nice: Hi Paresh, Coupon from CrackMyDeal : CRACKD2014, 20% off on WebHosting (Business) at Unique InfoTech, Kamothe, Valid till 31-12-2014. T&C Apply. -------------------------------------------------------------------------------------------------------------- And missing content SMS : Hi Paresh, Coupon from CrackMyDeal : , % off on at , , Valid till 01-01-1970. T&C Apply. -------------------------------------------------------------------------------------------------------------- Please help me to solve it. Thanks and regards Paresh 1402152754-pdfcoupon.pdf
×
×
  • 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.