Example #1
0
        foreach ($attachments as $attachment) {
            $url = $attachment->ID;
            echo '<div class="div_div"  id="image_ss' . $attachment->ID . '"> <a href="' . ProjectTheme_generate_thumb($url, 900, 600) . '" rel="image_gal1"><img width="70" class="image_class" height="70" src="' . ProjectTheme_generate_thumb($url, 70, 70) . '" /></a>
			 
			</div>';
        }
    }
    ?>
    
    </div>
    </div>
 

<?php 
}
if (ProjectTheme_is_user_provider($uid)) {
    if (ProjectTheme_2_user_types()) {
        ?>

<div class="my_box3">
            <div class="padd10">
            
            	<div class="box_title"><?php 
        _e("User Latest Feedback", 'ProjectTheme');
        ?>
 
               <span class="sml_ltrs"> [<a href="<?php 
        bloginfo('siteurl');
        ?>
?p_action=user_feedback&post_author=<?php 
        echo $uid;
Example #2
0
								<p><?php 
            echo ProjectTheme_average_bid(get_the_ID());
            ?>
</p>
							</li>
                            
                            <li>
								<h3>&nbsp;</h3>
								<p>&nbsp;</p>
							</li>
                            
                            <?php 
            global $current_user;
            get_currentuserinfo();
            $uid = $current_user->ID;
            if ($closed == "0" && ProjectTheme_is_user_provider($uid) == true) {
                ?>
                            <li>
								<a href="#" class="post_bid_btn_new" rel="<?php 
                the_ID();
                ?>
"><?php 
                _e('Place a bid on this project', 'ProjectTheme');
                ?>
</a>
							</li>
                          	<?php 
            }
            ?>
                            
                	</ul>
Example #3
0
	  
	   });
	  
	  return false;
	});
	
	
	</script>

	<div class="box_title"><?php 
echo sprintf(__("Public Message Board: %s", 'ProjectTheme'), $post_au->post_title);
?>
</div>
  	<div class="bid_panel" style="width:550px;height:450px;overflow:auto">
    <?php 
if ($uid == $post_au->post_author or ProjectTheme_is_user_provider($uid)) {
    ?>
    
                <div class="padd10">
                <form method="post" id="info_form" action="<?php 
    echo get_permalink($pid);
    ?>
"> 
                <input type="hidden" name="control_id" value="<?php 
    echo base64_encode($pid);
    ?>
" /> 
                	<ul class="project-details" style="width:430px">
		                           
                            <li>
								<h3><?php 
Example #4
0
function ProjectTheme_my_account_area_main_function()
{
    global $current_user, $wp_query;
    get_currentuserinfo();
    $uid = $current_user->ID;
    ?>
    	<div id="content" class="account-main-area">
        
        <?php 
    if (isset($_GET['prj_not_approved'])) {
        $psts = get_post($_GET['prj_not_approved']);
        ?>
        
        <div class="saved_thing">
        <?php 
        echo sprintf(__('Your payment was received for the item: <b>%s</b> but your project needs to be approved. 
		You will be notified when your project will be approved and live on our website', 'ProjectTheme'), $psts->post_title);
        ?>
        </div>
        
        	<?php 
    }
    if (ProjectTheme_is_user_business($uid)) {
        ?>
                       
            	<div class="box_title"><?php 
        _e("My Latest Posted Projects", "ProjectTheme");
        ?>
</div>
                 
            	
                 <?php 
        global $wp_query;
        $query_vars = $wp_query->query_vars;
        $post_per_page = 5;
        $closed = array('key' => 'closed', 'value' => "0", 'compare' => '=');
        $paid = array('key' => 'paid', 'value' => "1", 'compare' => '=');
        $args = array('post_type' => 'project', 'author' => $uid, 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => $post_per_page, 'paged' => 1, 'meta_query' => array($paid, $closed), 'post_status' => array('draft', 'publish'));
        query_posts($args);
        //	query_posts( "meta_key=closed&meta_value=0&post_status=publish,draft&post_type=project&order=DESC&orderby=date&author=".$uid.
        //	"&posts_per_page=".$post_per_page."&paged=".$query_vars['paged'] );
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post_acc();
            }
            //if(function_exists('wp_pagenavi')):
            //wp_pagenavi(); endif;
        } else {
            echo '<div class="my_box3"> <div class="box_content"> ';
            _e("There are no projects yet.", 'ProjectTheme');
            echo '</div></div>';
        }
        wp_reset_query();
        ?>

          
           
           
           
          
            
            	<div class="box_title"><?php 
        _e("My Unpublished &amp; Unpaid Projects", 'ProjectTheme');
        ?>
</div>
                
			
			
				<?php 
        query_posts("post_status=draft&meta_key=paid&meta_value=0&post_type=project&order=DESC&orderby=id&author=" . $uid . "&posts_per_page=3");
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post_acc(array('unpaid'));
            }
        } else {
            echo '<div class="my_box3"><div class="box_content">';
            _e("There are no projects yet.", 'ProjectTheme');
            echo '</div></div>';
        }
        wp_reset_query();
        ?>
			
 
			<div class="clear10"></div>
			
			
			
        
            
            	<div class="box_title"><?php 
        _e("My Latest Closed Projects", 'ProjectTheme');
        ?>
</div>
                    
			
			
				<?php 
        query_posts("meta_key=closed&meta_value=1&post_type=project&order=DESC&orderby=id&author=" . $uid . "&posts_per_page=3");
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post_acc();
            }
        } else {
            echo '<div class="my_box3"><div class="box_content">';
            _e("There are no projects yet.", 'ProjectTheme');
            echo '</div></div>';
        }
        wp_reset_query();
        ?>
 
		
        <?php 
    }
    ?>
        
        <?php 
    if (ProjectTheme_is_user_provider($uid)) {
        ?>
	
           
           
 
        
            
            	<div class="box_title"><?php 
        _e("Outstanding Projects", 'ProjectTheme');
        ?>
</div>
                 
			
			
				<?php 
        global $wp_query;
        $query_vars = $wp_query->query_vars;
        $post_per_page = 3;
        $outstanding = array('key' => 'outstanding', 'value' => "1", 'compare' => '=');
        $winner = array('key' => 'winner', 'value' => $uid, 'compare' => '=');
        $args = array('post_type' => 'project', 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => $post_per_page, 'paged' => 1, 'meta_query' => array($outstanding, $winner));
        query_posts($args);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post_outstanding_project();
            }
        } else {
            echo '<div class="my_box3"><div class="box_content">';
            _e("There are no projects yet.", 'ProjectTheme');
            echo '</div></div>';
        }
        wp_reset_query();
        ?>

	 
 
        
            
            	<div class="box_title"><?php 
        _e("My Latest Posted Proposals", 'ProjectTheme');
        ?>
</div>
                 
			
			
				<?php 
        query_posts("meta_key=bid&meta_value=" . $uid . "&post_type=project&order=DESC&orderby=id&posts_per_page=3");
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post_my_proposal();
            }
        } else {
            echo '<div class="my_box3"><div class="box_content">';
            _e("There are no projects yet.", 'ProjectTheme');
            echo '</div></div>';
        }
        wp_reset_query();
        ?>

			 
            
     
        
            
            	<div class="box_title"><?php 
        _e("My Latest Won Projects", 'ProjectTheme');
        ?>
</div>
            
			
			
				<?php 
        query_posts("meta_key=winner&meta_value=" . $uid . "&post_type=project&order=DESC&orderby=id&posts_per_page=3");
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post();
            }
        } else {
            echo '<div class="my_box3"><div class="box_content">';
            _e("There are no projects yet.", 'ProjectTheme');
            echo '</div></div>';
        }
        wp_reset_query();
        ?>
 
            
        
        <?php 
    }
    ?>
   
                
        </div> <!-- end dif content -->
        
        <?php 
    ProjectTheme_get_users_links();
    ?>
        
    
	
