Пример #1
0
 /**
  * override convert function to update backend text
  */
 function convert($post, $thumbnail = '', $excerpt = false, $singular = false)
 {
     $result = parent::convert($post, $thumbnail);
     if ($result) {
         $currency = ae_currency_sign(false);
         $align = ae_currency_align(false);
         if ($align) {
             $result->backend_text = sprintf(__("(%s)%s for %d days", 'aecore-class-ae-package-backend'), $currency, $result->et_price, $result->et_duration);
         } else {
             $result->backend_text = sprintf(__("%s(%s) for %d days", 'aecore-class-ae-package-backend'), $result->et_price, $currency, $result->et_duration);
         }
     }
     return $result;
 }
Пример #2
0
		<div class="form-item">
			<div class="label"><?php 
_e("Enter a name for your plan", ET_DOMAIN);
?>
</div>
			<input class="bg-grey-input not-empty required" name="post_title" type="text" />
		</div>
		<div class="form-item f-left-all clearfix">
			<div class="width33p">
				<div class="label"><?php 
_e("Price", ET_DOMAIN);
?>
</div>
				<input class="bg-grey-input width50p not-empty is-number required number" name="et_price" type="text" /> 
				<?php 
ae_currency_sign();
?>
			</div>
			<div class="width33p">
				<div class="label"><?php 
_e("Availability", ET_DOMAIN);
?>
</div>
				<input class="bg-grey-input width50p not-empty is-number required number" type="text" name="et_duration" /> 
				<?php 
_e("days", ET_DOMAIN);
?>
			</div>
			<div class="width33p">
				<div class="label"><?php 
_e("Number of project can post", ET_DOMAIN);
Пример #3
0
    /**
     * render post type meta view
     * @author Dakachi
     * @since 1.0
     * @package AE
     */
    public function meta_view($post)
    {
        global $ae_post_factory;
        $ae_pack = $ae_post_factory->get('pack');
        $payment_package = $ae_pack->fetch();
        $currency = ae_get_option('currency');
        $place_obj = $ae_post_factory->get($this->post_type);
        $ad = (array) $place_obj->convert($post);
        ?>
 
        <table class="form-table ad-info">
            <input type="hidden" name="_et_nonce" value="<?php 
        echo wp_create_nonce($this->nonce);
        ?>
">
            <tbody>
            <tr valign="top">
                <th scope="row"><label for=""><strong><?php 
        _e("Packages:", ET_DOMAIN);
        ?>
</strong></label></th>
                <td>
                    <?php 
        if (!empty($payment_package)) {
            foreach ($payment_package as $key => $plan) {
                ?>
                    <p>
                        <input data-duration="<?php 
                echo $plan->et_duration;
                ?>
" class="ad-package" type="radio" id="et_ad_package_<?php 
                echo $plan->sku;
                ?>
" name="et_payment_package" value="<?php 
                echo $plan->sku;
                ?>
" <?php 
                checked($plan->sku, $ad['et_payment_package'], true);
                ?>
                        /> 
                        <label for="et_ad_package_<?php 
                echo $plan->sku;
                ?>
"><strong><?php 
                echo $plan->post_title;
                ?>
  <?php 
                echo $plan->et_price;
                ae_currency_sign();
                ?>
</strong> - <?php 
                echo $plan->backend_text;
                ?>
                        </label>
                    </p>
                    <?php 
            }
        }
        ?>
                </td>
            </tr>

            <tr valign="top">
                <th scope="row"><label for="et_featured"><strong><?php 
        _e("Featured post:", ET_DOMAIN);
        ?>
</strong></label></th>
                <td>
                    <input type="hidden" value="0" name="et_featured" />
                    <input value="1"  name="et_featured" type="checkbox" id="et_featured" <?php 
        checked(1, $ad['et_featured'], true);
        ?>
 >
                    <p class="description"><label for="et_featured" ><?php 
        _e("Make this post featured in listing.", ET_DOMAIN);
        ?>
</label></p>
                </td>
                
            </tr>

            <tr valign="top">
                <th scope="row"><label for="et_expired_date"><strong><?php 
        _e("Expired Date:", ET_DOMAIN);
        ?>
</strong></label></th>
                <td>
                    <input  name="et_expired_date" type="text" id="et_expired_date" value="<?php 
        echo $ad['et_expired_date'];
        ?>
" class="regular-text">
                    <p class="description"><?php 
        _e("Specify a date when ad will be archived.", ET_DOMAIN);
        ?>
</p>
                </td>
                
            </tr>

            <?php 
        do_action('et_meta_fields', $ad);
        ?>

            <!-- <tr valign="top">
                <?php 
        $user = get_user_by('id', $ad['post_author']);
        ?>
 
                <th scope="row"><label for="seller"><strong><?php 
        _e("Assign to a author:", ET_DOMAIN);
        ?>
</strong> </label></th>
                <td>
                    <input name="seller" type="text" id="seller" value="<?php 
        echo $user->display_name;
        ?>
" class="regular-text ltr">
                    <input type="hidden" id="et_author" name="post_author_override" value="<?php 
        echo $post->post_author;
        ?>
"> 
                    <p class="description"><?php 
        _e("Choose a seller to make him become the author of this item.", ET_DOMAIN);
        ?>
</p>
                </td>
            </tr> -->
            </tbody>
        </table>
        <?php 
        // print users list
        // $users = get_users();
        $template = array();
        // foreach ($users as $user) {
        //     $template[] = array(
        //         'value' => $user->ID,
        //         'label' => $user->display_name
        //     );
        // }
        ?>
        <script type="text/template" id="et_users">
            <?php 
        echo json_encode($template);
        ?>
        </script>
    <?php 
    }
