<?php } ?> <li> <h2> </h2> <p><input type="submit" name="save-job" value="<?php _e("Save Job", 'PricerrTheme'); ?> >>" /></p> </li> </form> </ul> </div> </div></div></div> <?php PricerrTheme_get_users_links(); ?> <?php get_footer();
function PricerrTheme_my_account_priv_mess_area_function() { global $current_user; get_currentuserinfo(); $uid = $current_user->ID; $myuid = $current_user->ID; //------------------------------------- global $wpdb, $wp_rewrite, $wp_query; $third_page = $_GET['priv_act']; if (empty($third_page)) { $third_page = 'home'; } $using_perm = PricerrTheme_using_permalinks(); if ($using_perm) { $privurl_m = get_permalink(get_option('PricerrTheme_my_account_priv_mess_page_id')) . "/?"; } else { $privurl_m = get_bloginfo('siteurl') . "/?page_id=" . get_option('PricerrTheme_my_account_priv_mess_page_id') . "&"; } ?> <div id="content"> <div class="my_box3"> <div class="padd10"> <div class="box_title3"><?php _e("Private Messages", 'PricerrTheme'); ?> </div> <div class="padd10"> <a href="<?php echo $privurl_m; ?> " class="green_btn"><?php _e("Messaging Home", "PricerrTheme"); ?> </a> <a href="<?php echo $privurl_m; ?> priv_act=send" class="green_btn"><?php _e("Send New Message", "PricerrTheme"); ?> </a> <a href="<?php echo $privurl_m; ?> priv_act=inbox" class="green_btn"><?php _e("Inbox", "PricerrTheme"); global $current_user; get_currentuserinfo(); $rd = PricerrTheme_get_unread_number_messages($current_user->ID); if ($rd > 0) { echo ' (' . $rd . ')'; } ?> </a> <a href="<?php echo $privurl_m; ?> priv_act=sent-items" class="green_btn"><?php _e("Sent Items", "PricerrTheme"); ?> </a> </div> </div> </div> <div class="clear10"></div> <?php if ($third_page == 'home') { ?> <!-- page content here --> <div class="my_box3"> <div class="padd10"> <div class="box_title"><?php _e("Latest Received Messages", "PricerrTheme"); ?> </div> <div class="box_content"> <?php global $wpdb; $s = "select * from " . $wpdb->prefix . "job_pm where user='******' AND show_to_destination='1' order by id desc limit 4"; $r = $wpdb->get_results($s); if (count($r) > 0) { echo '<table width="100%">'; echo '<tr>'; echo '<td>' . __('From User', 'PricerrTheme') . '</td>'; echo '<td>' . __('Subject', 'PricerrTheme') . '</td>'; echo '<td>' . __('Date', 'PricerrTheme') . '</td>'; echo '<td>' . __('Options', 'PricerrTheme') . '</td>'; echo '</tr>'; foreach ($r as $row) { if ($row->rd == 0) { $cls = 'bold_stuff'; } else { $cls = ''; } $user = get_userdata($row->initiator); echo '<tr>'; echo '<td class="' . $cls . '"><a href="' . PricerrTheme_get_user_profile_link($user->user_login) . '">' . $user->user_login . '</a></td>'; echo '<td class="' . $cls . '">' . $row->subject . '</td>'; echo '<td class="' . $cls . '">' . date_i18n('d-M-Y H:i:s', $row->datemade) . '</td>'; echo '<td><a href="' . $privurl_m . 'priv_act=read-message&id=' . $row->id . '">' . __('Read', 'PricerrTheme') . '</a> | <a href="' . $privurl_m . 'priv_act=delete-message&id=' . $row->id . '&return=home">' . __('Delete', 'PricerrTheme') . '</a></td>'; echo '</tr>'; } echo '</table>'; } else { _e('No messages here.', 'PricerrTheme'); } ?> </div> </div></div> <!--#######--> <div class="clear10"></div> <div class="my_box3"> <div class="padd10"> <div class="box_title"><?php _e("Latest Sent Items", "PricerrTheme"); ?> </div> <div class="box_content"> <?php global $wpdb; $s = "select * from " . $wpdb->prefix . "job_pm where initiator='{$myuid}' AND show_to_source='1' order by id desc limit 4"; $r = $wpdb->get_results($s); if (count($r) > 0) { echo '<table width="100%">'; echo '<tr>'; echo '<td>' . __('To User', 'PricerrTheme') . '</td>'; echo '<td>' . __('Subject', 'PricerrTheme') . '</td>'; echo '<td>' . __('Date', 'PricerrTheme') . '</td>'; echo '<td>' . __('Options', 'PricerrTheme') . '</td>'; echo '</tr>'; foreach ($r as $row) { //if($row->rd == 0) $cls = 'bold_stuff'; //else $cls = ''; $user = get_userdata($row->user); echo '<tr>'; echo '<td class="' . $cls . '"><a href="' . PricerrTheme_get_user_profile_link($user->user_login) . '">' . $user->user_login . '</a></td>'; echo '<td class="' . $cls . '">' . $row->subject . '</td>'; echo '<td class="' . $cls . '">' . date_i18n('d-M-Y H:i:s', $row->datemade) . '</td>'; echo '<td><a href="' . $privurl_m . 'priv_act=read-message&id=' . $row->id . '">' . __('Read', 'PricerrTheme') . '</a> | <a href="' . $privurl_m . 'priv_act=delete-message&id=' . $row->id . '&return=home">' . __('Delete', 'PricerrTheme') . '</a></td>'; echo '</tr>'; } echo '</table>'; } else { _e('No messages here.', 'PricerrTheme'); } ?> </div> </div> </div> <!-- page content here --> <?php } elseif ($third_page == 'inbox') { ?> <!-- page content here --> <div class="my_box3"> <div class="padd10"> <div class="box_title"><?php _e("Inbox", "PricerrTheme"); ?> </div> <div class="box_content"> <?php global $wpdb; $nrpostsPage = 12; $page = $_GET['pj']; if (empty($page)) { $page = 1; } $querystr2 = "select id from " . $wpdb->prefix . "job_pm where user='******' AND show_to_destination='1'"; $pageposts2 = $wpdb->get_results($querystr2, OBJECT); $total_count = count($pageposts2) == 0 ? 1 : count($pageposts2); $my_page = $page; $pages_curent = $page; //----------------------------------------------------------------------- $totalPages = $total_count > 0 ? ceil($total_count / $nrpostsPage) : 0; $pagess = $totalPages; $s = "select * from " . $wpdb->prefix . "job_pm where user='******' AND show_to_destination='1' order by id desc LIMIT " . $nrpostsPage * ($page - 1) . "," . $nrpostsPage; $r = $wpdb->get_results($s); if (count($r) > 0) { echo '<table width="100%">'; echo '<tr>'; echo '<td>' . __('From User', 'PricerrTheme') . '</td>'; echo '<td>' . __('Subject', 'PricerrTheme') . '</td>'; echo '<td>' . __('Date', 'PricerrTheme') . '</td>'; echo '<td>' . __('Options', 'PricerrTheme') . '</td>'; echo '</tr>'; foreach ($r as $row) { if ($row->rd == 0) { $cls = 'bold_stuff'; } else { $cls = ''; } $user = get_userdata($row->initiator); echo '<tr>'; echo '<td class="' . $cls . '"><a href="' . PricerrTheme_get_user_profile_link($user->user_login) . '">' . $user->user_login . '</a></td>'; echo '<td class="' . $cls . '">' . $row->subject . '</td>'; echo '<td class="' . $cls . '">' . date_i18n('d-M-Y H:i:s', $row->datemade) . '</td>'; echo '<td><a href="' . $privurl_m . 'priv_act=read-message&id=' . $row->id . '">' . __('Read', 'PricerrTheme') . '</a> | <a href="' . $privurl_m . 'priv_act=delete-message&id=' . $row->id . '&return=inbox">' . __('Delete', 'PricerrTheme') . '</td>'; echo '</tr>'; } echo '</table>'; ?> <div class="nav"> <?php $batch = 10; //ceil($page / $nrpostsPage ); $end = $batch * $nrpostsPage; if ($end > $pagess) { $end = $pagess; } $start = $end - $nrpostsPage + 1; if ($start < 1) { $start = 1; } $links = ''; $raport = ceil($my_page / $batch) - 1; if ($raport < 0) { $raport = 0; } $start = $raport * $batch + 1; $end = $start + $batch - 1; $end_me = $end + 1; $start_me = $start - 1; if ($end > $totalPages) { $end = $totalPages; } if ($end_me > $totalPages) { $end_me = $totalPages; } if ($start_me <= 0) { $start_me = 1; } $previous_pg = $page - 1; if ($previous_pg <= 0) { $previous_pg = 1; } $next_pg = $pages_curent + 1; if ($next_pg > $totalPages) { $next_pg = 1; } //PricerrTheme_get_browse_jobs_link($job_tax, $job_category, 'new', $page) if ($my_page > 1) { echo '<a href="' . PricerrTheme_get_browse_pm_link($previous_pg) . '"><< ' . __('Previous', 'PricerrTheme') . '</a>'; echo '<a href="' . PricerrTheme_get_browse_pm_link($start_me) . '"><<</a>'; } //------------------------ //echo $start." ".$end; for ($i = $start; $i <= $end; $i++) { if ($i == $pages_curent) { echo '<a class="activee" href="#">' . $i . '</a>'; } else { echo '<a href="' . PricerrTheme_get_browse_pm_link($i) . '">' . $i . '</a>'; } } //---------------------- if ($totalPages > $my_page) { echo '<a href="' . PricerrTheme_get_browse_pm_link($end_me) . '">>></a>'; } if ($page < $totalPages) { echo '<a href="' . PricerrTheme_get_browse_pm_link($next_pg) . '">' . __('Next', 'PricerrTheme') . ' >></a>'; } ?> </div> <?php } else { _e('No messages here.', 'PricerrTheme'); } ?> </div> </div> </div> <!-- page content here --> <?php } elseif ($third_page == 'sent-items') { ?> <!-- page content here --> <div class="my_box3"> <div class="padd10"> <div class="box_title"><?php _e("Sent Items", "PricerrTheme"); ?> </div> <div class="box_content"> <?php global $wpdb; $nrpostsPage = 12; $page = $_GET['pj']; if (empty($page)) { $page = 1; } $querystr2 = "select id from " . $wpdb->prefix . "job_pm where initiator='{$myuid}' AND show_to_source='1'"; $pageposts2 = $wpdb->get_results($querystr2, OBJECT); $total_count = count($pageposts2) == 0 ? 1 : count($pageposts2); $my_page = $page; $pages_curent = $page; //----------------------------------------------------------------------- $totalPages = $total_count > 0 ? ceil($total_count / $nrpostsPage) : 0; $pagess = $totalPages; $s = "select * from " . $wpdb->prefix . "job_pm where initiator='{$myuid}' AND show_to_source='1' order by id desc LIMIT " . $nrpostsPage * ($page - 1) . "," . $nrpostsPage; $r = $wpdb->get_results($s); if (count($r) > 0) { echo '<table width="100%">'; echo '<tr>'; echo '<td>' . __('To User', 'PricerrTheme') . '</td>'; echo '<td>' . __('Subject', 'PricerrTheme') . '</td>'; echo '<td>' . __('Date', 'PricerrTheme') . '</td>'; echo '<td>' . __('Options', 'PricerrTheme') . '</td>'; echo '</tr>'; foreach ($r as $row) { //if($row->rd == 0) $cls = 'bold_stuff'; //else $cls = ''; $user = get_userdata($row->user); echo '<tr>'; echo '<td class="' . $cls . '"><a href="' . PricerrTheme_get_user_profile_link($user->user_login) . '">' . $user->user_login . '</a></td>'; echo '<td class="' . $cls . '">' . $row->subject . '</td>'; echo '<td class="' . $cls . '">' . date_i18n('d-M-Y H:i:s', $row->datemade) . '</td>'; echo '<td><a href="' . $privurl_m . 'priv_act=read-message&id=' . $row->id . '">' . __('Read', 'PricerrTheme') . '</a> | <a href="' . $privurl_m . 'priv_act=delete-message&id=' . $row->id . '&return=outbox">' . __('Delete', 'PricerrTheme') . '</a></td>'; echo '</tr>'; } echo '</table>'; ?> <div class="nav"> <?php $batch = 10; //ceil($page / $nrpostsPage ); $end = $batch * $nrpostsPage; if ($end > $pagess) { $end = $pagess; } $start = $end - $nrpostsPage + 1; if ($start < 1) { $start = 1; } $links = ''; $raport = ceil($my_page / $batch) - 1; if ($raport < 0) { $raport = 0; } $start = $raport * $batch + 1; $end = $start + $batch - 1; $end_me = $end + 1; $start_me = $start - 1; if ($end > $totalPages) { $end = $totalPages; } if ($end_me > $totalPages) { $end_me = $totalPages; } if ($start_me <= 0) { $start_me = 1; } $previous_pg = $page - 1; if ($previous_pg <= 0) { $previous_pg = 1; } $next_pg = $pages_curent + 1; if ($next_pg > $totalPages) { $next_pg = 1; } //PricerrTheme_get_browse_jobs_link($job_tax, $job_category, 'new', $page) if ($my_page > 1) { echo '<a href="' . PricerrTheme_get_browse_pm_link2($previous_pg) . '"><< ' . __('Previous', 'PricerrTheme') . '</a>'; echo '<a href="' . PricerrTheme_get_browse_pm_link2($start_me) . '"><<</a>'; } //------------------------ //echo $start." ".$end; for ($i = $start; $i <= $end; $i++) { if ($i == $pages_curent) { echo '<a class="activee" href="#">' . $i . '</a>'; } else { echo '<a href="' . PricerrTheme_get_browse_pm_link2($i) . '">' . $i . '</a>'; } } //---------------------- if ($totalPages > $my_page) { echo '<a href="' . PricerrTheme_get_browse_pm_link2($end_me) . '">>></a>'; } if ($page < $totalPages) { echo '<a href="' . PricerrTheme_get_browse_pm_link2($next_pg) . '">' . __('Next', 'PricerrTheme') . ' >></a>'; } ?> </div> <?php } else { _e('No messages here.', 'PricerrTheme'); } ?> </div> </div> </div> <!-- page content here --> <?php } elseif ($third_page == 'read-message') { $id = $_GET['id']; $s = "select * from " . $wpdb->prefix . "job_pm where id='{$id}' AND (user='******' OR initiator='{$myuid}')"; $r = $wpdb->get_results($s); $row = $r[0]; if ($myuid == $row->initiator) { $owner = true; } else { $owner = false; } if (!$owner) { $wpdb->query("update " . $wpdb->prefix . "job_pm set rd='1' where id='{$row->id}'"); } ?> <!-- page content here --> <div class="my_box3"> <div class="padd10"> <div class="box_title"><?php _e("Read Message: ", "PricerrTheme"); echo " " . $row->subject; ?> </div> <div class="box_content"> <?php $mess = $row->content; $PricerrTheme_filter_urls_private_messages = get_option('PricerrTheme_filter_urls_private_messages'); if ($PricerrTheme_filter_urls_private_messages == "yes") { $mess = PricerrTheme_url_cleaner($row->content); } //----------------------- $PricerrTheme_filter_emails_private_messages = get_option('PricerrTheme_filter_emails_private_messages'); if ($PricerrTheme_filter_emails_private_messages == "yes") { $pattern = "/[^@\\s]*@[^@\\s]*\\.[^@\\s]*/"; $replacement = "[****]"; preg_replace($pattern, $replacement, $mess); } echo $mess; ?> <br/> <br/> <?php if ($owner == false) { ?> <a href="<?php echo $privurl_m; ?> priv_act=send&<?php echo 'pid=' . $row->pid . '&uid=' . $row->initiator; ?> " class="nice_link"><?php _e("Reply"); ?> </a> <?php } ?> </div> </div> </div> <!-- page content here --> <?php } elseif ($third_page == 'delete-message') { $id = $_GET['id']; $s = "select * from " . $wpdb->prefix . "job_pm where id='{$id}' AND (user='******' OR initiator='{$myuid}')"; $r = $wpdb->get_results($s); $row = $r[0]; global $current_user; get_currentuserinfo(); $myuid = $current_user->ID; if ($myuid == $row->initiator) { $owner = true; } else { $owner = false; } //if(!$owner) //$wpdb->query("update_i18n ".$wpdb->prefix."auction_pm set rd='1' where id='{$row->id}'"); ?> <!-- page content here --> <div class="my_box3"> <div class="padd10"> <div class="box_title"><?php _e("Delete Message: ", "PricerrTheme"); echo " " . $row->subject; ?> </div> <div class="box_content"> <?php echo $row->content; ?> <br/> <br/> <?php if (1) { //$owner == false): ?> <a href="<?php echo $privurl_m; ?> priv_act=delete-message&<?php echo 'id=' . $row->id . '&return=' . $_GET['return'] . "&confirm_message_deletion=yes"; ?> " class="nice_link"><?php _e("Confirm Deletion", 'PricerrTheme'); ?> </a> <?php } ?> </div> </div> </div> <!-- page content here --> <?php } elseif ($third_page == 'send') { ?> <?php $pid = $_GET['pid']; $uid = $_GET['uid']; $user = get_userdata($uid); if (!empty($pid)) { $post = get_post($pid); $subject = "RE: " . $post->post_title; } if (isset($_POST['send'])) { $subject = htmlspecialchars($_POST['subject']); $message = nl2br(htmlspecialchars($_POST['message'])); $to = $_POST['to']; if (!empty($to)) { $uid = PricerrTheme_get_userid_from_username($to); } //--- parse emails out of the private messages ------- $PricerrTheme_filter_emails_private_messages = get_option('PricerrTheme_filter_emails_private_messages'); if ($PricerrTheme_filter_emails_private_messages == "yes") { $message = PricerrTheme_parseEmails($message); } //--- parse links out of the private messages --- $PricerrTheme_filter_urls_private_messages = get_option('PricerrTheme_filter_urls_private_messages'); if ($PricerrTheme_filter_urls_private_messages == "yes") { $message = PricerrTheme_parseHyperlinks($message); } //---------------------- if ($uid != false) { global $current_user; get_currentuserinfo(); $myuid = $current_user->ID; $tm_tm = $_POST['tm_tm']; global $wpdb; $s = "select * from " . $wpdb->prefix . "job_pm where initiator='{$myuid}' and datemade='{$tm_tm}'"; $r = $wpdb->get_results($s); if (count($r) == 0) { $s = "insert into " . $wpdb->prefix . "job_pm (subject, content, datemade, pid, initiator, user) values('{$subject}','{$message}','{$tm_tm}','{$pid}','{$myuid}','{$uid}')"; $wpdb->query($s); //----------------------- PricerrTheme_send_email_when_new_PM($myuid, $uid, $subject, $message); } //----------------------- ?> <div class="my_box3"> <div class="padd10"> <?php _e('Your message has been sent.', 'PricerrTheme'); ?> </div> </div> <?php } else { echo '<div class="error">' . __('Invalid username', 'PricerrTheme') . "</div>"; } } else { ?> <div class="my_box3"> <div class="padd10"> <div class="box_title"><?php _e("Send Private Message to: ", "PricerrTheme"); ?> <?php echo $user->user_login; ?> </div> <div class="box_content"> <form method="post"> <input type="hidden" value="<?php echo current_time('timestamp', 0); ?> " name="tm_tm" /> <table> <?php if (empty($uid)) { ?> <tr> <td width="140"><?php _e("Send To", "PricerrTheme"); ?> :</td> <td><input size="20" name="to" type="text" value="" /></td> </tr> <?php } ?> <tr> <td width="140"><?php _e("Subject", "PricerrTheme"); ?> :</td> <td><input size="50" name="subject" type="text" value="<?php echo $subject; ?> " /></td> </tr> <tr> <td valign="top"><?php _e("Message", "PricerrTheme"); ?> :</td> <td><textarea name="message" rows="6" cols="50"></textarea></td> </tr> <tr> <td width="140"> </td> <td></td> </tr> <tr> <td width="140"> </td> <td><input name="send" type="submit" value="<?php _e("Send Message", 'PricerrTheme'); ?> " /></td> </tr> </table> </form> </div> </div> </div> <?php } } ?> </div> <?php PricerrTheme_get_users_links(); }
function PricerrTheme_my_account_pers_info_area_function() { global $current_user; get_currentuserinfo(); $uid = $current_user->ID; //------------------------------------- global $wpdb, $wp_rewrite, $wp_query; $third_page = $wp_query->query_vars['third_page']; ?> <div id="content"> <!-- page content here --> <div class="my_box3"> <div class="padd10"> <div class="box_title3"><?php _e("Personal Info", 'PricerrTheme'); ?> </div> <div class="box_content"> <?php if (isset($_POST['save-info'])) { $personal_info = strip_tags(nl2br($_POST['personal_info']), '<br />'); update_user_meta($uid, 'personal_info', substr($personal_info, 0, 500)); update_user_meta($uid, 'user_location', $_POST['job_location_cat']); if (isset($_POST['password'])) { if (!empty($_POST['password'])) { $p1 = trim($_POST['password']); $p2 = trim($_POST['reppassword']); if ($p1 == $p2) { global $wpdb; $newp = md5($p1); $sq = "update " . $wpdb->prefix . "users set user_pass='******' where ID='{$uid}'"; $wpdb->query($sq); } else { echo '<div class="error">' . __('Password was not changed. It does not match the password confirmation.', 'PricerrTheme') . '</div>'; } } } $personal_info = trim($_POST['paypal_email']); update_user_meta($uid, 'paypal_email', $personal_info); $user_full_name = trim($_POST['user_full_name']); update_user_meta($uid, 'user_full_name', $user_full_name); if (!empty($_FILES['avatar']["tmp_name"])) { $avatar = $_FILES['avatar']; $tmp_name = $avatar["tmp_name"]; $name = $avatar["name"]; $upldir = wp_upload_dir(); $path = $upldir['path']; $url = $upldir['url']; $name = str_replace(" ", "", $name); if (getimagesize($tmp_name) > 0) { move_uploaded_file($tmp_name, $path . "/" . $name); update_user_meta($uid, 'avatar', $url . "/" . $name); } } echo '<div class="saved_thing">' . __("Information saved!", "PricerrTheme") . '</div>'; } ?> <form method="post" enctype="multipart/form-data"> <ul class="post-new3"> <li> <h2><?php echo __('Your Full Name', 'PricerrTheme'); ?> :</h2> <p><input type="text" class="do_input" name="user_full_name" value="<?php echo get_user_meta($uid, 'user_full_name', true); ?> " size="40" /></p> </li> <li> <h2><?php echo __('Your Location', 'PricerrTheme'); ?> :</h2> <p> <?php $locs = get_user_meta($uid, 'user_location', true); echo PricerrTheme_get_categories("job_location", !isset($_POST['job_location_cat']) ? $locs : htmlspecialchars($_POST['job_location_cat']), __('Select Location', 'PricerrTheme'), "do_input"); ?> </p> </li> <li> <h2><?php echo __('New Password', "PricerrTheme"); ?> :</h2> <p><input type="password" value="" class="do_input" name="password" size="40" /></p> </li> <li> <h2><?php echo __('Repeat Password', "PricerrTheme"); ?> :</h2> <p><input type="password" value="" class="do_input" name="reppassword" size="40" /></p> </li> <li> <h2><?php echo __('PayPal Email', 'PricerrTheme'); ?> :</h2> <p><input type="text" class="do_input" name="paypal_email" value="<?php echo get_user_meta($uid, 'paypal_email', true); ?> " size="40" /></p> </li> <li> <h2><?php echo __('Profile Description', 'PricerrTheme'); ?> :</h2> <p><textarea type="textarea" cols="30" class="do_input" rows="5" name="personal_info"><?php echo get_user_meta($uid, 'personal_info', true); ?> </textarea></p> </li> <li> <h2><?php echo __('Profile Avatar', 'PricerrTheme'); ?> :</h2> <p> <input type="file" class="do_input" name="avatar" /> <br/> <?php _e('max file size: 2mb. Formats: jpeg, jpg, png, gif', 'PricerrTheme'); ?> <br/> <img width="50" height="50" border="0" src="<?php echo pricerrTheme_get_avatar($uid, 50, 50); ?> " /> </p> </li> <li> <h2> </h2> <p><input type="submit" name="save-info" value="<?php _e("Save", 'PricerrTheme'); ?> " /></p> </li> </ul> </form> </div> </div> </div> </div> <?php PricerrTheme_get_users_links(); }
function PricerrTheme_my_account_shopping_area_function() { global $current_user; get_currentuserinfo(); $uid = $current_user->ID; //------------------------------------- $pg = $_GET['pg']; if (!isset($pg)) { $pg = 'home'; } global $current_user; get_currentuserinfo(); $uid = $current_user->ID; $act_nr = PricerrTheme_shooping_active_nr($uid); $rev_nr = PricerrTheme_shooping_review_nr($uid); $can_nr = PricerrTheme_shooping_cancelled_nr($uid); $com_nr = PricerrTheme_shooping_completed_nr($uid); $using_perm = PricerrTheme_using_permalinks(); if ($using_perm) { $shp_pg_lnk = get_permalink(get_option('PricerrTheme_my_account_shopping_page_id')) . "/?"; } else { $shp_pg_lnk = get_bloginfo('siteurl') . "/?page_id=" . get_option('PricerrTheme_my_account_shopping_page_id') . "&"; } ?> <div id="content"> <!-- page content here --> <div class="my_box3"> <div class="padd10"> <div class="box_title3"><?php _e("My Shopping", 'PricerrTheme'); ?> </div> <div class="clear10"></div> <div class="shopping_menu_dv"> <ul id="shopping_menu"> <li><a <?php echo $pg == "home" ? 'class="actiove"' : ""; ?> href="<?php echo $shp_pg_lnk; ?> "><?php echo sprintf(__("Active Jobs (%s)", "PricerrTheme"), $act_nr); ?> </a></li> <li><a <?php echo $pg == "pending" ? 'class="actiove"' : ""; ?> href="<?php echo $shp_pg_lnk; ?> pg=pending"><?php echo sprintf(__("Pending my Review (%s)", "PricerrTheme"), $rev_nr); ?> </a></li> <li><a <?php echo $pg == "cancelled" ? 'class="actiove"' : ""; ?> href="<?php echo $shp_pg_lnk; ?> pg=cancelled"><?php echo sprintf(__("Cancelled (%s)", "PricerrTheme"), $can_nr); ?> </a></li> <li><a <?php echo $pg == "completed" ? 'class="actiove"' : ""; ?> href="<?php echo $shp_pg_lnk; ?> pg=completed"><?php echo sprintf(__("Completed (%s)", "PricerrTheme"), $com_nr); ?> </a></li> </ul> </div> <div style="overflow:hidden; width:100%; float:left"> <?php if ($pg == "home") { ?> <?php global $wpdb; $prefix = $wpdb->prefix; $s = "select * from " . $prefix . "job_orders where uid='{$uid}' AND done_seller='0' AND done_buyer='0' AND date_finished='0' AND closed='0'\n\t\t\t order by id desc"; $r = $wpdb->get_results($s); if (count($r) == 0) { echo __('No active jobs', 'PricerrTheme'); } else { foreach ($r as $row) { PricerrTheme_show_bought($row); } } ?> <?php } elseif ($pg == "pending") { ?> <?php global $current_user; get_currentuserinfo(); $uid = $current_user->ID; global $wpdb; $prefix = $wpdb->prefix; $s = "select * from " . $prefix . "job_orders where uid='{$uid}' AND done_seller='1' AND done_buyer='0' AND closed='0' \n\t\t\torder by id desc"; $r = $wpdb->get_results($s); if (count($r) == 0) { echo __('No pending review jobs.', 'PricerrTheme'); } else { foreach ($r as $row) { PricerrTheme_show_bought($row); } } ?> <?php } elseif ($pg == "cancelled") { ?> <?php global $current_user; get_currentuserinfo(); $uid = $current_user->ID; global $wpdb; $prefix = $wpdb->prefix; $s = "select * from " . $prefix . "job_orders where uid='{$uid}' AND closed='1' order by id desc"; $r = $wpdb->get_results($s); if (count($r) == 0) { echo __('No cancelled jobs.', 'PricerrTheme'); } else { foreach ($r as $row) { PricerrTheme_show_bought($row); } } ?> <?php } elseif ($pg == "completed") { ?> <?php global $current_user; get_currentuserinfo(); $uid = $current_user->ID; global $wpdb; $prefix = $wpdb->prefix; $s = "select * from " . $prefix . "job_orders where uid='{$uid}' AND completed='1' order by id desc"; $r = $wpdb->get_results($s); if (count($r) == 0) { echo __('No completed jobs.', 'PricerrTheme'); } else { foreach ($r as $row) { PricerrTheme_show_bought($row); } } ?> <?php } ?> </div> </div> </div> </div> <?php PricerrTheme_get_users_links(); }
function PricerrTheme_my_account_reviews_area_function() { global $current_user; get_currentuserinfo(); $uid = $current_user->ID; //------------------------------------- global $wpdb, $wp_rewrite, $wp_query; $third_page = $wp_query->query_vars['third_page']; $third_page = $_GET['pg']; if (empty($_GET['pg'])) { $third_page = 'home'; } ?> <div id="content"> <div class="my_box3"> <div class="padd10"> <!-- page content here --> <div class="box_title3"><?php _e("My Ratings", 'PricerrTheme'); ?> </div> <?php $using_perm = PricerrTheme_using_permalinks(); if ($using_perm) { $rev_pg_lnk = get_permalink(get_option('PricerrTheme_my_account_reviews_page_id')) . "/?"; } else { $rev_pg_lnk = get_bloginfo('siteurl') . "/?page_id=" . get_option('PricerrTheme_my_account_reviews_page_id') . "&"; } ?> <div id="padd10"> <a class="green_btn"<?php echo $third_page == "home" ? 'class="actiove"' : ""; ?> href="<?php echo $rev_pg_lnk; ?> "><?php _e("Ratings to Award", "PricerrTheme"); ?> </a> <a class="green_btn"<?php echo $third_page == "waiting" ? 'class="actiove"' : ""; ?> href="<?php echo $rev_pg_lnk; ?> pg=waiting"><?php _e("Pending Ratings", "PricerrTheme"); ?> </a> <a class="green_btn"<?php echo $third_page == "my_rev" ? 'class="actiove"' : ""; ?> href="<?php echo $rev_pg_lnk; ?> pg=my_rev"><?php _e("My Ratings", "PricerrTheme"); ?> </a> </div> <div class="clear10"></div> <?php if ($third_page == "home") { ?> <div class="box_content"> <script> jQuery(document).ready(function() { jQuery('.dd-submit-rating').click(function() { var id = jQuery(this).attr('rel'); var uprating = jQuery("#rating_me-" + id + " :selected").val(); var reason = jQuery("#reason-" + id).val(); if(reason.length < 10) { alert("<?php _e('Please input a longer description for your rating', 'PricerrTheme'); ?> "); return false; } jQuery.ajax({ type: "POST", url: "<?php echo get_bloginfo('siteurl'); ?> /", data: "rate_me=1&ids="+id+"&uprating="+uprating+"&reason="+reason, success: function(msg){ jQuery("#post-" + id).hide('slow'); } }); return false; }); //------------------------- }); </script> <?php global $wpdb; $query = "select distinct *, ratings.id ratid from " . $wpdb->prefix . "job_ratings ratings, " . $wpdb->prefix . "job_orders orders where \r\n\t\t\t\t\t ratings.awarded='0' AND orders.id=ratings.orderid AND orders.uid='{$uid}'"; $r = $wpdb->get_results($query); if (count($r) > 0) { foreach ($r as $row) { $post = $row->pid; $post = get_post($post); $user = get_userdata($row->touser); ?> <div class="post" id="post-<?php echo $row->ratid; ?> "> <div class="padd10_only"> <div class="image_holder3"> <a href="<?php the_permalink(); ?> "><img width="65" height="50" src="<?php echo PricerrTheme_get_first_post_image($row->pid, 65, 50); ?> " /></a> </div> <div class="title_holder3" > <h2><a href="<?php echo get_permalink($row->pid); ?> "><?php echo PricerrTheme_wrap_the_title($post->post_title, $row->pid); ?> </a></h2> <div class="c111">Rate:</div> <div class="c111"><textarea id="reason-<?php echo $row->ratid; ?> " rows="2" cols="35"></textarea></div> <div class="c111"> <select name="rating_me" id="rating_me-<?php echo $row->ratid; ?> "> <option value="5">5</option> <option value="4">4</option> <option value="3">3</option> <option value="2">2</option> <option value="1">1</option> </select> </div> <div class="c111 ck999"> <a href="#" rel="<?php echo $row->ratid; ?> " class="dd-submit-rating"><?php _e('Submit Rating Now', 'PricerrTheme'); ?> </a> </div> </div> </div> </div> <?php } } else { _e("There are no reviews to be awarded.", "PricerrTheme"); } ?> </div> <?php } elseif ($third_page == "waiting") { ?> <div class="box_content"> <?php global $wpdb; $query = "select distinct * from " . $wpdb->prefix . "job_ratings ratings, " . $wpdb->prefix . "job_orders orders, \r\n\t\t\t\t\t" . $wpdb->prefix . "posts posts where posts.ID=orders.pid AND \r\n\t\t\t\t\t ratings.awarded='0' AND orders.id=ratings.orderid AND posts.post_author='{$uid}'"; $r = $wpdb->get_results($query); if (count($r) > 0) { foreach ($r as $row) { $post = $row->pid; $post = get_post($post); $user = get_userdata($row->uid); ?> <div class="post" id="post-<?php echo $row->ratid; ?> "> <div class="padd10_only"> <div class="image_holder3"> <a href="<?php the_permalink(); ?> "><img width="65" height="50" src="<?php echo PricerrTheme_get_first_post_image($row->pid, 65, 50); ?> " /></a> </div> <div class="title_holder3" > <h2><a href="<?php echo get_permalink($row->pid); ?> "><?php echo PricerrTheme_wrap_the_title($post->post_title, $row->pid); ?> </a></h2> <?php echo sprintf(__('Waiting from: %s', 'PricerrTheme'), $user->user_login); ?> </div> </div> </div> <?php } } else { _e("You have no pending reviews.", "PricerrTheme"); } ?> </div> <?php } elseif ($third_page == "my_rev") { ?> <div class="box_content"> <?php global $wpdb; $query = "select distinct *, ratings.id ratid from " . $wpdb->prefix . "job_ratings ratings, " . $wpdb->prefix . "job_orders orders, \r\n\t\t\t\t\t" . $wpdb->prefix . "posts posts where posts.ID=orders.pid AND \r\n\t\t\t\t\t ratings.awarded='1' AND orders.id=ratings.orderid AND posts.post_author='{$uid}'"; $r = $wpdb->get_results($query); if (count($r) > 0) { foreach ($r as $row) { $post = $row->pid; $post = get_post($post); $user = get_userdata($row->touser); ?> <div class="post" id="post-<?php echo $row->ratid; ?> "> <div class="padd10_only"> <div class="image_holder3"> <a href="<?php the_permalink(); ?> "><img width="65" height="50" src="<?php echo PricerrTheme_get_first_post_image($row->pid, 65, 50); ?> " /></a> </div> <div class="title_holder3" > <h2><a href="<?php echo get_permalink($row->pid); ?> "><?php echo PricerrTheme_wrap_the_title($post->post_title, $row->pid); ?> </a></h2> <div class="c111"><b><?php _e("Rated", "PricerrTheme"); ?> : </b></div> <div class="c111"><?php echo PricerrTheme_show_stars_our_of_number($row->grade); ?> </div> <div class="clear10" style="float:left"></div> <div class="c111"><b><?php _e("Description", "PricerrTheme"); ?> : </b></div> <div class="c111"><?php echo stripslashes($row->reason); ?> </div> </div> </div> </div> <?php } } else { _e("You have no reviews.", "PricerrTheme"); } ?> </div> <?php } ?> <!-- page content here --> </div></div></div> <?php PricerrTheme_get_users_links(); }
function PricerrTheme_my_account_sales_area_function() { global $current_user; get_currentuserinfo(); $uid = $current_user->ID; //------------------------------------- $pg = $_GET['pg']; if (!isset($pg)) { $pg = 'home'; } global $current_user; get_currentuserinfo(); $uid = $current_user->ID; global $wpdb; $prefix = $wpdb->prefix; ?> <div id="content"> <!-- page content here --> <div class="my_box3"> <div class="padd10"> <div class="box_title3"><?php _e("My Sales", 'PricerrTheme'); ?> </div> <div class="clear10"></div> <div class="shopping_menu_dv"> <ul id="shopping_menu"> <?php $act_jb = PricerrTheme_get_number_of_active_jobs($uid); $del_jb = PricerrTheme_get_number_of_delivered_jobs($uid); $com_jb = PricerrTheme_get_number_of_completed_jobs($uid); $can_jb = PricerrTheme_get_number_of_cencelled_jobs($uid); $using_perm = PricerrTheme_using_permalinks(); if ($using_perm) { $sal_pg_lnk = get_permalink(get_option('PricerrTheme_my_account_sales_page_id')) . "/?"; } else { $sal_pg_lnk = get_bloginfo('siteurl') . "/?page_id=" . get_option('PricerrTheme_my_account_sales_page_id') . "&"; } ?> <li><a <?php echo $pg == "home" ? 'class="actiove"' : ""; ?> href="<?php echo $sal_pg_lnk; ?> "><?php echo sprintf(__("Active Jobs (%s)", "PricerrTheme"), $act_jb); ?> </a></li> <li><a <?php echo $pg == "delivered" ? 'class="actiove"' : ""; ?> href="<?php echo $sal_pg_lnk; ?> pg=delivered"><?php echo sprintf(__("Delivered (%s)", "PricerrTheme"), $del_jb); ?> </a></li> <li><a <?php echo $pg == "completed" ? 'class="actiove"' : ""; ?> href="<?php echo $sal_pg_lnk; ?> pg=completed"><?php echo sprintf(__("Completed (%s)", "PricerrTheme"), $com_jb); ?> </a></li> <li><a <?php echo $pg == "cancelled" ? 'class="actiove"' : ""; ?> href="<?php echo $sal_pg_lnk; ?> pg=cancelled"><?php echo sprintf(__("Cancelled (%s)", "PricerrTheme"), $can_jb); ?> </a></li> </ul> </div> <div style="overflow:hidden; width:100%; float:left"> <?php if ($pg == "home") { ?> <?php $s = "select distinct * from " . $prefix . "job_orders orders, " . $prefix . "posts posts\n\t\t\t where posts.post_author='{$uid}' AND posts.ID=orders.pid AND orders.done_seller='0' AND \n\t\t\t orders.done_buyer='0' AND orders.date_finished='0' AND orders.closed='0' order by orders.id desc"; $r = $wpdb->get_results($s); if (count($r) == 0) { echo __('No active jobs', 'PricerrTheme'); } else { foreach ($r as $row) { PricerrTheme_show_sale($row); } } ?> <?php } elseif ($pg == "delivered") { ?> <?php global $current_user; get_currentuserinfo(); $uid = $current_user->ID; global $wpdb; $prefix = $wpdb->prefix; $s = "select distinct * from " . $prefix . "job_orders orders, " . $prefix . "posts posts\n\t\t\t where posts.post_author='{$uid}' AND posts.ID=orders.pid AND orders.done_seller='1' AND \n\t\t\t orders.done_buyer='0' AND orders.closed='0' order by orders.id desc"; $r = $wpdb->get_results($s); if (count($r) == 0) { echo __('No delivered jobs.', 'PricerrTheme'); } else { foreach ($r as $row) { PricerrTheme_show_sale($row); } } ?> <?php } elseif ($pg == "cancelled") { ?> <?php global $current_user; get_currentuserinfo(); $uid = $current_user->ID; global $wpdb; $prefix = $wpdb->prefix; $s = "select distinct * from " . $prefix . "job_orders orders, " . $prefix . "posts posts\n\t\t\t where posts.post_author='{$uid}' AND posts.ID=orders.pid AND orders.closed='1' order by orders.id desc"; $r = $wpdb->get_results($s); if (count($r) == 0) { echo __('No cancelled jobs.', 'PricerrTheme'); } else { foreach ($r as $row) { PricerrTheme_show_sale($row); } } ?> <?php } elseif ($pg == "completed") { ?> <?php global $current_user; get_currentuserinfo(); $uid = $current_user->ID; global $wpdb; $prefix = $wpdb->prefix; $s = "select distinct * from " . $prefix . "job_orders orders, " . $prefix . "posts posts\n\t\t\t where posts.post_author='{$uid}' AND posts.ID=orders.pid AND orders.done_seller='1' AND \n\t\t\t orders.done_buyer='1' AND orders.closed='0' order by orders.id desc"; $r = $wpdb->get_results($s); if (count($r) == 0) { echo __('No completed jobs.', 'PricerrTheme'); } else { foreach ($r as $row) { PricerrTheme_show_sale($row); } } ?> <?php } ?> </div> </div> </div> </div> <?php PricerrTheme_get_users_links(); }
function PricerrTheme_my_account_affiliates_area_function() { global $current_user, $wpdb, $wp_query; get_currentuserinfo(); $uid = $current_user->ID; ?> <div id="content"> <div class="my_box3"> <div class="padd10"> <div class="box_title"><?php _e("Affiliates Panel", "PricerrTheme"); ?> </div> <div class="box_content"> <div class="aff_id_thing"> <?php $aff_url = get_bloginfo('siteurl') . "/?ref_id_usr="******"aff_id_thing2"> <?php _e('Share this link with all your friends, when they join to the website through your link you get a percent (%) of all their money spent on our website. Additionally you can share your affiliate link through social networks like facebook and twitter.', 'PricerrTheme'); ?> </div> </div> </div> </div> <div class="clear10"></div> <div class="my_box3"> <div class="padd10"> <div class="box_title"><?php _e("Your Affiliate Users", "PricerrTheme"); ?> </div> <div class="box_content"> <?php global $wpdb; $s = "select * from " . $wpdb->prefix . "job_affiliate_users where owner_id='{$uid}' order by id desc"; $r = $wpdb->get_results($s); if (count($r) > 0) { ?> <table width="100%"> <tr> <td><strong><?php _e('Username', 'PricerrTheme'); ?> </strong></td> <td><strong><?php _e('Joined On', 'PricerrTheme'); ?> </strong></td> </tr> <?php foreach ($r as $row) { $usr = get_userdata($row->affiliate_id); echo '<tr>'; echo '<td><a href="' . get_bloginfo('siteurl') . '/?p_action=user_profile&post_author=' . $usr->ID . '">' . $usr->user_login . '</a></td>'; echo '<td>' . date_i18n('d-m-Y H:i:s', $row->datemade) . '</td>'; echo '</tr>'; } ?> </table> <?php } else { _e('Sorry you do not have any affiliate users right now.', 'PricerrTheme'); } ?> </div> </div> </div> <div class="clear10"></div> <div class="my_box3"> <div class="padd10"> <div class="box_title"><?php _e("Affiliate Earnings", "PricerrTheme"); ?> </div> <div class="box_content"> <?php global $wpdb; $s = "select * from " . $wpdb->prefix . "job_affiliate_commissions where uid='{$uid}' order by id desc, paid asc"; $r = $wpdb->get_results($s); if (count($r) > 0) { ?> <table width="100%"> <tr> <td><strong><?php _e('Job', 'PricerrTheme'); ?> </strong></td> <td><strong><?php _e('Date', 'PricerrTheme'); ?> </strong></td> <td><strong><?php _e('Amount', 'PricerrTheme'); ?> </strong></td> <td><strong><?php _e('Paid?', 'PricerrTheme'); ?> </strong></td> </tr> <?php foreach ($r as $row) { $post_au = get_post($row->pid); echo '<tr>'; echo '<td><a href="' . get_permalink($row->pid) . '">' . $post_au->post_title . '</a></td>'; echo '<td>' . date_i18n('d-m-Y H:i:s', $row->datemade) . '</td>'; echo '<td>' . pricerrtheme_get_show_price($row->amount) . '</td>'; echo '<td>' . ($row->paid == 0 ? __('No', 'PricerrTheme') : __('Yes', 'PricerrTheme')) . '</td>'; echo '</tr>'; } ?> </table> <?php } else { _e('Sorry you do not have any commissions right now.', 'PricerrTheme'); } ?> </div> </div> </div> </div> <?php PricerrTheme_get_users_links(); }
function PricerrTheme_my_account_payments_area_function() { global $current_user, $wpdb; get_currentuserinfo(); $uid = $current_user->ID; $using_perm = PricerrTheme_using_permalinks(); if ($using_perm) { $pay_pg_lnk = get_permalink(get_option('PricerrTheme_my_account_payments_page_id')) . "/?"; } else { $pay_pg_lnk = get_bloginfo('siteurl') . "/?page_id=" . get_option('PricerrTheme_my_account_payments_page_id') . "&"; } //------------------------------------- ?> <div id="content"> <!-- page content here --> <div class="my_box3"> <div class="padd10"> <div class="box_title3"><?php _e("My Payments", 'PricerrTheme'); ?> </div> <div class="padd10"> <a class="green_btn" href="<?php echo $pay_pg_lnk; ?> pg=withdraw"><?php _e('Withdraw Money', 'PricerrTheme'); ?> </a> <a class="green_btn" href="<?php echo $pay_pg_lnk; ?> pg=transactions"><?php _e('Transactions', 'PricerrTheme'); ?> </a> </div> <div class="clear10"></div> <div class="clear10"></div> <?php $pg = $_GET['pg']; if (!isset($pg)) { $pg = 'home'; } global $wpdb; if ($_GET['pg'] == 'closewithdrawal') { $id = $_GET['id']; $s = "select * from " . $wpdb->prefix . "job_withdraw where id='{$id}' AND uid='{$uid}'"; $r = $wpdb->get_results($s); if (count($r) == 1) { $row = $r[0]; $amount = $row->amount; $cr = PricerrTheme_get_credits($uid); PricerrTheme_update_credits($uid, $cr + $amount); $s = "delete from " . $wpdb->prefix . "job_withdraw where id='{$id}' AND uid='{$uid}'"; $wpdb->query($s); echo __('Request canceled!', 'PricerrTheme') . '<br/><br/>'; } } if ($pg == 'home') { ?> <?php $bal = PricerrTheme_get_credits($uid); echo '<h1 class="balance">' . sprintf(__("Your Current Balance is: %s", "PricerrTheme"), PricerrTheme_get_show_price($bal)) . "</h1>"; ?> <div class="clear10"></div> <div class="box_title"><?php _e('Pending Withdrawals', 'PricerrTheme'); ?> </div> <div class="padd10"> <?php global $wpdb; //---------------- $s = "select * from " . $wpdb->prefix . "job_withdraw where done='0' AND uid='{$uid}' order by id desc"; $r = $wpdb->get_results($s); if (count($r) == 0) { echo __('No withdrawals pending yet.', 'PricerrTheme'); } else { echo '<table width="100%">'; foreach ($r as $row) { echo '<tr>'; echo '<td>' . date('d-M-Y H:i:s', $row->datemade) . '</td>'; echo '<td>' . PricerrTheme_get_show_price($row->amount) . ' ' . '</td>'; echo '<td>' . $row->payeremail . '</td>'; echo '<td><a href="' . $pay_pg_lnk . 'pg=closewithdrawal&id=' . $row->id . '" class="green_btn">' . __('Close Request', 'PricerrTheme') . '</a></td>'; echo '</tr>'; } echo '</table>'; } ?> </div> <!-- ###################### --> <div class="clear10"></div> <div class="box_title"><?php _e("Pending Incoming Payments", "PricerrTheme"); ?> </div> <div class="padd10"> <?php global $current_user; get_currentuserinfo(); $uid = $current_user->ID; global $wpdb; $prefix = $wpdb->prefix; $s = "select distinct * from " . $prefix . "job_orders orders, " . $prefix . "posts posts\r\n\t\t\t\t\t where posts.post_author='{$uid}' AND posts.ID=orders.pid AND orders.done_seller='0' AND \r\n\t\t\t\t\t orders.done_buyer='0' AND orders.date_finished='0' AND orders.closed='0' order by orders.id desc"; $r = $wpdb->get_results($s); if (count($r) == 0) { echo __('No payments pending yet.', 'PricerrTheme'); } else { echo '<table width="100%">'; foreach ($r as $row) { $post = get_post($row->pid); $from = get_userdata($row->uid); echo '<tr>'; echo '<td>' . $from->user_login . '</td>'; echo '<td><a href="' . get_permalink($row->pid) . '">' . $post->post_title . '</a></td>'; echo '<td>' . date_i18n('d-M-Y H:i:s', $row->date_made) . '</td>'; echo '<td>' . PricerrTheme_get_show_price($row->mc_gross) . '</td>'; echo '</tr>'; } echo '</table>'; } ?> </div> <?php } elseif ($pg == 'withdraw') { ?> <div class="box_title"><?php _e("Request Withdrawal", "PricerrTheme"); ?> </div> <div class="padd10"> <?php $bal = PricerrTheme_get_credits($uid); echo '<span class="balance">'; printf(__('Your Current Balance is: %s', 'PricerrTheme'), PricerrTheme_get_show_price($bal)); echo "</span><br/><br/>"; if (isset($_POST['withdraw']) or isset($_POST['withdraw2']) or isset($_POST['withdraw3']) or isset($_POST['withdraw4']) or isset($_POST['withdraw5']) or isset($_POST['withdraw6']) or isset($_POST['withdraw7'])) { $amount = trim($_POST['amount']); $paypal = trim($_POST['paypal']); if (isset($_POST['withdraw2'])) { $amount = trim($_POST['amount2']); } if (isset($_POST['withdraw3'])) { $amount = trim($_POST['amount3']); } if (isset($_POST['withdraw4'])) { $amount = trim($_POST['amount4']); } if (isset($_POST['withdraw5'])) { $amount = trim($_POST['amount5']); } if (isset($_POST['withdraw6'])) { $amount = trim($_POST['amount6']); } if (isset($_POST['withdraw7'])) { $amount = trim($_POST['amount7']); } $PricerrTheme_withdraw_limit = get_option('PricerrTheme_withdraw_limit'); if (empty($PricerrTheme_withdraw_limit) or !is_numeric($PricerrTheme_withdraw_limit)) { $PricerrTheme_withdraw_limit = 10; } if (!is_numeric($amount) || $amount < 0) { echo '<span class="error">' . __('ERROR: Provide a well formated amount.', 'PricerrTheme') . '</span>'; } else { if (PricerrTheme_isValidEmail($paypal) == false) { echo '<span class="error">' . __('ERROR: Invalid email provided.', 'PricerrTheme') . '</span>'; } else { if ($amount < $PricerrTheme_withdraw_limit) { echo '<span class="error">' . sprintf(__('ERROR: The amount must be higher than: %s.', 'PricerrTheme'), PricerrTheme_get_show_price($PricerrTheme_withdraw_limit)) . '</span>'; } else { $min = get_option('PricerrTheme_withdraw_limit'); if ($min == 0) { $min = "0"; } if (empty($min)) { $min = 10; } if ($bal < $amount) { echo '<span class="error">' . __('ERROR: Your balance is smaller than the amount requested.', 'PricerrTheme') . '</span>'; } else { $method = "PayPal"; if (isset($_POST['withdraw2'])) { $method = "Moneybookers"; } if (isset($_POST['withdraw3'])) { $method = "Payza"; } $method = apply_filters('PricerrTheme_withdraw_method', $method); $tm = current_time('timestamp', 0); global $wpdb; if (!empty($_POST['tm_tm'])) { $tm = $_POST['tm_tm']; } $s = "select * from " . $wpdb->prefix . "job_withdraw where uid='{$uid}' AND datemade='{$tm}'"; $r = $wpdb->get_results($s); if (count($r) == 0) { $s = "insert into " . $wpdb->prefix . "job_withdraw (payeremail, methods, amount, datemade, uid) \r\n\t\t\t\t\t\t\t\tvalues('{$paypal}', '{$method}','{$amount}','{$tm}','{$uid}')"; $wpdb->query($s); $cr = PricerrTheme_get_credits($uid); PricerrTheme_update_credits($uid, $cr - $amount); //----------------------- PricerrTheme_send_email_when_withdraw_requested($uid, $method, PricerrTheme_get_show_price($amount)); //----------------------- } echo '<span class="balance">' . __('Your request has been queued. Redirecting...', 'PricerrTheme') . '</span>'; $url_redir = $pay_pg_lnk; echo '<meta http-equiv="refresh" content="2;url=' . $url_redir . '" />'; } } } } } global $current_user; get_currentuserinfo(); $uid = $current_user->ID; $opt = get_option('PricerrTheme_paypal_enable'); if ($opt == "yes") { ?> <br /><br /> <table> <form method="post" enctype="application/x-www-form-urlencoded"> <input type="hidden" value="<?php echo current_time('timestamp', 0); ?> " name="tm_tm" /> <tr> <td><?php _e('Withdraw amount:', 'PricerrTheme'); ?> </td><td> <input value="<?php echo $_POST['amount']; ?> " type="text" size="10" name="amount" /> <?php echo PricerrTheme_get_currency(); ?> </td> </tr> <tr> <td><?php _e('PayPal Email:', 'PricerrTheme'); ?> </td><td><input value="<?php echo get_user_meta($uid, 'paypal_email', true); ?> " type="text" size="30" name="paypal" /></td> </tr> <tr> <td></td> <td> <input type="submit" name="withdraw" value="<?php _e('Withdraw', 'PricerrTheme'); ?> " /></td></tr></form></table> <?php } $opt = get_option('PricerrTheme_moneybookers_enable'); if ($opt == "yes") { ?> <br/><br/> <table> <form method="post" enctype="application/x-www-form-urlencoded"> <input type="hidden" value="<?php echo current_time('timestamp', 0); ?> " name="tm_tm" /> <tr> <td><?php _e('Withdraw amount:', 'PricerrTheme'); ?> </td><td> <input value="<?php echo $_POST['amount2']; ?> " type="text" size="10" name="amount2" /> <?php echo PricerrTheme_get_currency(); ?> </td> </tr> <tr> <td><?php _e('Moneybookers Email:', 'PricerrTheme'); ?> </td><td><input value="" type="text" size="30" name="paypal" /></td> </tr> <tr> <td></td> <td> <input type="submit" name="withdraw2" value="<?php _e('Withdraw', 'PricerrTheme'); ?> " /></td></tr></form></table> <?php } $opt = get_option('PricerrTheme_alertpay_enable'); if ($opt == "yes") { ?> <br/><br/> <table> <form method="post" enctype="application/x-www-form-urlencoded"> <input type="hidden" value="<?php echo current_time('timestamp', 0); ?> " name="tm_tm" /> <tr> <td><?php _e('Withdraw amount:', 'PricerrTheme'); ?> </td><td> <input value="<?php echo $_POST['amount3']; ?> " type="text" size="10" name="amount3" /> <?php echo PricerrTheme_get_currency(); ?> </td> </tr> <tr> <td><?php _e('Payza Email:', 'PricerrTheme'); ?> </td><td><input value="" type="text" size="30" name="paypal" /></td> </tr> <tr> <td></td> <td> <input type="submit" name="withdraw3" value="<?php _e('Withdraw', 'PricerrTheme'); ?> " /></td></tr></form></table> <?php } do_action('PricerrTheme_payments_withdraw_options'); ?> </div> <?php } elseif ($pg == 'transactions') { ?> <div class="my_box3"> <div class="padd10"> <div class="box_title"><?php _e("Transactions", "PricerrTheme"); ?> </div> <div class="padd10"> <?php $s = "select * from " . $wpdb->prefix . "job_payment_transactions where uid='{$uid}' order by id desc"; $r = $wpdb->get_results($s); if (count($r) == 0) { echo __('No activity yet.', 'PricerrTheme'); } else { $i = 0; echo '<table width="100%" cellpadding="5">'; foreach ($r as $row) { if ($row->tp == 0) { $class = "redred"; $sign = "-"; } else { $class = "greengreen"; $sign = "+"; } echo '<tr style="background:' . ($i % 2 ? "#f2f2f2" : "#f9f9f9") . '" >'; echo '<td>' . $row->reason . '</td>'; echo '<td width="25%">' . date('d-M-Y H:i:s', $row->datemade) . '</td>'; echo '<td width="20%" class="' . $class . '"><b>' . $sign . PricerrTheme_get_show_price($row->amount) . '</b></td>'; echo '</tr>'; $i++; } echo '</table>'; } ?> </div> </div> </div> <?php } ?> <!-- page content here --> </div> </div> </div> <?php PricerrTheme_get_users_links(); }
function PricerrTheme_my_account_cancel_reqq_area_function() { $oid = $_GET['oid']; global $wpdb, $current_user; get_currentuserinfo(); $uid = $current_user->ID; $s = "select * from " . $wpdb->prefix . "job_orders where id='{$oid}'"; $r = $wpdb->get_results($s); $row = $r[0]; $post_au = get_post($row->pid); $dt = current_time('timestamp', 0); //----------------------- if ($row->request_cancellation_from_seller == 1) { if ($post_au->post_author != $uid) { //i am the buyer here $s_message = __('The seller of this job has requested a mutual cancellation for this order. Please accept or deny it using the controls below:', 'PricerrTheme'); $return_me = get_permalink(get_option('PricerrTheme_my_account_shopping_page_id')); if ($_GET['accept'] == "yes") { $s1 = "update " . $wpdb->prefix . "job_orders set accept_cancellation_request='1', closed='1', date_accept_cancellation='{$dt}' where id='{$row->id}'"; $wpdb->query($s1); $current_cash = PricerrTheme_get_credits($row->uid); PricerrTheme_update_credits($row->uid, $current_cash + $row->mc_gross); $reason = sprintf(__('Payment refunded for job: <a href="%s">%s</a>', 'PricerrTheme'), get_permalink($post_au->ID), $post_au->post_title); PricerrTheme_add_history_log('1', $reason, $row->mc_gross, $row->uid); } if ($_GET['accept'] == "no") { $s1 = "update " . $wpdb->prefix . "job_orders set accept_cancellation_request='-1' where id='{$row->id}'"; $wpdb->query($s1); } } else { echo 'oups #3211!'; exit; } } if ($row->request_cancellation_from_buyer == 1) { if ($post_au->post_author == $uid) { // i am the seller here $s_message = __('The buyer of this job has requested a mutual cancellation for this order. Please accept or deny it using the controls below:', 'PricerrTheme'); $return_me = get_permalink(get_option('PricerrTheme_my_account_sales_page_id')); if ($_GET['accept'] == "yes") { $s1 = "update " . $wpdb->prefix . "job_orders set accept_cancellation_request='1', closed='1', date_accept_cancellation='{$dt}' where id='{$row->id}'"; $wpdb->query($s1); $current_cash = PricerrTheme_get_credits($row->uid); PricerrTheme_update_credits($row->uid, $current_cash + $row->mc_gross); $reason = sprintf(__('Payment refunded for job: <a href="%s">%s</a>', 'PricerrTheme'), get_permalink($post_au->ID), $post_au->post_title); PricerrTheme_add_history_log('1', $reason, $row->mc_gross, $row->uid); } if ($_GET['accept'] == "no") { $s1 = "update " . $wpdb->prefix . "job_orders set accept_cancellation_request='-1' where id='{$row->id}'"; $wpdb->query($s1); } } else { echo 'oups #3219!'; exit; } } //----------------------- ?> <div id="content"> <!-- page content here --> <div class="my_box3"> <div class="padd10"> <div class="box_title3"><?php printf(__("Answer Cancellation Request: #%s", 'PricerrTheme'), $oid); ?> </div> <div style="overflow:hidden; width:100%; float:left"> <div class="clear10"></div> <?php if (isset($_GET['accept'])) { if ($_GET['accept'] == "yes") { ?> <?php printf(__('You have accepted the cancellation request. You can <b><a href="%s">go back</a></b> now', 'PricerrTheme'), $return_me); ?> <?php } else { ?> <?php printf(__('You have not accepted the cancellation request. You can <b><a href="%s">go back</a></b> now', 'PricerrTheme'), $return_me); ?> <?php } } else { ?> <div class="job_content_page_title"> <?php echo '<span class="font_big_it">' . sprintf(__('Job Title: %s', 'PricerrTheme'), $post_au->post_title) . '</span>'; echo '<br/><br/>'; echo $s_message; $using_perm = PricerrTheme_using_permalinks(); if ($using_perm) { $lnk7 = get_permalink(get_option('PricerrTheme_my_account_mutual_cancellation')) . "?oid=" . $row->id; } else { $lnk7 = get_permalink(get_option('PricerrTheme_my_account_mutual_cancellation')) . "&oid=" . $row->id; } ?> </div> <div class="job_content_page_title"> <a href="<?php echo $lnk7; ?> &accept=yes" class="deactivate_job"><?php _e('Accept Cancellation', 'PricerrTheme'); ?> </a> <a href="<?php echo $lnk7; ?> &accept=no" class="del_job"><?php _e('Deny Cancellation', 'PricerrTheme'); ?> </a> </div> <?php } ?> </div> </div> </div> </div> <?php PricerrTheme_get_users_links(); }
function PricerrTheme_my_account_area_function() { global $current_user; get_currentuserinfo(); $uid = $current_user->ID; update_user_meta($uid, 'ip_reg', $_SERVER['REMOTE_ADDR']); update_user_meta($uid, 'last_user_login', current_time('timestamp', 0)); //------------------------------------- ?> <div id="content"> <!-- page content here --> <?php global $wpdb; $s = "select orders.id oid, posts.ID pid, count(chatbox.id) mess_count from " . $wpdb->prefix . "job_chatbox chatbox, " . $wpdb->prefix . "job_orders orders, {$wpdb->posts} posts where \r\n\t\t\t\tchatbox.rd_receiver='0' AND chatbox.oid=orders.id AND chatbox.uid!='{$uid}' AND posts.ID=orders.pid AND (posts.post_author='{$uid}' OR orders.uid='{$uid}') group by orders.id order by orders.id desc "; $r = $wpdb->get_results($s); //echo '<pre>'; //print_r($r); //echo '<pre>'; if (count($r) > 0) { ?> <div class="info_box_m"> <table width="100%"> <?php foreach ($r as $row) { $pst = get_post($row->pid); $lkm = get_bloginfo('siteurl') . "/?jb_action=chat_box&oid=" . $row->oid; echo '<tr>'; echo '<td width="32"><img src="' . get_bloginfo('template_url') . '/images/i_icon.png" border="0" /></td>'; echo '<td>'; echo sprintf(__('You have %s unread message(s) on the order for: <a href="%s">%s</a>', 'PricerrTheme'), $row->mess_count, $lkm, PricerrTheme_wrap_the_title($pst->post_title, $row->pid)); echo '</td></tr>'; } ?> </table> </div> <?php } ?> <!-- notifications --> <div class="my_new_box_title"><?php _e("My Listings", 'PricerrTheme'); ?> </div> <div class="job_info_stuff2"> <div class="padd5"> <div class="font-my-account-info"><?php _e("Active", "PricerrTheme"); ?> : <?php echo pricerrTheme_nr_active_jobs($uid); ?> </div> <div class="separator_my-account"></div> <div class="font-my-account-info"><?php _e("Inactive", "PricerrTheme"); ?> : <?php echo pricerrTheme_nr_inactive_jobs($uid); ?> </div> <div class="separator_my-account"></div> <div class="font-my-account-info"><?php _e("In Review", "PricerrTheme"); ?> : <?php echo pricerrTheme_nr_in_review_jobs($uid); ?> </div> </div> </div> <!-- ####### --> <div class="box_content"> <?php global $wp_query; $query_vars = $wp_query->query_vars; $post_per_page = 10; query_posts("meta_key=closed&meta_value=0&post_status=publish,draft&post_type=job&order=DESC&orderby=id&author=" . $uid . "&posts_per_page=" . $post_per_page . "&paged=" . $query_vars['paged']); if (have_posts()) { while (have_posts()) { the_post(); PricerrTheme_get_post_small(); } if (function_exists('wp_pagenavi')) { wp_pagenavi(); } } else { _e("There are no jobs yet.", 'PricerrTheme'); } wp_reset_query(); ?> </div> <!-- page content here --> </div> <?php PricerrTheme_get_users_links(); }