<?php 
}
Example #5
0
function ProjectTheme_get_users_links()
{
    global $current_user, $wpdb;
    get_currentuserinfo();
    $rd = projectTheme_get_unread_number_messages($current_user->ID);
    if ($rd > 0) {
        $ssk = "<span class='notif_a'>" . $rd . "</span>";
    } else {
        $ssk = '';
    }
    $uid = $current_user->ID;
    //-----------------------
    $query = "select id from " . $wpdb->prefix . "project_ratings where fromuser='******' AND awarded='0'";
    $r = $wpdb->get_results($query);
    $ttl_fdbks = count($r);
    if ($ttl_fdbks > 0) {
        $ttl_fdbks2 = "<span class='notif_a'>" . $ttl_fdbks . "</span>";
    }
    $ProjectTheme_enable_2_user_tp = get_option('ProjectTheme_enable_2_user_tp');
    $user_tp = get_user_meta($uid, 'user_tp', true);
    ?>

    

	<div id="right-sidebar" class="account-sidebar">

			<ul class="xoxo">

			

			<li class="widget-container widget_text"> 

			<p>

			

            <ul id="my-account-admin-menu">

            	<li><a href="<?php 
    echo projectTheme_my_account_link();
    ?>
" <?php 
    echo $current_page == "home" ? "class='active'" : "";
    ?>
><?php 
    _e("MyAccount Home", 'ProjectTheme');
    ?>
</a></li>

                

                <?php 
    $pmnts_lnk = get_permalink(get_option('ProjectTheme_my_account_payments_id'));
    $pmnts_lnk = apply_filters('ProjectTheme_my_account_payments_id_link', $pmnts_lnk);
    $ProjectTheme_enable_credits_wallet = get_option('ProjectTheme_enable_credits_wallet');
    if ($ProjectTheme_enable_credits_wallet != 'no') {
        ?>
             

                <li><a href="<?php 
        echo $pmnts_lnk;
        ?>
"><?php 
        _e("Finances", 'ProjectTheme');
        ?>
</a></li>    

                <?php 
    }
    ?>

                            

                <li><a href="<?php 
    echo get_permalink(get_option('ProjectTheme_my_account_private_messages_id'));
    ?>
"><?php 
    echo sprintf(__("Private Messages %s", 'ProjectTheme'), $ssk);
    ?>
</a></li>

               	<li><a href="<?php 
    echo get_permalink(get_option('ProjectTheme_my_account_personal_info_id'));
    ?>
"><?php 
    _e("Personal Info", 'ProjectTheme');
    ?>
</a></li>

                <li><a href="<?php 
    echo get_permalink(get_option('ProjectTheme_my_account_feedback_id'));
    ?>
"><?php 
    printf(__("Feedback/Reviews %s", 'ProjectTheme'), $ttl_fdbks2);
    ?>
</a></li>

                

                

                <?php 
    do_action('ProjectTheme_my_account_main_menu');
    ?>

                

            </ul>

            

            </p>

			</li>

            

            <!-- ###### -->

			<?php 
    if (ProjectTheme_is_user_business($uid)) {
        ?>

            <li class="widget-container widget_text"><h3 class="widget-title"><?php 
        _e("Project Owner Menu", 'ProjectTheme');
        ?>
</h3>

			<p>

			<?php 
        global $wpdb;
        //				 $querystr = "
        //
        //					SELECT distinct wposts.ID
        //
        //					FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta2, $wpdb->postmeta wpostmeta3
        //
        //					WHERE wposts.post_author='$uid' AND wposts.ID = wpostmeta2.post_id
        //
        //					AND wpostmeta2.meta_key='paid_user' AND wpostmeta2.meta_value='0'
        //
        //
        //
        //					AND wposts.ID = wpostmeta3.post_id AND
        //
        //					wpostmeta3.meta_key='delivered' AND wpostmeta3.meta_value='1'
        //
        //
        //
        //					 AND wposts.post_type = 'project' ";
        $querystr = "\n\n\t\t\t\t\tSELECT distinct p.ID \n                    \n                    FROM {$wpdb->posts} AS p\n                        \n                    LEFT JOIN " . $wpdb->prefix . "project_bids AS pb ON p.ID = pb.pid\n                        \n                    WHERE   p.post_author = '{$uid}'\n                        AND pb.winner = '1'\n                        AND pb.paid = '0'\n                        AND pb.delivered = '1'\n                        AND p.post_type = 'project' ";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        $ttl_prj = count($pageposts);
        if ($ttl_prj > 0) {
            $scn = "<span class='notif_a'>" . $ttl_prj . "</span>";
        }
        //------------------------------------------------
        /*$querystr = "
        
        					SELECT distinct wposts.ID 
        
        					FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta2
        
        					WHERE wposts.post_author='$uid' AND wposts.ID = wpostmeta2.post_id AND
        
        					wpostmeta2.meta_key='paid' AND wpostmeta2.meta_value='0' AND wposts.post_type = 'project' AND wposts.post_status = 'draft' ";*/
        $querystr = "\n\n\t\t\t\t\tSELECT distinct wposts.ID \n\n\t\t\t\t\tFROM {$wpdb->posts} wposts\n\n\t\t\t\t\tWHERE wposts.post_author='{$uid}' AND  wposts.post_type = 'project' AND wposts.post_status = 'draft' ";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        $ttl_prj2 = count($pageposts);
        if ($ttl_prj2 > 0) {
            $scn2 = "<span class='notif_a'>" . $ttl_prj2 . "</span>";
        }
        //------------------------------------------------
        $querystr = "\n\n\t\t\t\t\tSELECT distinct wposts.ID \n\n\t\t\t\t\tFROM {$wpdb->posts} wposts, {$wpdb->postmeta} wpostmeta2, {$wpdb->postmeta} wpostmeta3\n\n\t\t\t\t\tWHERE wposts.post_author='{$uid}' AND wposts.ID = wpostmeta2.post_id AND wposts.ID = wpostmeta3.post_id AND\n\n\t\t\t\t\twpostmeta2.meta_key='outstanding' AND wpostmeta2.meta_value='1' AND wposts.post_type = 'project' AND wposts.post_status= 'publish' " . " AND wpostmeta3.meta_key='mark_coder_delivered' AND wpostmeta3.meta_value = '1'";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        $ttl_prj2 = count($pageposts);
        if ($ttl_prj2 > 0) {
            $compl = "<span class='notif_a'>" . $ttl_prj2 . "</span>";
        }
        $querystr = "\n\n\t\t\t\t\tSELECT distinct wposts.ID \n\n\t\t\t\t\tFROM {$wpdb->posts} wposts, {$wpdb->postmeta} wpostmeta2\n\n\t\t\t\t\tWHERE wposts.post_author='{$uid}' AND wposts.ID = wpostmeta2.post_id AND\n\n\t\t\t\t\twpostmeta2.meta_key='closed' AND wpostmeta2.meta_value='1' AND wposts.post_type = 'project' AND wposts.post_status = 'publish'";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        $ttl_prj2 = count($pageposts);
        if ($ttl_prj2 > 0) {
            $closed_number = "<span class='notif_a'>" . $ttl_prj2 . "</span>";
        }
        $querystr = "\n\n\t\t\t\t\tSELECT distinct wposts.ID \n\n\t\t\t\t\tFROM {$wpdb->posts} wposts, {$wpdb->postmeta} wpostmeta2\n\n\t\t\t\t\tWHERE wposts.post_author='{$uid}' AND wposts.ID = wpostmeta2.post_id AND\n\n\t\t\t\t\twpostmeta2.meta_key='closed' AND wpostmeta2.meta_value='0' AND wposts.post_type = 'project' AND wposts.post_status = 'publish'";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        $ttl_prj2 = count($pageposts);
        if ($ttl_prj2 > 0) {
            $active_number = "<span class='notif_a'>" . $ttl_prj2 . "</span>";
        }
        //				$querystr = "
        //
        //					SELECT distinct wposts.ID
        //
        //					FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta3, $wpdb->postmeta wpostmeta4
        //
        //					WHERE
        //
        //					wposts.ID = wpostmeta4.post_id AND
        //
        //					wpostmeta4.meta_key='paid_user' AND wpostmeta4.meta_value='1'
        //
        //					AND wposts.post_type = 'project' AND wposts.post_author='$uid'";
        $querystr = "\n                        SELECT pb.ID \n                        FROM {$wpdb->posts} AS p\n                        LEFT JOIN {$wpdb->prefix}project_bids AS pb ON p.ID = pb.pid\n                        WHERE   p.post_author = '{$uid}'\n                            AND pb.winner = '1'\n                            AND pb.paid = '1'\n                            AND p.post_type = 'project' ";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        $paid = count($pageposts);
        if ($paid > 0) {
            $paid = "<span class='notif_a'>" . $paid . "</span>";
        } else {
            $paid = '';
        }
        ?>

            <ul id="my-account-admin-menu_seller">

            	 <li><a href="<?php 
        echo projectTheme_post_new_link();
        ?>
" ><?php 
        _e("Post New Project", 'ProjectTheme');
        ?>
</a></li>  

                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_active_projects_id'));
        ?>
"><?php 
        printf(__("Active Projects %s", 'ProjectTheme'), $active_number);
        /*_e("Active Projects",'ProjectTheme');*/
        ?>
</a></li>

                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_closed_projects_id'));
        ?>
"><?php 
        printf(__("Closed Projects %s", 'ProjectTheme'), $closed_number);
        /*_e("Closed Projects",'ProjectTheme');*/
        ?>
</a></li>

                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_unpublished_projects_id'));
        ?>
"><?php 
        printf(__("Unpublished Projects %s", 'ProjectTheme'), $scn2);
        ?>
</a></li>

                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_awaiting_completion_id'));
        ?>
"><?php 
        printf(__("Awaiting Completion %s", 'ProjectTheme'), $compl);
        ?>
</a></li>

                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_outstanding_payments_id'));
        ?>
"><?php 
        printf(__("Outstanding Payments %s", 'ProjectTheme'), $scn);
        ?>
</a></li>

                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_completed_payments_id'));
        ?>
"><?php 
        printf(__("Completed Payments %s", 'ProjectTheme'), $paid);
        /*_e("Completed Payments",'ProjectTheme');*/
        ?>
</a></li>

                 

                 <?php 
        do_action('ProjectTheme_my_account_service_contractor_menu');
        ?>

                 

            </ul>

            

            </p>

			</li>

            

            <!-- ###### -->

			<?php 
    }
    if (ProjectTheme_is_user_provider($uid)) {
        ?>

            <li class="widget-container widget_text"><h3 class="widget-title"><?php 
        _e("QA Engineer Menu", 'ProjectTheme');
        ?>
</h3>

			<p>

			<?php 
        $querystr = "\n\n\t\t\t\t\tSELECT distinct wposts.ID \n\n\t\t\t\t\tFROM {$wpdb->posts} wposts, {$wpdb->postmeta} wpostmeta2\n\n\t\t\t\t\tWHERE wposts.ID = wpostmeta2.post_id AND\n\n\t\t\t\t\twpostmeta2.meta_key='winner' AND wpostmeta2.meta_value='{$uid}'\n\n\t\t\t\t\tAND wposts.post_type = 'project' AND wposts.post_status = 'publish' ";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        $won = count($pageposts);
        if ($won > 0) {
            $won = "<span class='notif_a'>" . $won . "</span>";
        } else {
            $won = '';
        }
        $querystr = "\n\t\t\t\t\tSELECT p.ID\n                    FROM {$wpdb->posts} AS p\n                    LEFT JOIN {$wpdb->prefix}project_bids AS b ON p.ID = b.pid\n                    LEFT JOIN {$wpdb->prefix}postmeta AS wpostmeta2 ON p.ID = wpostmeta2.post_id\n                    LEFT JOIN {$wpdb->prefix}postmeta AS wpostmeta3 ON p.ID = wpostmeta3.post_id\n                    WHERE \n                    b.uid = '916' AND b.outstanding = '1'\n                    AND wpostmeta2.meta_key='winner' AND wpostmeta2.meta_value='916'\n                    AND wpostmeta3.meta_key='outstanding' AND wpostmeta3.meta_value='1' \n                    AND p.post_type = 'project' AND p.post_status = 'publish' ";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        $outsnr = count($pageposts);
        if ($outsnr > 0) {
            $outsnr = "<span class='notif_a'>" . $outsnr . "</span>";
        } else {
            $outsnr = '';
        }
        //---------------------------------------
        //					$querystr = "
        //
        //					SELECT distinct wposts.ID
        //
        //					FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta2, $wpdb->postmeta wpostmeta3, $wpdb->postmeta wpostmeta4
        //
        //					WHERE wposts.ID = wpostmeta2.post_id AND
        //
        //					wpostmeta2.meta_key='winner' AND wpostmeta2.meta_value='$uid' AND
        //
        //
        //
        //
        //
        //					wposts.ID = wpostmeta3.post_id AND
        //
        //					wpostmeta3.meta_key='delivered' AND wpostmeta3.meta_value='1' AND
        //
        //
        //
        //					wposts.ID = wpostmeta4.post_id AND
        //
        //					wpostmeta4.meta_key='paid_user' AND wpostmeta4.meta_value='0'
        //
        //
        //
        //					AND wposts.post_type = 'project' ";
        $querystr = "\n                        SELECT distinct p.ID \n                        FROM {$wpdb->posts} AS p\n                        LEFT JOIN {$wpdb->prefix}project_bids AS pb ON p.ID = pb.pid\n                        WHERE   pb.uid = '{$uid}'\n                            AND pb.winner = '1'\n                            AND pb.paid = '0'\n                            AND pb.delivered = '1'\n                            AND p.post_type = 'project' ";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        $awnr = count($pageposts);
        if ($awnr > 0) {
            $awnr = "<span class='notif_a'>" . $awnr . "</span>";
        } else {
            $awnr = '';
        }
        //				$querystr = "
        //
        //					SELECT distinct wposts.ID
        //
        //					FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta2, $wpdb->postmeta wpostmeta3, $wpdb->postmeta wpostmeta4
        //
        //					WHERE wposts.ID = wpostmeta2.post_id AND
        //
        //					wpostmeta2.meta_key='winner' AND wpostmeta2.meta_value='$uid' AND
        //
        //
        //					wposts.ID = wpostmeta3.post_id AND
        //
        //					wpostmeta3.meta_key='delivered' AND wpostmeta3.meta_value='1' AND
        //
        //
        //					wposts.ID = wpostmeta4.post_id AND
        //
        //					wpostmeta4.meta_key='paid_user' AND wpostmeta4.meta_value='1'
        //
        //					AND wposts.post_type = 'project' ";
        $querystr = "\n                        SELECT distinct p.ID \n                        FROM {$wpdb->posts} AS p\n                        LEFT JOIN {$wpdb->prefix}project_bids AS pb ON p.ID = pb.pid\n                        WHERE   pb.uid = '{$uid}'\n                            AND pb.winner = '1'\n                            AND pb.paid = '1'\n                            AND pb.delivered = '1'\n                            AND p.post_type = 'project' ";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        $deliv = count($pageposts);
        if ($deliv > 0) {
            $deliv = "<span class='notif_a'>" . $deliv . "</span>";
        } else {
            $deliv = '';
        }
        $s = "select * from " . $wpdb->prefix . "project_bids where uid='{$uid}'";
        $r = $wpdb->get_results($s);
        $pids = array();
        foreach ($r as $k => $rr) {
            $pids[] = $rr->pid;
        }
        $pids = implode(',', $pids);
        $querystr = "\n\n\t\t\t\t\tSELECT distinct wposts.ID \n\n\t\t\t\t\tFROM {$wpdb->posts} wposts\n\n\t\t\t\t\tWHERE wposts.ID IN ({$pids})\n\n\t\t\t\t\t\n\n\t\t\t\t\tAND wposts.post_type = 'project' AND wposts.post_status = 'publish'";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        $prop = count($pageposts);
        if ($prop > 0) {
            $prop = "<span class='notif_a'>" . $prop . "</span>";
        } else {
            $prop = '';
        }
        ?>

            <ul id="my-account-admin-menu_buyer">

                   

                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_won_projects_id'));
        ?>
"><?php 
        printf(__("Projects I’ve Won %s", 'ProjectTheme'), $won);
        /*_e("Projects I’ve Won",'ProjectTheme');*/
        ?>
</a></li>

                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_outstanding_projects_id'));
        ?>
"><?php 
        printf(__("Projects in progress %s", 'ProjectTheme'), $outsnr);
        ?>
</a></li>

                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_awaiting_payments_id'));
        ?>
"><?php 
        printf(__("Awaiting Payments %s", 'ProjectTheme'), $awnr);
        ?>
</a></li>

                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_delivered_projects_id'));
        ?>
"><?php 
        printf(__("Delivered & Paid Projects %s", 'ProjectTheme'), $deliv);
        /*_e("Delivered & Paid Projects",'ProjectTheme');*/
        ?>
</a></li>

                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_bid_projects_id'));
        ?>
"><?php 
        printf(__("My Proposals %s", 'ProjectTheme'), $prop);
        /*_e("My Proposals",'ProjectTheme');*/
        ?>
</a></li>

                 

                 <?php 
        do_action('ProjectTheme_my_account_service_provider_menu');
        ?>

                 

            </ul>

             

            </p>

			</li>

            <?php 
    }
    ?>

            

			</ul>

		</div>

		<?php 
}
Example #6
0
	    <?php 
        }
    }
    $testimonials = get_posts(array('numberposts' => 1000, 'offset' => 0, 'category' => '', 'orderby' => 'post_date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'testimonial', 'post_mime_type' => '', 'post_parent' => '', 'post_status' => 'publish'));
    if ($testimonials) {
        echo '<h2 class="widget-title testi_title_e">QA Engineer Testimonials</h2>';
        echo '<ul class="testimonials_slider_engineer">';
        foreach ($testimonials as $key => $testimonial) {
            if ($testimonial->post_password == 'engineer') {
                echo '<li class="full_width">';
                echo do_shortcode('[testimonial_single id="' . $testimonial->ID . '" template="1" img_size="small" img_loc="before" orientation="landscape" txt_align="center" ]');
                echo '</li>';
            }
        }
        echo '</ul>';
        if (ProjectTheme_is_user_provider(get_current_user_id())) {
            echo '<h2 class="subm_testi">Submit a Testimonial</h2>';
            echo '<div style="display:none;">';
            echo do_shortcode('[contact-form-7 id="1012" title="Testimonial"]');
            echo '</div>';
            $user = wp_get_current_user();
            ?>
	    	<script type="text/javascript">
	    		$(document).ready(function(){
	    			$('input[name="your-name"]').val('<?php 
            echo $user->user_login;
            ?>
');
	    			$('input[name="your-name"]').prop('readonly','readonly');
	    			$('input[name="your-email"]').val('<?php 
            echo $user->user_email;
Example #7
0
bloginfo('template_url');
?>
/images/sc1.jpg" },
        { src: "<?php 
bloginfo('template_url');
?>
/images/sc2.jpg" },
        { src: "<?php 
bloginfo('template_url');
?>
/images/sc3.jpg" },
        { src: "<?php 
bloginfo('template_url');
?>
/images/sc4.jpg" }
//
    ]
});});
	
	</script>
<?php 
if (is_user_logged_in()) {
    $user = new WP_User($user_ID);
    if (!empty($user->roles) && is_array($user->roles)) {
        foreach ($user->roles as $role) {
            $role;
        }
    }
}
?>
function ProjectTheme_my_account_personal_info_function()
{
    global $current_user, $wpdb, $wp_query;
    get_currentuserinfo();
    $uid = $current_user->ID;
    ?>
    	<div id="content" class="account-main-area">
        	
           <?php 
    if (isset($_POST['save-info'])) {
        //if(file_exists('cimy_update_ExtraFields'))
        cimy_update_ExtraFields_new_me();
        if (!empty($_FILES['avatar']["tmp_name"])) {
            if (filesize($_FILES['avatar']['tmp_name']) > 1024 * 1024) {
                echo '<div class="error">' . __("Avatar was not updated. File is to big!", "ProjectTheme") . '</div>';
                $xxp = 1;
            } else {
                //***********************************
                $pid = 0;
                $cid = $uid;
                require_once ABSPATH . "wp-admin" . '/includes/file.php';
                $upload_overrides = array('test_form' => false);
                $uploaded_file = wp_handle_upload($_FILES['avatar'], $upload_overrides);
                $file_name_and_location = $uploaded_file['file'];
                $file_title_for_media_library = $_FILES['file']['name'];
                $arr_file_type = wp_check_filetype(basename($_FILES['avatar']['name']));
                $uploaded_file_type = $arr_file_type['type'];
                $attachment = array('post_mime_type' => $uploaded_file_type, 'post_title' => addslashes($file_title_for_media_library), 'post_content' => '', 'post_status' => 'inherit', 'post_parent' => $pid, 'post_author' => $cid);
                require_once ABSPATH . "wp-admin" . '/includes/image.php';
                $attach_id = wp_insert_attachment($attachment, $file_name_and_location, $pid);
                $attach_data = wp_generate_attachment_metadata($attach_id, $file_name_and_location);
                wp_update_attachment_metadata($attach_id, $attach_data);
                update_user_meta($uid, 'avatar_' . 'project', $attach_id);
                //***********************************
            }
        }
        //---------------------
        $wpdb->query("delete from " . $wpdb->prefix . "project_email_alerts where uid='{$uid}' ");
        $email_cats = $_POST['email_cats'];
        if (count($email_cats) > 0) {
            foreach ($email_cats as $em) {
                $wpdb->query("insert into " . $wpdb->prefix . "project_email_alerts (uid,catid) values('{$uid}','{$em}') ");
            }
        }
        //-------------------
        //email_locs
        //****************************************************************************************************
        $ProjectTheme_enable_project_location = get_option('ProjectTheme_enable_project_location');
        if ($ProjectTheme_enable_project_location != "no") {
            $wpdb->query("delete from " . $wpdb->prefix . "project_email_alerts_locs where uid='{$uid}' ");
            $email_cats = $_POST['email_locs'];
            if (count($email_cats) > 0) {
                foreach ($email_cats as $em) {
                    $wpdb->query("insert into " . $wpdb->prefix . "project_email_alerts_locs (uid,catid) values('{$uid}','{$em}') ");
                }
            }
        }
        //****************************************************************************************************
        //-------------------
        $user_description = trim($_POST['user_description']);
        update_user_meta($uid, 'user_description', $user_description);
        $per_hour = trim($_POST['per_hour']);
        update_user_meta($uid, 'per_hour', $per_hour);
        $user_location = trim($_POST['project_location_cat']);
        update_user_meta($uid, 'user_location', $user_location);
        $user_city = trim($_POST['user_city']);
        update_user_meta($uid, 'user_city', $user_city);
        if (isset($_POST['paypal_email'])) {
            $paypalnum = trim($_POST['paypal_email']);
            if (is_email($paypalnum)) {
                $my_em = get_user_meta($uid, 'paypal_email', true);
                $s_em = get_users('meta_value=' . $paypalnum);
                $em_dom = strstr($paypalnum, '@');
                $em_dom = str_replace('@', '', $em_dom);
                if ($my_em != $paypalnum && !$s_em) {
                    function isDomainAvailible($domain)
                    {
                        $curlInit = curl_init($domain);
                        curl_setopt($curlInit, CURLOPT_CONNECTTIMEOUT, 10);
                        curl_setopt($curlInit, CURLOPT_HEADER, true);
                        curl_setopt($curlInit, CURLOPT_NOBODY, true);
                        curl_setopt($curlInit, CURLOPT_RETURNTRANSFER, true);
                        $response = curl_exec($curlInit);
                        curl_close($curlInit);
                        if ($response) {
                            return true;
                        }
                        return false;
                    }
                    if (isDomainAvailible($em_dom)) {
                        update_user_meta($uid, 'paypal_email', $paypalnum);
                    } else {
                        $xxp = 1;
                        echo '<div class="error">' . __('Incorrect PayPal Email', 'ProjectTheme') . '</div>';
                    }
                } else {
                    $xxp = 1;
                    echo '<div class="error">' . __('This PayPal Email already exists', 'ProjectTheme') . '</div>';
                }
            } else {
                $xxp = 1;
                echo '<div class="error">' . __('Incorrect PayPal Email', 'ProjectTheme') . '</div>';
            }
        } else {
            update_user_meta($uid, 'paypal_email', '');
        }
        $personal_info = trim($_POST['payza_email']);
        update_user_meta($uid, 'payza_email', $personal_info);
        $personal_info = trim($_POST['moneybookers_email']);
        update_user_meta($uid, 'moneybookers_email', $personal_info);
        $user_url = trim($_POST['user_url']);
        update_user_meta($uid, 'user_url', $user_url);
        do_action('ProjectTheme_pers_info_save_action');
        if (isset($_POST['new_user_name']) && !empty($_POST['new_user_name'])) {
            $new_user_name = trim($_POST['new_user_name']);
            $new_user_name = preg_replace('|\\s+|', '', $new_user_name);
            if (!validate_username($new_user_name) or $new_user_name == '' or !preg_match('/[0-9aA-zZ]/', $new_user_name)) {
                echo '<div class="error">' . __("Incorrect username!", "ProjectTheme") . '</div>';
                $xxp = 1;
            } elseif (username_exists($new_user_name) && $new_user_name != $current_user->user_login) {
                echo '<div class="error">' . __("This Username already exists!", "ProjectTheme") . '</div>';
                $xxp = 1;
            } elseif ($new_user_name != $current_user->user_login) {
                global $wpdb;
                $sq = "UPDATE " . $wpdb->users . " SET user_login='******' WHERE ID='{$uid}'";
                $wpdb->query($sq);
                $inc = 2;
            }
        }
        if (isset($_POST['new_user_email']) && !empty($_POST['new_user_email'])) {
            $new_user_email = trim($_POST['new_user_email']);
            $new_user = get_user_by('email', $new_user_email);
            $new_uid = $new_user->ID;
            $user = get_userdata($uid);
            if ($new_user_email == $user->user_email) {
            } elseif (!$new_uid) {
                global $wpdb;
                $sq = "update " . $wpdb->users . " set user_email='{$new_user_email}' where ID='{$uid}'";
                $wpdb->query($sq);
            } else {
                echo '<div class="error">' . __("This Email already exists!", "ProjectTheme") . '</div>';
                $xxp = 1;
            }
        }
        if (isset($_POST['password']) && !empty($_POST['password'])) {
            $p1 = trim($_POST['password']);
            $p2 = trim($_POST['reppassword']);
            if (!empty($p1) && !empty($p2)) {
                if ($p1 == $p2) {
                    global $wpdb;
                    $newp = md5($p1);
                    $sq = "update " . $wpdb->users . " set user_pass='******' where ID='{$uid}'";
                    $wpdb->query($sq);
                    $inc = 1;
                } else {
                    echo '<div class="error">' . __("Password was not updated. Passwords do not match!", "ProjectTheme") . '</div>';
                    $xxp = 1;
                }
            } else {
                echo '<div class="error">' . __("Password was not updated. Passwords do not match!", "ProjectTheme") . '</div>';
                $xxp = 1;
            }
        }
        //---------------------------------------
        $arr = $_POST['custom_field_id'];
        for ($i = 0; $i < count($arr); $i++) {
            $ids = $arr[$i];
            $value = $_POST['custom_field_value_' . $ids];
            if (is_array($value)) {
                delete_user_meta($uid, "custom_field_ID_" . $ids);
                for ($j = 0; $j < count($value); $j++) {
                    add_user_meta($uid, "custom_field_ID_" . $ids, $value[$j]);
                }
            } else {
                update_user_meta($uid, "custom_field_ID_" . $ids, $value);
            }
        }
        //--------------------------------------------
        if ($xxp != 1) {
            echo '<div class="saved_thing">' . __('Info saved!', 'ProjectTheme');
            if ($inc == 1) {
                echo '<br/>' . __('Your password was changed. Redirecting to login page...', 'ProjectTheme');
                echo '<meta http-equiv="refresh" content="2; url=' . get_bloginfo('url') . '/wp-login.php">';
            } elseif ($inc == 2) {
                echo '<br/>' . __('Your Username was changed. Redirecting to login page...', 'ProjectTheme');
                echo '<meta http-equiv="refresh" content="2; url=' . get_bloginfo('url') . '/wp-login.php">';
            }
            echo '</div>';
        }
    }
    $user = get_userdata($uid);
    $user_location = get_user_meta($uid, 'user_location', true);
    ?>
         
       
    <script type="text/javascript">
	
	function delete_this2(id)
	{
		 jQuery.ajax({
						method: 'get',
						url : '<?php 
    echo get_bloginfo('siteurl');
    ?>
/index.php/?_ad_delete_pid='+id,
						dataType : 'text',
						success: function (text) {   jQuery('#image_ss'+id).remove();  }
					 });
		  //alert("a");
	
	}

	
 
	
	
	</script>     
            
             <form method="post"  enctype="multipart/form-data">
             
            <div class="my_box3">
            	
             
                <div class="box_content">    
	
         <ul class="post-new3">
        <li>
        	<h2><?php 
    echo __('Username', 'ProjectTheme');
    ?>
:</h2>
        	<p><input type="text" size="35" value="<?php 
    echo $user->user_login;
    ?>
" name="new_user_name" class="do_input" /></p>
        </li>

        <li>
        	<h2><?php 
    echo __('Email', 'ProjectTheme');
    ?>
:</h2>
        	<p><input type="text" size="35" value="<?php 
    echo $user->user_email;
    ?>
" name="new_user_email" class="do_input" /></p>
        </li>

		<?php 
    $opt = get_option('ProjectTheme_enable_project_location');
    if ($opt != 'no') {
        ?>
        
		 <!-- <li>
        	<h2><?php 
        echo __('Location', 'ProjectTheme');
        ?>
:</h2>
        	<p>
            <?php 
        echo ProjectTheme_get_categories("project_location", $user_location, __("Select Location", "ProjectTheme"), "do_input");
        ?>
            </p>
        </li> -->
		
        
        <li>
        	<h2><?php 
        echo __('Country', 'ProjectTheme');
        ?>
:</h2>
        	<p>
        		<?php 
        $args = "orderby=name&order=ASC&hide_empty=0&parent=0";
        $terms = get_terms('project_location', $args);
        $cur_country = get_user_meta($uid, 'user_city');
        echo '<select name="user_city" class="do_input"><option value="">Select Country</option>';
        if ($terms) {
            foreach ($terms as $key => $term) {
                if ($cur_country[0] == $term->name) {
                    echo '<option value="' . $term->name . '" selected>' . $term->name . '</option>';
                } else {
                    echo '<option value="' . $term->name . '">' . $term->name . '</option>';
                }
            }
        }
        echo '</select>';
        ?>
        		<!-- <input type="text" size="35" name="user_city" value="<?php 
        echo get_user_meta($uid, 'user_city', true);
        ?>
" class="do_input" /> -->
        	</p>
        </li>
        
		<?php 
    }
    ?>
     
            <script>
			
			jQuery(document).ready(function(){
			tinyMCE.init({
					mode : "specific_textareas",
					theme : "modern", 
					/*statusbar: false,*/
					/*plugins : "autolink, lists, spellchecker, style, layer, table, advhr, advimage, advlink, emotions, iespell, inlinepopups, insertdatetime, preview, media, searchreplace, print, contextmenu, paste, directionality, fullscreen, noneditable, visualchars, nonbreaking, xhtmlxtras, template",*/
					editor_selector :"tinymce-enabled"
				});
			});
						
			</script>    
        <li>
        	<h2><?php 
    echo __('Description', 'ProjectTheme');
    ?>
:</h2>
        	<p><textarea cols="40" rows="5"  name="user_description" class="tinymce-enabled do_input"><?php 
    echo get_usermeta($uid, 'user_description', true);
    ?>
</textarea></p>
        </li>
        
        <?php 
    $opt = get_option('ProjectTheme_paypal_enable');
    if ($opt == "yes") {
        ?>
        
        <li>
        	<h2><?php 
        echo __('PayPal Email', 'ProjectTheme');
        ?>
:</h2>
        	<p><input type="text" size="35" name="paypal_email" value="<?php 
        echo get_user_meta($uid, 'paypal_email', true);
        ?>
" class="do_input" /></p>
        </li>
        
        <?php 
    }
    $opt = get_option('ProjectTheme_moneybookers_enable');
    if ($opt == "yes") {
        ?>
        
        <li>
        	<h2><?php 
        echo __('Moneybookers Email', 'ProjectTheme');
        ?>
:</h2>
        	<p><input type="text" size="35" name="moneybookers_email" value="<?php 
        echo get_user_meta($uid, 'moneybookers_email', true);
        ?>
" class="do_input" /></p>
        </li>
        
        <?php 
    }
    $opt = get_option('ProjectTheme_alertpay_enable');
    if ($opt == "yes") {
        ?>
        
         <li>
        	<h2><?php 
        echo __('Payza Email', 'ProjectTheme');
        ?>
:</h2>
        	<p><input type="text" size="35" name="payza_email" value="<?php 
        echo get_user_meta($uid, 'payza_email', true);
        ?>
" class="do_input" /></p>
        </li>
       <?php 
    }
    ?>
 
        
         <li>
        	<h2><?php 
    echo __('New Password', "ProjectTheme");
    ?>
:</h2>
        	<p><input type="password" value="" class="do_input" name="password" size="35" /></p>
        </li>
        
        
        <li>
        	<h2><?php 
    echo __('Repeat Password', "ProjectTheme");
    ?>
:</h2>
        	<p><input type="password" value="" class="do_input" name="reppassword" size="35"  /></p>
        </li>
        
        
        <?php 
    do_action('ProjectTheme_pers_info_fields_1');
    ?>

   		  <li>
        	<h2><?php 
    echo __('Profile Avatar', 'ProjectTheme');
    ?>
:</h2>
        	<style type="text/css">
        		.video-delete {
				    display: none;
				    color: #FF0000;
				    border: 1px solid #FF0000;
				    padding: 0 5px;
				    border-radius: 50%;
				    cursor: pointer;
				}
        		.sp-inline {
        			display: inline-block;
        		}
        	</style>
        		<p>
        			<span class="sp-inline">
        				<input type="file" name="avatar" class="new-file-style" />
        			</span>
        			<span class="video-delete" onclick="delete_choose();">X</span>
        		</p>
        		<script>
        			function delete_choose(){
       					$('.new-file-style').val('').show();
       					$('#new_name_file').remove();
       					$('.video-delete').hide();
    				}
    				$( document ).ready(function() {
    					$('.new-file-style').on("change", function(){
      						var file = $('.new-file-style')[0].files[0];
        					if(file){
        						$('.new-file-style').hide();
        						$('.video-delete').css('display','inline-block');
        						$( '<span id="new_name_file">'+file.name+'</span>' ).insertAfter( ".new-file-style" );
        					}
      					});
    				});
        		</script>
        	<p>
           		<?php 
    _e('max file size: 1mb. Formats: jpeg, jpg, png, gif', 'ProjectTheme');
    ?>
<br/>
            	<img width="50" height="50" border="0" src="<?php 
    echo ProjectTheme_get_avatar($uid, 50, 50);
    ?>
" /> 
            </p>
        </li>
   
   
   <li>
   <?php 
    if (function_exists('cimy_extract_ExtraFields')) {
        cimy_extract_ExtraFields();
    }
    ?>
   <?php 
    if (isset($_POST['delet-pic'])) {
        if (!empty($_FILES['avatar']["tmp_name"])) {
            if (filesize($_FILES['avatar']['tmp_name']) > 1024 * 1024) {
                echo '<div class="error">' . __("Avatar was not updated. File is to big!", "ProjectTheme") . '</div>';
                $xxp = 1;
            } else {
                //***********************************
                $pid = 0;
                $cid = $uid;
                require_once ABSPATH . "wp-admin" . '/includes/file.php';
                $upload_overrides = array('test_form' => false);
                $uploaded_file = wp_handle_upload($_FILES['avatar'], $upload_overrides);
                $file_name_and_location = $uploaded_file['http://bidqa.com/wp-content/themes/ProjectTheme/images/noav.jpg'];
                $file_title_for_media_library = $_FILES['http://bidqa.com/wp-content/themes/ProjectTheme/images/noav.jpg']['http://bidqa.com/wp-content/themes/ProjectTheme/images/noav.jpg'];
                $arr_file_type = wp_check_filetype(basename($_FILES['avatar']['name']));
                $uploaded_file_type = $arr_file_type['type'];
                $attachment = array('post_mime_type' => $uploaded_file_type, 'post_title' => addslashes($file_title_for_media_library), 'post_content' => '', 'post_status' => 'inherit', 'post_parent' => $pid, 'post_author' => $cid);
                require_once ABSPATH . "wp-admin" . '/includes/image.php';
                $attach_id = wp_insert_attachment($attachment, $file_name_and_location, $pid);
                $attach_data = wp_generate_attachment_metadata($attach_id, $file_name_and_location);
                wp_update_attachment_metadata($attach_id, $attach_data);
                update_user_meta($uid, 'avatar_' . 'project', $attach_id);
                //***********************************
            }
        }
    }
    ?>
   
   </li> http://bidqa.com/wp-content/themes/ProjectTheme/images/noav.jpg
        <li>
        <p><input type="submit" name="delet-pic" class="my-buttons" value="<?php 
    _e("Delete profile pic.", 'ProjectTheme');
    ?>
" /></p>
       &nbsp;&nbsp;&nbsp;
        <p><input type="submit" name="save-info" class="my-buttons" value="<?php 
    _e("Save", 'ProjectTheme');
    ?>
" /></p>
        </li>
        
       </ul> 
        
               
        
           </div>
           </div>     
            
            <div class="clear10"></div>
            
            <div class="my_box3" id="other_infs_mm1">
           
            
            	<div class="box_title" id="other_infs_mm"><?php 
    _e("Other Information", 'ProjectTheme');
    ?>
</div>
                <div class="box_content">  
                
        <ul class="post-new3">
        
        
        <?php 
    do_action('ProjectTheme_pers_info_fields_2');
    ?>
        
        <?php 
    $user_tp = get_user_meta($uid, 'user_tp', true);
    if (empty($user_tp)) {
        $user_tp = 'all';
    }
    if ($user_tp == "all") {
        $catid = array('all', 'service_buyer', 'service_provider');
    } else {
        $catid = array($user_tp);
    }
    if (current_user_can('manage_options')) {
        $catid = array('all', 'service_buyer', 'service_provider');
    }
    $k = 0;
    $arr = ProjectTheme_get_users_category_fields($catid, $uid);
    $exf = '';
    for ($i = 0; $i < count($arr); $i++) {
        $exf .= '<li>';
        $exf .= '<h2>' . $arr[$i]['field_name'] . $arr[$i]['id'] . ':</h2>';
        $exf .= '<p>' . $arr[$i]['value'] . '</p>';
        $exf .= '</li>';
        $k++;
    }
    echo $exf;
    if (ProjectTheme_is_user_provider($uid)) {
        $k++;
        ?>
           
                            
        <li>
        	<h2><?php 
        echo __('Hourly Rate', 'ProjectTheme');
        ?>
:</h2>
        	<p><?php 
        echo projectTheme_currency();
        ?>
<input type="text" size="7" name="per_hour" value="<?php 
        echo get_user_meta($uid, 'per_hour', true);
        ?>
" class="do_input" /> 
             *<?php 
        _e('your estimated hourly rate', 'ProjectTheme');
        ?>
</p>
        </li>
        <script type="text/javascript">
        	$( 'input[name="per_hour"]' ).keypress(function( event ) {
        	  var kkk = event.which;     		  
        	  console.log(kkk);
        	  if(((kkk>47 && kkk<58) || (kkk>64 && kkk<91) || kkk==8 || kkk==0 || kkk==46)){    		  
        	  	return true;
        	  }
        	  else{
        	  	return false;
        	  }
        	  
        	});
        </script>
        <?php 
    }
    global $current_user;
    get_currentuserinfo();
    $uid = $current_user->ID;
    $cid = $uid;
    if (ProjectTheme_is_user_provider($uid)) {
        ?>
           
                            
        <li>
        	<h2><?php 
        echo __('Portfolio Pictures', 'ProjectTheme');
        ?>
:</h2>
        	<p>
			
             <div class="cross_cross">



	<script type="text/javascript" src="<?php 
        echo get_bloginfo('template_url');
        ?>
/js/dropzone.js"></script>     
	<link rel="stylesheet" href="<?php 
        echo get_bloginfo('template_url');
        ?>
/css/dropzone.css" type="text/css" />
    
 
    
    
    <script>
 
	
	jQuery(function() {

Dropzone.autoDiscover = false; 	 
var myDropzoneOptions = {
  maxFilesize: 15,
    addRemoveLinks: true,
	acceptedFiles:'image/*',
    clickable: true,
	url: "<?php 
        bloginfo('siteurl');
        ?>
/?my_upload_of_project_files8=1",
};
 
var myDropzone = new Dropzone('div#myDropzoneElement2', myDropzoneOptions);

myDropzone.on("sending", function(file, xhr, formData) {
  formData.append("author", "<?php 
        echo $current_user->ID;
        ?>
"); // Will send the filesize along with the file as POST data.
  formData.append("ID", "<?php 
        echo $pid;
        ?>
"); // Will send the filesize along with the file as POST data.
});

   
    <?php 
        $args = array('order' => 'ASC', 'orderby' => 'post_date', 'post_type' => 'attachment', 'author' => $current_user->ID, 'meta_key' => 'is_portfolio', 'meta_value' => '1', 'numberposts' => -1);
        $attachments = get_posts($args);
        if ($attachments) {
            foreach ($attachments as $attachment) {
                $url = $attachment->guid;
                $imggg = $attachment->post_mime_type;
                $url = wp_get_attachment_url($attachment->ID);
                ?>
	
						var mockFile = { name: "<?php 
                echo $attachment->post_title;
                ?>
", size: 12345, serverId: '<?php 
                echo $attachment->ID;
                ?>
' };
						myDropzone.options.addedfile.call(myDropzone, mockFile);
						myDropzone.options.thumbnail.call(myDropzone, mockFile, "<?php 
                echo projectTheme_generate_thumb($attachment->ID, 100, 100);
                ?>
");						 
				
				<?php 
            }
        }
        ?>
 
	myDropzone.on("success", function(file, response) {
    /* Maybe display some more file information on your page */
	 file.serverId = response;
	 file.thumbnail = "<?php 
        echo bloginfo('template_url');
        ?>
/images/file_icon.png";
	 
	   
  });
  
  
myDropzone.on("removedfile", function(file, response) {
    /* Maybe display some more file information on your page */
	  delete_this2(file.serverId);
	 
  });  	
	
	});
	
	</script>

    

	<?php 
        _e('Click the grey area below to add project images.', 'ProjectTheme');
        ?>
    <div class="dropzone dropzone-previews" id="myDropzoneElement2" ></div>
 
    
	</div>
            
            
            
     
            
            
            </p>
        </li>
        
        <?php 
    }
    if (ProjectTheme_is_user_provider($uid)) {
        $k++;
        ?>
                    
                    <li>
                        <h2><?php 
        echo __('Emails Alerts', 'ProjectTheme');
        ?>
:</h2>
                        <p>
						*<?php 
        _e('you will get an email notification when a project is posted in the selected categories', 'ProjectTheme');
        ?>
						<div style="border:1px solid #ccc;background:#f2f2f2; overflow:auto; width:350px; border-radius:5px; height:160px;">
                        
                        <?php 
        global $wpdb;
        $ss = "select * from " . $wpdb->prefix . "project_email_alerts where uid='{$uid}'";
        $rr = $wpdb->get_results($ss);
        $terms = get_terms('project_cat', 'parent=0&orderby=name&hide_empty=0');
        foreach ($terms as $term) {
            $chk = projectTheme_check_list_emails($term->term_id, $rr) == true ? "checked='checked'" : "";
            echo '<input type="checkbox" name="email_cats[]" ' . $chk . ' value="' . $term->term_id . '" /> ' . $term->name . "<br/>";
            $terms2 = get_terms('project_cat', 'parent=' . $term->term_id . '&orderby=name&hide_empty=0');
            foreach ($terms2 as $term2) {
                $chk = projectTheme_check_list_emails($term2->term_id, $rr) == 1 ? "checked='checked'" : "";
                echo '&nbsp;&nbsp; &nbsp; <input type="checkbox" name="email_cats[]" ' . $chk . ' value="' . $term2->term_id . '" /> ' . $term2->name . "<br/>";
                $terms3 = get_terms('project_cat', 'parent=' . $term2->term_id . '&orderby=name&hide_empty=0');
                foreach ($terms3 as $term3) {
                    $chk = projectTheme_check_list_emails($term3->term_id, $rr) == 1 ? "checked='checked'" : "";
                    echo '&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <input type="checkbox" ' . $chk . ' name="email_cats[]" 
										value="' . $term3->term_id . '" /> ' . $term3->name . "<br/>";
                }
            }
        }
        ?>
                        
                        </div>
                        <br/>
                        </p>
                    </li>
        
        <?php 
        $ProjectTheme_enable_project_location = get_option('ProjectTheme_enable_project_location');
        if ($ProjectTheme_enable_project_location != "no") {
            ?>
        	   <li>
                        <h2>&nbsp;</h2>
                        <p>
						*<?php 
            _e('you will get an email notification when a project is posted in the selected locations', 'ProjectTheme');
            ?>
						<div style="border:1px solid #ccc;background:#f2f2f2; overflow:auto; width:350px; border-radius:5px; height:160px;">
                        
                        <?php 
            global $wpdb;
            $ss = "select * from " . $wpdb->prefix . "project_email_alerts_locs where uid='{$uid}'";
            $rr = $wpdb->get_results($ss);
            $terms = get_terms('project_location', 'parent=0&orderby=name&hide_empty=0');
            foreach ($terms as $term) {
                $chk = projectTheme_check_list_emails($term->term_id, $rr) == true ? "checked='checked'" : "";
                echo '<input type="checkbox" name="email_locs[]" ' . $chk . ' value="' . $term->term_id . '" /> ' . $term->name . "<br/>";
                $terms2 = get_terms('project_location', 'parent=' . $term->term_id . '&orderby=name&hide_empty=0');
                foreach ($terms2 as $term2) {
                    $chk = projectTheme_check_list_emails($term2->term_id, $rr) == 1 ? "checked='checked'" : "";
                    echo '&nbsp;&nbsp; &nbsp; <input type="checkbox" name="email_locs[]" ' . $chk . ' value="' . $term2->term_id . '" /> ' . $term2->name . "<br/>";
                    $terms3 = get_terms('project_location', 'parent=' . $term2->term_id . '&orderby=name&hide_empty=0');
                    foreach ($terms3 as $term3) {
                        $chk = projectTheme_check_list_emails($term3->term_id, $rr) == 1 ? "checked='checked'" : "";
                        echo '&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <input type="checkbox" ' . $chk . ' name="email_locs[]" 
										value="' . $term3->term_id . '" /> ' . $term3->name . "<br/>";
                    }
                }
            }
            ?>
                        
                        </div>
                        <br/>
                        </p>
                    </li>
        
        
        <?php 
        }
    }
    if ($k == 0) {
        echo '<style>#other_infs_mm, #bk_save_not, #other_infs_mm1 { display:none; } </style>';
    }
    ?>
		 
        
        			
                    <li id="bk_save_not">
        <h2>&nbsp;</h2> <input type="hidden" value="<?php 
    echo $uid;
    ?>
" name="user_id" />
        <p><input type="submit" class="my-buttons" name="save-info" value="<?php 
    _e("Save", 'ProjectTheme');
    ?>
" /></p>
        </li>
                    
        </ul>
                
                
              
                </div>
                </div>
                
                
             
            
            
            
            
		</form>

                
        </div> <!-- end dif content -->
        
        <?php 
    ProjectTheme_get_users_links();
    ?>
        
    
	
<?php 
}
Example #9
0
function ProjectTheme_get_users_links()
{
    global $current_user, $wpdb;
    get_currentuserinfo();
    $rd = projectTheme_get_unread_number_messages($current_user->ID);
    if ($rd > 0) {
        $ssk = "<span class='notif_a'>" . $rd . "</span>";
    } else {
        $ssk = '';
    }
    $uid = $current_user->ID;
    //-----------------------
    $query = "select id from " . $wpdb->prefix . "project_ratings where fromuser='******' AND awarded='0'";
    $r = $wpdb->get_results($query);
    $ttl_fdbks = count($r);
    if ($ttl_fdbks > 0) {
        $ttl_fdbks2 = "<span class='notif_a'>" . $ttl_fdbks . "</span>";
    }
    $ProjectTheme_enable_2_user_tp = get_option('ProjectTheme_enable_2_user_tp');
    $user_tp = get_user_meta($uid, 'user_tp', true);
    ?>
    
	<div id="right-sidebar" class="account-sidebar">
			<ul class="xoxo">
			
			<li class="widget-container widget_text"> 
			<p>
			
            <ul id="my-account-admin-menu">
            	<li><a href="<?php 
    echo projectTheme_my_account_link();
    ?>
" <?php 
    echo $current_page == "home" ? "class='active'" : "";
    ?>
><?php 
    _e("MyAccount Home", 'ProjectTheme');
    ?>
</a></li>
                
                <?php 
    $pmnts_lnk = get_permalink(get_option('ProjectTheme_my_account_payments_id'));
    $pmnts_lnk = apply_filters('ProjectTheme_my_account_payments_id_link', $pmnts_lnk);
    $ProjectTheme_enable_credits_wallet = get_option('ProjectTheme_enable_credits_wallet');
    if ($ProjectTheme_enable_credits_wallet != 'no') {
        ?>
             
                <li><a href="<?php 
        echo $pmnts_lnk;
        ?>
"><?php 
        _e("Finances", 'ProjectTheme');
        ?>
</a></li>    
                <?php 
    }
    ?>
                            
                <li><a href="<?php 
    echo get_permalink(get_option('ProjectTheme_my_account_private_messages_id'));
    ?>
"><?php 
    echo sprintf(__("Private Messages %s", 'ProjectTheme'), $ssk);
    ?>
</a></li>
               	<li><a href="<?php 
    echo get_permalink(get_option('ProjectTheme_my_account_personal_info_id'));
    ?>
"><?php 
    _e("Personal Info", 'ProjectTheme');
    ?>
</a></li>
                <li><a href="<?php 
    echo get_permalink(get_option('ProjectTheme_my_account_feedback_id'));
    ?>
"><?php 
    printf(__("Reviews/Feedback %s", 'ProjectTheme'), $ttl_fdbks2);
    ?>
</a></li>
                
                
                <?php 
    do_action('ProjectTheme_my_account_main_menu');
    ?>
                
            </ul>
            
            </p>
			</li>
            
            <!-- ###### -->
			<?php 
    if (ProjectTheme_is_user_business($uid)) {
        ?>
            <li class="widget-container widget_text"><h3 class="widget-title"><?php 
        _e("Service Contractor Menu", 'ProjectTheme');
        ?>
</h3>
			<p>
			<?php 
        global $wpdb;
        $querystr = "\n\t\t\t\t\tSELECT distinct wposts.ID \n\t\t\t\t\tFROM {$wpdb->posts} wposts, {$wpdb->postmeta} wpostmeta2, {$wpdb->postmeta} wpostmeta3\n\t\t\t\t\tWHERE wposts.post_author='{$uid}' AND wposts.ID = wpostmeta2.post_id AND\n\t\t\t\t\twpostmeta2.meta_key='paid_user' AND wpostmeta2.meta_value='0'\n\t\t\t\t\t\n\t\t\t\t\tAND wposts.ID = wpostmeta3.post_id AND\n\t\t\t\t\twpostmeta3.meta_key='delivered' AND wpostmeta3.meta_value='1'\n\t\t\t\t\t\n\t\t\t\t\t AND wposts.post_type = 'project' ";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        $ttl_prj = count($pageposts);
        if ($ttl_prj > 0) {
            $scn = "<span class='notif_a'>" . $ttl_prj . "</span>";
        }
        //------------------------------------------------
        $querystr = "\n\t\t\t\t\tSELECT distinct wposts.ID \n\t\t\t\t\tFROM {$wpdb->posts} wposts, {$wpdb->postmeta} wpostmeta2\n\t\t\t\t\tWHERE wposts.post_author='{$uid}' AND wposts.ID = wpostmeta2.post_id AND\n\t\t\t\t\twpostmeta2.meta_key='paid' AND wpostmeta2.meta_value='0' AND wposts.post_type = 'project' AND wposts.post_status = 'draft' ";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        $ttl_prj2 = count($pageposts);
        if ($ttl_prj2 > 0) {
            $scn2 = "<span class='notif_a'>" . $ttl_prj2 . "</span>";
        }
        //------------------------------------------------
        $querystr = "\n\t\t\t\t\tSELECT distinct wposts.ID \n\t\t\t\t\tFROM {$wpdb->posts} wposts, {$wpdb->postmeta} wpostmeta2\n\t\t\t\t\tWHERE wposts.post_author='{$uid}' AND wposts.ID = wpostmeta2.post_id AND\n\t\t\t\t\twpostmeta2.meta_key='outstanding' AND wpostmeta2.meta_value='1' AND wposts.post_type = 'project' ";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        $ttl_prj2 = count($pageposts);
        if ($ttl_prj2 > 0) {
            $compl = "<span class='notif_a'>" . $ttl_prj2 . "</span>";
        }
        ?>
            <ul id="my-account-admin-menu_seller">
            	 <li><a href="<?php 
        echo projectTheme_post_new_link();
        ?>
" ><?php 
        _e("Post New Project", 'ProjectTheme');
        ?>
</a></li>  
                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_active_projects_id'));
        ?>
"><?php 
        _e("Active Projects", 'ProjectTheme');
        ?>
</a></li>
                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_closed_projects_id'));
        ?>
"><?php 
        _e("Closed Projects", 'ProjectTheme');
        ?>
</a></li>
                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_unpublished_projects_id'));
        ?>
"><?php 
        printf(__("Unpublished Projects %s", 'ProjectTheme'), $scn2);
        ?>
</a></li>
                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_awaiting_completion_id'));
        ?>
"><?php 
        printf(__("Awaiting Completion %s", 'ProjectTheme'), $compl);
        ?>
</a></li>
                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_outstanding_payments_id'));
        ?>
"><?php 
        printf(__("Outstanding Payments %s", 'ProjectTheme'), $scn);
        ?>
</a></li>
                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_completed_payments_id'));
        ?>
"><?php 
        _e("Completed Payments", 'ProjectTheme');
        ?>
</a></li>
                 
                 <?php 
        do_action('ProjectTheme_my_account_service_contractor_menu');
        ?>
                 
            </ul>
            
            </p>
			</li>
            
            <!-- ###### -->
			<?php 
    }
    if (ProjectTheme_is_user_provider($uid)) {
        ?>
            <li class="widget-container widget_text"><h3 class="widget-title"><?php 
        _e("Freelancer Menu", 'ProjectTheme');
        ?>
</h3>
			<p>
			<?php 
        $querystr = "\n\t\t\t\t\tSELECT distinct wposts.ID \n\t\t\t\t\tFROM {$wpdb->posts} wposts, {$wpdb->postmeta} wpostmeta2, {$wpdb->postmeta} wpostmeta3\n\t\t\t\t\tWHERE wposts.ID = wpostmeta2.post_id AND\n\t\t\t\t\twpostmeta2.meta_key='winner' AND wpostmeta2.meta_value='{$uid}' AND\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\twposts.ID = wpostmeta3.post_id AND\n\t\t\t\t\twpostmeta3.meta_key='outstanding' AND wpostmeta3.meta_value='1' \n\t\t\t\t\t\n\t\t\t\t\tAND wposts.post_type = 'project' ";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        $outsnr = count($pageposts);
        if ($outsnr > 0) {
            $outsnr = "<span class='notif_a'>" . $outsnr . "</span>";
        } else {
            $outsnr = '';
        }
        //---------------------------------------
        $querystr = "\n\t\t\t\t\tSELECT distinct wposts.ID \n\t\t\t\t\tFROM {$wpdb->posts} wposts, {$wpdb->postmeta} wpostmeta2, {$wpdb->postmeta} wpostmeta3, {$wpdb->postmeta} wpostmeta4\n\t\t\t\t\tWHERE wposts.ID = wpostmeta2.post_id AND\n\t\t\t\t\twpostmeta2.meta_key='winner' AND wpostmeta2.meta_value='{$uid}' AND\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\twposts.ID = wpostmeta3.post_id AND\n\t\t\t\t\twpostmeta3.meta_key='delivered' AND wpostmeta3.meta_value='1' AND\n\t\t\t\t\t\n\t\t\t\t\twposts.ID = wpostmeta4.post_id AND\n\t\t\t\t\twpostmeta4.meta_key='paid_user' AND wpostmeta4.meta_value='0' \n\t\t\t\t\t\n\t\t\t\t\tAND wposts.post_type = 'project' ";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        $awnr = count($pageposts);
        if ($awnr > 0) {
            $awnr = "<span class='notif_a'>" . $awnr . "</span>";
        } else {
            $awnr = '';
        }
        ?>
            <ul id="my-account-admin-menu_buyer">
                   
                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_won_projects_id'));
        ?>
"><?php 
        _e("Won Projects", 'ProjectTheme');
        ?>
</a></li>
                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_outstanding_projects_id'));
        ?>
"><?php 
        printf(__("Outstanding Projects %s", 'ProjectTheme'), $outsnr);
        ?>
</a></li>
                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_awaiting_payments_id'));
        ?>
"><?php 
        printf(__("Awaiting Payments %s", 'ProjectTheme'), $awnr);
        ?>
</a></li>
                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_delivered_projects_id'));
        ?>
"><?php 
        _e("Delivered & Paid Projects", 'ProjectTheme');
        ?>
</a></li>
                 
                 
                 <li><a href="<?php 
        echo get_permalink(get_option('ProjectTheme_my_account_bid_projects_id'));
        ?>
"><?php 
        _e("My Proposals", 'ProjectTheme');
        ?>
</a></li>
                 
                 <?php 
        do_action('ProjectTheme_my_account_service_provider_menu');
        ?>
                 
            </ul>
             
            </p>
			</li>
            <?php 
    }
    ?>
            
			</ul>
		</div>
		<?php 
}
Example #10
0
function ProjectTheme_post_new_area_function()
{
    global $wp_query, $projectOK, $current_user, $MYerror;
    get_currentuserinfo();
    $new_Project_step = $wp_query->query_vars['post_new_step'];
    if (empty($new_Project_step)) {
        $new_Project_step = 1;
    }
    $pid = $wp_query->query_vars['projectid'];
    $uid = $current_user->ID;
    ?>
    	<div id="content" class="sonita">
        	
            <div class="my_box3">            
                <div class="box_content"> 
                
                <?php 
    $is_it_allowed = true;
    $is_it_allowed = apply_filters('ProjectTheme_is_it_allowed_place_bids', $is_it_allowed);
    if ($is_it_allowed != true) {
        do_action('ProjectTheme_is_it_not_allowed_place_bids_action');
    } else {
        ?>
                
            	
    			<?php 
        echo '<div id="steps">';
        echo '<ul>';
        echo '<li ' . ($new_Project_step == '1' ? "class='active_step' " : "") . '>' . __("Project Info", 'ProjectTheme') . '</li>';
        do_action('ProjectTheme_after_step1_show', $new_Project_step);
        echo '<li ' . ($new_Project_step == '2' ? "class='active_step' " : "") . '>' . __("Options", 'ProjectTheme') . '</li>';
        echo '<li ' . ($new_Project_step == '3' ? "class='active_step' " : "") . '>' . __("Preview", 'ProjectTheme') . '</li>';
        echo '<li ' . ($new_Project_step == '4' ? "class='active_step' " : "") . '>' . __("Payment & Finish", 'ProjectTheme') . '</li>';
        echo '</ul>';
        echo '</div>';
        //****************************************************************************************
        if ($new_Project_step == "1") {
            //-----------------
            $location = wp_get_object_terms($pid, 'project_location', array('order' => 'ASC', 'orderby' => 'term_id'));
            $cat = wp_get_object_terms($pid, 'project_cat', array('order' => 'ASC', 'orderby' => 'term_id'));
            if (!empty($pid)) {
                $post = get_post($pid);
            }
            if (is_array($MYerror)) {
                if ($projectOK == 0) {
                    echo '<div class="errrs">';
                    echo __('Your form has errors. Please check below, correct the errors, then submit again.', 'ProjectTheme');
                    echo '</div>';
                }
            }
            ?>
    <div class="sonita2">
 <form method="post" action="<?php 
            echo ProjectTheme_post_new_with_pid_stuff_thg($pid, '1');
            ?>
">  
    <ul class="post-new">
    <?php 
            do_action('ProjectTheme_step1_before_title');
            ?>
    	
        
        <li>
        	<h3><?php 
            _e('Project Main Information', 'ProjectTheme');
            ?>
</h3>
        </li>
        
        <li class="<?php 
            echo projecttheme_get_post_new_error_thing('project_title');
            ?>
">
        <?php 
            echo projecttheme_get_post_new_error_thing_display('project_title');
            ?>
        
        	<h2><?php 
            echo __('Your project title', 'ProjectTheme');
            ?>
</h2>
        	<p><input type="text" size="50" class="do_input_new full_wdth_me" name="project_title" placeholder="<?php 
            _e('eg: I need a website created very soon.', 'ProjectTheme');
            ?>
" value="<?php 
            echo empty($_POST['project_title']) ? $post->post_title == "Auto Draft" ? "" : $post->post_title : $_POST['project_title'];
            ?>
" /></p>
        </li>
        
         <?php 
            do_action('ProjectTheme_step1_before_description');
            ?>
        <?php 
            $pst = $post->post_content;
            $pst = str_replace("<br />", "", $pst);
            ?>
        <li class="<?php 
            echo projecttheme_get_post_new_error_thing('project_description');
            ?>
">
        <?php 
            echo projecttheme_get_post_new_error_thing_display('project_description');
            ?>
        
        	<h2><?php 
            echo __('Description', 'ProjectTheme');
            ?>
</h2>
        <p><textarea rows="6" cols="60" class="full_wdth_me do_input_new description_edit" placeholder="<?php 
            _e('Describe here your project scope.', 'ProjectTheme');
            ?>
"  name="project_description"><?php 
            echo trim($pst);
            ?>
</textarea></p>
        </li>

		
         <li>
        	<h3><?php 
            _e('Categories', 'ProjectTheme');
            ?>
</h3>
        </li>
       
     <?php 
            do_action('ProjectTheme_step1_before_category');
            ?>
  
        
            <script>
			
									function display_subcat(vals)
									{
										jQuery.post("<?php 
            bloginfo('siteurl');
            ?>
/?get_subcats_for_me=1", {queryString: ""+vals+""}, function(data){
											if(data.length >0) {
												 
												jQuery('#sub_cats').html(data);
												 
											}
										});
										
									}
									
									
									function display_subcat2(vals)
									{
										jQuery.post("<?php 
            bloginfo('siteurl');
            ?>
/?get_locscats_for_me=1", {queryString: ""+vals+""}, function(data){
											if(data.length >0) {
												 
												jQuery('#sub_locs').html(data);
												jQuery('#sub_locs2').html("&nbsp;");
												 
											}
											else
											{
												jQuery('#sub_locs').html("&nbsp;");
												jQuery('#sub_locs2').html("&nbsp;");	
											}
										});
										
									}
									
									function display_subcat3(vals)
									{
										jQuery.post("<?php 
            bloginfo('siteurl');
            ?>
/?get_locscats_for_me2=1", {queryString: ""+vals+""}, function(data){
											if(data.length >0) {
												 
												jQuery('#sub_locs2').html(data);
												 
											}
										});
										
									}
									
									</script>
        
        <li class="<?php 
            echo projecttheme_get_post_new_error_thing('project_category');
            ?>
">
        <?php 
            echo projecttheme_get_post_new_error_thing_display('project_category');
            ?>
        
        	 
        	<p class="strom_100">
			
            
            
            <?php 
            if (get_option('ProjectTheme_enable_multi_cats') == "yes") {
                ?>
			<div class="multi_cat_placeholder_thing">
            
            	<?php 
                $selected_arr = ProjectTheme_build_my_cat_arr($pid);
                echo projectTheme_get_categories_multiple('project_cat', $selected_arr);
                ?>
            
            </div>
            
            <?php 
            } else {
                ?>
            
			<?php 
                echo projectTheme_get_categories_clck("project_cat", !isset($_POST['project_cat_cat']) ? is_array($cat) ? $cat[0]->term_id : "" : htmlspecialchars($_POST['project_cat_cat']), __('Select Category', 'ProjectTheme'), "do_input_new", 'onchange="display_subcat(this.value)"');
                echo '<br/><span id="sub_cats">';
                if (!empty($cat[1]->term_id)) {
                    $args2 = "orderby=name&order=ASC&hide_empty=0&parent=" . $cat[0]->term_id;
                    $sub_terms2 = get_terms('project_cat', $args2);
                    $ret = '<select class="do_input_new" name="subcat">';
                    $ret .= '<option value="">' . __('Select Subcategory', 'ProjectTheme') . '</option>';
                    $selected1 = $cat[1]->term_id;
                    foreach ($sub_terms2 as $sub_term2) {
                        $sub_id2 = $sub_term2->term_id;
                        $ret .= '<option ' . ($selected1 == $sub_id2 ? "selected='selected'" : " ") . ' value="' . $sub_id2 . '">' . $sub_term2->name . '</option>';
                    }
                    $ret .= "</select>";
                    echo $ret;
                }
                echo '</span>';
                ?>
            <?php 
            }
            ?>
            
            
            </p>
        </li>
  
  	
        
        <?php 
            do_action('ProjectTheme_step1_before_tags');
            $project_tags = '';
            $t = wp_get_post_tags($post->ID);
            foreach ($t as $tags) {
                $project_tags .= $tags->name . ", ";
            }
            ?>
		<li>
        	<h2><?php 
            echo __('Tags', 'ProjectTheme');
            ?>
</h2>
        <p><input type="text" size="50" class="full_wdth_me do_input_new"  name="project_tags" placeholder="<?php 
            _e('eg: something, comma, separated.', 'ProjectTheme');
            ?>
" value="<?php 
            echo $project_tags;
            ?>
" /> </p>
        </li>
        
        
        <?php 
            do_action('ProjectTheme_step1_after_tags');
            ?>
        
        <li>
        	<h3><?php 
            _e('Skills', 'ProjectTheme');
            ?>
</h3>
        </li>
        
        
        <li>
        <div class="multi_cat_placeholder_thing">
            
            	<?php 
            $selected_arr = projectTheme_build_my_cat_arr2($pid);
            echo projectTheme_get_categories_multiple2('project_skill', $selected_arr);
            ?>
            
        </div>
        </li>
        
        
    
  <li>
        	<h3><?php 
            _e('Pricing and Budget', 'ProjectTheme');
            ?>
</h3>
        </li>
  
  <?php 
            do_action('ProjectTheme_step1_before_price');
            ?>
  
        <li><h2><?php 
            echo __('Project Budget', 'ProjectTheme');
            ?>
</h2>
        <p class="strom_100">
        
      <?php 
            $sel = get_post_meta($pid, 'budgets', true);
            echo ProjecTheme_get_budgets_dropdown($sel, 'do_input_new');
            ?>
      
      </p>
        </li>
       
        <?php 
            do_action('ProjectTheme_step1_before_ending');
            ?>
        
        <li>
        <h2>
         
        <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/jquery-ui.min.js"></script>
        	
        
        <link rel="stylesheet" media="all" type="text/css" href="<?php 
            echo get_bloginfo('template_url');
            ?>
/css/ui_thing.css" />
		<script type="text/javascript" language="javascript" src="<?php 
            echo get_bloginfo('template_url');
            ?>
/js/timepicker.js"></script>
          

       <?php 
            _e("Project Ending On", 'ProjectTheme');
            ?>
</h2>
       <?php 
            $dt = get_post_meta($pid, 'ending', true);
            if (!empty($dt)) {
                $dt = date_i18n('d-m-Y H:i', $dt);
            }
            ?>
       <p><input type="text" name="ending" id="ending" class="full_wdth_me do_input_new" value="<?php 
            echo $dt;
            ?>
"  /></p>
       </li>
        
 		<script>
		<?php 
            $dd = get_option('projectTheme_project_period');
            if (empty($dd)) {
                $dd = 7;
            }
            ?>
		
			var myDate=new Date();
			myDate.setDate(myDate.getDate()+<?php 
            echo $dd;
            ?>
);
			
			$(document).ready(function() {
				 $('#ending').datetimepicker({
				showSecond: false,
				timeFormat: 'hh:mm:ss',
				
					currentText: '<?php 
            _e('Now', 'ProjectTheme');
            ?>
',
					closeText: '<?php 
            _e('Done', 'ProjectTheme');
            ?>
',
					ampm: false,
					dateFormat: 'dd-mm-yy',
					timeFormat: 'hh:mm tt',
					timeSuffix: '',
					maxDateTime: myDate,
					timeOnlyTitle: '<?php 
            _e('Choose Time', 'ProjectTheme');
            ?>
',
					timeText: '<?php 
            _e('Time', 'ProjectTheme');
            ?>
',
					hourText: '<?php 
            _e('Hour', 'ProjectTheme');
            ?>
',
					minuteText: '<?php 
            _e('Minute', 'ProjectTheme');
            ?>
',
					secondText: '<?php 
            _e('Second', 'ProjectTheme');
            ?>
',
					timezoneText: '<?php 
            _e('Time Zone', 'ProjectTheme');
            ?>
'
			
			});});
 
 		</script>
        
        
            

        
        
        <?php 
            do_action('ProjectTheme_step1_before_location');
            ?>
        <?php 
            $ProjectTheme_enable_project_location = get_option('ProjectTheme_enable_project_location');
            if ($ProjectTheme_enable_project_location == "yes") {
                ?>
        
          <li>
        	<h3><?php 
                _e('Location', 'ProjectTheme');
                ?>
</h3>
        </li>
        
        <li  class="<?php 
                echo projecttheme_get_post_new_error_thing('project_location');
                ?>
">
        <?php 
                echo projecttheme_get_post_new_error_thing_display('project_location');
                ?>
        
        	<h2><?php 
                echo __('Location', 'ProjectTheme');
                ?>
</h2>
        <p class="strom_100"> 
        
  
        
        <?php 
                echo projectTheme_get_categories_clck("project_location", !isset($_POST['project_location_cat']) ? is_array($location) ? $location[0]->term_id : "" : htmlspecialchars($_POST['project_location_cat']), __('Select Location', 'ProjectTheme'), "do_input_new", 'onchange="display_subcat2(this.value)"');
                echo '<br/><span id="sub_locs">';
                if (!empty($location[1]->term_id)) {
                    $args2 = "orderby=name&order=ASC&hide_empty=0&parent=" . $location[0]->term_id;
                    $sub_terms2 = get_terms('project_location', $args2);
                    $ret = '<select class="do_input_new" name="subloc">';
                    $ret .= '<option value="">' . __('Select SubLocation', 'ProjectTheme') . '</option>';
                    $selected1 = $location[1]->term_id;
                    foreach ($sub_terms2 as $sub_term2) {
                        $sub_id2 = $sub_term2->term_id;
                        $ret .= '<option ' . ($selected1 == $sub_id2 ? "selected='selected'" : " ") . ' value="' . $sub_id2 . '">' . $sub_term2->name . '</option>';
                    }
                    $ret .= "</select>";
                    echo $ret;
                }
                echo '</span>';
                echo '<br/><span id="sub_locs2">';
                if (!empty($location[2]->term_id)) {
                    $args2 = "orderby=name&order=ASC&hide_empty=0&parent=" . $location[1]->term_id;
                    $sub_terms2 = get_terms('project_location', $args2);
                    $ret = '<select class="do_input_new" name="subloc2">';
                    $ret .= '<option value="">' . __('Select SubLocation', 'ProjectTheme') . '</option>';
                    $selected1 = $location[2]->term_id;
                    foreach ($sub_terms2 as $sub_term2) {
                        $sub_id2 = $sub_term2->term_id;
                        $ret .= '<option ' . ($selected1 == $sub_id2 ? "selected='selected'" : " ") . ' value="' . $sub_id2 . '">' . $sub_term2->name . '</option>';
                    }
                    $ret .= "</select>";
                    echo $ret;
                }
                echo '</span>';
                ?>
        
        
        
        
        
        
        
        </p>
        </li>
       
       
       <?php 
                do_action('ProjectTheme_step1_before_address');
                ?>
    
       <?php 
                $show_address = true;
                $show_address = apply_filters('ProjectTheme_show_address_filter', $show_address);
                if ($show_address == true) {
                    ?>
 
        <li>
        	<h2><?php 
                    echo __('Address', 'ProjectTheme');
                    ?>
</h2>
        <p><input type="text" size="50" class="full_wdth_me do_input_new" placeholder="<?php 
                    _e('eg: New York, 13221', 'ProjectTheme');
                    ?>
"  name="project_location_addr" value="<?php 
                    echo !isset($_POST['project_location_addr']) ? get_post_meta($pid, 'Location', true) : $_POST['project_location_addr'];
                    ?>
" /> </p>
        </li>
        <?php 
                }
            }
            ?>
        
         <li>
        	<h3><?php 
            _e('Attach Images', 'ProjectTheme');
            ?>
</h3>
        </li>
        
         <li>
        <div class="cross_cross">

 
    
 
    
    
    <script>
 
	
	jQuery(function() {

Dropzone.autoDiscover = false; 	 
var myDropzoneOptions = {
  maxFilesize: 15,
    addRemoveLinks: true,
	acceptedFiles:'image/*',
    clickable: true,
	url: "<?php 
            bloginfo('siteurl');
            ?>
/?my_upload_of_project_files2=1",
};
 
var myDropzone = new Dropzone('div#myDropzoneElement2', myDropzoneOptions);

myDropzone.on("sending", function(file, xhr, formData) {
  formData.append("author", "<?php 
            echo $cid;
            ?>
"); // Will send the filesize along with the file as POST data.
  formData.append("ID", "<?php 
            echo $pid;
            ?>
"); // Will send the filesize along with the file as POST data.
});

   
    <?php 
            $args = array('order' => 'ASC', 'orderby' => 'menu_order', 'post_type' => 'attachment', 'post_parent' => $pid, 'post_status' => null, 'post_mime_type' => 'image', 'numberposts' => -1);
            $attachments = get_posts($args);
            if ($pid > 0) {
                if ($attachments) {
                    foreach ($attachments as $attachment) {
                        $url = $attachment->guid;
                        $imggg = $attachment->post_mime_type;
                        $url = wp_get_attachment_url($attachment->ID);
                        ?>
	
						var mockFile = { name: "<?php 
                        echo $attachment->post_title;
                        ?>
", size: 12345, serverId: '<?php 
                        echo $attachment->ID;
                        ?>
' };
						myDropzone.options.addedfile.call(myDropzone, mockFile);
						myDropzone.options.thumbnail.call(myDropzone, mockFile, "<?php 
                        echo projectTheme_generate_thumb($attachment->ID, 100, 100);
                        ?>
");						 
				
				<?php 
                    }
                }
            }
            ?>
 
	myDropzone.on("success", function(file, response) {
    /* Maybe display some more file information on your page */
	 file.serverId = response;
	 file.thumbnail = "<?php 
            echo bloginfo('template_url');
            ?>
/images/file_icon.png";
	 
	   
  });
  
  
myDropzone.on("removedfile", function(file, response) {
    /* Maybe display some more file information on your page */
	  delete_this2(file.serverId);
	 
  });  	
	
	});
	
	</script>

    

	<?php 
            _e('Click the grey area below to add project images. Other files are not accepted. Use the form below.', 'ProjectTheme');
            ?>
    <div class="dropzone dropzone-previews" id="myDropzoneElement2" ></div>
 
    
	</div>
        </li>
   		
        <li>
        	<h3><?php 
            _e('Attach Files', 'ProjectTheme');
            ?>
</h3>
        </li>
        
        
        <li>
        <div class="cross_cross">



	<script type="text/javascript" src="<?php 
            echo get_bloginfo('template_url');
            ?>
/js/dropzone.js"></script>     
	<link rel="stylesheet" href="<?php 
            echo get_bloginfo('template_url');
            ?>
/css/dropzone.css" type="text/css" />
    
 
    
    
    <script>
 
	
	jQuery(function() {

Dropzone.autoDiscover = false; 	 
var myDropzoneOptions = {
  maxFilesize: 15,
    addRemoveLinks: true,
	acceptedFiles:'.zip,.pdf,.rar,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.psd,.ai',
    clickable: true,
	url: "<?php 
            bloginfo('siteurl');
            ?>
/?my_upload_of_project_files_proj=1",
};
 
var myDropzone = new Dropzone('div#myDropzoneElement', myDropzoneOptions);

myDropzone.on("sending", function(file, xhr, formData) {
  formData.append("author", "<?php 
            echo $cid;
            ?>
"); // Will send the filesize along with the file as POST data.
  formData.append("ID", "<?php 
            echo $pid;
            ?>
"); // Will send the filesize along with the file as POST data.
});

   
    <?php 
            $args = array('order' => 'ASC', 'orderby' => 'menu_order', 'post_type' => 'attachment', 'meta_key' => 'is_prj_file', 'meta_value' => '1', 'post_parent' => $pid, 'post_status' => null, 'numberposts' => -1);
            $attachments = get_posts($args);
            if ($pid > 0) {
                if ($attachments) {
                    foreach ($attachments as $attachment) {
                        $url = $attachment->guid;
                        $imggg = $attachment->post_mime_type;
                        if ('image/png' != $imggg && 'image/jpeg' != $imggg) {
                            $url = wp_get_attachment_url($attachment->ID);
                            ?>

					var mockFile = { name: "<?php 
                            echo $attachment->post_title;
                            ?>
", size: 12345, serverId: '<?php 
                            echo $attachment->ID;
                            ?>
' };
					myDropzone.options.addedfile.call(myDropzone, mockFile);
					myDropzone.options.thumbnail.call(myDropzone, mockFile, "<?php 
                            echo bloginfo('template_url');
                            ?>
/images/file_icon.png");
					 
			
			<?php 
                        }
                    }
                }
            }
            ?>
   


myDropzone.on("success", function(file, response) {
    /* Maybe display some more file information on your page */
	 file.serverId = response;
	 file.thumbnail = "<?php 
            echo bloginfo('template_url');
            ?>
/images/file_icon.png";
	 
	   
  });
  
  
myDropzone.on("removedfile", function(file, response) {
    /* Maybe display some more file information on your page */
	  delete_this2(file.serverId);
	 
  });  	
	
	});
	
	</script>

    <script type="text/javascript">
	
	function delete_this2(id)
	{
		 jQuery.ajax({
						method: 'get',
						url : '<?php 
            echo get_bloginfo('siteurl');
            ?>
/index.php/?_ad_delete_pid='+id,
						dataType : 'text',
						success: function (text) {   jQuery('#image_ss'+id).remove();  }
					 });
		  //alert("a");
	
	}

	
 
	
	
	</script>

	<?php 
            _e('Click the grey area below to add project files. Images are not accepted.', 'ProjectTheme');
            ?>
    <div class="dropzone dropzone-previews" id="myDropzoneElement" ></div>
 
    
	</div>
        </li>
        
        <li>
        <h2>&nbsp;</h2>
        <p> 
        <input type="submit" name="project_submit1" value="<?php 
            _e("Next Step", 'ProjectTheme');
            ?>
 >>" class="submit_bottom" /></p>
        </li>
    	
        <?php 
            do_action('ProjectTheme_step1_after_submit');
            ?>
    
    </ul>
    </form>
    </div>
    <?php 
        }
        if ($new_Project_step == "2") {
            global $MYerror, $projectOK;
            $cid = $current_user->ID;
            do_action('ProjectTheme_post_new_step2_before_images');
            if (is_array($MYerror)) {
                if ($projectOK == 0) {
                    echo '<div class="errrs">';
                    echo __('Your form has errors. Please check below, correct the errors, then submit again.', 'ProjectTheme');
                    echo '</div>';
                }
            }
            ?>
    
    
    
   
 	<ul class="post-new">
    
     

 
      <form method="post" > 
      <?php 
            do_action('ProjectTheme_step2_before_project_files');
            ?>
      
      
      
      
      
      	<?php 
            /*-------  custom fields  -------- */
            ?>
        <?php 
            $show_fields_in_step2 = true;
            $show_fields_in_step2 = apply_filters('ProjectTheme_show_fields_in_step2', $show_fields_in_step2);
            if ($show_fields_in_step2 == true) {
                $catid = ProjectTheme_get_project_primary_cat($pid);
                $arr = ProjectTheme_get_project_category_fields($catid, $pid);
                for ($i = 0; $i < count($arr); $i++) {
                    echo '<li class="' . projecttheme_get_post_new_error_thing('custom_field_' . $arr[$i]['id']) . '"  >';
                    echo projecttheme_get_post_new_error_thing_display('custom_field_' . $arr[$i]['id']);
                    echo '<h2>' . $arr[$i]['field_name'] . $arr[$i]['id'] . '</h2>';
                    echo '<p>' . $arr[$i]['value'] . '</p>';
                    echo '</li>';
                }
            }
            $ProjectTheme_enable_featured_option = get_option('ProjectTheme_enable_featured_option');
            if ($ProjectTheme_enable_featured_option != "no") {
                ?>
		
	 
      
      
        <li>
        <h2><?php 
                _e("Feature project?", 'ProjectTheme');
                ?>
</h2>
        <p><input type="checkbox" class="do_input_new" name="featured" value="1" 
		<?php 
                $feature = get_post_meta($pid, 'featured', true);
                echo $feature == "1" ? "checked='checked'" : "";
                ?>
 /> 
        <?php 
                $projectTheme_featured_fee = get_option('projectTheme_featured_fee');
                $sl = __('Extra fee is applied', 'ProjectTheme');
                if (empty($projectTheme_featured_fee) or $projectTheme_featured_fee <= 0) {
                    $sl = '';
                }
                printf(__("By clicking this checkbox you mark your project as featured. %s", 'ProjectTheme'), $sl);
                ?>
</p>
        </li>
        
        <?php 
            }
            ?>
        
        <?php 
            do_action('ProjectTheme_step2_before_feature_project');
            ?>
        
        
        <?php 
            $ProjectTheme_enable_sealed_option = get_option('ProjectTheme_enable_sealed_option');
            if ($ProjectTheme_enable_sealed_option != "no") {
                ?>
        
        <li>
        <h2><?php 
                _e("Sealed Bidding?", 'ProjectTheme');
                ?>
</h2>
        <p><input type="checkbox" class="do_input_new" name="private_bids" value="1"
        <?php 
                $private_bids = get_post_meta($pid, 'private_bids', true);
                echo $private_bids == "1" ? "checked='checked'" : "";
                ?>
 /> 
        <?php 
                $projectTheme_sealed_bidding_fee = get_option('projectTheme_sealed_bidding_fee');
                $sl = __('Extra fee is applied', 'ProjectTheme');
                if (empty($projectTheme_sealed_bidding_fee) or $projectTheme_sealed_bidding_fee <= 0) {
                    $sl = '';
                }
                printf(__("By clicking this checkbox you hide your project's bids. %s", 'ProjectTheme'), $sl);
                ?>
</p>
        </li>
        <?php 
            }
            ?>
        
        <?php 
            do_action('ProjectTheme_step2_before_sealed_bidding');
            ?>
        
        <?php 
            $ProjectTheme_enable_hide_option = get_option('ProjectTheme_enable_hide_option');
            if ($ProjectTheme_enable_hide_option != "no") {
                ?>
        
        
        <li>
        <h2><?php 
                _e("Hide Project from search engines", 'ProjectTheme');
                ?>
</h2>
        <p><input type="checkbox" class="do_input_new" name="hide_project" value="1" 
        <?php 
                $hide_project = get_post_meta($pid, 'hide_project', true);
                echo $hide_project == "1" ? "checked='checked'" : "";
                ?>
/> 
        <?php 
                $projectTheme_hide_project_fee = get_option('projectTheme_hide_project_fee');
                $sl = __('Extra fee is applied', 'ProjectTheme');
                if (empty($projectTheme_hide_project_fee) or $projectTheme_hide_project_fee <= 0) {
                    $sl = '';
                }
                echo sprintf(__("By clicking this checkbox you hide your project from search engines. %s", 'ProjectTheme'), $sl);
                ?>
</p>
        </li>
        <?php 
            }
            ?>
        
		<?php 
            do_action('ProjectTheme_step2_before_hide_project');
            ?>
        
      

        
        <li>
        <h2>&nbsp;</h2>
        <?php 
            $stp = 1;
            $stp = apply_filters('ProjectTheme_filter_go_back_stp2', $stp);
            ?>
        <p><a href="<?php 
            echo ProjectTheme_post_new_with_pid_stuff_thg($pid, $stp);
            ?>
" class="go_back_btn" ><?php 
            _e('Go Back', 'ProjectTheme');
            ?>
</a> 
        <input type="submit" name="project_submit2" value="<?php 
            _e("Next Step", 'ProjectTheme');
            ?>
 >>" class="submit_bottom" /></p>
        </li>
    
    
    </ul>
    </form>
    
    
    
    <?php 
        }
        do_action('ProjectTheme_see_if_we_can_add_steps', $new_Project_step, $pid);
        if ($new_Project_step == "3") {
            ?>

<div class="padd10">

<a href="<?php 
            echo ProjectTheme_post_new_with_pid_stuff_thg($pid, 2);
            ?>
" class="go_back_btn" ><?php 
            _e('Go Back', 'ProjectTheme');
            ?>
</a> 
<a href="<?php 
            echo ProjectTheme_post_new_with_pid_stuff_thg($pid, 4);
            ?>
" class="go_back_btn" ><?php 
            _e('Next Step', 'ProjectTheme');
            ?>
 >></a> 

</div>
<div class="clear10"></div>

<hr color="efefef" />


</div></div>


<div><div>


<?php 
            global $current_user;
            get_currentuserinfo();
            $uid = $current_user->ID;
            global $wpdb;
            $post_AU = get_post($pid);
            $PID_PID = $pid;
            ?>

     
<link media="screen" rel="stylesheet" href="'.get_bloginfo('template_url').'/css/colorbox.css" /> 
<script src="'.get_bloginfo('template_url').'/js/jquery.colorbox.js"></script> 
<script>

		
			jQuery(document).ready(function(){
				
				jQuery("a[rel='image_gal1']").colorbox();
				jQuery("a[rel='image_gal2']").colorbox();
				
				
 
				
				jQuery('.get_files').click( function () {
					
					var myRel = jQuery(this).attr('rel');
					myRel = myRel.split("_");
					
					jQuery.colorbox({href: "<?php 
            bloginfo('siteurl');
            ?>
/?get_files_panel=" + myRel[0] +"&uid=" + myRel[1] });
					return false;
				});
				
				
				jQuery("#report-this-link").click( function() {
					
					if(jQuery("#report-this").css('display') == 'none')					
					jQuery("#report-this").show('slow');
					else
					jQuery("#report-this").hide('slow');
					
					return false;
				});
				
				
				jQuery("#contact_seller-link").click( function() {
					
					if(jQuery("#contact-seller").css('display') == 'none')					
					jQuery("#contact-seller").show('slow');
					else
					jQuery("#contact-seller").hide('slow');
					
					return false;
				});
				
		});
</script>   


 
 
  <?php 
            $location = get_post_meta($PID_PID, "Location", true);
            $ending = get_post_meta($PID_PID, "ending", true);
            $featured = get_post_meta($PID_PID, "featured", true);
            $private_bids = get_post_meta($PID_PID, "private_bids", true);
            //---- increase views
            $views = get_post_meta($PID_PID, "views", true);
            $views = $views + 1;
            update_post_meta($PID_PID, "views", $views);
            ?>
	   
    

 


<div class="content_dust">


	

<div id="report-this" style="display:none">
<div class="my_box3">
            <div class="padd10">
            
            	<div class="box_title"><?php 
            echo __("Report this project", 'ProjectTheme');
            ?>
</div>
                <div class="box_content">
                <?php 
            if (!is_user_logged_in()) {
                ?>
                
                <?php 
                echo sprintf(__('You need to be <a href="%s">logged</a> in to use this feature.', 'ProjectTheme'), get_bloginfo('siteurl') . "/wp-login.php");
                ?>
                <?php 
            } else {
                ?>
                
                
					<form method="post"><input type="hidden" value="<?php 
                echo $PID_PID;
                ?>
" name="pid_rep" />
                    <ul class="post-new3">

        
        <li>
        	<h2><?php 
                echo __('Reason for reporting', 'ProjectTheme');
                ?>
:</h2>
        <p><textarea rows="4" cols="40" class="do_input"  name="reason_report"></textarea></p>
        </li>
        
        
     
        
        <li>
        <h2>&nbsp;</h2>
        <p><input type="submit" name="report_this" value="<?php 
                _e('Submit Report', 'ProjectTheme');
                ?>
" /></p>
        </li>
    
    
    </ul>
    </form> <?php 
            }
            ?>
                    
                    
				</div>
			</div>
			</div>
            
            <div class="clear10"></div>

</div>


<!-- ######### -->






 			<div class="project-signle-content-main">
 
			 
				
                <?php 
            $closed = get_post_meta($PID_PID, 'closed', true);
            ?>
                
				<div class="project-page-details-holder">
                <?php 
            if ($closed == "0") {
                if ($bid_posted == "0") {
                    ?>
 
		
                        <div class="bid_panel_err">
                        <div class="padd10">
                        <?php 
                    _e("Your bid has not been posted. Please correct the errors and try again.", 'ProjectTheme');
                    echo '<br/>';
                    foreach ($errors as $err) {
                        echo $err . '<br/>';
                    }
                    ?>
                        </div>
                        </div>
                
                <?php 
                }
                ?>
                
                
                <?php 
                if ($_GET['bid_posted'] == 1) {
                    ?>
		
                        <div class="bid_panel_ok">
                        <div class="padd10">
                        <?php 
                    _e("Your bid has been posted.", 'ProjectTheme');
                    ?>
                        </div>
                        </div>
                
                <?php 
                }
                ?>

               
               
               	<div class="bid_panel_front">
                <div class="padd10">
                
                <div class="small_buttons_div_left">
                	<ul class="project-details">
							<li>
                            	<img src="<?php 
                bloginfo('template_url');
                ?>
/images/wallet_icon2.png" width="18" height="18" alt="budget" />
								<h3><?php 
                echo __("Project Budget", 'ProjectTheme');
                ?>
:</h3>
								<p><?php 
                echo ProjectTheme_get_budget_name_string_fromID(get_post_meta($PID_PID, 'budgets', true));
                ?>
</p>
							</li>
                            
                            
                            <li>
                            	<img src="<?php 
                bloginfo('template_url');
                ?>
/images/coins_icon.png" width="18" height="18" alt="coins" />
								<h3><?php 
                echo __("Average Bid", 'ProjectTheme');
                ?>
:</h3>
								<p><?php 
                echo ProjectTheme_average_bid($PID_PID);
                ?>
</p>
							</li>
                            
                            
                         
                            
            			<?php 
                $ProjectTheme_enable_project_location = get_option('ProjectTheme_enable_project_location');
                if ($ProjectTheme_enable_project_location == "yes") {
                    ?>
   
                            <li>
								<img src="<?php 
                    echo get_bloginfo('template_url');
                    ?>
/images/loc_icon.png" width="18" height="18" alt="location" /> 
								<h3><?php 
                    echo __("Location", 'ProjectTheme');
                    ?>
:</h3>
								<p><?php 
                    echo get_the_term_list($PID_PID, 'project_location', '', ', ', '');
                    ?>
</p>
							</li>
                          
                        <?php 
                }
                ?>
  
                          
                             
                             <li>
								<img src="<?php 
                echo get_bloginfo('template_url');
                ?>
/images/cate_icon.png" width="18" height="18" alt="category" /> 
								<h3><?php 
                echo __("Category", 'ProjectTheme');
                ?>
:</h3>
								<p><?php 
                echo get_the_term_list($PID_PID, 'project_cat', '', ', ', '');
                ?>
</p>
							</li>
                               
          
							<li>
								<img src="<?php 
                echo get_bloginfo('template_url');
                ?>
/images/cal_icon.png" width="18" height="18" alt="calendar" /> 
								<h3><?php 
                echo __("Posted on", 'ProjectTheme');
                ?>
:</h3>
								<p><?php 
                echo get_the_time("jS F Y g:i A", $PID_PID);
                ?>
</p>
							</li>
                          
                          <li>
								<img src="<?php 
                echo get_bloginfo('template_url');
                ?>
/images/clock_icon.png" width="18" height="18" alt="clock" /> 
								<h3><?php 
                echo __("Time Left", 'ProjectTheme');
                ?>
:</h3>
								<p><?php 
                echo $closed == "0" ? ProjectTheme_prepare_seconds_to_words($ending - current_time('timestamp', 0)) : __("Expired/Closed", 'ProjectTheme');
                ?>
</p>
							</li>
                            
                          
                          <li>
                            	<img src="<?php 
                bloginfo('template_url');
                ?>
/images/prop_icon.png" width="18" height="18" alt="proposals" />
								<h3><?php 
                echo __("Proposals", 'ProjectTheme');
                ?>
:</h3>
								<p><?php 
                echo projectTheme_number_of_bid($PID_PID);
                ?>
</p>
							</li>
                            
                	</ul>
                    
                    <div class="clear10"></div>
                    
                    </div>
                    <!-- ########### -->
                    
                    <div class="small_buttons_div">
                    	<ul id="these-special-buttons">
                        	<li><a href="<?php 
                $post = get_post($PID_PID);
                if ($current_user->ID == $post_AU->post_author) {
                    echo '#';
                } else {
                    echo ProjectTheme_get_priv_mess_page_url('send', '', '&uid=' . $post_AU->post_author . '&pid=' . $PID_PID);
                }
                ?>
" class="project-owner-contact"><?php 
                _e('Contact Project Owner', 'ProjectTheme');
                ?>
</a></li>
                            <li><a href="#" class="message_brd_cls project-owner-contact"><?php 
                _e('Project Message Board', 'ProjectTheme');
                ?>
</a></li>
                        </ul>
                    </div>
                  
                </div>
                </div>
               
                
                <?php 
            } else {
                // project closed
                ?>
                
                <div class="bid_panel">
                <div class="padd10">
                
                	<?php 
                $pid = $PID_PID;
                $winner = get_post_meta($PID_PID, 'winner', true);
                if (!empty($winner)) {
                    global $wpdb;
                    $q = "select bid from " . $wpdb->prefix . "project_bids where pid='{$pid}' and winner='1'";
                    $r = $wpdb->get_results($q);
                    $r = $r[0];
                    _e("Project closed for price: ", 'ProjectTheme');
                    echo ProjectTheme_get_show_price($r->bid);
                }
                ?>
                
                </div>
                </div>
                
                <?php 
            }
            ?>
               
						
												
					</div>
				
				 
			</div>
			
			
			<div class="clear10"></div>
			
			<!-- ####################### -->
			
			<div class="my_box3">
           
            
            	<div class="box_title"><?php 
            echo __("Project Description", 'ProjectTheme');
            ?>
</div>
                <div class="box_content" id="project-single-page-content">
					<?php 
            echo $post_AU->post_content;
            do_action('ProjectTheme_after_description_in_single_proj_page');
            ?>
				</div>
			</div>
		
			
			<div class="clear10"></div>
            
            
            <!-- ####################### -->
			<?php 
            $private_bids = get_post_meta($PID_PID, 'private_bids', true);
            ?>
			<div class="my_box3">
            
            
            	<div class="box_title"><?php 
            echo __("Proposals", 'ProjectTheme');
            ?>
 <?php 
            if ($private_bids == 'yes' or $private_bids == '1' or $private_bids == 1) {
                _e('[project has private proposals]', 'ProjectTheme');
            }
            ?>
</div>
                <div class="box_content">
				<?php 
            $ProjectTheme_enable_project_files = get_option('ProjectTheme_enable_project_files');
            $winner = get_post_meta($PID_PID, 'winner', true);
            $post = get_post($PID_PID);
            global $wpdb;
            $pid = $PID_PID;
            $bids = "select * from " . $wpdb->prefix . "project_bids where pid='{$pid}' order by id DESC";
            $res = $wpdb->get_results($bids);
            if ($post_AU->post_author == $uid) {
                $owner = 1;
            } else {
                $owner = 0;
            }
            if (count($res) > 0) {
                if ($private_bids == 'yes' or $private_bids == '1' or $private_bids == 1) {
                    if ($owner == 1) {
                        $show_stuff = 1;
                    } else {
                        if (projectTheme_current_user_has_bid($uid, $res)) {
                            $show_stuff = 1;
                        } else {
                            $show_stuff = 0;
                        }
                    }
                } else {
                    $show_stuff = 1;
                }
                //------------
                if ($show_stuff == 1) {
                    echo '<table id="my_bids" width="100%">';
                    echo '<thead><tr>';
                    echo '<th>' . __('Username', 'ProjectTheme') . '</th>';
                    echo '<th>' . __('Bid', 'ProjectTheme') . '</th>';
                    echo '<th>' . __('Date Made', 'ProjectTheme') . '</th>';
                    echo '<th>' . __('Days to Complete', 'ProjectTheme') . '</th>';
                    if ($owner == 1) {
                        if (empty($winner)) {
                            echo '<th>' . __('Choose Winner', 'ProjectTheme') . '</th>';
                        }
                        if ($ProjectTheme_enable_project_files != "no") {
                            echo '<th>' . __('Bid Files', 'ProjectTheme') . '</th>';
                        }
                        echo '<th>' . __('Messaging', 'ProjectTheme') . '</th>';
                    }
                    if ($closed == "1") {
                        echo '<th>' . __('Winner', 'ProjectTheme') . '</th>';
                    }
                    echo '</tr></thead><tbody>';
                }
                //-------------
                foreach ($res as $row) {
                    if ($owner == 1) {
                        $show_this_around = 1;
                    } else {
                        if ($private_bids == 'yes' or $private_bids == '1' or $private_bids == 1) {
                            if ($uid == $row->uid) {
                                $show_this_around = 1;
                            } else {
                                $show_this_around = 0;
                            }
                        } else {
                            $show_this_around = 1;
                        }
                    }
                    if ($show_this_around == 1) {
                        $user = get_userdata($row->uid);
                        echo '<tr>';
                        echo '<th><a href="' . ProjectTheme_get_user_profile_link($user->ID) . '">' . $user->user_login . '</a></th>';
                        echo '<th>' . ProjectTheme_get_show_price($row->bid) . '</th>';
                        echo '<th>' . date("d-M-Y H:i:s", $row->date_made) . '</th>';
                        echo '<th>' . $row->days_done . '</th>';
                        if ($owner == 1) {
                            $nr = 7;
                            if (empty($winner)) {
                                // == 0)
                                echo '<th><a href="' . get_bloginfo('siteurl') . '/?p_action=choose_winner&pid=' . $PID_PID . '&bid=' . $row->id . '">' . __('Select', 'ProjectTheme') . '</a></th>';
                            }
                            if ($ProjectTheme_enable_project_files != "no") {
                                echo '<th>';
                                if (projecttheme_see_if_project_files_bid($PID_PID, $row->uid) == true) {
                                    echo '<a href="#" class="get_files" rel="' . $PID_PID . '_' . $row->uid . '">' . __('Bid Files', 'ProjectTheme') . '</a>';
                                } else {
                                    _e('None', 'ProjectTheme');
                                }
                                echo '</th>';
                            }
                            echo '<th><a href="' . ProjectTheme_get_priv_mess_page_url('send', '', '&uid=' . $row->uid . '&pid=' . $PID_PID) . '">' . __('Send Message', 'ProjectTheme') . '</a></th>';
                        } else {
                            $nr = 4;
                        }
                        if ($closed == "1") {
                            if ($row->winner == 1) {
                                echo '<th>' . __('Yes', 'ProjectTheme') . '</th>';
                            } else {
                                echo '<th>&nbsp;</th>';
                            }
                        }
                        echo '</tr>';
                        echo '<tr>';
                        echo '<th colspan="' . $nr . '" class="my_td_with_border">' . $row->description . '</th>';
                        echo '</tr>';
                    }
                }
                echo '</tbody></table>';
            } else {
                _e("No proposals placed yet.", 'ProjectTheme');
            }
            ?>
	
				</div>
			</div>
			
			
            <?php 
            $ProjectTheme_enable_images_in_projects = get_option('ProjectTheme_enable_images_in_projects');
            $ProjectTheme_enable_images_in_projects = apply_filters('ProjectTheme_enable_images_in_projects_hk', $ProjectTheme_enable_images_in_projects);
            if ($ProjectTheme_enable_images_in_projects == "yes") {
                ?>
			<div class="clear10"></div>
			
			<!-- ####################### -->
			
			<div class="my_box3">
           
            
            	<div class="box_title"><?php 
                echo __("Image Gallery", 'ProjectTheme');
                ?>
</div>
                <div class="box_content">
				<?php 
                $arr = ProjectTheme_get_post_images($PID_PID);
                $xx_w = 600;
                $projectTheme_width_of_project_images = get_option('projectTheme_width_of_project_images');
                if (!empty($projectTheme_width_of_project_images)) {
                    $xx_w = $projectTheme_width_of_project_images;
                }
                if (!is_numeric($xx_w)) {
                    $xx_w = 600;
                }
                if ($arr) {
                    echo '<ul class="image-gallery">';
                    foreach ($arr as $image) {
                        echo '<li><a href="' . ProjectTheme_generate_thumb($image, 900, $xx_w) . '" rel="image_gal2"><img src="' . ProjectTheme_generate_thumb($image, 100, 80) . '" width="100" class="img_class" /></a></li>';
                    }
                    echo '</ul>';
                } else {
                    echo __('No images.', 'ProjectTheme');
                }
                ?>
				
				
				</div>
			</div>
			<?php 
            }
            ?>
			
			<div class="clear10"></div>
			
			<!-- ####################### -->
			<?php 
            $ProjectTheme_enable_project_location = get_option('ProjectTheme_enable_project_location');
            if ($ProjectTheme_enable_project_location == "yes") {
                ?>
        
			<div class="my_box3">
            
            
            	<div class="box_title"><?php 
                echo __("Map Location", 'ProjectTheme');
                ?>
</div>
                <div class="box_content">
	
				<div id="map" style="width: 655px; height: 300px;border:2px solid #ccc;float:left"></div>
				
                <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> 
            
            <script type="text/javascript"
            src="<?php 
                echo get_bloginfo('template_url');
                ?>
/js/mk.js"></script> 
                                                <script type="text/javascript"> 
   



	  var geocoder;
  var map;
  function initialize() {
    geocoder = new google.maps.Geocoder();
    var latlng = new google.maps.LatLng(-34.397, 150.644);
    var myOptions = {
      zoom: 13,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    map = new google.maps.Map(document.getElementById("map"), myOptions);
  }

  function codeAddress(address) {
    
    geocoder.geocode( { 'address': address}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        map.setCenter(results[0].geometry.location);
        var marker = new MarkerWithLabel({
            
            position: results[0].geometry.location,
			map: map,
       labelContent: address,
       labelAnchor: new google.maps.Point(22, 0),
       labelClass: "labels", // the CSS class for the label
       labelStyle: {opacity: 1.0}

        });
      } else {
        //alert("Geocode was not successful for the following reason: " + status);
      }
    });
  }

initialize();

codeAddress("<?php 
                global $post;
                $pid = $post_AU->ID;
                $terms = wp_get_post_terms($pid, 'project_location');
                foreach ($terms as $term) {
                    echo $term->name . " ";
                }
                $location = get_post_meta($pid, "Location", true);
                echo $location;
                ?>
");

    </script> 
				
			
			</div>
			</div> <?php 
            }
            ?>
			
			<!-- ####################### -->
			
 



</div>

<?php 
            echo '<div id="right-sidebar" class="page-sidebar">';
            echo '<ul class="xoxo">';
            //---------------------
            // build the exclude list
            //---------------------
            // build the exclude list
            $exclude = array();
            $args = array('order' => 'ASC', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'post_parent' => $pid, 'numberposts' => -1, 'post_status' => null);
            $attachments = get_posts($args);
            foreach ($attachments as $att) {
                $exclude[] = $att->ID;
            }
            //-0------------------
            $args = array('order' => 'ASC', 'post_type' => 'attachment', 'meta_key' => 'is_bidding_file', 'meta_value' => '1', 'post_parent' => $pid, 'numberposts' => -1, 'post_status' => null);
            $attachments = get_posts($args);
            foreach ($attachments as $att) {
                $exclude[] = $att->ID;
            }
            //------------------
            $args = array('order' => 'ASC', 'post_type' => 'attachment', 'post_parent' => $pid, 'exclude' => $exclude, 'numberposts' => -1, 'post_status' => null);
            $attachments = get_posts($args);
            ?>
    <li class="widget-container widget_text" id="ad-other-details">
		<h3 class="widget-title"><?php 
            _e("Apply for this Project", 'ProjectTheme');
            ?>
</h3>
		<p>
        <?php 
            _e('You can use the button below to apply and submit a proposal for this project.', 'ProjectTheme');
            ?>
        </p>
        
        
       <p id='proposal_btn_p'>
         <?php 
            global $current_user;
            get_currentuserinfo();
            $uid = $current_user->ID;
            if ($closed == "0" && ProjectTheme_is_user_provider($uid) == true) {
                ?>
                            
								<a href="#" class="post_bid_btn_new" id='submit-proposal-id' rel="<?php 
                the_ID();
                ?>
"><?php 
                _e('Submit a Proposal', 'ProjectTheme');
                ?>
</a>
							 
                          	<?php 
            }
            ?>
       
       </p> 
    </li>
    
    
    
    	<li class="widget-container widget_text" id="ad-other-details">
		<h3 class="widget-title"><?php 
            _e("Project Posted By", 'ProjectTheme');
            ?>
</h3>
		
        <div class="avatar-op-wrap">
        	
            <div class="avatar-op-inner"><img width="60" height="60" border="0" class="project-single-avatar" src="<?php 
            echo ProjectTheme_get_avatar($post_AU->post_author, 60, 60);
            ?>
" /> </div>
        	<div class="avatar-op-list">
            		<ul>
                    	<li><a class="avatar-posted-by-username" href="<?php 
            bloginfo('siteurl');
            ?>
/?p_action=user_profile&post_author=<?php 
            echo $post_AU->post_author;
            ?>
"><?php 
            echo $post_AU->user_login;
            ?>
</a></li>
                    	<li><?php 
            echo ProjectTheme_project_get_star_rating2($post_AU->post_author);
            ?>
</li>
                        <li><a href="<?php 
            echo ProjectTheme_get_user_feedback_link($post_AU->post_author);
            ?>
"><?php 
            _e('View User Feedback', 'ProjectTheme');
            ?>
</a></li>
                    </ul>
            </div>
            
        </div>
        
        <p>
        <ul class="other-dets other-dets2">
				 
                <?php 
            $has_created = projectTheme_get_total_number_of_created_Projects($post_AU->post_author);
            $has_closed = projectTheme_get_total_number_of_closed_Projects($post_AU->post_author);
            $has_rated = projectTheme_get_total_number_of_rated_Projects($post_AU->post_author);
            ?>
                
                 
                 
                <li>
					<h3><?php 
            _e("Has created:", 'ProjectTheme');
            ?>
</h3>
					<p><?php 
            echo sprintf(__("%s project(s)", 'ProjectTheme'), $has_created);
            ?>
</p> 
				</li>
                
                
                <li>
					<h3><?php 
            _e("Has closed:", 'ProjectTheme');
            ?>
</h3>
					<p><?php 
            echo sprintf(__("%s project(s)", 'ProjectTheme'), $has_closed);
            ?>
</p> 
				</li>
            
            
            	<li>
					<h3><?php 
            _e("Has rated:", 'ProjectTheme');
            ?>
</h3>
					<p><?php 
            echo sprintf(__("%s provider(s)", 'ProjectTheme'), $has_rated);
            ?>
</p> 
				</li>
            
            
            	<br/><br/>
               <a href="<?php 
            bloginfo('siteurl');
            ?>
/?p_action=user_profile&post_author=<?php 
            echo $post_AU->post_author;
            ?>
"><?php 
            _e('See More Projects by this user', 'ProjectTheme');
            ?>
</a><br/>
               
                		
			</ul>
   		</p>
   </li>
       
       <?php 
            $ProjectTheme_enable_project_files = get_option('ProjectTheme_enable_project_files');
            if ($ProjectTheme_enable_project_files != "no") {
                ?>
       
     	<li class="widget-container widget_text" id="ad-other-details">
		<h3 class="widget-title"><?php 
                _e("Project Files", 'ProjectTheme');
                ?>
</h3>
		<p>
        
        <ul class="other-dets other-dets2">
				<?php 
                if (count($attachments) == 0) {
                    echo __('No project files.', 'ProjectTheme');
                }
                foreach ($attachments as $at) {
                    ?>
                
                <li> <a href="<?php 
                    echo wp_get_attachment_url($at->ID);
                    ?>
"><?php 
                    echo $at->post_title;
                    ?>
</a>
				</li> 
			<?php 
                }
                ?>
		
			</ul>
   		</p>
   </li>
  <?php 
            }
            ?>
  
    
    
	<li class="widget-container widget_text" id="ad-other-details">
		<h3 class="widget-title"><?php 
            _e("Other Options", 'ProjectTheme');
            ?>
</h3>
		<p>
        
        <div class="add-this">
						<!-- AddThis Button BEGIN -->
							<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
							<a class="addthis_button_preferred_1"></a>
							<a class="addthis_button_preferred_2"></a>
							<a class="addthis_button_preferred_3"></a>
							<a class="addthis_button_preferred_4"></a>
							<a class="addthis_button_compact"></a>
							<a class="addthis_counter addthis_bubble_style"></a>
							</div>
							<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4df68b4a2795dcd9"></script>
							<!-- AddThis Button END -->
						</div>	
        
   		</p>
   </li>
       
    
	<li class="widget-container widget_text" id="ad-other-details">
		<h3 class="widget-title"><?php 
            _e("Other Details", 'ProjectTheme');
            ?>
</h3>
		<p>
			<ul class="other-dets other-dets2">
	 
		 
				<?php 
            $ProjectTheme_enable_project_location = get_option('ProjectTheme_enable_project_location');
            if ($ProjectTheme_enable_project_location == "yes") {
                ?>
				<li>
					<img src="<?php 
                echo get_bloginfo('template_url');
                ?>
/images/location.png" width="15" height="15" /> 
					<h3><?php 
                _e("Address", 'ProjectTheme');
                ?>
:</h3>
					<p><?php 
                echo $location;
                ?>
</p> 
				</li>
		
        
        <?php 
            }
            ?>
        
        		
                <?php 
            $rt = get_option('projectTheme_show_project_views');
            if ($rt != 'no') {
                ?>
				
				<li>
					<img src="<?php 
                echo get_bloginfo('template_url');
                ?>
/images/viewed.png" width="15" height="15" /> 
					<h3><?php 
                _e("Viewed", 'ProjectTheme');
                ?>
:</h3>
					<p><?php 
                echo $views;
                ?>
 <?php 
                _e("times", 'ProjectTheme');
                ?>
</p> 
				</li>
				<?php 
            }
            ?>
				
                
                <?php 
            $my_arrms = true;
            $my_arrms = apply_filters('ProjectTheme_show_fields_in_sidebar', $my_arrms);
            if ($my_arrms == true) {
                $arrms = ProjectTheme_get_project_fields_values($PID_PID);
                if (count($arrms) > 0) {
                    for ($i = 0; $i < count($arrms); $i++) {
                        ?>
                <li>
					<h3><?php 
                        echo $arrms[$i]['field_name'];
                        ?>
:</h3>
               	 	<p><?php 
                        echo $arrms[$i]['field_value'];
                        ?>
</p>
                </li>
				<?php 
                    }
                }
            }
            ?>
				
                
				
			</ul>
			<?php 
            if (ProjectTheme_is_owner_of_post()) {
                ?>
				
			<a href="<?php 
                echo get_bloginfo('siteurl');
                ?>
/?p_action=edit_project&pid=<?php 
                the_ID();
                ?>
" class="nice_link"><?php 
                _e("Edit", 'ProjectTheme');
                ?>
</a> 
			<a href="<?php 
                echo get_bloginfo('siteurl');
                ?>
/?p_action=repost_project&pid=<?php 
                the_ID();
                ?>
" class="nice_link"><?php 
                _e("Repost", 'ProjectTheme');
                ?>
</a> 
		<!--	<a href="<?php 
                echo get_bloginfo('siteurl');
                ?>
/?p_action=delete_project&pid=<?php 
                the_ID();
                ?>
" class="nice_link"><?php 
                _e("Delete", 'ProjectTheme');
                ?>
</a> -->
			
			<?php 
            } else {
                ?>
			
			<a href="#" id="report-this-link" class="nice_link"><?php 
                _e("Report", 'ProjectTheme');
                ?>
</a>
            <a href="<?php 
                $post = get_post($PID_PID);
                echo ProjectTheme_get_priv_mess_page_url('send', '', '&uid=' . $post_AU->post_author . '&pid=' . $PID_PID);
                ?>
" class="nice_link"><?php 
                _e("Contact Seller", 'ProjectTheme');
                ?>
</a>
				
                <?php 
            }
            ?>
		</p>
	</li>
	
	
	<?php 
            dynamic_sidebar('project-widget-area');
            echo '</ul>';
            echo '</div>';
            //===============================================================================================
            ?>
 




<?php 
        }
        if ($new_Project_step == "4") {
            $catid = ProjectTheme_get_project_primary_cat($pid);
            $ProjectTheme_get_images_cost_extra = ProjectTheme_get_images_cost_extra($pid);
            //--------------------------------------------------
            // hide project from search engines fee calculation
            $projectTheme_hide_project_fee = get_option('projectTheme_hide_project_fee');
            if (!empty($projectTheme_hide_project_fee)) {
                $opt = get_post_meta($pid, 'hide_project', true);
                if ($opt == "0") {
                    $projectTheme_hide_project_fee = 0;
                }
            } else {
                $projectTheme_hide_project_fee = 0;
            }
            //---------------------
            $made_me_date = get_post_meta($pid, 'made_me_date', true);
            $tms = current_time('timestamp', 0);
            $projectTheme_project_period = get_option('projectTheme_project_period');
            if (empty($projectTheme_project_period)) {
                $projectTheme_project_period = 30;
            }
            if (empty($made_me_date)) {
                $ee = $tms + 3600 * 24 * $projectTheme_project_period;
                update_post_meta($pid, 'ending', $ee);
            } else {
                $ee = get_post_meta($pid, 'ending', true) + $tms - $made_me_date;
                update_post_meta($pid, 'ending', $ee);
            }
            //-------------------------------------------------------------------------------
            // sealed bidding fee calculation
            $projectTheme_sealed_bidding_fee = get_option('projectTheme_sealed_bidding_fee');
            if (!empty($projectTheme_sealed_bidding_fee)) {
                $opt = get_post_meta($pid, 'private_bids', true);
                if ($opt == "0") {
                    $projectTheme_sealed_bidding_fee = 0;
                }
            } else {
                $projectTheme_sealed_bidding_fee = 0;
            }
            //-------
            $featured = get_post_meta($pid, 'featured', true);
            $feat_charge = get_option('projectTheme_featured_fee');
            if ($featured != "1") {
                $feat_charge = 0;
            }
            $custom_set = get_option('projectTheme_enable_custom_posting');
            if ($custom_set == 'yes') {
                $posting_fee = get_option('projectTheme_theme_custom_cat_' . $catid);
                if (empty($posting_fee)) {
                    $posting_fee = 0;
                }
            } else {
                $posting_fee = get_option('projectTheme_base_fee');
            }
            $total = $feat_charge + $posting_fee + $projectTheme_sealed_bidding_fee + $projectTheme_hide_project_fee + $ProjectTheme_get_images_cost_extra;
            //-----------------------------------------------
            $payment_arr = array();
            $base_fee_paid = get_post_meta($pid, 'base_fee_paid', true);
            if ($base_fee_paid != "1" and $posting_fee > 0) {
                $my_small_arr = array();
                $my_small_arr['fee_code'] = 'base_fee';
                $my_small_arr['show_me'] = true;
                $my_small_arr['amount'] = $posting_fee;
                $my_small_arr['description'] = __('Base Fee', 'ProjectTheme');
                array_push($payment_arr, $my_small_arr);
            }
            //-----------------------
            $my_small_arr = array();
            $my_small_arr['fee_code'] = 'extra_img';
            $my_small_arr['show_me'] = true;
            $my_small_arr['amount'] = $ProjectTheme_get_images_cost_extra;
            $my_small_arr['description'] = __('Extra Images Fee', 'ProjectTheme');
            array_push($payment_arr, $my_small_arr);
            //------------------------
            $featured_paid = get_post_meta($pid, 'featured_paid', true);
            $opt = get_post_meta($pid, 'featured', true);
            if ($feat_charge > 0 and $featured_paid != 1 and $opt == 1) {
                $my_small_arr = array();
                $my_small_arr['fee_code'] = 'feat_fee';
                $my_small_arr['show_me'] = true;
                $my_small_arr['amount'] = $feat_charge;
                $my_small_arr['description'] = __('Featured Fee', 'ProjectTheme');
                array_push($payment_arr, $my_small_arr);
                //------------------------
            }
            $private_bids_paid = get_post_meta($pid, 'private_bids_paid', true);
            $opt = get_post_meta($pid, 'private_bids', true);
            if ($projectTheme_sealed_bidding_fee > 0 and $private_bids_paid != 1 and ($opt == 1 or $opt == "yes")) {
                $my_small_arr = array();
                $my_small_arr['fee_code'] = 'sealed_project';
                $my_small_arr['show_me'] = true;
                $my_small_arr['amount'] = $projectTheme_sealed_bidding_fee;
                $my_small_arr['description'] = __('Sealed Bidding Fee', 'ProjectTheme');
                array_push($payment_arr, $my_small_arr);
                //------------------------
            }
            $hide_project_paid = get_post_meta($pid, 'hide_project_paid', true);
            $opt = get_post_meta($pid, 'hide_project', true);
            if ($projectTheme_hide_project_fee > 0 and $hide_project_paid != "1" and ($opt == "1" or $opt == "yes")) {
                $my_small_arr = array();
                $my_small_arr['fee_code'] = 'hide_project';
                $my_small_arr['show_me'] = true;
                $my_small_arr['amount'] = $projectTheme_hide_project_fee;
                $my_small_arr['description'] = __('Hide Project From Search Engines Fee', 'ProjectTheme');
                array_push($payment_arr, $my_small_arr);
            }
            $payment_arr = apply_filters('ProjectTheme_filter_payment_array', $payment_arr, $pid);
            $new_total = 0;
            foreach ($payment_arr as $payment_item) {
                if ($payment_item['amount'] > 0) {
                    $new_total += $payment_item['amount'];
                }
            }
            //-----------------------------------------------
            $post = get_post($pid);
            $admin_email = get_bloginfo('admin_email');
            $total = apply_filters('ProjectTheme_filter_payment_total', $new_total, $pid);
            //----------------------------------------
            $finalize = isset($_GET['finalize']) ? true : false;
            update_post_meta($pid, 'finalised_posted', '1');
            //-----------
            if ($total == 0) {
                echo '<div >';
                echo __('Thank you for posting your project with us.', 'ProjectTheme');
                update_post_meta($pid, "paid", "1");
                if (get_option('projectTheme_admin_approves_each_project') == 'yes') {
                    $my_post = array();
                    $my_post['ID'] = $pid;
                    $my_post['post_status'] = 'draft';
                    wp_update_post($my_post);
                    if ($finalize == true) {
                        ProjectTheme_send_email_posted_project_not_approved($pid);
                        ProjectTheme_send_email_posted_project_not_approved_admin($pid);
                    }
                    echo '<br/>' . __('Your project isn`t live yet, the admin needs to approve it.', 'ProjectTheme');
                } else {
                    $my_post = array();
                    $my_post['ID'] = $pid;
                    $my_post['post_status'] = 'publish';
                    if ($finalize == true) {
                        wp_update_post($my_post);
                        wp_publish_post($pid);
                        ProjectTheme_send_email_posted_project_approved($pid);
                        ProjectTheme_send_email_posted_project_approved_admin($pid);
                        ProjectTheme_send_email_subscription($pid);
                    }
                }
                echo '</div>';
            } else {
                update_post_meta($pid, "paid", "0");
                echo '<div >';
                echo __('Thank you for posting your project with us. Below is the total price that you need to pay in order to put your project live.<br/>
			Click the pay button and you will be redirected...', 'ProjectTheme');
                echo '</div>';
            }
            //----------------------------------------
            echo '<table style="margin-top:25px">';
            $show_payment_table = true;
            $show_payment_table = apply_filters('ProjectTheme_filter_payment_show_table', $show_payment_table, $pid);
            if ($show_payment_table == true and $total > 0) {
                foreach ($payment_arr as $payment_item) {
                    if ($payment_item['amount'] > 0) {
                        echo '<tr>';
                        echo '<td>' . $payment_item['description'] . '&nbsp; &nbsp;</td>';
                        echo '<td>' . ProjectTheme_get_show_price($payment_item['amount'], 2) . '</td>';
                        echo '</tr>';
                    }
                }
                echo '<tr>';
                echo '<td>&nbsp;</td>';
                echo '<td></td>';
                echo '</tr>';
                echo '<tr>';
                echo '<td><strong>' . __('Total to Pay', 'ProjectTheme') . '</strong></td>';
                echo '<td><strong>' . ProjectTheme_get_show_price($total, 2) . '</strong></td>';
                echo '</tr>';
                $ProjectTheme_enable_credits_wallet = get_option('ProjectTheme_enable_credits_wallet');
                if ($ProjectTheme_enable_credits_wallet != 'no') {
                    echo '<tr>';
                    echo '<td><strong>' . __('Your Total Credits', 'ProjectTheme') . '</strong></td>';
                    echo '<td><strong>' . ProjectTheme_get_show_price(ProjectTheme_get_credits($uid), 2) . '</strong></td>';
                    echo '</tr>';
                }
                echo '<tr>';
                echo '<td>&nbsp;<br/>&nbsp;</td>';
                echo '<td></td>';
                echo '</tr>';
            }
            //endif show this table
            if ($total == 0 && $finalize == true) {
                if (get_option('projectTheme_admin_approves_each_project') != 'yes') {
                    echo '<tr>';
                    echo '<td></td>';
                    echo '<td><div class="clear100"></div><a href="' . get_permalink($pid) . '" class="go_back_btn">' . __('See your project', 'ProjectTheme') . '</a></td>';
                    echo '</tr>';
                } else {
                    echo '<tr>';
                    echo '<td></td>';
                    echo '<td><a href="' . get_permalink(get_option('ProjectTheme_my_account_page_id')) . '" class="go_back_btn">' . __('Go to your account', 'ProjectTheme') . '</a></td>';
                    echo '</tr>';
                }
                echo '</table>';
            } elseif ($total > 0) {
                echo '</table>';
                update_post_meta($pid, 'unpaid', '1');
                $ProjectTheme_enable_credits_wallet = get_option('ProjectTheme_enable_credits_wallet');
                if ($ProjectTheme_enable_credits_wallet != 'no') {
                    echo '<a href="' . get_bloginfo('siteurl') . '/?p_action=credits_listing&pid=' . $pid . '" class="edit_project_pay_cls">' . __('Pay by Credits', 'ProjectTheme') . '</a>';
                }
                global $project_ID;
                $project_ID = $pid;
                //-------------------
                $ProjectTheme_paypal_enable = get_option('ProjectTheme_paypal_enable');
                $ProjectTheme_alertpay_enable = get_option('ProjectTheme_alertpay_enable');
                $ProjectTheme_moneybookers_enable = get_option('ProjectTheme_moneybookers_enable');
                if ($ProjectTheme_paypal_enable == "yes") {
                    echo '<a href="' . get_bloginfo('siteurl') . '/?p_action=paypal_listing&pid=' . $pid . '" class="edit_project_pay_cls">' . __('Pay by PayPal', 'ProjectTheme') . '</a>';
                }
                if ($ProjectTheme_moneybookers_enable == "yes") {
                    echo '<a href="' . get_bloginfo('siteurl') . '/?p_action=mb_listing&pid=' . $pid . '" class="edit_project_pay_cls">' . __('Pay by MoneyBookers/Skrill', 'ProjectTheme') . '</a>';
                }
                if ($ProjectTheme_alertpay_enable == "yes") {
                    echo '<a href="' . get_bloginfo('siteurl') . '/?p_action=payza_listing&pid=' . $pid . '" class="edit_project_pay_cls">' . __('Pay by Payza', 'ProjectTheme') . '</a>';
                }
                do_action('ProjectTheme_add_payment_options_to_post_new_project', $pid);
            } else {
                echo '</table>';
            }
            echo '<div class="clear10"></div>';
            echo '<div class="clear10"></div>';
            echo '<div class="clear10"></div>';
            echo '<div class="padd10">';
            if ($finalize == false) {
                echo ' <a href="' . ProjectTheme_post_new_with_pid_stuff_thg($pid, '3') . '" class="go_back_btn" >' . __('Go Back', 'ProjectTheme') . '</a>';
            }
            if ($total == 0 && $finalize == false) {
                echo ' <a href="' . ProjectTheme_post_new_with_pid_stuff_thg($pid, '4', 'finalize') . '" 
	class="go_back_btn" >' . __('Finalize Project Posting', 'ProjectTheme') . '</a>';
            }
            echo '</div>';
        }
        ?>
                
            <?php 
    }
    ?>
                
                
              </div>
           </div>
                
        </div> <!-- end dif content -->
     
        
    
	
<?php 
}
Example #11
0
global $current_user;
get_currentuserinfo();
$uid = $current_user->ID;
$bids = "select uid from " . $wpdb->prefix . "project_bids where pid='{$pid}' order by id DESC";
$res = $wpdb->get_results($bids);
foreach ($res as $key => $value) {
    $res2[] = $value->uid;
}
if (!$res2) {
    $res2 = array();
}
if (!$winners) {
    $winners = array();
}
//if($closed == "0" && ProjectTheme_is_user_provider($uid) == true && !in_array($uid,$winners)):
if (!ProjectTheme_is_user_business($uid) && $closed == "0" && ProjectTheme_is_user_provider($uid) == true && !in_array($uid, $winners)) {
    ?>
    <li class="widget-container widget_text" id="ad-other-details">
		<h3 class="widget-title"><?php 
    _e("Apply for this Project", 'ProjectTheme');
    ?>
</h3>
		<p>
        <?php 
    _e('You can use the button below to apply and submit a proposal for this project.', 'ProjectTheme');
    ?>
        </p>
        
        
       <p id='proposal_btn_p'>
function ProjectTheme_my_account_personal_info_function()
{
    global $current_user, $wpdb, $wp_query;
    get_currentuserinfo();
    $uid = $current_user->ID;
    ?>
    	<div id="content" class="account-main-area">
        	
           <?php 
    if (isset($_POST['save-info'])) {
        //if(file_exists('cimy_update_ExtraFields'))
        cimy_update_ExtraFields_new_me();
        require_once ABSPATH . "wp-admin" . '/includes/file.php';
        require_once ABSPATH . "wp-admin" . '/includes/image.php';
        if (!empty($_FILES['avatar']["name"])) {
            $upload_overrides = array('test_form' => false);
            $uploaded_file = wp_handle_upload($_FILES['avatar'], $upload_overrides);
            $file_name_and_location = $uploaded_file['file'];
            $file_title_for_media_library = $_FILES['avatar']['name'];
            $file_name_and_location = $uploaded_file['file'];
            $file_title_for_media_library = $_FILES['avatar']['name'];
            $arr_file_type = wp_check_filetype(basename($_FILES['avatar']['name']));
            $uploaded_file_type = $arr_file_type['type'];
            $urls = $uploaded_file['url'];
            if ($uploaded_file_type == "image/png" or $uploaded_file_type == "image/jpg" or $uploaded_file_type == "image/jpeg" or $uploaded_file_type == "image/gif") {
                $attachment = array('post_mime_type' => $uploaded_file_type, 'post_title' => 'User Avatar', 'post_content' => '', 'post_status' => 'inherit', 'post_parent' => 0, 'post_author' => $uid);
                $attach_id = wp_insert_attachment($attachment, $file_name_and_location, 0);
                $attach_data = wp_generate_attachment_metadata($attach_id, $file_name_and_location);
                wp_update_attachment_metadata($attach_id, $attach_data);
                $_wp_attached_file = get_post_meta($attach_id, '_wp_attached_file', true);
                if (!empty($_wp_attached_file)) {
                    update_user_meta($uid, 'avatar_project', $attach_id);
                }
            }
        }
        //---------------------
        $wpdb->query("delete from " . $wpdb->prefix . "project_email_alerts where uid='{$uid}' ");
        $email_cats = $_POST['email_cats'];
        if (count($email_cats) > 0) {
            foreach ($email_cats as $em) {
                $wpdb->query("insert into " . $wpdb->prefix . "project_email_alerts (uid,catid) values('{$uid}','{$em}') ");
            }
        }
        //-------------------
        //email_locs
        //****************************************************************************************************
        $ProjectTheme_enable_project_location = get_option('ProjectTheme_enable_project_location');
        if ($ProjectTheme_enable_project_location != "no") {
            $wpdb->query("delete from " . $wpdb->prefix . "project_email_alerts_locs where uid='{$uid}' ");
            $email_cats = $_POST['email_locs'];
            if (count($email_cats) > 0) {
                foreach ($email_cats as $em) {
                    $wpdb->query("insert into " . $wpdb->prefix . "project_email_alerts_locs (uid,catid) values('{$uid}','{$em}') ");
                }
            }
        }
        //****************************************************************************************************
        //-------------------
        $user_description = trim($_POST['user_description']);
        update_user_meta($uid, 'user_description', $user_description);
        $per_hour = trim($_POST['per_hour']);
        update_user_meta($uid, 'per_hour', $per_hour);
        $user_location = trim($_POST['project_location_cat']);
        update_user_meta($uid, 'user_location', $user_location);
        $user_city = trim($_POST['user_city']);
        update_user_meta($uid, 'user_city', $user_city);
        $personal_info = trim($_POST['paypal_email']);
        update_user_meta($uid, 'paypal_email', $personal_info);
        $personal_info = trim($_POST['payza_email']);
        update_user_meta($uid, 'payza_email', $personal_info);
        $personal_info = trim($_POST['moneybookers_email']);
        update_user_meta($uid, 'moneybookers_email', $personal_info);
        $user_url = trim($_POST['user_url']);
        update_user_meta($uid, 'user_url', $user_url);
        do_action('ProjectTheme_pers_info_save_action');
        if (isset($_POST['password']) && !empty($_POST['password'])) {
            $p1 = trim($_POST['password']);
            $p2 = trim($_POST['reppassword']);
            if (!empty($p1) && !empty($p2)) {
                if ($p1 == $p2) {
                    global $wpdb;
                    $newp = md5($p1);
                    $sq = "update " . $wpdb->users . " set user_pass='******' where ID='{$uid}'";
                    $wpdb->query($sq);
                    $inc = 1;
                } else {
                    echo '<div class="error">' . __("Password was not updated. Passwords do not match!", "ProjectTheme") . '</div>';
                    $xxp = 1;
                }
            } else {
                echo '<div class="error">' . __("Password was not updated. Passwords do not match!", "ProjectTheme") . '</div>';
                $xxp = 1;
            }
        }
        //---------------------------------------
        $arr = $_POST['custom_field_id'];
        for ($i = 0; $i < count($arr); $i++) {
            $ids = $arr[$i];
            $value = $_POST['custom_field_value_' . $ids];
            if (is_array($value)) {
                delete_user_meta($uid, "custom_field_ID_" . $ids);
                for ($j = 0; $j < count($value); $j++) {
                    add_user_meta($uid, "custom_field_ID_" . $ids, $value[$j]);
                }
            } else {
                update_user_meta($uid, "custom_field_ID_" . $ids, $value);
            }
        }
        //--------------------------------------------
        if ($xxp != 1) {
            echo '<div class="saved_thing">' . __('Info saved!', 'ProjectTheme');
            if ($inc == 1) {
                echo '<br/>' . __('Your password was changed. Redirecting to login page...', 'ProjectTheme');
                echo '<meta http-equiv="refresh" content="2; url=' . get_bloginfo('url') . '/wp-login.php">';
            }
            echo '</div>';
        }
    }
    $user = get_userdata($uid);
    $user_location = get_user_meta($uid, 'user_location', true);
    ?>
         
       
    <script type="text/javascript">
	
	function delete_this2(id)
	{
		 jQuery.ajax({
						method: 'get',
						url : '<?php 
    echo get_bloginfo('siteurl');
    ?>
/index.php/?_ad_delete_pid='+id,
						dataType : 'text',
						success: function (text) {   jQuery('#image_ss'+id).remove();  }
					 });
		  //alert("a");
	
	}

	
 
	
	
	</script>     
            
             <form method="post"  enctype="multipart/form-data">
             
            <div class="my_box3">
            	
             
                <div class="box_content">    
	
         <ul class="post-new3">
        <li>
        	<h2><?php 
    echo __('Username', 'ProjectTheme');
    ?>
:</h2>
        	<p><input type="text" size="35" value="<?php 
    echo $user->user_login;
    ?>
" disabled="disabled" class="do_input" /></p>
        </li>

		<?php 
    $opt = get_option('ProjectTheme_enable_project_location');
    if ($opt != 'no') {
        ?>
        
		 <li>
        	<h2><?php 
        echo __('Location', 'ProjectTheme');
        ?>
:</h2>
        	<p>
            <?php 
        echo ProjectTheme_get_categories("project_location", $user_location, __("Select Location", "ProjectTheme"), "do_input");
        ?>
            </p>
        </li>
		
        
        <li>
        	<h2><?php 
        echo __('City', 'ProjectTheme');
        ?>
:</h2>
        	<p><input type="text" size="35" name="user_city" value="<?php 
        echo get_user_meta($uid, 'user_city', true);
        ?>
" class="do_input" /></p>
        </li>
        
		<?php 
    }
    ?>
     
            <script>
			
			jQuery(document).ready(function(){
			tinyMCE.init({
					mode : "specific_textareas",
					theme : "modern", 
					/*plugins : "autolink, lists, spellchecker, style, layer, table, advhr, advimage, advlink, emotions, iespell, inlinepopups, insertdatetime, preview, media, searchreplace, print, contextmenu, paste, directionality, fullscreen, noneditable, visualchars, nonbreaking, xhtmlxtras, template",*/
					editor_selector :"tinymce-enabled"
				});
			});
						
			</script>    
        <li>
        	<h2><?php 
    echo __('Description', 'ProjectTheme');
    ?>
:</h2>
        	<p><textarea cols="40" rows="5"  name="user_description" class="tinymce-enabled do_input"><?php 
    echo get_usermeta($uid, 'user_description', true);
    ?>
</textarea></p>
        </li>
        
        <?php 
    $opt = get_option('ProjectTheme_paypal_enable');
    if ($opt == "yes") {
        ?>
        
        <li>
        	<h2><?php 
        echo __('PayPal Email', 'ProjectTheme');
        ?>
:</h2>
        	<p><input type="text" size="35" name="paypal_email" value="<?php 
        echo get_user_meta($uid, 'paypal_email', true);
        ?>
" class="do_input" /></p>
        </li>
        
        <?php 
    }
    $opt = get_option('ProjectTheme_moneybookers_enable');
    if ($opt == "yes") {
        ?>
        
        <li>
        	<h2><?php 
        echo __('Moneybookers Email', 'ProjectTheme');
        ?>
:</h2>
        	<p><input type="text" size="35" name="moneybookers_email" value="<?php 
        echo get_user_meta($uid, 'moneybookers_email', true);
        ?>
" class="do_input" /></p>
        </li>
        
        <?php 
    }
    $opt = get_option('ProjectTheme_alertpay_enable');
    if ($opt == "yes") {
        ?>
        
         <li>
        	<h2><?php 
        echo __('Payza Email', 'ProjectTheme');
        ?>
:</h2>
        	<p><input type="text" size="35" name="payza_email" value="<?php 
        echo get_user_meta($uid, 'payza_email', true);
        ?>
" class="do_input" /></p>
        </li>
       <?php 
    }
    ?>
 
        
         <li>
        	<h2><?php 
    echo __('New Password', "ProjectTheme");
    ?>
:</h2>
        	<p><input type="password" value="" class="do_input" name="password" size="35" /></p>
        </li>
        
        
        <li>
        	<h2><?php 
    echo __('Repeat Password', "ProjectTheme");
    ?>
:</h2>
        	<p><input type="password" value="" class="do_input" name="reppassword" size="35"  /></p>
        </li>
        
        
        <?php 
    do_action('ProjectTheme_pers_info_fields_1');
    ?>
        
   		  <li>
        	<h2><?php 
    echo __('Profile Avatar', 'ProjectTheme');
    ?>
:</h2>
        	<p> <input type="file" name="avatar" /> <br/>
           <?php 
    _e('max file size: 1mb. Formats: jpeg, jpg, png, gif', 'ProjectTheme');
    ?>
            <br/>
            <img width="50" height="50" border="0" src="<?php 
    echo ProjectTheme_get_avatar($uid, 50, 50);
    ?>
" /> 
            </p>
        </li>
   
   
   <li>
   <?php 
    if (function_exists('cimy_extract_ExtraFields')) {
        cimy_extract_ExtraFields();
    }
    ?>
   </li> 
        
        
        <li>
        <h2>&nbsp;</h2>
        <p><input type="submit" name="save-info" class="my-buttons" value="<?php 
    _e("Save", 'ProjectTheme');
    ?>
" /></p>
        </li>
        
       </ul> 
        
               
        
           </div>
           </div>     
            
            <div class="clear10"></div>
            
            <div class="my_box3" >
           
            
            	<div class="box_title" id="other_infs_mm"><?php 
    _e("Other Information", 'ProjectTheme');
    ?>
</div>
                <div class="box_content">  
                
        <ul class="post-new3">
        
        
        <?php 
    do_action('ProjectTheme_pers_info_fields_2');
    ?>
        
        <?php 
    $user_tp = get_user_meta($uid, 'user_tp', true);
    if (empty($user_tp)) {
        $user_tp = 'all';
    }
    if ($user_tp == "all") {
        $catid = array('all', 'service_buyer', 'service_provider');
    } else {
        $catid = array($user_tp);
    }
    if (current_user_can('manage_options')) {
        $catid = array('all', 'service_buyer', 'service_provider');
    }
    $k = 0;
    $arr = ProjectTheme_get_users_category_fields($catid, $uid);
    $exf = '';
    for ($i = 0; $i < count($arr); $i++) {
        $exf .= '<li>';
        $exf .= '<h2>' . $arr[$i]['field_name'] . $arr[$i]['id'] . ':</h2>';
        $exf .= '<p>' . $arr[$i]['value'] . '</p>';
        $exf .= '</li>';
        $k++;
    }
    echo $exf;
    if (ProjectTheme_is_user_provider($uid)) {
        $k++;
        ?>
           
                            
        <li>
        	<h2><?php 
        echo __('Hourly Rate', 'ProjectTheme');
        ?>
:</h2>
        	<p><?php 
        echo projectTheme_currency();
        ?>
<input type="text" size="7" name="per_hour" value="<?php 
        echo get_user_meta($uid, 'per_hour', true);
        ?>
" class="do_input" /> 
             *<?php 
        _e('your estimated hourly rate', 'ProjectTheme');
        ?>
</p>
        </li>
        
        <?php 
    }
    global $current_user;
    get_currentuserinfo();
    $uid = $current_user->ID;
    $cid = $uid;
    if (ProjectTheme_is_user_provider($uid)) {
        ?>
           
                            
        <li>
        	<h2><?php 
        echo __('Portfolio Pictures', 'ProjectTheme');
        ?>
:</h2>
        	<p>
			
             <div class="cross_cross">



	<script type="text/javascript" src="<?php 
        echo get_bloginfo('template_url');
        ?>
/js/dropzone.js"></script>     
	<link rel="stylesheet" href="<?php 
        echo get_bloginfo('template_url');
        ?>
/css/dropzone.css" type="text/css" />
    
 
    
    
    <script>
 
	
	jQuery(function() {

Dropzone.autoDiscover = false; 	 
var myDropzoneOptions = {
  maxFilesize: 15,
    addRemoveLinks: true,
	acceptedFiles:'image/*',
    clickable: true,
	url: "<?php 
        bloginfo('siteurl');
        ?>
/?my_upload_of_project_files8=1",
};
 
var myDropzone = new Dropzone('div#myDropzoneElement2', myDropzoneOptions);

myDropzone.on("sending", function(file, xhr, formData) {
  formData.append("author", "<?php 
        echo $current_user->ID;
        ?>
"); // Will send the filesize along with the file as POST data.
  formData.append("ID", "<?php 
        echo $pid;
        ?>
"); // Will send the filesize along with the file as POST data.
});

   
    <?php 
        $args = array('order' => 'ASC', 'orderby' => 'post_date', 'post_type' => 'attachment', 'author' => $current_user->ID, 'meta_key' => 'is_portfolio', 'meta_value' => '1', 'numberposts' => -1);
        $attachments = get_posts($args);
        if ($attachments) {
            foreach ($attachments as $attachment) {
                $url = $attachment->guid;
                $imggg = $attachment->post_mime_type;
                $url = wp_get_attachment_url($attachment->ID);
                ?>
	
						var mockFile = { name: "<?php 
                echo $attachment->post_title;
                ?>
", size: 12345, serverId: '<?php 
                echo $attachment->ID;
                ?>
' };
						myDropzone.options.addedfile.call(myDropzone, mockFile);
						myDropzone.options.thumbnail.call(myDropzone, mockFile, "<?php 
                echo projectTheme_generate_thumb($attachment->ID, 100, 100);
                ?>
");						 
				
				<?php 
            }
        }
        ?>
 
	myDropzone.on("success", function(file, response) {
    /* Maybe display some more file information on your page */
	 file.serverId = response;
	 file.thumbnail = "<?php 
        echo bloginfo('template_url');
        ?>
/images/file_icon.png";
	 
	   
  });
  
  
myDropzone.on("removedfile", function(file, response) {
    /* Maybe display some more file information on your page */
	  delete_this2(file.serverId);
	 
  });  	
	
	});
	
	</script>

    

	<?php 
        _e('Click the grey area below to add project images.', 'ProjectTheme');
        ?>
    <div class="dropzone dropzone-previews" id="myDropzoneElement2" ></div>
 
    
	</div>
            
            
            
     
            
            
            </p>
        </li>
        
        <?php 
    }
    if (ProjectTheme_is_user_provider($uid)) {
        $k++;
        ?>
                    
                    <li>
                        <h2><?php 
        echo __('Emails Alerts', 'ProjectTheme');
        ?>
:</h2>
                        <p><div style="border:1px solid #ccc;background:#f2f2f2; overflow:auto; width:350px; border-radius:5px; height:160px;">
                        
                        <?php 
        global $wpdb;
        $ss = "select * from " . $wpdb->prefix . "project_email_alerts where uid='{$uid}'";
        $rr = $wpdb->get_results($ss);
        $terms = get_terms('project_cat', 'parent=0&orderby=name&hide_empty=0');
        foreach ($terms as $term) {
            $chk = projectTheme_check_list_emails($term->term_id, $rr) == true ? "checked='checked'" : "";
            echo '<input type="checkbox" name="email_cats[]" ' . $chk . ' value="' . $term->term_id . '" /> ' . $term->name . "<br/>";
            $terms2 = get_terms('project_cat', 'parent=' . $term->term_id . '&orderby=name&hide_empty=0');
            foreach ($terms2 as $term2) {
                $chk = projectTheme_check_list_emails($term2->term_id, $rr) == 1 ? "checked='checked'" : "";
                echo '&nbsp;&nbsp; &nbsp; <input type="checkbox" name="email_cats[]" ' . $chk . ' value="' . $term2->term_id . '" /> ' . $term2->name . "<br/>";
                $terms3 = get_terms('project_cat', 'parent=' . $term2->term_id . '&orderby=name&hide_empty=0');
                foreach ($terms3 as $term3) {
                    $chk = projectTheme_check_list_emails($term3->term_id, $rr) == 1 ? "checked='checked'" : "";
                    echo '&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <input type="checkbox" ' . $chk . ' name="email_cats[]" 
										value="' . $term3->term_id . '" /> ' . $term3->name . "<br/>";
                }
            }
        }
        ?>
                        
                        </div>
                        <br/>
                        *<?php 
        _e('you will get an email notification when a project is posted in the selected categories', 'ProjectTheme');
        ?>
</p>
                    </li>
        
        <?php 
        $ProjectTheme_enable_project_location = get_option('ProjectTheme_enable_project_location');
        if ($ProjectTheme_enable_project_location != "no") {
            ?>
        	   <li>
                        <h2>&nbsp;</h2>
                        <p><div style="border:1px solid #ccc;background:#f2f2f2; overflow:auto; width:350px; border-radius:5px; height:160px;">
                        
                        <?php 
            global $wpdb;
            $ss = "select * from " . $wpdb->prefix . "project_email_alerts_locs where uid='{$uid}'";
            $rr = $wpdb->get_results($ss);
            $terms = get_terms('project_location', 'parent=0&orderby=name&hide_empty=0');
            foreach ($terms as $term) {
                $chk = projectTheme_check_list_emails($term->term_id, $rr) == true ? "checked='checked'" : "";
                echo '<input type="checkbox" name="email_locs[]" ' . $chk . ' value="' . $term->term_id . '" /> ' . $term->name . "<br/>";
                $terms2 = get_terms('project_location', 'parent=' . $term->term_id . '&orderby=name&hide_empty=0');
                foreach ($terms2 as $term2) {
                    $chk = projectTheme_check_list_emails($term2->term_id, $rr) == 1 ? "checked='checked'" : "";
                    echo '&nbsp;&nbsp; &nbsp; <input type="checkbox" name="email_locs[]" ' . $chk . ' value="' . $term2->term_id . '" /> ' . $term2->name . "<br/>";
                    $terms3 = get_terms('project_location', 'parent=' . $term2->term_id . '&orderby=name&hide_empty=0');
                    foreach ($terms3 as $term3) {
                        $chk = projectTheme_check_list_emails($term3->term_id, $rr) == 1 ? "checked='checked'" : "";
                        echo '&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <input type="checkbox" ' . $chk . ' name="email_locs[]" 
										value="' . $term3->term_id . '" /> ' . $term3->name . "<br/>";
                    }
                }
            }
            ?>
                        
                        </div>
                        <br/>
                        *<?php 
            _e('you will get an email notification when a project is posted in the selected locations', 'ProjectTheme');
            ?>
</p>
                    </li>
        
        
        <?php 
        }
    }
    if ($k == 0) {
        echo '<style>#other_infs_mm, #bk_save_not { display:none; } </style>';
    }
    ?>
        
        			
                    <li id="bk_save_not">
        <h2>&nbsp;</h2> <input type="hidden" value="<?php 
    echo $uid;
    ?>
" name="user_id" />
        <p><input type="submit" class="my-buttons" name="save-info" value="<?php 
    _e("Save", 'ProjectTheme');
    ?>
" /></p>
        </li>
                    
        </ul>
                
                
              
                </div>
                </div>
                
                
             
            
            
            
            
		</form>

                
        </div> <!-- end dif content -->
        
        <?php 
    ProjectTheme_get_users_links();
    ?>
        
    
	
<?php 
}
function ProjectTheme_is_it_allowed_place_bids_memms($as)
{
    global $current_user;
    get_currentuserinfo();
    $uid = $current_user->ID;
    $ProjectTheme_enable_membs = get_option('ProjectTheme_enable_membs');
    if ($ProjectTheme_enable_membs == "yes") {
        $trial = get_option('projectTheme_monthly_trial_period');
        if (empty($trial)) {
            $membership_available = get_user_meta($uid, 'membership_available', true);
            $tm = current_time('timestamp', 0);
            if ($tm > $membership_available) {
                add_filter('ProjectTheme_is_it_not_allowed_place_bids_action', 'ProjectTheme_is_it_not_allowed_place_bids_action_meeems');
                return false;
            }
        } else {
            $trial_used = get_user_meta($uid, 'trial_used', true);
            if (empty($trial_used)) {
                $tm = current_time('timestamp', 0);
                update_user_meta($uid, 'trial_used', "1");
                update_user_meta($uid, 'membership_available', $tm + $trial * 3600 * 24);
                //------------------------
                $projectTheme_monthly_nr_of_bids = get_option('projectTheme_monthly_nr_of_bids');
                if (empty($projectTheme_monthly_nr_of_bids)) {
                    $projectTheme_monthly_nr_of_bids = 10;
                }
                update_user_meta($uid, 'projectTheme_monthly_nr_of_bids', $projectTheme_monthly_nr_of_bids);
                return true;
            } else {
                $membership_available = get_user_meta($uid, 'membership_available', true);
                $tm = current_time('timestamp', 0);
                if ($tm > $membership_available) {
                    add_filter('ProjectTheme_is_it_not_allowed_place_bids_action', 'ProjectTheme_is_it_not_allowed_place_bids_action_meeems');
                    return false;
                } else {
                    if (ProjectTheme_is_user_business($uid)) {
                        $projectTheme_monthly_nr_of_projects = get_user_meta($uid, 'projectTheme_monthly_nr_of_projects', true);
                        if ($projectTheme_monthly_nr_of_projects <= -1) {
                            add_filter('ProjectTheme_is_it_not_allowed_place_bids_action', 'ProjectTheme_is_it_not_allowed_place_bids_action_meeems');
                            return false;
                        }
                    }
                    if (ProjectTheme_is_user_provider($uid)) {
                        $projectTheme_monthly_nr_of_bids = get_user_meta($uid, 'projectTheme_monthly_nr_of_bids', true);
                        if ($projectTheme_monthly_nr_of_bids <= 0) {
                            add_filter('ProjectTheme_is_it_not_allowed_place_bids_action', 'ProjectTheme_is_it_not_allowed_place_bids_action_meeems2');
                            return false;
                        }
                    }
                }
            }
        }
    }
    return true;
}
Example #14
0
function ProjectTheme_my_account_disputes_area_function()
{
    $no_comment_admin = 0;
    $no_comment = 0;
    global $current_user, $wpdb, $wp_query;
    get_currentuserinfo();
    $uid = $current_user->ID;
    if ($_POST) {
        if ($_POST['disp_id']) {
            $disp_id = $_POST['disp_id'];
            $closedon = current_time('timestamp', 0);
            $admin_comment = trim($_POST['admin_comment']);
            if (!$admin_comment) {
                $no_comment_admin = 1;
            } else {
                $no_comment_admin = 0;
                $winner = $_POST['winner'];
                if (!$winner) {
                    $s = "update " . $wpdb->prefix . "project_disputes SET `solution`=1, `closedon`={$closedon}, `admin_comment`='{$admin_comment}' WHERE `id`={$disp_id}";
                    $wpdb->query($s);
                } else {
                    $s = "update " . $wpdb->prefix . "project_disputes SET `solution`=1, `winner`={$winner}, `closedon`={$closedon}, `admin_comment`='{$admin_comment}' WHERE `id`={$disp_id}";
                    $wpdb->query($s);
                }
            }
        } else {
            $initiator = $_POST['initiator'];
            $datemade = current_time('timestamp', 0);
            $comment = trim($_POST['comment']);
            $pid_defendant = explode('/', $_POST['defendant']);
            $pid = $pid_defendant[0];
            $defendant = $pid_defendant[1];
            if ($comment) {
                $no_comment = 0;
                $s = "insert into " . $wpdb->prefix . "project_disputes (initiator,pid,datemade,solution,winner,closedon,comment,defendant,admin_comment)\n                    values('{$initiator}','{$pid}','{$datemade}',0,0,0,'{$comment}','{$defendant}','')";
                if ($wpdb->query($s)) {
                    $created_success = 1;
                } else {
                    $created_success = 0;
                }
            } else {
                $no_comment = 1;
            }
        }
    }
    ?>
<div id="content" class="account-main-area">
            <?php 
    if ($created_success) {
        echo '<div class="saved_thing">Dispute created.</div>';
    }
    ?>
            <?php 
    if ($no_comment) {
        echo '<div class="errrs">You cannot leave the dispute comment blank!</div>';
    }
    ?>
            
            <?php 
    if ($no_comment_admin) {
        echo '<div class="errrs">You cannot leave the Comment for closing dispute blank!</div>';
    }
    ?>

            
            
        <div class="my_box3">
            <div class="padd10">
        
            <div class="box_title"><?php 
    _e("Create Dispute", "ProjectTheme");
    ?>
</div>
            <div class="box_content"> 
            <?php 
    if (ProjectTheme_is_user_business($uid)) {
        //                    $querystr = "
        //                                    SELECT distinct wposts.*
        //                                    FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
        //                                    WHERE wposts.post_author='$uid'
        //                                    AND  wposts.ID = wpostmeta.post_id
        //                                    AND wpostmeta.meta_key = 'closed'
        //                                    AND wpostmeta.meta_value = '0'
        //                                    AND wposts.post_status = 'publish'
        //                                    AND wposts.post_type = 'project'
        //                                    ORDER BY wposts.post_date DESC";
        $querystr = "\n                                    SELECT distinct wposts.* \n                                    FROM {$wpdb->posts} wposts, {$wpdb->postmeta} wpostmeta \n                                    WHERE wposts.post_author='{$uid}' \n                                    AND  wposts.ID = wpostmeta.post_id \n                                    AND wposts.post_status = 'publish' \n                                    AND wposts.post_type = 'project'\n                                    ORDER BY wposts.post_date DESC";
        $r = $wpdb->get_results($querystr);
        foreach ($r as $row) {
            $pid = $row->ID;
            $ar = 1;
            $bids = projectTheme_get_winner_bid($pid, $ar);
            foreach ($bids as $key => $bid) {
                $user = get_userdata($bid->uid);
                $Defendants[$pid][$bid->uid]['user_name'] = $user->user_login;
                $Defendants[$pid][$bid->uid]['post_title'] = get_the_title($pid);
            }
        }
    } elseif (ProjectTheme_is_user_provider($uid)) {
        $querystr = "\n                                   SELECT * \n                                   FROM " . $wpdb->prefix . "project_bids\n                                   WHERE `uid`='{$uid}' \n                                   AND  `winner` = '1'\n                                   ORDER BY `date_made` DESC";
        $r = $wpdb->get_results($querystr);
        foreach ($r as $row) {
            $pid = $row->pid;
            $post = get_post($pid);
            $user = get_userdata($post->post_author);
            $Defendants[$pid][$post->post_author]['user_name'] = $user->user_login;
            $Defendants[$pid][$post->post_author]['post_title'] = get_the_title($pid);
        }
    }
    ?>

                <form method="POST">
                    <input hidden name="initiator" value="<?php 
    echo $uid;
    ?>
">        
                    <?php 
    //var_dump($Defendants);
    ?>
                
                    <label>Defendant
                            <?php 
    if (isset($Defendants)) {
        ?>
                        <select name="defendant">
                            <?php 
        foreach ($Defendants as $pid => $Defendant) {
            foreach ($Defendant as $f_uid => $Def) {
                echo '<option value="' . $pid . '/' . $f_uid . '">' . $Def['post_title'] . ' - ' . $Def['user_name'] . '</option>';
            }
        }
        ?>
    
                        </select>
                            <?php 
    }
    ?>
                    </label>
                        <?php 
    if (!isset($Defendants)) {
        echo '<p>' . __("There are no available users for disput", "ProjectTheme") . '</p>';
    }
    ?>
                        
                    <br>
                    <label class="disput_comment">Comment
                        <textarea class="disput_comment" name="comment"></textarea>
                    </label><br>
                    <input type="submit" value="Create Dispute">
                </form>                         
            
            
            
            </div>
            </div>
            </div>

<?php 
    $querystr = "\n                                        SELECT * \n                                        FROM " . $wpdb->prefix . "project_disputes\n                                        WHERE `solution`=0\n                                        AND  `initiator` = '{$uid}' \n                                        ORDER BY `datemade` DESC";
    $open_disputes = $wpdb->get_results($querystr);
    $querystr = "\n                                        SELECT * \n                                        FROM " . $wpdb->prefix . "project_disputes\n                                        WHERE `solution`=0\n                                        AND  `defendant` = '{$uid}' \n                                        ORDER BY `datemade` DESC";
    $open_disputes_on_me = $wpdb->get_results($querystr);
    $querystr = "\n                                        SELECT * \n                                        FROM " . $wpdb->prefix . "project_disputes\n                                        WHERE `solution`=1\n                                        AND  `initiator` = '{$uid}' \n                                        ORDER BY `datemade` DESC";
    $closed_disputes = $wpdb->get_results($querystr);
    $querystr = "\n                                        SELECT * \n                                        FROM " . $wpdb->prefix . "project_disputes\n                                        WHERE `solution`=1\n                                        AND  `defendant` = '{$uid}' \n                                        ORDER BY `datemade` DESC";
    $closed_disputes_on_me = $wpdb->get_results($querystr);
    ?>
<div class="clear10"></div>
    	
            <div class="my_box3">
            	<div class="padd10">
            
            	<div class="box_title"><?php 
    _e("Open Disputes", "ProjectTheme");
    ?>
</div>

                <div class="box_content"> 
                <div class="box_title"><?php 
    _e("As Initiator", "ProjectTheme");
    ?>
</div>
            	
                    <?php 
    if ($open_disputes) {
        echo '<table class="open_disputes">';
        echo '<tr>';
        echo '<td>Date create</td>';
        echo '<td>Defendant</td>';
        echo '<td>Comment</td>';
        //echo '<td>Winner</td>';
        echo '<td>Comment for closing this dispute</td>';
        echo '<td>Action</td>';
        echo '</tr>';
        foreach ($open_disputes as $key => $open_dispute) {
            $user = get_userdata($open_dispute->defendant);
            $user_winner = get_userdata($open_dispute->winner);
            echo '<tr>';
            echo '<form method="POST">';
            //echo '<td>'.date('m-d-Y H:i',$open_dispute->datemade).'</td>';
            echo '<td class="conv_time">' . $open_dispute->datemade . '</td>';
            echo '<td>' . $user->user_login . '</td>';
            echo '<td class="disp_com">' . $open_dispute->comment . '</td>';
            //echo '<td><label>'.$current_user->user_login.'<input type="radio" name="winner" value="'.$open_dispute->initiator.'"></label><label>'.$user->user_login.'<input type="radio" name="winner" value="'.$open_dispute->defendant.'"></label></td>';
            echo '<td> <textarea name="admin_comment"></textarea></td>';
            echo '<td> <input hidden name="disp_id" value="' . $open_dispute->id . '"><input type="submit" value="Close"></td>';
            echo '</form>';
            echo '</tr>';
        }
        echo '</table>';
    } else {
        _e('There are no open disputes.', 'ProjectTheme');
    }
    ?>
               
                
                
                </div>

                <div class="box_content"> 
                <div class="box_title"><?php 
    _e("As Defendant", "ProjectTheme");
    ?>
</div>
                
                    <?php 
    if ($open_disputes_on_me) {
        echo '<table class="open_disputes">';
        echo '<tr>';
        echo '<td>Date create</td>';
        echo '<td>Initiator</td>';
        echo '<td>Comment</td>';
        echo '</tr>';
        foreach ($open_disputes_on_me as $key => $open_dispute) {
            $user = get_userdata($open_dispute->initiator);
            $user_winner = get_userdata($open_dispute->winner);
            echo '<tr>';
            //echo '<td>'.date('m-d-Y H:i',$open_dispute->datemade).'</td>';
            echo '<td class="conv_time">' . $open_dispute->datemade . '</td>';
            echo '<td>' . $user->user_login . '</td>';
            echo '<td class="disp_com">' . $open_dispute->comment . '</td>';
            echo '</tr>';
        }
        echo '</table>';
    } else {
        _e('There are no open disputes.', 'ProjectTheme');
    }
    ?>
               
                
                
                </div>
                </div>
                </div>
                
                
                
                
                
            <div class="my_box3">
            	<div class="padd10">
            
            	<div class="box_title"><?php 
    _e("Closed Disputes", "ProjectTheme");
    ?>
</div>
                <div class="box_content"> 
                <div class="box_title"><?php 
    _e("As Initiator", "ProjectTheme");
    ?>
</div>
                    <?php 
    if ($closed_disputes) {
        echo '<table class="closed_disputes">';
        echo '<tr>';
        echo '<td>Date create</td>';
        echo '<td>Defendant</td>';
        echo '<td>Comment</td>';
        echo '<td>Winner</td>';
        echo '<td>Closed on</td>';
        echo '<td>Verdict</td>';
        echo '</tr>';
        foreach ($closed_disputes as $key => $closed_dispute) {
            $user = get_userdata($closed_dispute->defendant);
            $user_winner = get_userdata($closed_dispute->winner);
            echo '<tr>';
            //echo '<td>'.date('m-d-Y H:i',$closed_dispute->datemade).'</td>';
            echo '<td class="conv_time">' . $closed_dispute->datemade . '</td>';
            echo '<td>' . $user->user_login . '</td>';
            echo '<td class="disp_com">' . $closed_dispute->comment . '</td>';
            echo '<td>' . $user_winner->user_login . '</td>';
            echo '<td>' . date('m-d-Y H:i', $closed_dispute->closedon) . '</td>';
            echo '<td class="disp_com">' . $closed_dispute->admin_comment . '</td>';
            echo '</tr>';
        }
        echo '</table>';
    } else {
        _e('There are no closed disputes.', 'ProjectTheme');
    }
    ?>
                
                </div>
                <div class="box_content"> 
                <div class="box_title"><?php 
    _e("As Defendant", "ProjectTheme");
    ?>
</div>
                    <?php 
    if ($closed_disputes_on_me) {
        echo '<table class="closed_disputes">';
        echo '<tr>';
        echo '<td>Date create</td>';
        echo '<td>Initiator</td>';
        echo '<td>Comment</td>';
        echo '<td>Winner</td>';
        echo '<td>Closed on</td>';
        echo '<td>Verdict</td>';
        echo '</tr>';
        foreach ($closed_disputes_on_me as $key => $closed_dispute) {
            $user = get_userdata($closed_dispute->initiator);
            $user_winner = get_userdata($closed_dispute->winner);
            echo '<tr>';
            //echo '<td>'.date('m-d-Y H:i',$closed_dispute->datemade).'</td>';
            echo '<td class="conv_time">' . $closed_dispute->datemade . '</td>';
            echo '<td>' . $user->user_login . '</td>';
            echo '<td class="disp_com">' . $closed_dispute->comment . '</td>';
            echo '<td>' . $user_winner->user_login . '</td>';
            echo '<td>' . date('m-d-Y H:i', $closed_dispute->closedon) . '</td>';
            echo '<td class="disp_com">' . $closed_dispute->admin_comment . '</td>';
            echo '</tr>';
        }
        echo '</table>';
    } else {
        _e('There are no closed disputes.', 'ProjectTheme');
    }
    ?>
                
                </div>
                </div>
                </div>

                <div class="clear10"></div>
                
                
                
                
                </div>  
                 <script type="text/javascript">
            $(document).ready(function(){
                
                $('.conv_time').each(function(){
                    var tm = parseInt($(this).text())*1000;
                    console.log(tm);
                    var time = new Date(tm);
                    $(this).text(time.toLocaleString());
                });
            });
        </script> 
<?php 
    ProjectTheme_get_users_links();
}
Example #15
0
function ProjectTheme_my_account_area_main_function()
{
    global $current_user, $wp_query;
    get_currentuserinfo();
    $uid = $current_user->ID;
    ?>
    	<div id="content">
        	<?php 
    if (ProjectTheme_is_user_business($uid)) {
        ?>
            <div class="my_box3">            
            	<div class="box_title"><?php 
        _e("Your Latest Posted Projects", "ProjectTheme");
        ?>
</div>
                <div class="box_content "> 
            	
                 <?php 
        $query_vars = $wp_query->query_vars;
        $post_per_page = 3;
        global $wp_query;
        $query_vars = $wp_query->query_vars;
        $post_per_page = 5;
        $closed = array('key' => 'closed', 'value' => "0", 'compare' => '=');
        $paid = array('key' => 'paid', 'value' => "1", 'compare' => '=');
        $args = array('post_type' => 'project', 'author' => $uid, 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => $post_per_page, 'paged' => 1, 'meta_query' => array($paid, $closed), 'post_status' => array('draft', 'publish'));
        query_posts($args);
        //	query_posts( "meta_key=closed&meta_value=0&post_status=publish,draft&post_type=project&order=DESC&orderby=date&author=".$uid.
        //	"&posts_per_page=".$post_per_page."&paged=".$query_vars['paged'] );
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post();
            }
            //if(function_exists('wp_pagenavi')):
            //wp_pagenavi(); endif;
        } else {
            _e("There are no projects yet.", 'ProjectTheme');
        }
        wp_reset_query();
        ?>

              </div>
           </div>
           
           
           <div class="my_box3">
          
            
            	<div class="box_title"><?php 
        _e("My Unpublished &amp; Unpaid Projects", 'ProjectTheme');
        ?>
</div>
                <div class="box_content">    
			
			
				<?php 
        query_posts("post_status=draft&meta_key=paid&meta_value=0&post_type=project&order=DESC&orderby=id&author=" . $uid . "&posts_per_page=3");
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post(array('unpaid'));
            }
        } else {
            _e("There are no projects yet.", 'ProjectTheme');
        }
        wp_reset_query();
        ?>
			
			</div>
			</div>
	
			
			
			<div class="clear10"></div>
			
			
			<div class="my_box3">
        
            
            	<div class="box_title"><?php 
        _e("My Latest Closed Projects", 'ProjectTheme');
        ?>
</div>
                <div class="box_content">    
			
			
				<?php 
        query_posts("meta_key=closed&meta_value=1&post_type=project&order=DESC&orderby=id&author=" . $uid . "&posts_per_page=3");
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post();
            }
        } else {
            _e("There are no projects yet.", 'ProjectTheme');
        }
        wp_reset_query();
        ?>

			</div>
			</div>
		
        <?php 
    }
    ?>
        
        <?php 
    if (ProjectTheme_is_user_provider($uid)) {
        ?>
	
           
           
        <div class="my_box3">
        
            
            	<div class="box_title"><?php 
        _e("Outstanding Projects", 'ProjectTheme');
        ?>
</div>
                <div class="box_content">    
			
			
				<?php 
        global $wp_query;
        $query_vars = $wp_query->query_vars;
        $post_per_page = 3;
        $outstanding = array('key' => 'outstanding', 'value' => "1", 'compare' => '=');
        $winner = array('key' => 'winner', 'value' => $uid, 'compare' => '=');
        $args = array('post_type' => 'project', 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => $post_per_page, 'paged' => 1, 'meta_query' => array($outstanding, $winner));
        query_posts($args);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post_outstanding_project();
            }
        } else {
            _e("There are no projects yet.", 'ProjectTheme');
        }
        wp_reset_query();
        ?>

			</div>
			</div>   
           
           
           
           
           
        <div class="my_box3">
        
            
            	<div class="box_title"><?php 
        _e("My Latest Bids", 'ProjectTheme');
        ?>
</div>
                <div class="box_content">    
			
			
				<?php 
        query_posts("meta_key=bid&meta_value=" . $uid . "&post_type=project&order=DESC&orderby=id&posts_per_page=3");
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post();
            }
        } else {
            _e("There are no projects yet.", 'ProjectTheme');
        }
        wp_reset_query();
        ?>

			</div>
			</div>
            
            
            
            <div class="my_box3">
        
            
            	<div class="box_title"><?php 
        _e("My Latest Won Projects", 'ProjectTheme');
        ?>
</div>
                <div class="box_content">    
			
			
				<?php 
        query_posts("meta_key=winner&meta_value=" . $uid . "&post_type=project&order=DESC&orderby=id&posts_per_page=3");
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post();
            }
        } else {
            _e("There are no projects yet.", 'ProjectTheme');
        }
        wp_reset_query();
        ?>

			</div>
			</div>
            
        
        <?php 
    }
    ?>
   
                
        </div> <!-- end dif content -->
        
        <?php 
    ProjectTheme_get_users_links();
    ?>
        
    
	
<?php 
}
function ProjectTheme_my_account_personal_info_function()
{
    global $current_user, $wpdb, $wp_query;
    get_currentuserinfo();
    $uid = $current_user->ID;
    ?>
    	<div id="content">
        	
           <?php 
    if (isset($_POST['save-info'])) {
        //if(file_exists('cimy_update_ExtraFields'))
        cimy_update_ExtraFields_new_me();
        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);
            }
        }
        //---------------------
        $wpdb->query("delete from " . $wpdb->prefix . "project_email_alerts where uid='{$uid}' ");
        $email_cats = $_POST['email_cats'];
        if (count($email_cats) > 0) {
            foreach ($email_cats as $em) {
                $wpdb->query("insert into " . $wpdb->prefix . "project_email_alerts (uid,catid) values('{$uid}','{$em}') ");
            }
        }
        //-------------------
        //email_locs
        //****************************************************************************************************
        $ProjectTheme_enable_project_location = get_option('ProjectTheme_enable_project_location');
        if ($ProjectTheme_enable_project_location != "no") {
            $wpdb->query("delete from " . $wpdb->prefix . "project_email_alerts_locs where uid='{$uid}' ");
            $email_cats = $_POST['email_locs'];
            if (count($email_cats) > 0) {
                foreach ($email_cats as $em) {
                    $wpdb->query("insert into " . $wpdb->prefix . "project_email_alerts_locs (uid,catid) values('{$uid}','{$em}') ");
                }
            }
        }
        //****************************************************************************************************
        //-------------------
        $user_description = trim($_POST['user_description']);
        update_user_meta($uid, 'user_description', $user_description);
        $per_hour = trim($_POST['per_hour']);
        update_user_meta($uid, 'per_hour', $per_hour);
        $user_location = trim($_POST['project_location_cat']);
        update_user_meta($uid, 'user_location', $user_location);
        $user_city = trim($_POST['user_city']);
        update_user_meta($uid, 'user_city', $user_city);
        $personal_info = trim($_POST['paypal_email']);
        update_user_meta($uid, 'paypal_email', $personal_info);
        $personal_info = trim($_POST['payza_email']);
        update_user_meta($uid, 'payza_email', $personal_info);
        $personal_info = trim($_POST['moneybookers_email']);
        update_user_meta($uid, 'moneybookers_email', $personal_info);
        $user_url = trim($_POST['user_url']);
        update_user_meta($uid, 'user_url', $user_url);
        do_action('ProjectTheme_pers_info_save_action');
        if (isset($_POST['password']) && !empty($_POST['password'])) {
            $p1 = trim($_POST['password']);
            $p2 = trim($_POST['reppassword']);
            if (!empty($p1) && !empty($p2)) {
                if ($p1 == $p2) {
                    global $wpdb;
                    $newp = md5($p1);
                    $sq = "update " . $wpdb->prefix . "users set user_pass='******' where ID='{$uid}'";
                    $wpdb->query($sq);
                } else {
                    echo __("Passwords do not match!", "ProjectTheme");
                }
            }
        }
        //---------------------------------------
        $arr = $_POST['custom_field_id'];
        for ($i = 0; $i < count($arr); $i++) {
            $ids = $arr[$i];
            $value = $_POST['custom_field_value_' . $ids];
            if (is_array($value)) {
                delete_user_meta($uid, "custom_field_ID_" . $ids);
                for ($j = 0; $j < count($value); $j++) {
                    add_user_meta($uid, "custom_field_ID_" . $ids, $value[$j]);
                }
            } else {
                update_user_meta($uid, "custom_field_ID_" . $ids, $value);
            }
        }
        //--------------------------------------------
        echo '<div class="saved_thing">' . __('Info saved!', 'ProjectTheme') . '</div>';
    }
    $user = get_userdata($uid);
    $user_location = get_user_meta($uid, 'user_location', true);
    ?>
         
            
            
             <form method="post"  enctype="multipart/form-data">
             
            <div class="my_box3">
            	
            
            	<div class="box_title"><?php 
    _e("Personal Information", 'ProjectTheme');
    ?>
</div>
                <div class="box_content">    
	
         <ul class="post-new3">
        <li>
        	<h2><?php 
    echo __('Username', 'ProjectTheme');
    ?>
:</h2>
        	<p><input type="text" size="35" value="<?php 
    echo $user->user_login;
    ?>
" disabled="disabled" class="do_input" /></p>
        </li>

		<?php 
    $opt = get_option('ProjectTheme_enable_project_location');
    if ($opt != 'no') {
        ?>
        
		 <li>
        	<h2><?php 
        echo __('Location', 'ProjectTheme');
        ?>
:</h2>
        	<p>
            <?php 
        echo ProjectTheme_get_categories("project_location", $user_location, __("Select Location", "ProjectTheme"), "do_input");
        ?>
            </p>
        </li>
		
        
        <li>
        	<h2><?php 
        echo __('City', 'ProjectTheme');
        ?>
:</h2>
        	<p><input type="text" size="35" name="user_city" value="<?php 
        echo get_user_meta($uid, 'user_city', true);
        ?>
" class="do_input" /></p>
        </li>
        
		<?php 
    }
    ?>
     
            <script>
			
			jQuery(document).ready(function(){
			tinyMCE.init({
					mode : "specific_textareas",
					theme : "advanced", 
					/*plugins : "autolink, lists, spellchecker, style, layer, table, advhr, advimage, advlink, emotions, iespell, inlinepopups, insertdatetime, preview, media, searchreplace, print, contextmenu, paste, directionality, fullscreen, noneditable, visualchars, nonbreaking, xhtmlxtras, template",*/
					editor_selector :"tinymce-enabled"
				});
			});
						
			</script>    
        <li>
        	<h2><?php 
    echo __('Description', 'ProjectTheme');
    ?>
:</h2>
        	<p><textarea cols="40" rows="5"  name="user_description" class="tinymce-enabled do_input"><?php 
    echo get_usermeta($uid, 'user_description', true);
    ?>
</textarea></p>
        </li>
        
        <?php 
    $opt = get_option('ProjectTheme_paypal_enable');
    if ($opt == "yes") {
        ?>
        
        <li>
        	<h2><?php 
        echo __('PayPal Email', 'ProjectTheme');
        ?>
:</h2>
        	<p><input type="text" size="35" name="paypal_email" value="<?php 
        echo get_user_meta($uid, 'paypal_email', true);
        ?>
" class="do_input" /></p>
        </li>
        
        <?php 
    }
    $opt = get_option('ProjectTheme_moneybookers_enable');
    if ($opt == "yes") {
        ?>
        
        <li>
        	<h2><?php 
        echo __('Moneybookers Email', 'ProjectTheme');
        ?>
:</h2>
        	<p><input type="text" size="35" name="moneybookers_email" value="<?php 
        echo get_user_meta($uid, 'moneybookers_email', true);
        ?>
" class="do_input" /></p>
        </li>
        
        <?php 
    }
    $opt = get_option('ProjectTheme_alertpay_enable');
    if ($opt == "yes") {
        ?>
        
         <li>
        	<h2><?php 
        echo __('Payza Email', 'ProjectTheme');
        ?>
:</h2>
        	<p><input type="text" size="35" name="payza_email" value="<?php 
        echo get_user_meta($uid, 'payza_email', true);
        ?>
" class="do_input" /></p>
        </li>
       <?php 
    }
    ?>
 
        
         <li>
        	<h2><?php 
    echo __('New Password', "ProjectTheme");
    ?>
:</h2>
        	<p><input type="password" value="" class="do_input" name="password" size="35" /></p>
        </li>
        
        
        <li>
        	<h2><?php 
    echo __('Repeat Password', "ProjectTheme");
    ?>
:</h2>
        	<p><input type="password" value="" class="do_input" name="reppassword" size="35"  /></p>
        </li>
        
        
        <?php 
    do_action('ProjectTheme_pers_info_fields_1');
    ?>
        
   		  <li>
        	<h2><?php 
    echo __('Profile Avatar', 'ProjectTheme');
    ?>
:</h2>
        	<p> <input type="file" name="avatar" /> <br/>
           <?php 
    _e('max file size: 1mb. Formats: jpeg, jpg, png, gif', 'ProjectTheme');
    ?>
            <br/>
            <img width="50" height="50" border="0" src="<?php 
    echo ProjectTheme_get_avatar($uid, 50, 50);
    ?>
" /> 
            </p>
        </li>
   
   
   <li>
   <?php 
    if (function_exists('cimy_extract_ExtraFields')) {
        cimy_extract_ExtraFields();
    }
    ?>
   </li> 
        
        
        <li>
        <h2>&nbsp;</h2>
        <p><input type="submit" name="save-info" value="<?php 
    _e("Save", 'ProjectTheme');
    ?>
" /></p>
        </li>
        
       </ul> 
        
               
        
           </div>
           </div>     
            
            <div class="clear10"></div>
            
            <div class="my_box3" >
           
            
            	<div class="box_title" id="other_infs_mm"><?php 
    _e("Other Information", 'ProjectTheme');
    ?>
</div>
                <div class="box_content">  
                
        <ul class="post-new3">
        
        
        <?php 
    do_action('ProjectTheme_pers_info_fields_2');
    ?>
        
        <?php 
    $user_tp = get_user_meta($uid, 'user_tp', true);
    if (empty($user_tp)) {
        $user_tp = 'all';
    }
    if ($user_tp == "all") {
        $catid = array('all', 'service_buyer', 'service_provider');
    } else {
        $catid = array($user_tp);
    }
    if (current_user_can('manage_options')) {
        $catid = array('all', 'service_buyer', 'service_provider');
    }
    $k = 0;
    $arr = ProjectTheme_get_users_category_fields($catid, $uid);
    $exf = '';
    for ($i = 0; $i < count($arr); $i++) {
        $exf .= '<li>';
        $exf .= '<h2>' . $arr[$i]['field_name'] . $arr[$i]['id'] . ':</h2>';
        $exf .= '<p>' . $arr[$i]['value'] . '</p>';
        $exf .= '</li>';
        $k++;
    }
    echo $exf;
    if (ProjectTheme_is_user_provider($uid)) {
        $k++;
        ?>
           
                            
        <li>
        	<h2><?php 
        echo __('Hourly Rate', 'ProjectTheme');
        ?>
:</h2>
        	<p><?php 
        echo projectTheme_currency();
        ?>
<input type="text" size="7" name="per_hour" value="<?php 
        echo get_user_meta($uid, 'per_hour', true);
        ?>
" class="do_input" /> 
             *<?php 
        _e('your estimated hourly rate', 'ProjectTheme');
        ?>
</p>
        </li>
        
        <?php 
    }
    global $current_user;
    get_currentuserinfo();
    $uid = $current_user->ID;
    if (ProjectTheme_is_user_provider($uid)) {
        ?>
           
                            
        <li>
        	<h2><?php 
        echo __('Portfolio Pictures', 'ProjectTheme');
        ?>
:</h2>
        	<p>
			
     <?php 
        ?>
       
    <script type="text/javascript">
	
	function delete_this(id)
	{
		 $.ajax({
						method: 'get',
						url : '<?php 
        echo get_bloginfo('siteurl');
        ?>
/index.php/?_ad_delete_pid='+id,
						dataType : 'text',
						success: function (text) {   $('#image_ss'+id).remove();  }
					 });
		  //alert("a");
	
	}

	
	
	$(function() {
		
		$("#fileUpload4").uploadify({
			height        : 30,
			auto:			true,
			swf           : '<?php 
        echo get_bloginfo('template_url');
        ?>
/lib/uploadify/uploadify.swf',
			uploader      : '<?php 
        echo get_bloginfo('template_url');
        ?>
/lib/uploadify/uploady8.php',
			width         : 180,
			buttonText	: 'Add Portfolio Images',
			fileTypeExts  : '*.jpg;*.jpeg;*.gif;*.png',
			formData    : {'ID':<?php 
        echo 0;
        ?>
,'author':<?php 
        echo $uid;
        ?>
},
			onUploadSuccess : function(file, data, response) {
			
			//alert(data);
			var bar = data.split("|");
			
$('#thumbnails').append('<div class="div_div" id="image_ss'+bar[1]+'" ><img width="70" class="image_class" height="70" src="' + bar[0] + '" /><a href="javascript: void(0)" onclick="delete_this('+ bar[1] +')"><img border="0" src="<?php 
        echo get_bloginfo('template_url');
        ?>
/images/delete_icon.png" border="0" /></a></div>');
}
	
			
			
    	});
		
		
	});
	
	
	</script>
	
    <style type="text/css">
	.div_div
	{
		margin-left:5px; float:left; 
		width:110px;margin-top:10px;
	}
	
	</style>
    
    <div id="fileUpload4" style="width:100%">You have a problem with your javascript</div>
    <div id="thumbnails" style="overflow:hidden;margin-top:20px">
    
    <?php 
        $args = array('order' => 'ASC', 'orderby' => 'post_date', 'post_type' => 'attachment', 'author' => $current_user->ID, 'meta_key' => 'is_portfolio', 'meta_value' => '1', 'post_mime_type' => 'image', 'numberposts' => -1);
        $i = 0;
        $attachments = get_posts($args);
        if ($attachments) {
            foreach ($attachments as $attachment) {
                $url = wp_get_attachment_url($attachment->ID);
                echo '<div class="div_div"  id="image_ss' . $attachment->ID . '"><img width="70" class="image_class" height="70" src="' . ProjectTheme_generate_thumb($url, 70, 70) . '" />
			<a href="javascript: void(0)" onclick="delete_this(\'' . $attachment->ID . '\')"><img border="0" src="' . get_bloginfo('template_url') . '/images/delete_icon.png" /></a>
			</div>';
            }
        }
        ?>
    
    </div>
            
            
            </p>
        </li>
        
        <?php 
    }
    if (ProjectTheme_is_user_provider($uid)) {
        $k++;
        ?>
                    
                    <li>
                        <h2><?php 
        echo __('Emails Alerts', 'ProjectTheme');
        ?>
:</h2>
                        <p><div style="border:1px solid #ccc;background:#f2f2f2; overflow:auto; width:350px; border-radius:5px; height:160px;">
                        
                        <?php 
        global $wpdb;
        $ss = "select * from " . $wpdb->prefix . "project_email_alerts where uid='{$uid}'";
        $rr = $wpdb->get_results($ss);
        $terms = get_terms('project_cat', 'parent=0&orderby=name&hide_empty=0');
        foreach ($terms as $term) {
            $chk = projectTheme_check_list_emails($term->term_id, $rr) == true ? "checked='checked'" : "";
            echo '<input type="checkbox" name="email_cats[]" ' . $chk . ' value="' . $term->term_id . '" /> ' . $term->name . "<br/>";
            $terms2 = get_terms('project_cat', 'parent=' . $term->term_id . '&orderby=name&hide_empty=0');
            foreach ($terms2 as $term2) {
                $chk = projectTheme_check_list_emails($term2->term_id, $rr) == 1 ? "checked='checked'" : "";
                echo '&nbsp;&nbsp; &nbsp; <input type="checkbox" name="email_cats[]" ' . $chk . ' value="' . $term2->term_id . '" /> ' . $term2->name . "<br/>";
                $terms3 = get_terms('project_cat', 'parent=' . $term2->term_id . '&orderby=name&hide_empty=0');
                foreach ($terms3 as $term3) {
                    $chk = projectTheme_check_list_emails($term3->term_id, $rr) == 1 ? "checked='checked'" : "";
                    echo '&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <input type="checkbox" ' . $chk . ' name="email_cats[]" 
										value="' . $term3->term_id . '" /> ' . $term3->name . "<br/>";
                }
            }
        }
        ?>
                        
                        </div>
                        <br/>
                        *<?php 
        _e('you will get an email notification when a project is posted in the selected categories', 'ProjectTheme');
        ?>
</p>
                    </li>
        
        <?php 
        $ProjectTheme_enable_project_location = get_option('ProjectTheme_enable_project_location');
        if ($ProjectTheme_enable_project_location != "no") {
            ?>
        	   <li>
                        <h2>&nbsp;</h2>
                        <p><div style="border:1px solid #ccc;background:#f2f2f2; overflow:auto; width:350px; border-radius:5px; height:160px;">
                        
                        <?php 
            global $wpdb;
            $ss = "select * from " . $wpdb->prefix . "project_email_alerts_locs where uid='{$uid}'";
            $rr = $wpdb->get_results($ss);
            $terms = get_terms('project_location', 'parent=0&orderby=name&hide_empty=0');
            foreach ($terms as $term) {
                $chk = projectTheme_check_list_emails($term->term_id, $rr) == true ? "checked='checked'" : "";
                echo '<input type="checkbox" name="email_locs[]" ' . $chk . ' value="' . $term->term_id . '" /> ' . $term->name . "<br/>";
                $terms2 = get_terms('project_location', 'parent=' . $term->term_id . '&orderby=name&hide_empty=0');
                foreach ($terms2 as $term2) {
                    $chk = projectTheme_check_list_emails($term2->term_id, $rr) == 1 ? "checked='checked'" : "";
                    echo '&nbsp;&nbsp; &nbsp; <input type="checkbox" name="email_locs[]" ' . $chk . ' value="' . $term2->term_id . '" /> ' . $term2->name . "<br/>";
                    $terms3 = get_terms('project_location', 'parent=' . $term2->term_id . '&orderby=name&hide_empty=0');
                    foreach ($terms3 as $term3) {
                        $chk = projectTheme_check_list_emails($term3->term_id, $rr) == 1 ? "checked='checked'" : "";
                        echo '&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <input type="checkbox" ' . $chk . ' name="email_locs[]" 
										value="' . $term3->term_id . '" /> ' . $term3->name . "<br/>";
                    }
                }
            }
            ?>
                        
                        </div>
                        <br/>
                        *<?php 
            _e('you will get an email notification when a project is posted in the selected locations', 'ProjectTheme');
            ?>
</p>
                    </li>
        
        
        <?php 
        }
    }
    if ($k == 0) {
        echo '<style>#other_infs_mm, #bk_save_not { display:none; } </style>';
    }
    ?>
        
        			
                    <li id="bk_save_not">
        <h2>&nbsp;</h2> <input type="hidden" value="<?php 
    echo $uid;
    ?>
" name="user_id" />
        <p><input type="submit" name="save-info" value="<?php 
    _e("Save", 'ProjectTheme');
    ?>
" /></p>
        </li>
                    
        </ul>
                
                
              
                </div>
                </div>
                
                
             
            
            
            
            
		</form>

                
        </div> <!-- end dif content -->
        
        <?php 
    ProjectTheme_get_users_links();
    ?>
        
    
	
<?php 
}