Пример #4
0
    /**
     * render container element
     */
    function render()
    {
        echo '<div class="ae-overview">';
        $payment = $this->payment;
        $post_types = $this->post_types;
        $daily_data = array();
        $weekly_data = array();
        $monthly_data = array();
        foreach ($post_types as $post_type) {
            $obj = get_post_type_object($post_type);
            $monthly = $this->get_monthly_stat($post_type);
            $monthly_data[] = array('label' => $obj->labels->name, 'data' => $monthly, 'title' => __("Overview", ET_DOMAIN));
            $weekly = $this->get_weekly_stat($post_type);
            $weekly_data[] = array('label' => $obj->labels->name, 'data' => $weekly, 'title' => __("3 Months Overview", ET_DOMAIN));
            $daily = $this->get_daily_stat($post_type);
            $daily_data[] = array('label' => $obj->labels->name, 'data' => $daily, 'title' => __("2 weeks Overview", ET_DOMAIN));
        }
        $daily_register = $this->get_daily_registration();
        if (!empty($daily_register)) {
            $daily_data[] = array('label' => __("Signup", ET_DOMAIN), 'data' => $daily_register, 'title' => __("Overview", ET_DOMAIN));
        }
        $weekly_register = $this->get_daily_registration();
        if (!empty($weekly_register)) {
            $weekly_data[] = array('label' => __("Signup", ET_DOMAIN), 'data' => $weekly_register, 'title' => __("Overview", ET_DOMAIN));
        }
        $monthly_register = $this->get_monthly_registration();
        if (!empty($monthly_register)) {
            $monthly_data[] = array('label' => __("Signup", ET_DOMAIN), 'data' => $monthly_register, 'title' => __("Overview", ET_DOMAIN));
        }
        if ($payment) {
            $currency = ae_currency_sign(false);
            $daily_payment = $this->get_daily_payment('publish');
            $weekly_payment = $this->get_weekly_payment('publish');
            $monthly_payment = $this->get_monthly_payment();
            if (!empty($daily_payment)) {
                $daily_data[] = array('label' => sprintf(__("Revenue(%s)", ET_DOMAIN), $currency), 'data' => $daily_payment, 'title' => __("Revenue", ET_DOMAIN));
            }
            if (!empty($weekly_payment)) {
                $weekly_data[] = array('label' => sprintf(__("Revenue(%s)", ET_DOMAIN), $currency), 'data' => $weekly_payment, 'title' => __("Revenue", ET_DOMAIN));
            }
            if (!empty($monthly_payment)) {
                $monthly_data[] = array('label' => sprintf(__("Revenue(%s)", ET_DOMAIN), $currency), 'data' => $monthly_payment, 'title' => __("Revenue", ET_DOMAIN));
            }
        }
        ?>
    	<script type="application/json" id="monthly_data">
    	<?php 
        echo json_encode($monthly_data);
        ?>
    	</script>

    	<script type="application/json" id="weekly_data">
    	<?php 
        echo json_encode($weekly_data);
        ?>
    	</script>

    	<script type="application/json" id="daily_data">
    	<?php 
        echo json_encode($daily_data);
        ?>
    	</script>


	    	<div class="charts" style="">
	    		<div id="daily_chart" style=""></div>
	    		<div id="weekly_chart" style=""></div>
	    		<div id="monthly_chart" style=""></div>
	    	</div>
	    	<!-- <div class="details" style="">
		    	<ul>
		    		<strong>Today</strong>
		    		<label for=""></label>
		    		<li>dakl dlkasd aslk kldja l</li>
		    		Yesterday
		    		<li>dakl dlkasd aslk kldja l</li>
		    		This week
		    		<li>dakl dlkasd aslk kldja l</li>
		    		Lastweek
		    		<li>dakl dlkasd aslk kldja l</li>

		    	</ul>
	    	</div>	 -->

    <?php 
        echo '</div>';
    }
Пример #5
0
    switch ($post->post_status) {
        case 'pending':
            echo '<a title="' . __("Pending", ET_DOMAIN) . '" class="color-red error" href="#"><span class="icon" data-icon="!"></span></a>';
            break;
        case 'publish':
            echo '<a title="' . __("Confirmed", ET_DOMAIN) . '" class="color-green" href="#"><span class="icon" data-icon="2"></span></a>';
            break;
        default:
            echo '<a title="' . __("Failed", ET_DOMAIN) . '" class="color" style="color :grey;" href="#"><span class="icon" data-icon="*"></span></a>';
            break;
    }
    ?>
	
			<span class="price font-quicksand">
				<?php 
    echo ae_currency_sign(false) . $order_data['total'];
    ?>
			</span>
		<?php 
    if ($post_parent) {
        ?>
				<a target="_blank" href="<?php 
        echo get_permalink($post_parent->ID);
        ?>
" class="ad ad-name">
					<?php 
        echo get_the_title($post_parent->ID);
        echo ' (' . $package['NAME'] . ')';
        ?>
				</a>
			<?php 
Пример #6
0
/**
 * print currency with a price format
 * @author Dakachi
 */
function ae_price($price, $echo = true)
{
    $currency = '<sup>' . ae_currency_sign(false) . '</sup>';
    // if()
    $options = AE_Options::get_instance();
    $align = $options->currency['align'];
    if ($align) {
        echo $currency . $price;
    } else {
        echo $price . $currency;
    }
}