Esempio n. 1
0
                ?>
</td>
						</tr>
						<tr>
							<td><span><?php 
                echo DEAL_CODE_TEXT;
                ?>
</span>: <?php 
                echo $transaction_obj->deal_coupon;
                ?>
</td>
							<td><span><?php 
                echo PAID_AMOUNT;
                ?>
</span>: <?php 
                echo get_currency_sym() . number_format($transaction_obj->payable_amt, 2);
                ?>
</td>
						</tr>
						<tr>
							<td><span><?php 
                echo PAYMENT_DATE;
                ?>
</span>: <?php 
                echo $transaction_obj->payment_date;
                ?>
</td>
							<td><span><?php 
                echo TRANSACTION_ID;
                ?>
</span>: <?php 
Esempio n. 2
0
<?php

get_header();
global $wpdb, $upload_folder_path, $transection_db_table_name, $last_postid, $is_login;
$select_transql = $wpdb->get_row("select * from {$transection_db_table_name} where trans_id = '" . $_GET['pid'] . "' ");
$is_login = $_REQUEST['is_login'];
$paymentmethod = $select_transql->payment_method;
$paid_amount = get_currency_sym() . number_format($select_transql->payable_amt, 2);
$redirect_url = get_post_meta($select_transql->post_id, 'thankyou_page_url', true);
$fromEmail = get_site_emailId();
$fromEmailName = get_site_emailName();
$paymentupdsql = "select option_value from {$wpdb->options} where option_name ='payment_method_" . $paymentmethod . "'";
$paymentupdinfo = $wpdb->get_results($paymentupdsql);
if ($paymentupdinfo) {
    foreach ($paymentupdinfo as $paymentupdinfoObj) {
        $option_value = unserialize($paymentupdinfoObj->option_value);
        $name = $option_value['name'];
        $option_value_str = serialize($option_value);
    }
}
if ($is_login == 'N') {
    $new_user = NEW_USER_SUCCESS;
}
$buyer_information = "<div style='line-height:30px;'>\n\t\t<div style='float:left;width:350px;'>\n\t\t<lable><strong>" . BILLING_NAME . "</strong></lable> : " . $select_transql->billing_name . "<br />\n\t\t<lable><strong>" . BILLING_ADDRESS . "</strong></lable> : " . $select_transql->billing_add . "<br />\n\t\t</div>\n\t\t<div style='float:left;'>\n\t\t<lable><strong>" . SHIPPING_NAME . "</strong></lable> : " . $select_transql->shipping_name . "<br />\n\t\t<lable><strong>" . SHIPPING_ADDRESS . "</strong></lable> : " . $select_transql->shipping_add . "<br />\n\t\t</div><div style='clear:both'>&nbsp;</div>\n\t\t<lable><strong>" . PAYMET_MODE . "</strong></lable> : " . $name . "<br />\n\t</div>";
if ($paymentmethod == 'prebanktransfer') {
    $filecontent = stripslashes(get_option('post_pre_bank_trasfer_msg_content'));
    if ($filecontent == "") {
        $filecontent = __('<p>Thanks you, your information has been successfully received.</p><p>Kindly transfer amount of <u>[#payable_amt#] </u> to our bank. Our bank account details are mentioned below.</p>
<p>Bank Name : [#bank_name#]</p><p>Account Number : [#account_number#]</p><br><p>Please include the following reference : [#submition_Id#]</p><h5 class="title">View your submitted information : </h5>' . $new_user . $buyer_information . '<br /><p>Thank you for visiting us at [#site_name#].</p>', 'templatic');
    }
} else {
Esempio n. 3
0
          <?php 
                echo CURRENT_PRICE;
                ?>
          </span> <strong><small><?php 
                echo get_currency_sym();
                ?>
</small><?php 
                echo $current_price;
                ?>
</strong></li>
        <li class="rate_our_price"><span>
          <?php 
                echo OUR_PRICE;
                ?>
          </span> <strong><small><?php 
                echo get_currency_sym();
                ?>
</small><?php 
                echo $our_price;
                ?>
</strong></li>
        <li class="rate_percentage"><span>
          <?php 
                echo YOU_SAVE;
                ?>
          </span> <strong><?php 
                echo @number_format($percentsave, 2);
                ?>
%</strong></li>
        <li class="bdr_none rate_item_sold"><span>
          <?php 
Esempio n. 4
0
function upcoming_transaction_dashboard_widget()
{
    $args = array('meta_key' => 'is_expired', 'meta_value' => '0', 'post_status' => 'publish', 'post_type' => CUSTOM_POST_TYPE1, 'orderby' => 'DESC');
    $live_posts = get_posts($args);
    if ($live_posts) {
        echo '<link href="' . get_template_directory_uri() . '/monetize/admin.css" rel="stylesheet" type="text/css" />';
        echo '<table class="widefat"  width="100%" >
			<thead>	
			<tr>
				<th valign="top" align="left">ID</th>
				<th valign="top" align="left">Deal Title</th>
				<th valign="top" align="left">Total Transaction</th>
				<th valign="top" align="left">Original Price</th>
				<th valign="top" align="left">Discounted Price</th>
				<th valign="top" align="left">Status</th>
			</tr>';
        foreach ($live_posts as $post) {
            if (get_post_meta($post->ID, 'status', true) == '1' || get_post_meta($post->ID, 'status', true) == '2') {
                $status = ifetch_status(get_post_meta($post->ID, 'status', true), get_post_meta($post->ID, 'is_expired', true));
                if ($status == 'Pending') {
                    $status_dis = "<span class='color_pending'>Pending</span>";
                } else {
                    if ($status == 'Expired') {
                        $status_dis = "<span class='color_expire'>Expired</span>";
                    } else {
                        if ($status == 'Accepted') {
                            $status_dis = "<span class='color_active'>Accepted</span>";
                        } else {
                            if ($status == 'Active') {
                                $status_dis = "<span class='color_active'>Active</span>";
                            } else {
                                if ($status == 'Rejected') {
                                    $status_dis = "<span class='color_reject'><strong>Rejected</strong></span>";
                                } else {
                                    $status_dis = "<span class='color_terminate'><strong>Terminated</strong></span>";
                                }
                            }
                        }
                    }
                }
                echo '<tr>
				<td valign="top" align="left">' . $post->ID . '</td>
				<td valign="top" align="left"><a href="' . site_url() . '/wp-admin/admin.php?page=report&deal_id=' . $post->ID . '#option_deal_report">' . $post->post_title . '</a></td>
				<td valign="top" align="left">' . deal_transaction($post->ID) . '</td>
				<td valign="top" align="left">' . get_currency_sym() . get_post_meta($post->ID, 'current_price', true) . '</td>
				<td valign="top" align="left">' . get_currency_sym() . get_post_meta($post->ID, 'our_price', true) . '</td>
				<td valign="top" align="left">' . $status_dis . '</td>';
            }
        }
        echo '</thead>	</table>';
    }
}
Esempio n. 5
0
    $coupon_address = $_SESSION['coupon_address'];
    if ($coupon_type == '1') {
        $coupon_type = 'Custom Link Deal';
    } elseif ($coupon_type == '2') {
        $coupon_type = 'Fixed Deal';
    } elseif ($coupon_type == '3') {
        $coupon_type = 'Custom Generated Deal';
    } elseif ($coupon_type == '4') {
        $coupon_type = 'Physical Barcode Deal';
    } elseif ($coupon_type == '5') {
        $coupon_type = 'Physical Product Deal';
    }
    if ($coupon_address != "") {
        $deal_detail = sprintf(__("\n\t\t\t<h5 class='title'>" . DEAL_DETAILS_TEXT . "</h5>\n\t\t\t<ul>\n\t\t\t<li><strong>" . DEAL_TITLE_TEXT . ": </strong>%s  \t</li>\n \t\t\t<li><strong>" . DEAL_CONTENT_TEXT . ":</strong> %s \t</li>\t\n \t\t\t<li><strong>" . NO_OF_ITEMS . ":</strong> %s \t</li>\t\n\t\t\t<li><strong>" . DEAL_TYPE . ":</strong> %s </li>\t\n\t\t\t<li><strong>" . DEAL_CPRICE_TEXT . ": </strong>%s </li>\t\n\t\t\t<li><strong>" . DEAL_YOUR_PRICE_TEXT . ": </strong>%s </li>\t\n\t\t\t<li><strong>" . STORE_ADDRESS . ": </strong>%s </li>\t\n\t\t</ul>\n\t\t\t", 'templatic'), $deal_title, $deal_desc, $no_of_coupon, get_currency_sym() . $current_price, get_currency_sym() . $our_price, $current_price, $coupon_address);
    } else {
        $deal_detail = sprintf(__("\n\t\t\t<h5 class='title'>" . DEAL_DETAILS_TEXT . "</h5>\n\t\t\t<ul>\n\t\t\t<li><strong>" . DEAL_TITLE_TEXT . ": </strong>%s  \t</li>\n \t\t\t<li><strong>" . DEAL_CONTENT_TEXT . ":</strong> %s \t</li>\t\n \t\t\t<li><strong>" . NO_OF_ITEMS . ":</strong> %s \t</li>\t\n\t\t\t<li><strong>" . DEAL_TYPE . ":</strong> %s </li>\t\n\t\t\t<li><strong>" . DEAL_CPRICE_TEXT . ": </strong>%s </li>\t\n\t\t\t<li><strong>" . DEAL_YOUR_PRICE_TEXT . ": </strong>%s </li>\t\n\t\t</ul>\n\t\t\t", 'templatic'), $deal_title, $deal_desc, $no_of_coupon, $coupon_type, get_currency_sym() . $current_price, get_currency_sym() . $our_price);
    }
    // End All Transection Details With Deal
    ?>
<div class="post-content">
<div ><?php 
    if ($current_user->data->ID == "") {
        $fromEmail = get_site_emailId();
        $site_name = get_option('blogname');
        $search_array = array('[#user_email#]', '[#admin_email#]', '[#blog_name#]', '[#deal_detail#]');
        $replace_array = array($_SESSION['owner_email'], $fromEmail, $site_name, $deal_detail);
        $filecontent = str_replace($search_array, $replace_array, SUCCESS_NEW_USER_DEAL);
        _e($filecontent, 'templatic');
    } else {
        $fromEmail = get_site_emailId();
        $site_name = get_option('blogname');
Esempio n. 6
0
</span><span>: <?php 
        echo get_post_meta($total_deals_obj->ID, 'no_of_coupon', true);
        ?>
</span></li>
								<li><span class="field"><?php 
        echo DEAL_CPRICE_TEXT;
        ?>
</span><span>:  <?php 
        echo get_currency_sym() . get_post_meta($total_deals_obj->ID, 'current_price', true);
        ?>
</span></li>
								<li><span class="field"><?php 
        echo DEAL_PRICE_TEXT;
        ?>
</span><span>: <?php 
        echo get_currency_sym() . get_post_meta($total_deals_obj->ID, 'our_price', true);
        ?>
</span></li>		
							</ul>
							<p class="deallistinglinks">
								<span class="link"><?php 
        echo DEAL_WEBLINK_TEXT;
        ?>
 : <a href="<?php 
        echo get_post_meta($total_deals_obj->ID, 'coupon_website', true);
        ?>
" title="<?php 
        echo $total_deals_obj->coupon_website;
        ?>
" target="_blank"><?php 
        echo get_post_meta($total_deals_obj->ID, 'coupon_website', true);
Esempio n. 7
0
    function widget($args, $instance)
    {
        // prints the widget
        extract($args, EXTR_SKIP);
        $title = empty($instance['title']) ? '&nbsp;' : apply_filters('widget_title', $instance['title']);
        $category = empty($instance['category']) ? '' : apply_filters('widget_category', $instance['category']);
        $post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']);
        $user_db_table_name = get_user_table();
        $status_deal = empty($instance['status_deal']) ? '' : apply_filters('widget_status_deal', $instance['status_deal']);
        ?>
		<h3 class="deal_widget_title"><?php 
        _e($title, 'templatic');
        ?>
 <small> ( <a href="<?php 
        echo site_url();
        ?>
/?ptype=taxonomy_all_deal_tab" class="b_viewalldeal"><?php 
        _e(VIEW_ALL_DEAL, 'templatic');
        ?>
</a> ) </small> </h3>
		<span class="flip_postion"></span>
		<div class="deals_widget">
  <!-- BOF Loop -->
			<?php 
        templ_page_title_above();
        //page title above action hook
        ?>
			<?php 
        $destination_path = site_url() . '/wp-content/uploads/';
        ?>
			<script type="text/javascript" src="<?php 
        bloginfo('template_directory');
        ?>
/js/timer.js"></script>
 <?php 
        global $wp_query, $post, $wpdb;
        $current_term = $wp_query->get_queried_object();
        if ($current_term->name) {
            $ptitle = $current_term->name;
        }
        ?>
			<div id="loop" class="<?php 
        if (get_option('ptttheme_view_opt') == 'Grid View') {
            echo 'grid';
        } else {
            echo 'list clear';
        }
        ?>
 ">
    <!-- BOF All Deal -->
<?php 
        global $wpdb, $transection_db_table_name;
        $targetpage = site_url("?ptype=deals");
        $postmeta_db_table_name = $wpdb->prefix . "postmeta";
        $post_db_table_name = $wpdb->prefix . "posts";
        $total_deals = mysql_query("select p.* from {$post_db_table_name} p where p.post_type = 'seller' and p.post_status = 'publish' ");
        $total_pages = mysql_num_rows($total_deals);
        $recordsperpage = $post_number;
        $pagination = $_REQUEST['pagination'];
        if ($pagination == '') {
            $pagination = 1;
        }
        $strtlimit = ($pagination - 1) * $recordsperpage;
        $endlimit = $strtlimit + $recordsperpage;
        if ($category) {
            $category = "'" . str_replace(",", "','", $category) . "'";
            $sqlsql = " and p.ID in (select tr.object_id from {$wpdb->term_relationships} tr join {$wpdb->term_taxonomy} t on t.term_taxonomy_id=tr.term_taxonomy_id where t.term_id in ({$category})  )";
        }
        $dealcnt_sql = $wpdb->get_results("select p.* from {$post_db_table_name} p where p.post_type = 'seller' and p.post_status = 'publish' {$sqlsql} ORDER BY ID DESC  limit {$strtlimit},{$recordsperpage} ");
        if (count($dealcnt_sql) > 0) {
            $pcount = 0;
            foreach ($dealcnt_sql as $post) {
                if ($status_deal == 'all') {
                    $expired = get_post_meta($post->ID, 'is_expired', true) == '1' || get_post_meta($post->ID, 'is_expired', true) == '0';
                } else {
                    $expired = get_post_meta($post->ID, 'is_expired', true) == '0';
                }
                if ($status_deal == 'all') {
                    $pcount++;
                    if (get_post_meta($post->ID, 'enddate', true) != '0') {
                        deal_expire_process($post->ID);
                    }
                    $coupon_website = get_post_meta($post->ID, 'coupon_website', true);
                    $owner_name = get_post_meta($post->ID, 'owner_name', true);
                    $our_price = get_post_meta($post->ID, 'our_price', true);
                    $current_price = get_post_meta($post->ID, 'current_price', true);
                    $sellsql = "select count(*) from {$transection_db_table_name} where post_id=" . $post->ID . " and status=1";
                    $totdiff = $current_price - $our_price;
                    $percent = $totdiff * 100;
                    $percentsave = $percent / $current_price;
                    $sellsqlinfo = $wpdb->get_var($sellsql);
                    if (get_post_meta($post->ID, 'enddate', true) != '0') {
                        if (get_post_meta($post->ID, 'coupon_end_date_time', true) != "") {
                            $date = get_post_meta($post->ID, 'coupon_end_date_time', true);
                            $tardate = date("F d, Y H:i:s", get_post_meta($post->ID, 'coupon_end_date_time', true));
                            $targatedate = date("d-m-y H:i:s", get_post_meta($post->ID, 'coupon_end_date_time', true));
                            $tardate1 = date("F d, Y", get_post_meta($post->ID, 'coupon_end_date_time', true));
                            $enddate1 = date("Y-m-d H:i:s", get_post_meta($post->ID, 'coupon_end_date_time', true));
                            if (date("Y-m-d H:i:s") >= $enddate1 && get_post_meta($post->ID, 'enddate', true) != '0') {
                                if (get_post_meta($post->ID, 'is_expired', true) == '0' || get_post_meta($post->ID, 'is_expired', true) == '') {
                                    update_post_meta($post->ID, 'is_expired', '1');
                                }
                            }
                        } else {
                            if (get_post_meta($post->ID, 'enddate', true) != '0' && get_post_meta($post->ID, 'no_of_coupon', true) == $sellsqlinfo) {
                                if (get_post_meta($post->ID, 'is_expired', true) == '0' || get_post_meta($post->ID, 'is_expired', true) == '') {
                                    update_post_meta($post->ID, 'is_expired', '1');
                                }
                            }
                        }
                    }
                    $stdate = date("F d, Y H:i:s", get_post_meta($post->ID, 'coupon_start_date_time', true));
                    $no_of_coupon = get_post_meta($post->ID, 'no_of_coupon', true);
                    ?>
					<div <?php 
                    post_class('post posts_deals');
                    ?>
 id="post_<?php 
                    the_ID();
                    ?>
" >
						<div class="product_image "> <a href="<?php 
                    the_permalink();
                    ?>
">
<?php 
                    if (get_post_meta($post->ID, 'file_name', true) != "") {
                        ?>
								<img src="<?php 
                        echo templ_thumbimage_filter(get_post_meta($post->ID, 'file_name', true), 260, 180);
                        ?>
" alt="" />
<?php 
                    } else {
                        ?>
								<img src="<?php 
                        echo get_template_directory_uri() . "/images/no-image.png";
                        ?>
" width="260" height="180" alt="" />
<?php 
                    }
                    ?>
						</a></div>
						<div class="product_image grid_img"> <a href="<?php 
                    the_permalink();
                    ?>
">
<?php 
                    if (get_post_meta($post->ID, 'file_name', true) != "") {
                        ?>
								<img src="<?php 
                        echo templ_thumbimage_filter(get_post_meta($post->ID, 'file_name', true), 280, 180);
                        ?>
" alt="" />
<?php 
                    } else {
                        ?>
									<div class="noimg"><?php 
                        _e('Image <br />not available', 'templatic');
                        ?>
</div>
<?php 
                    }
                    ?>
						</a> </div>
						<div class="content_right content_right_inner"><span class="title_grey"><?php 
                    _e(PROVIDE_BY, 'templatic');
                    ?>
</span>
<?php 
                    $user_db_table_name = get_user_table();
                    $user_data = $wpdb->get_row("select * from {$user_db_table_name} where ID = '" . $post->post_author . "'");
                    ?>
							<a href="<?php 
                    echo get_author_posts_url($post->post_author);
                    ?>
" class="top_lnk" title="<?php 
                    echo $user_data->display_name;
                    ?>
"><?php 
                    echo get_post_meta($post->ID, 'owner_name', true);
                    ?>
</a>
							<h3><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    echo $post->post_title;
                    ?>
</a></h3>
							<div class="grid_price"><span class="strike_rate"><?php 
                    _e('Our Price :', 'templatic');
                    ?>
 <s><?php 
                    echo get_currency_sym();
                    echo $current_price;
                    ?>
</s></span> <span class="rate"><?php 
                    _e('Offer Price :', 'templatic');
                    ?>
 <?php 
                    echo get_currency_sym();
                    echo $our_price;
                    ?>
</span> </div>
							<?php 
                    if (date("Y-m-d H:i:s") >= $enddate1 || strtotime($stdate) >= strtotime($tardate) || get_post_meta($post->ID, 'no_of_coupon', true) == $sellsqlinfo) {
                        if (get_post_meta($post->ID, 'is_expired', true) == '1') {
                            ?>
									<div class="i_expire"><?php 
                            echo THIS_DEAL;
                            ?>
<span><?php 
                            echo EXPIRED;
                            ?>
</span> <?php 
                            echo ON;
                            ?>
 <span><?php 
                            echo $tardate1;
                            ?>
</span></div>
<?php 
                        }
                        if (get_post_meta($post->ID, 'no_of_coupon', true) == $sellsqlinfo && get_post_meta($post->ID, 'is_expired', true) != '1') {
                            ?>
					<div class="i_start"><span><?php 
                            echo "Is Sold Out";
                            ?>
</span></div>
					<?php 
                        }
                    } else {
                        if (get_post_meta($post->ID, 'coupon_end_date_time', true)) {
                            ?>
									<div class="deal_time_box">
										<div class="time_line"> </div>
											<div id="countdowncontainer_<?php 
                            _e($post->ID, 'templatic');
                            ?>
"></div>
											<div class="fr" id="fr_<?php 
                            echo $post->ID;
                            ?>
">
												<div class="price_main"> <span class="strike_rate"><?php 
                            echo get_currency_sym();
                            echo $current_price;
                            ?>
</span> <span class="rate"><?php 
                            echo get_currency_sym();
                            echo $our_price;
                            ?>
</span> </div>
												<?php 
                            if (get_post_meta($post->ID, 'coupon_type', true) == 1) {
                                ?>
												<a href="<?php 
                                echo get_post_meta($post->ID, 'coupon_link', true);
                                ?>
" title="<?php 
                                echo BUY_NOW;
                                ?>
" class="btn_buy" target="_blank"><?php 
                                echo BUY_NOW;
                                ?>
</a>
												<?php 
                            } else {
                                ?>
												<a href="<?php 
                                echo get_option('siteurl');
                                ?>
/?ptype=buydeal&amp;did=<?php 
                                _e($post->ID, 'templatic');
                                ?>
" title="<?php 
                                echo BUY_NOW;
                                ?>
" class="btn_buy"><?php 
                                echo BUY_NOW;
                                ?>
</a>
												<?php 
                            }
                            ?>
											</div>
											<?php 
                            $targatedate = explode(' ', $targatedate);
                            $tar_date = explode('-', $targatedate[0]);
                            $tar_time = explode(':', $targatedate[1]);
                            $timezone = get_option('ptthemes_time_offset');
                            $exp_year = explode(',', $tardate1);
                            ?>
											<script>
											displayTZCountDown(setTZCountDown('<?php 
                            echo $tar_date[1];
                            ?>
','<?php 
                            echo $tar_date[0];
                            ?>
','<?php 
                            echo $tar_time[0];
                            ?>
','<?php 
                            echo $timezone;
                            ?>
','<?php 
                            echo $exp_year[1];
                            ?>
'),'countdowncontainer_<?php 
                            _e($post->ID, 'templatic');
                            ?>
','fr_<?php 
                            echo $post->ID;
                            ?>
','<?php 
                            echo $tardate1;
                            ?>
');
											</script>
									</div>
<?php 
                        }
                    }
                    ?>
							<ul class="rate_summery">
								<li class="rate_current_price"><span><?php 
                    echo CURRENT_PRICE;
                    ?>
</span> <strong><small><?php 
                    echo get_currency_sym();
                    ?>
</small><?php 
                    echo $current_price;
                    ?>
</strong></li>
								<li class="rate_our_price"><span><?php 
                    echo OUR_PRICE;
                    ?>
</span> <strong><small><?php 
                    echo get_currency_sym();
                    ?>
</small><?php 
                    echo $our_price;
                    ?>
</strong></li>
								<li class="rate_percentage"><span><?php 
                    echo YOU_SAVE;
                    ?>
</span> <strong><?php 
                    echo @number_format($percentsave, 2);
                    ?>
%</strong></li>
								<li class="bdr_none rate_item_sold"><span><?php 
                    echo ITEMS_SOLD;
                    ?>
</span> <strong><?php 
                    echo $sellsqlinfo;
                    ?>
</strong>
							</ul>
<?php 
                    $post_categories = wp_get_post_terms($post->ID, 'seller_category');
                    if ($post_categories[1] != "") {
                        ?>
								<div class="post_cats clearfix">
<?php 
                        the_taxonomies(array('before' => '<span class="categories">', 'sep' => '</span><span class="tags">', 'after' => '</span>'));
                        ?>
								</div>
<?php 
                    }
                    if (get_post_meta($post->ID, 'enddate', true) == '0' && get_option('ptttheme_view_opt') != 'Grid View' && get_post_meta($post->ID, 'status', true) == '1') {
                        ?>
		<?php 
                        if (get_post_meta($post->ID, 'coupon_type', true) == 1) {
                            ?>
						<a href="<?php 
                            echo get_post_meta($post->ID, 'coupon_link', true);
                            ?>
" title="<?php 
                            echo BUY_NOW;
                            ?>
" class="btn_buy_deal" target="_blank"><?php 
                            echo BUY_NOW;
                            ?>
</a>
		<?php 
                        } else {
                            ?>
						<a href="<?php 
                            echo get_option('siteurl');
                            ?>
/?ptype=buydeal&amp;did=<?php 
                            _e($post->ID, 'templatic');
                            ?>
" title="<?php 
                            echo BUY_NOW;
                            ?>
" class="btn_buy_deal"><?php 
                            echo BUY_NOW;
                            ?>
</a>
		<?php 
                        }
                    }
                    if (get_post_meta($post->ID, 'is_expired', true) != 1 && get_option('ptttheme_view_opt') == 'Grid View') {
                        if (get_post_meta($post->ID, 'coupon_type', true) == 1) {
                            ?>
								 <a href="<?php 
                            echo get_post_meta($post->ID, 'coupon_link', true);
                            ?>
" title="<?php 
                            echo BUY_NOW;
                            ?>
" class="btn_buy_grid"><?php 
                            echo BUY_NOW;
                            ?>
</a>
								
<?php 
                        } else {
                            ?>
								<a href="<?php 
                            echo get_option('siteurl');
                            ?>
/?ptype=buydeal&amp;did=<?php 
                            _e($post->ID, 'templatic');
                            ?>
" title="<?php 
                            echo BUY_NOW;
                            ?>
" class="btn_buy_grid"><?php 
                            echo BUY_NOW;
                            ?>
</a>
<?php 
                        }
                    }
                    ?>
							<div class="text_content"  id="content_<?php 
                    _e($post->ID, 'templatic');
                    ?>
"><?php 
                    echo "" . $post->post_excerpt . "";
                    ?>
<a href="<?php 
                    the_permalink();
                    ?>
" class="readmore_link"><?php 
                    _e(get_option('ptthemes_content_excerpt_readmore'));
                    ?>
</a></div>
						</div>
					</div>
<?php 
                    $page_layout = templ_get_page_layout();
                    if ($pcount == 3) {
                        $pcount = 0;
                        ?>
						<div class="hr clear"></div>
<?php 
                    }
                } else {
                    if (get_post_meta($post->ID, 'is_expired', true) != 1) {
                        $pcount++;
                        if (get_post_meta($post->ID, 'enddate', true) != '0') {
                            deal_expire_process($post->ID);
                        }
                        $coupon_website = get_post_meta($post->ID, 'coupon_website', true);
                        $owner_name = get_post_meta($post->ID, 'owner_name', true);
                        $our_price = get_post_meta($post->ID, 'our_price', true);
                        $current_price = get_post_meta($post->ID, 'current_price', true);
                        $sellsql = "select count(*) from {$transection_db_table_name} where post_id=" . $post->ID . " and status=1";
                        $totdiff = $current_price - $our_price;
                        $percent = $totdiff * 100;
                        $recordsperpage = $post_number;
                        $percentsave = $percent / $current_price;
                        $sellsqlinfo = $wpdb->get_var($sellsql);
                        if (get_post_meta($post->ID, 'enddate', true) != '0') {
                            if (get_post_meta($post->ID, 'coupon_end_date_time', true) != "") {
                                $date = get_post_meta($post->ID, 'coupon_end_date_time', true);
                                $tardate = date("F d, Y H:i:s", get_post_meta($post->ID, 'coupon_end_date_time', true));
                                $targatedate = date("d-m-y H:i:s", get_post_meta($post->ID, 'coupon_end_date_time', true));
                                $tardate1 = date("F d, Y", get_post_meta($post->ID, 'coupon_end_date_time', true));
                                $enddate1 = date("Y-m-d H:i:s", get_post_meta($post->ID, 'coupon_end_date_time', true));
                                if (date("Y-m-d H:i:s") >= $enddate1 && get_post_meta($post->ID, 'enddate', true) != '0') {
                                    if (get_post_meta($post->ID, 'is_expired', true) == '0' || get_post_meta($post->ID, 'is_expired', true) == '') {
                                        update_post_meta($post->ID, 'is_expired', '1');
                                    }
                                }
                            } else {
                                if (get_post_meta($post->ID, 'enddate', true) != '0' && get_post_meta($post->ID, 'no_of_coupon', true) == $sellsqlinfo) {
                                    if (get_post_meta($post->ID, 'is_expired', true) == '0' || get_post_meta($post->ID, 'is_expired', true) == '') {
                                        update_post_meta($post->ID, 'is_expired', '1');
                                    }
                                }
                            }
                        }
                        $stdate = date("F d, Y H:i:s", get_post_meta($post->ID, 'coupon_start_date_time', true));
                        $no_of_coupon = get_post_meta($post->ID, 'no_of_coupon', true);
                        ?>
						<div <?php 
                        post_class('post posts_deals');
                        ?>
 id="post_<?php 
                        the_ID();
                        ?>
" >
							<div class="product_image "> <a href="<?php 
                        the_permalink();
                        ?>
">
<?php 
                        if (get_post_meta($post->ID, 'file_name', true) != "") {
                            ?>
									<img src="<?php 
                            echo templ_thumbimage_filter(get_post_meta($post->ID, 'file_name', true), 260, 180);
                            ?>
" alt="" />
<?php 
                        } else {
                            ?>
									<img src="<?php 
                            echo get_template_directory_uri() . "/images/no-image.png";
                            ?>
" width="260" height="180" alt="" />
<?php 
                        }
                        ?>
							</a> </div>
							<div class="product_image grid_img"> <a href="<?php 
                        the_permalink();
                        ?>
">
<?php 
                        if (get_post_meta($post->ID, 'file_name', true) != "") {
                            ?>
									<img src="<?php 
                            echo templ_thumbimage_filter(get_post_meta($post->ID, 'file_name', true), 280, 180);
                            ?>
" alt="" />
<?php 
                        } else {
                            ?>
									<div class="noimg"> <?php 
                            _e('Image <br /> not available', 'templatic');
                            ?>
</div>
<?php 
                        }
                        ?>
							</a> </div>
							<div class="content_right content_right_inner"><?php 
                        if (get_option('ptthemes_listing_author') != 'No') {
                            ?>
        
                   <span class="title_grey"><?php 
                            echo PROVIDE_BY;
                            ?>
 </span>
					<?php 
                            $user_db_table_name = get_user_table();
                            $user_data = $wpdb->get_row("select * from {$user_db_table_name} where ID = '" . $post->post_author . "'");
                            ?>
					
					<a href="<?php 
                            echo get_author_posts_url($post->post_author);
                            ?>
" class="top_lnk" title="<?php 
                            echo $user_data->display_name;
                            ?>
"><?php 
                            echo get_post_meta($post->ID, 'owner_name', true);
                            ?>
</a>
					<?php 
                        }
                        ?>
								<h3><a href="<?php 
                        the_permalink();
                        ?>
"><?php 
                        echo $post->post_title;
                        ?>
</a></h3>
								<div class="grid_price"><span class="strike_rate"><?php 
                        _e(OUR_PRICES, 'templatic');
                        ?>
<s><?php 
                        echo get_currency_sym();
                        echo $current_price;
                        ?>
</s></span> <span class="rate"><?php 
                        _e(OFFER_PRICE, 'templatic');
                        ?>
 <?php 
                        echo get_currency_sym();
                        echo $our_price;
                        ?>
</span>
							</div>
<?php 
                        if (get_post_meta($post->ID, 'enddate', true) != '0' || get_post_meta($post->ID, 'no_of_coupon', true) == $sellsqlinfo) {
                            if (date("Y-m-d H:i:s") >= $enddate1 || get_post_meta($post->ID, 'no_of_coupon', true) == $sellsqlinfo) {
                                if (get_post_meta($post->ID, 'is_expired', true) == '1') {
                                    if (get_post_meta($post->ID, 'is_expired', true) == '0') {
                                        update_post_meta($post->ID, 'is_expired', '1');
                                    }
                                    ?>
									<div class="i_expire"><?php 
                                    echo THIS_DEAL;
                                    ?>
<span><?php 
                                    echo EXPIRED;
                                    ?>
</span> <?php 
                                    echo ON;
                                    ?>
 <span><?php 
                                    echo $tardate1;
                                    ?>
</span></div>
<?php 
                                }
                                if (get_post_meta($post->ID, 'no_of_coupon', true) == $sellsqlinfo && get_post_meta($post->ID, 'is_expired', true) != '1') {
                                    ?>
					<div class="i_start"><span><?php 
                                    echo "Is Sold Out";
                                    ?>
</span></div>
					<?php 
                                }
                            } else {
                                if (get_post_meta($post->ID, 'coupon_end_date_time', true)) {
                                    ?>
									<div class="deal_time_box">
										<div class="time_line"> </div>
										<div id="countdowncontainer_<?php 
                                    _e($post->ID, 'templatic');
                                    ?>
"></div>
										
										<div class="fr" id="fr_<?php 
                                    echo $post->ID;
                                    ?>
">
											<div class="price_main"> <span class="strike_rate"><?php 
                                    echo get_currency_sym();
                                    echo $current_price;
                                    ?>
</span> <span class="rate"><?php 
                                    echo get_currency_sym();
                                    echo $our_price;
                                    ?>
</span> </div>
<?php 
                                    if (get_post_meta($post->ID, 'coupon_type', true) == 1) {
                                        ?>
												<a href="<?php 
                                        echo get_post_meta($post->ID, 'coupon_link', true);
                                        ?>
" title="<?php 
                                        _e(BUY_NOW, 'templatic');
                                        ?>
" class="btn_buy" target="_blank"><?php 
                                        _e(BUY_NOW, 'templatic');
                                        ?>
</a>
<?php 
                                    } else {
                                        ?>
												<a href="<?php 
                                        echo get_option('siteurl');
                                        ?>
/?ptype=buydeal&amp;did=<?php 
                                        _e($post->ID, 'templatic');
                                        ?>
" title="<?php 
                                        _e(BUY_NOW, 'templatic');
                                        ?>
" class="btn_buy"><?php 
                                        _e(BUY_NOW, 'templatic');
                                        ?>
</a>
<?php 
                                    }
                                    ?>
										</div>
										 <?php 
                                    $targatedate = explode(' ', $targatedate);
                                    $tar_date = explode('-', $targatedate[0]);
                                    $tar_time = explode(':', $targatedate[1]);
                                    $timezone = get_option('ptthemes_time_offset');
                                    $exp_year = explode(',', $tardate1);
                                    ?>
											<script>
											displayTZCountDown(setTZCountDown('<?php 
                                    echo $tar_date[1];
                                    ?>
','<?php 
                                    echo $tar_date[0];
                                    ?>
','<?php 
                                    echo $tar_time[0];
                                    ?>
','<?php 
                                    echo $timezone;
                                    ?>
','<?php 
                                    echo $exp_year[1];
                                    ?>
'),'countdowncontainer_<?php 
                                    _e($post->ID, 'templatic');
                                    ?>
','fr_<?php 
                                    echo $post->ID;
                                    ?>
','<?php 
                                    echo $tardate1;
                                    ?>
');
											</script>
									</div>
<?php 
                                }
                            }
                        }
                        ?>
        <ul class="rate_summery">
          <li class="rate_current_price"><span>
            <?php 
                        echo CURRENT_PRICE;
                        ?>
            </span> <strong><small><?php 
                        echo get_currency_sym();
                        ?>
</small><?php 
                        echo $current_price;
                        ?>
</strong></li>
          <li class="rate_our_price"><span>
            <?php 
                        echo OUR_PRICE;
                        ?>
            </span> <strong><small><?php 
                        echo get_currency_sym();
                        ?>
</small><?php 
                        echo $our_price;
                        ?>
</strong></li>
          <li class="rate_percentage"><span>
            <?php 
                        echo YOU_SAVE;
                        ?>
            </span> <strong><?php 
                        echo @number_format($percentsave, 2);
                        ?>
%</strong></li>
          <li class="bdr_none rate_item_sold"><span>
            <?php 
                        echo ITEMS_SOLD;
                        ?>
            </span> <strong><?php 
                        echo $sellsqlinfo;
                        ?>
</strong> </li>
        </ul>
        <?php 
                        if (templ_is_show_post_category()) {
                            ?>
        <div class="post_cats clearfix">
          <?php 
                            the_taxonomies(array('before' => '<span class="categories">', 'sep' => '</span><span class="tags">', 'after' => '</span>'));
                            ?>
        </div>
        <?php 
                        }
                        ?>
		<?php 
                        if (get_post_meta($post->ID, 'enddate', true) == '0' && get_option('ptttheme_view_opt') != 'Grid View' && get_post_meta($post->ID, 'status', true) == '1' && get_post_meta($post->ID, 'is_expired', true) == '0') {
                            ?>
		<?php 
                            if (get_post_meta($post->ID, 'coupon_type', true) == 1) {
                                ?>
						<a href="<?php 
                                echo get_post_meta($post->ID, 'coupon_link', true);
                                ?>
" title="<?php 
                                echo BUY_NOW;
                                ?>
" class="btn_buy_deal" target="_blank"><?php 
                                echo BUY_NOW;
                                ?>
</a>
		<?php 
                            } else {
                                ?>
						<a href="<?php 
                                echo get_option('siteurl');
                                ?>
/?ptype=buydeal&amp;did=<?php 
                                _e($post->ID, 'templatic');
                                ?>
" title="<?php 
                                echo BUY_NOW;
                                ?>
" class="btn_buy_deal"><?php 
                                echo BUY_NOW;
                                ?>
</a>
		<?php 
                            }
                        }
                        ?>
        <?php 
                        if (get_post_meta($post->ID, 'is_expired', true) != 1) {
                            if (get_post_meta($post->ID, 'coupon_type', true) == 1) {
                                ?>
        <a href="<?php 
                                echo get_post_meta($post->ID, 'coupon_link', true);
                                ?>
" onclick="" title="<?php 
                                echo BUY_NOW;
                                ?>
" class="btn_buy_grid"><?php 
                                echo BUY_NOW;
                                ?>
</a>
        <?php 
                            } else {
                                ?>
				 <a href="<?php 
                                echo get_option('siteurl');
                                ?>
/?ptype=buydeal&amp;did=<?php 
                                _e($post->ID, 'templatic');
                                ?>
" title="<?php 
                                echo BUY_NOW;
                                ?>
" class="btn_buy_grid"><?php 
                                echo BUY_NOW;
                                ?>
</a>
		<?php 
                            }
                        }
                        ?>
        <div class="text_content"  id="content_<?php 
                        _e($post->ID, 'templatic');
                        ?>
">
          <?php 
                        echo "" . $post->post_excerpt . "";
                        ?>
          <a href="<?php 
                        the_permalink();
                        ?>
" class="readmore_link">
          <?php 
                        _e(get_option('ptthemes_content_excerpt_readmore'));
                        ?>
          </a> </div>
      </div>
    </div>
    <?php 
                        $page_layout = templ_get_page_layout();
                        if ($pcount == 3) {
                            $pcount = 0;
                            ?>
    <div class="hr clear"></div>
 <?php 
                        }
                    }
                }
            }
        }
        ?>
    <!-- EOF All Deal -->
  </div>
</div>
<!--  CONTENT AREA END -->
<?php 
    }
Esempio n. 8
0
function get_property_price($postid)
{
    if (get_post_meta($postid, 'price', true) && get_post_meta($postid, 'price', true) > 0) {
        //return get_currency_sym().number_format(get_post_meta($postid,'price',true));
        return get_currency_sym() . get_post_meta($postid, 'price', true);
    }
}
Esempio n. 9
0
 :</strong><br /> <?php 
            echo $transaction_childdeal->shipping_add;
            ?>
 
		<?php 
        } else {
            echo get_post_meta($transaction_childdeal->post_id, 'voucher_text', true);
        }
    }
    ?>
</p>
		<p class="deal_paid"><?php 
    echo PAID_AMOUNT;
    ?>
 <span class="amount"><?php 
    echo get_currency_sym() . number_format($transaction_childdeal->payable_amt, 2);
    ?>
</span></p>
		<p class="coupon_expire"><?php 
    if (get_post_meta($transaction_childdeal->post_id, 'coupon_end_date_time', true) != '') {
        //echo EXPIRE_ON.date("F d,Y H:i:s",get_post_meta($transaction_childdeal->post_id,'coupon_end_date_time',true));
    } else {
        //echo START_FROM.date("F d,Y H:i:s",get_post_meta($transaction_childdeal->post_id,'coupon_start_date_time',true));
    }
    ?>
</p>
		 <center><?php 
    if (get_post_meta($transaction_childdeal->post_id, 'coupon_type', true) == '4' && get_option(ptttheme_google_map_opt) == 'Enable' && get_option('pttheme_google_map_api') != '') {
        $geo_longitude = get_post_meta($transaction_childdeal->post_id, 'geo_longitude', true);
        $geo_latitude = get_post_meta($transaction_childdeal->post_id, 'geo_latitude', true);
        $shipping_address = get_post_meta($transaction_childdeal->post_id, 'shhiping_address', true);
Esempio n. 10
0
function seller_accept_deal($deal_id)
{
    global $wpdb;
    /*-------Fetch Email details --------*/
    $email_table = $wpdb->prefix . "email_setup";
    $email_data = $wpdb->get_row("select * from {$email_table} where eid='1412'");
    /*-------Fetch Seller data--------*/
    $deal_table = $wpdb->prefix . "deal_entry";
    $deal_id = '5';
    $deal_data = $wpdb->get_row("select * from {$deal_table} where deal_id='" . $deal_id . "'");
    /*-------Fetch LOgin data--------*/
    $user_table = $wpdb->prefix . "users";
    $user_name = $deal_data->owner_name;
    $user = $wpdb->get_row("select * from {$user_table} where user_login='******'");
    $to_name = $deal_data->owner_name;
    $to_email = $deal_data->owner_email;
    $start_date = htmlspecialchars_decode(date('F d,Y H:i:s', $deal_data->coupon_start_date_time));
    $end_date = htmlspecialchars_decode(date('F d,Y H:i:s', $deal_data->coupon_end_date_time));
    $deal_details = "<b>Title : </b>" . $deal_data->post_title . "<br/><br/>" . "<b>Duration : </b>" . $start_date . " to " . $end_date . "<br/><br/>" . "<b>Your price : </b>" . get_currency_sym() . $deal_data->our_price . "<br/><br/>" . "<b>Current price : </b>" . get_currency_sym() . $deal_data->current_price . "<br/><br/>" . "<b>Total Items :</b>" . $deal_data->no_of_coupon . "<br/><br/><b>Coupon code :</b>" . $deal_data->coupon_code;
    $login_details = "<b>Seller details</b><br/>" . "<b>User name :</b>" . $user->user_login . "<br/><b>Email :</b>" . $user->user_email;
    $senderemail = $email_data->senderemail;
    $sendersub = $email_data->seller_deal_accept_sub;
    $sendercontent = $email_data->seller_deal_accept_content;
    $smessage1 = str_replace("[#to_name#]", $to_name . ",", $sendercontent);
    $smessage2 = str_replace("[#deal_details#]", $deal_details, $smessage1);
    $smessage3 = str_replace("[#site_name#]", "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'], $smessage2);
    $seller_message = str_replace("[#seller_details#]", $login_details, $smessage3);
    $headers = "From :" . $senderemail . "\r\n";
    $headers .= "MIME-Version: 1.0" . "\r\n";
    $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
    $mail_success = @mail($to_email, $sendersub, $seller_message, $headers);
}
Esempio n. 11
0
"><?php 
        echo $post->post_title;
        ?>
</a>
				</div>
				<div class="form_row clearfix">
				<label style="padding:0px;width:100px;">
					Deal Price : 
				</label>
				<?php 
        echo get_currency_sym();
        echo $price;
        if (get_post_meta($post->ID, 'shipping_cost', true) > 0) {
            ?>
				<?php 
            echo "(Including Shipping price " . get_currency_sym() . get_post_meta($post->ID, 'shipping_cost', true) . " )";
        }
        ?>
			</div>
			<p><?php 
        _e(BUY_DEAL_DESC, 'templatic');
        ?>
</p>
            <div id="post_<?php 
        the_ID();
        ?>
">
				<div class="post-content">
		<?php 
        if ($_REQUEST['msg'] == 'nopaymethod') {
            ?>
Esempio n. 12
0
 if ($coupon_type == '1') {
     $coupon_type = 'Custom Link Deal';
 } elseif ($coupon_type == '2') {
     $coupon_type = 'Fixed Deal';
 } elseif ($coupon_type == '3') {
     $coupon_type = 'Custom Generated Deal';
 } elseif ($coupon_type == '4') {
     $coupon_type = 'Physical Barcode Deal';
 } elseif ($coupon_type == '5') {
     $coupon_type = 'Physical Product Deal';
 }
 // Start All Transection Details With Deal
 if ($coupon_address != "") {
     $transaction_details = sprintf(__("\n\t\t\t<p><strong>" . DEAL_DETAILS_TEXT . "</strong> \r</p>\n\t\t\t<p><strong>" . DEAL_TITLE_TEXT . ": </strong>%s \r\t</p>\n\t\t\t<p><strong>" . DEAL_CONTENT_TEXT . ": </strong>%s \r\t</p>\n\t\t\t<p><strong>" . NO_OF_ITEMS . ": </strong>%s \r\t</p>\n\t\t\t<p><strong>" . DEAL_TYPE . ": </strong>%s \r\t</p>\n\t\t\t<p><strong>" . DEAL_CPRICE_TEXT . ": </strong>%s \r\t</p>\n\t\t\t<p><strong>" . DEAL_YOUR_PRICE_TEXT . ": </strong>%s \r\t</p>\n\t\t\t<p><strong>" . STORE_ADDRESS . ":</strong> %s \r\t</p>\n\t\t\t", 'templatic'), $deal_title, $deal_desc, $no_of_coupon, get_currency_sym() . $current_price, get_currency_sym() . $our_price, $current_price, $coupon_address);
 } else {
     $transaction_details = sprintf(__("\n\t\t\t<p><strong>" . DEAL_DETAILS_TEXT . "</strong> \r</p>\n\t\t\t<p><strong>" . DEAL_TITLE_TEXT . ": </strong>%s \r\t</p>\n\t\t\t<p><strong>" . DEAL_CONTENT_TEXT . ": </strong>%s \r\t</p>\n\t\t\t<p><strong>" . NO_OF_ITEMS . ": </strong>%s \r\t</p>\n\t\t\t<p><strong>" . DEAL_TYPE . ": </strong>%s \r\t</p>\n\t\t\t<p><strong>" . DEAL_CPRICE_TEXT . ": </strong>%s \r\t</p>\n\t\t\t<p><strong>" . DEAL_YOUR_PRICE_TEXT . ": </strong>%s \r\t</p>\n\t\t\t", 'templatic'), $deal_title, $deal_desc, $no_of_coupon, $coupon_type, get_currency_sym() . $current_price, get_currency_sym() . $our_price);
 }
 // End All Transection Details With Deal
 // Start User Details With Deal
 $users_details = sprintf(__("\n\t<p><strong>" . SELLER_DETAIL . "</strong> \r</p>\n\t<p><strong>" . NAME . ":</strong> %s \r\t</p>\n\t<p><strong>" . EMAIL . ":</strong> %s \r\t</p><p><strong>Password :</strong> %s \r</p>", 'templatic'), $user_fname, $user_email, $password);
 $fromEmail = get_site_emailId();
 $fromEmailName = get_site_emailName();
 /*-------Fetch Email details --------*/
 $client_message = get_option('post_submited_success_email_content');
 if ($client_message == "") {
     $client_message = $transaction_details;
 }
 $subject = get_option('post_submited_success_email_subject');
 if ($subject == "") {
     $subject = 'A new deal is submitted';
 }
Esempio n. 13
0
    $coupon_type = $u_data->deal_type;
    $deal_title = $u_data->post_title;
    $payable_amount = $u_data->payable_amt;
    $paymentmethod = $u_data->payment_method;
    if ($coupon_type == '1') {
        $coupon_type = 'Custom Link Deal';
    } elseif ($coupon_type == '2') {
        $coupon_type = 'Fixed Deal';
    } elseif ($coupon_type == '3') {
        $coupon_type = 'Custom Generated Deal';
    } elseif ($coupon_type == '4') {
        $coupon_type = 'Physical Barcode Deal';
    } elseif ($coupon_type == '5') {
        $coupon_type = 'Physical Product Deal';
    }
    $transaction_details = sprintf(__("\n\t\t<p><h3 >" . DEAL_DETAILS_TEXT . "</h3></p>\n\t\t<p><strong>" . DEAL_TITLE_TEXT . ":</strong> %s </p>\n\t\t<p><strong>" . DEAL_COUPON . ":</strong> %s\t</p>\n\t\t<p><strong>" . DEAL_TYPE . ":</strong> %s </p>\n\t\t<p><strong>" . PAYABLE_AMOUT . ": </strong>%s</p>\n\t\t<p><strong>" . PAYMENT_METHOD . ": </strong>%s</p>\n\t\t", 'templatic'), $deal_title, $deal_coupon, $coupon_type, get_currency_sym() . $payable_amount, $paymentmethod);
    $seller_name = get_post_meta($did1, 'owner_name', true);
    $seller_email = get_post_meta($did1, 'owner_email', true);
    // End All Transection Details With Deal
    // Start User Details With Deal
    $users_details = sprintf(__("\n\t<p><h3 >" . SELLER_DETAIL . "</h3> \r</p>\n\t<p><strong>" . NAME . ":</strong> %s \r\t</p>\n\t<p><strong>" . EMAIL . ":</strong> %s \r\t</p>", 'templatic'), $seller_name, $seller_email);
    $buyer_detail = sprintf(__("\n\t<p><h3 >Buyer Details</h3> \r</p>\n\t<table border='0'>\n\t\t<tr>\n\t\t\t<td valign='top'><strong>" . BILLING_NAME . "</strong></td>\n\t\t\t<td valign='top'>%s</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign='top'><strong>" . BILLING_ADDRESS . "</strong></td>\n\t\t\t<td valign='top'>%s</td>\n\t\t</tr><tr>\n\t\t\t<td valign='top'><strong>" . SHIPPING_NAME . "</strong></td>\n\t\t\t<td valign='top'>%s</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign='top'><strong>" . SHIPPING_ADDRESS . "</strong></td>\n\t\t\t<td valign='top'>%s</td>\n\t\t</tr>\n\t</table>", 'templatic'), $user_billing_name, $billing_Address, $buser_shipping_name, $ship_add);
    /*-------Fetch Email details --------*/
    $client_message = '<p>Dear [#to_name#]</p><p>A buyer with the following details bought your deal [#deal_title#] on [#site_name#]</p><p>[#buyer_detail#]</p> <p>[#deal_details#]</p><br /><br /><p>Thanks!</p><p>[#site_name#]</p>';
    $subject = 'Congratulations, a new sale has occured to your deal ' . $deal_title;
    $site_name = get_option('blogname');
    $search_array = array('[#to_name#]', '[#deal_title#]', '[#buyer_detail#]', '[#deal_details#]', '[#site_name#]');
    $replace_array = array($seller_name . ",", $deal_title, $buyer_detail, $transaction_details, $site_name);
    $email_seller_content = str_replace($search_array, $replace_array, $client_message);
    $admin_message = '<p>Dear [#to_name#]</p>
		<p>A buyer with the following details bought a deal [#deal_title#] on [#site_name#]</p><p>[#buyer_detail#]</p> <p>[#deal_details#]</p><p>[#seller_details#]</p><br /><br /><p>Thanks!</p><p>[#site_name#]</p>';
Esempio n. 14
0
$ordersql_from = " from {$trans_table} t,{$post_table} p ";
$ordersql_conditions = " where p.ID = t.post_id and t.status = '1'";
if ($_REQUEST['deal_id'] != '') {
    $id = $_REQUEST['deal_id'];
    $ordersql_conditions .= " and t.post_id = {$id}";
}
$ordersql_conditions .= " group by p.ID";
$priceinfo_count = $wpdb->get_results($ordersql_select . $ordersql_from . $ordersql_conditions);
if ($priceinfo_count > 0) {
    foreach ($priceinfo_count as $priceinfoObj) {
        $post_title = str_replace(',', ' ', $priceinfoObj->post_title);
        echo "ID,Title,Total Transaction,Status\r ";
        echo "{$priceinfoObj->ID},{$post_title}," . deal_transaction($priceinfoObj->ID) . "," . ($status = ifetch_status(get_post_meta($post->ID, 'status', true), get_post_meta($post->ID, 'is_expired', true)) . " \r\n \r\n");
        $deal_cnt = $wpdb->get_results("select * from {$trans_table} where post_id = '" . $priceinfoObj->ID . "' and status = '1'");
        if (count($deal_cnt) > 0) {
            echo "Title,Deal Coupon,Pay Date,Billing name,Billing address,Shipping name, Shipping address,Pay Method,Amount\r\n";
            $trans_table = $wpdb->prefix . "deal_transaction";
            foreach ($deal_cnt as $postObj) {
                $sub_post_title = str_replace(',', ' ', $postObj->post_title);
                $billing_add = str_replace(array(',', '<br />'), ' ', $postObj->billing_add);
                $shipping_add = str_replace(array(',', '<br />'), ' ', $postObj->shipping_add);
                echo "{$sub_post_title},{$postObj->deal_coupon}," . date('d/m/Y', strtotime($postObj->payment_date)) . ",{$postObj->billing_name},{$billing_add},{$postObj->shipping_name},{$shipping_add},{$postObj->payment_method}," . get_currency_sym() . number_format($postObj->payable_amt, 2) . " \r";
            }
        }
        echo "\r\n";
    }
} else {
    echo "No record available";
}
?>
  
Esempio n. 15
0
<?php

header('Content-Description: File Transfer');
header("Content-type: application/force-download");
header('Content-Disposition: inline; filename="transaction.csv"');
$file = dirname(__FILE__);
$file = substr($file, 0, stripos($file, "wp-content"));
require $file . "/wp-load.php";
global $wpdb, $current_user, $transection_db_table_name, $qry_string;
echo "Title,Deal Coupon,Pay Date,Billing name,Billing address,Shipping name,Shipping address,Pay Method,Amount\r\n";
$transinfo = $wpdb->get_results($_SESSION['qry_string']);
$totamt = 0;
if ($transinfo) {
    foreach ($transinfo as $priceinfoObj) {
        $totamt = $totamt + $priceinfoObj->payable_amt;
        $post_title = str_replace(',', ' ', $priceinfoObj->post_title);
        $billing_add = str_replace(array(',', '<br />'), ' ', $priceinfoObj->billing_add);
        $shipping_add = str_replace(array(',', '<br />'), ' ', $priceinfoObj->shipping_add);
        echo "{$post_title},{$priceinfoObj->deal_coupon}," . date('d/m/Y', strtotime($priceinfoObj->payment_date)) . ",{$priceinfoObj->billing_name},{$billing_add},{$priceinfoObj->shipping_name},{$shipping_add},{$priceinfoObj->payment_method}," . get_currency_sym() . number_format($priceinfoObj->payable_amt, 2) . " \r";
    }
    echo " , , , , , , ,Total Amount :, " . get_currency_sym() . " {$totamt} \r\n";
} else {
    echo "No record available";
}
?>
  
Esempio n. 16
0
function save_deal($post_id)
{
    global $post;
    if (!wp_verify_nonce($_POST['mytheme_meta_box_nonce'], 'deal_panel')) {
        return $post_id;
    }
    $uploadpath = wp_upload_dir();
    $tmpfolder = $uploadpath['baseurl'] . '/tmp/';
    $imgstr = '';
    if ($_POST["file_info"] != '') {
        foreach ($_POST["file_info"] as $key => $val) {
            $imagepath = $tmpfolder . $key . '.jpg';
            $imgstr .= '<a href="' . $imagepath . '" target="_blank" ><img src="' . $imagepath . '" height="100" width="100" alt="" /></a> &nbsp; &nbsp;';
        }
    }
    $user_fname = $_POST['owner_name'];
    $user_email = $_POST['owner_email'];
    $deal_title = '<a href="' . $_POST['link_url'] . '">' . $_POST['post_title'] . '</a>';
    $deal_desc = $_POST['post_content'];
    $coupon_website = $_POST['coupon_website'];
    $no_of_coupon = $_POST['no_of_coupon'];
    $our_price = $_POST['our_price'];
    $current_price = $_POST['current_price'];
    $coupon_type = $_POST['coupon_type'];
    if ($_POST['coupon_entry'] == 'coupon_entry_0') {
        $single_coupon_code = $_POST['coupon_code1'];
    } else {
        $coupon_code = $_POST['coupon_code'];
    }
    //echo  $coupon_code= $_POST['coupon_code'];
    $coupon_address = $_POST['coupon_address'];
    $coupon_link = $_POST['coupon_link'];
    $mediafilename = $_POST['media_file'];
    if ($coupon_type == '1') {
        $coupon_type = 'Custom Link Deal';
    } elseif ($coupon_type == '2') {
        $coupon_type = 'Fixed Deal';
    } elseif ($coupon_type == '3') {
        $coupon_type = 'Custom Generated Deal';
    } elseif ($coupon_type == '4') {
        $coupon_type = 'Physical Barcode Deal';
    } elseif ($coupon_type == '5') {
        $coupon_type = 'Physical Product Deal';
    }
    // Start All Transection Details With Deal
    if ($coupon_type == '4' || $coupon_type == '5') {
        if ($coupon_address != "") {
            $transaction_details = sprintf(__("\n\t\t\t<p><h3>Deal Details</h3> \r</p>\n\t\t\t<p><strong>Deal Title: </strong>%s \r\t</p>\n\t\t\t<p><strong>Deal Desc: </strong>%s \r\t</p>\n\t\t\t<p><strong>Deal Type: </strong>%s \r\t</p>\n\t\t\t<p><strong>Original Price: </strong>%s \r\t</p>\n\t\t\t<p><strong>Current Price: </strong>%s \r\t</p>\n\t\t\t<p><strong>Store Address:</strong> %s \r\t</p>\n\t\t\t", 'templatic'), $deal_title, $deal_desc, $coupon_code, get_currency_sym() . $current_price, get_currency_sym() . $our_price, $current_price, $coupon_address);
        } else {
            $transaction_details = sprintf(__("\n\t\t\t<p><h3>Deal Details </h3> \r</p>\n\t\t\t<p><strong>Deal Title:</strong> %s \r</p>\n\t\t\t<p><strong>Deal Desc:</strong> %s \r\t</p>\n\t\t\t<p><strong>Deal Type: </strong>%s \r\t</p>\n\t\t\t<p><strong>Original Price: </strong>%s \r\t</p>\n\t\t\t<p><strong>Current Price: </strong>%s \r\t</p>\n\t\t\t", 'templatic'), $deal_title, $deal_desc, $coupon_code, $coupon_type, get_currency_sym() . $current_price, get_currency_sym() . $our_price);
        }
    } else {
        $transaction_details = sprintf(__("\n\t\t<p><h3>Deal Details </h3>\r</p>\n\t\t<p><strong>Deal Title:</strong> %s \r</p>\n\t\t<p><strong>Deal Coupon:</strong> %s \r\t</p>\n\t\t<p><strong>Deal Type:</strong> %s \r\t</p>\n\t\t<p><strong>Original Price: </strong>%s \r\t</p>\n\t\t<p><strong>Current Price: </strong>%s \r\t</p>\n\t\t", 'templatic'), $deal_title, $single_coupon_code, $coupon_type, get_currency_sym() . $current_price, get_currency_sym() . $our_price);
    }
    // End All Transection Details With Deal
    $fromEmail = get_site_emailId();
    $fromEmailName = get_site_emailName();
    $store_name = get_option('blogname');
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return $post_id;
    }
    if ($_POST["status"] != "") {
        global $post;
        $pre = get_post_meta($post->ID, 'status', true);
        if ($pre != $_POST["status"]) {
            update_post_meta($post->ID, "status", $_POST["status"]);
            if ($_POST["status"] == '2') {
                update_post_meta($post->ID, "is_show", '1');
            }
            if ($_POST["status"] == '1' || $_POST["status"] == '2') {
                $client_message = get_option('req_accept_success_email_content');
                $users_details = sprintf(__("\n\t\t\t\t\t\t<p><h3>Seller Details</h3> \r</p>\n\t\t\t\t\t\t<p><strong>Name:</strong> %s \r\t</p>\n\t\t\t\t\t\t<p><strong>Email:</strong> %s \r\t</p>", 'templatic'), $user_fname, $user_email);
                $subject = get_option('req_accept_success_email_subject');
                $search_array = array('[#to_name#]', '[#site_name#]', '[#deal_details#]', '[#seller_details#]');
                $replace_array = array($user_fname . ",", $store_name, $transaction_details, $users_details);
                $email_seller_content = str_replace($search_array, $replace_array, $client_message);
                if (get_option('pttthemes_send_mail') == 'Enable' || get_option('pttthemes_send_mail') == '') {
                    templ_sendEmail($fromEmail, $fromEmailName, $user_email, $user_fname, $subject, $email_seller_content, $extra = '');
                }
            } else {
                if ($_POST["status"] == '3') {
                    $fromEmail = get_site_emailId();
                    $fromEmailName = get_site_emailName();
                    $store_name = get_option('blogname');
                    $client_message = get_option('req_reject_success_email_content');
                    $subject = get_option('req_reject_success_email_subject');
                    $search_array = array('[#to_name#]', '[#site_name#]');
                    $replace_array = array($user_fname . ",", $store_name);
                    $email_seller_content = str_replace($search_array, $replace_array, $client_message);
                    if (get_option('pttthemes_send_mail') == 'Enable' || get_option('pttthemes_send_mail') == '') {
                        templ_sendEmail($fromEmail, $fromEmailName, $user_email, $userName, $subject, $email_seller_content, $extra = '');
                    }
                } else {
                    // Do nothing
                }
            }
        } else {
            if ($_POST["status"] == '2') {
                update_post_meta($post->ID, "is_show", '1');
            }
        }
    } else {
        delete_post_meta($post->ID, "status", $_POST["status"]);
    }
    if ($_POST["owner_name"] != "") {
        update_post_meta($post->ID, "owner_name", $_POST["owner_name"]);
    } else {
        delete_post_meta($post->ID, "owner_name", $_POST["owner_name"]);
    }
    if ($_POST["_wp_attached_file"] != "") {
        update_post_meta($post->ID, "_wp_attached_file", $_POST["_wp_attached_file"]);
    } else {
        delete_post_meta($post->ID, "_wp_attached_file", $_POST["_wp_attached_file"]);
    }
    if ($_POST["owner_email"] != "") {
        update_post_meta($post->ID, "owner_email", $_POST["owner_email"]);
    } else {
        delete_post_meta($post->ID, "owner_email", $_POST["owner_email"]);
    }
    if ($_POST["thankyou_page_url"] != "") {
        update_post_meta($post->ID, "thankyou_page_url", $_POST["thankyou_page_url"]);
    } else {
        delete_post_meta($post->ID, "thankyou_page_url", $_POST["thankyou_page_url"]);
    }
    if ($_POST["coupon_website"] != "") {
        update_post_meta($post->ID, "coupon_website", $_POST["coupon_website"]);
    } else {
        delete_post_meta($post->ID, "coupon_website", $_POST["coupon_website"]);
    }
    if ($_POST["no_of_coupon"] != "") {
        update_post_meta($post->ID, "no_of_coupon", $_POST["no_of_coupon"]);
    } else {
        delete_post_meta($post->ID, "no_of_coupon", $_POST["no_of_coupon"]);
    }
    if ($_POST["coupon_type"] != "") {
        update_post_meta($post->ID, "coupon_type", $_POST["coupon_type"]);
    } else {
        delete_post_meta($post->ID, "coupon_type", $_POST["coupon_type"]);
    }
    if ($_POST["coupon_entry"] != "") {
        update_post_meta($post->ID, "coupon_entry", $_POST["coupon_entry"]);
        if ($_POST["coupon_entry"] == "coupon_entry_0") {
            update_post_meta($post->ID, "coupon_code", $_POST["coupon_code1"]);
        } else {
            update_post_meta($post->ID, "coupon_code", $_POST["coupon_code"]);
        }
    } else {
        delete_post_meta($post->ID, "coupon_entry", $_POST["coupon_entry"]);
        delete_post_meta($post->ID, "coupon_code", $_POST["coupon_code"]);
    }
    if ($_POST["min_purchases"] != "") {
        update_post_meta($post->ID, "min_purchases", $_POST["min_purchases"]);
    } else {
        delete_post_meta($post->ID, "min_purchases", $_POST["min_purchases"]);
    }
    if ($_POST["max_purchases_user"] != "") {
        update_post_meta($post->ID, "max_purchases_user", $_POST["max_purchases_user"]);
    } else {
        delete_post_meta($post->ID, "max_purchases_user", $_POST["max_purchases_user"]);
    }
    if ($_POST["shhiping_address"] != "") {
        update_post_meta($post->ID, "shhiping_address", $_POST["shhiping_address"]);
    } else {
        delete_post_meta($post->ID, "shhiping_address", $_POST["shhiping_address"]);
    }
    if ($_POST["shipping_cost"] != "") {
        update_post_meta($post->ID, "shipping_cost", $_POST["shipping_cost"]);
    } else {
        delete_post_meta($post->ID, "shipping_cost", $_POST["shipping_cost"]);
    }
    if ($_POST["geo_latitude"] != "") {
        update_post_meta($post->ID, "geo_latitude", $_POST["geo_latitude"]);
    } else {
        delete_post_meta($post->ID, "geo_latitude", $_POST["geo_latitude"]);
    }
    if ($_POST["geo_longitude"] != "") {
        update_post_meta($post->ID, "geo_longitude", $_POST["geo_longitude"]);
    } else {
        delete_post_meta($post->ID, "geo_longitude", $_POST["geo_longitude"]);
    }
    if ($_POST["coupon_type"] == "3" || $_POST["coupon_type"] == "4") {
        if ($_POST["coupon_code"] == "") {
            $sys_gen_coupon = '';
            if ($single_coupon_code == '') {
                for ($c = 0; $c < $_POST["no_of_coupon"]; $c++) {
                    $user_coup = wp_generate_password(3, false);
                    $sys_gen_coupon .= $post->ID . $user_coup . ",";
                }
                $sys_gen_coupon = trim($sys_gen_coupon, ",");
            } else {
                $sys_gen_coupon = $single_coupon_code;
            }
            update_post_meta($post->ID, "coupon_code", $sys_gen_coupon);
        } else {
            $totcop = $_POST["coupon_code"];
            if ($_POST["used_coupon_code"] != "") {
                $totcop .= "," . $_POST["used_coupon_code"];
            }
            $totalcpoarr = explode(",", $totcop);
            if (sizeof($totalcpoarr) == $_POST["no_of_coupon"]) {
            } elseif ($_POST["no_of_coupon"] > sizeof($totalcpoarr)) {
                $totorigcop = $_POST["coupon_code"];
                $extra_coupon = $_POST["no_of_coupon"] - sizeof($totalcpoarr);
                for ($c = 0; $c < $extra_coupon; $c++) {
                    $user_coup = wp_generate_password(3, false);
                    $sys_gen_coupon .= $post->ID . $user_coup . ",";
                }
                $sys_gen_coupon = trim($sys_gen_coupon, ",");
                $addextra = $totorigcop . "," . $sys_gen_coupon;
                update_post_meta($post->ID, "coupon_code", $addextra);
            }
        }
    }
    if ($_POST["used_coupon_code"] != "") {
        update_post_meta($post->ID, "used_coupon_code", $_POST["used_coupon_code"]);
    } else {
        delete_post_meta($post->ID, "used_coupon_code", $_POST["used_coupon_code"]);
    }
    if ($_POST["coupon_address"] != "") {
        update_post_meta($post->ID, "coupon_address", $_POST["coupon_address"]);
    } else {
        delete_post_meta($post->ID, "coupon_address", $_POST["coupon_address"]);
    }
    if ($_POST["coupon_link"] != "") {
        update_post_meta($post->ID, "coupon_link", $_POST["coupon_link"]);
    } else {
        delete_post_meta($post->ID, "coupon_link", $_POST["coupon_link"]);
    }
    if ($_POST["file_name"] != "") {
        update_post_meta($post->ID, "file_name", $_POST["file_name"]);
    } else {
        delete_post_meta($post->ID, "file_name", $_POST["file_name"]);
    }
    if ($_POST["coupon_start_date"] != "" && $_POST["coupon_start_time_hh"] != "" && $_POST["coupon_start_time_mm"] != "" && $_POST["coupon_start_time_ss"] != "") {
        //echo $_POST["coupon_start_date"]." ".$_POST["coupon_start_time_hh"].":".$_POST["coupon_start_time_mm"].":".$_POST["coupon_start_time_ss"];
        $coupon_start_date_time = strtotime($_POST["coupon_start_date"] . " " . $_POST["coupon_start_time_hh"] . ":" . $_POST["coupon_start_time_mm"] . ":" . $_POST["coupon_start_time_ss"]);
        update_post_meta($post->ID, "coupon_start_date_time", $coupon_start_date_time);
    } else {
        delete_post_meta($post->ID, "coupon_start_date_time", $coupon_start_date_time);
    }
    if ($_POST["enddate"] != "" || isset($_POST["enddate"])) {
        update_post_meta($post->ID, "coupon_end_date_time", '');
        update_post_meta($post->ID, "enddate", '0');
        if (get_post_meta($post->ID, 'is_expired', true) != '0') {
            update_post_meta($post->ID, "is_expired", '0');
        }
    } else {
        if ($_POST["coupon_end_date"] != "" && $_POST["coupon_end_time_hh"] != "" && $_POST["coupon_end_time_mm"] != "" && $_POST["coupon_end_time_ss"] != "") {
            $_POST["coupon_end_date"] . " " . $_POST["coupon_end_time_hh"] . ":" . $_POST["coupon_end_time_mm"] . ":" . $_POST["coupon_end_time_ss"];
            $coupon_end_date_time = strtotime($_POST["coupon_end_date"] . " " . $_POST["coupon_end_time_hh"] . ":" . $_POST["coupon_end_time_mm"] . ":" . $_POST["coupon_end_time_ss"]);
            update_post_meta($post->ID, "coupon_end_date_time", $coupon_end_date_time);
            if (get_post_meta($post->ID, 'is_expired', true) != '0') {
                update_post_meta($post->ID, "is_expired", '0');
            }
        } else {
            update_post_meta($post->ID, "coupon_end_date_time", "");
        }
        update_post_meta($post->ID, "enddate", '');
    }
    //update_post_meta($post->ID, "is_expired", $_POST["is_expired"]);
    if ($_POST["is_expired"] != "") {
        //update_post_meta($post->ID, "is_expired", $_POST["is_expired"]);
    } else {
        //update_post_meta($post->ID, "is_expired", '0');
    }
    if ($_POST["our_price"] != "") {
        update_post_meta($post->ID, "our_price", $_POST["our_price"]);
    } else {
        delete_post_meta($post->ID, "our_price", $_POST["our_price"]);
    }
    if ($_POST["current_price"] != "") {
        update_post_meta($post->ID, "current_price", $_POST["current_price"]);
    } else {
        delete_post_meta($post->ID, "current_price", $_POST["current_price"]);
    }
    global $post, $meta_boxes, $key;
    if (!wp_verify_nonce($_POST[$key . '_wpnonce'], plugin_basename(__FILE__))) {
        return $post_id;
    }
    if (!current_user_can('edit_post', $post_id)) {
        return $post_id;
    }
    foreach ($meta_boxes as $meta_box) {
        update_post_meta($post_id, $meta_box['name'], $_POST[$meta_box['name']]);
    }
}