Example #1
0
    echo $sale['type_name'];
    ?>
</td>
                        <td class="tr"><?php 
    echo price($sale['type_price']);
    ?>
</td>
                        <td style="position: relative">
                        <?php 
    if (!empty($promotions['promo_item_id'])) {
        if ($promotions['promo_id'] == 1) {
            $suffix = price($promotions['promo_value']) . " &#37;";
        } else {
            $suffix = "IDR " . price($promotions['promo_value']);
        }
        $today = current_date_sql();
        $current = get_sale_time($promotions['promo_end_datetime'], $today);
        $duration = get_sale_time($promotions['promo_end_datetime'], $promotions['promo_start_datetime']);
        if (date('Y-m-d') >= $promotions['promo_start_datetime'] and date('Y-m-d') <= $promotions['promo_end_datetime']) {
            $days_left = $current['left_days'] . " more day(s)";
        } else {
            if (date('Y-m-d') >= $promotions['promo_end_datetime']) {
                $days_left = $duration['left_days'] . " day(s)";
            } else {
                $days_left = $duration['left_days'] . " day(s)";
            }
        }
        ?>
                        
                        <div id="ajax_remove_wrapper_<?php 
        echo $promotions['promo_item_id'];
Example #2
0
<?php

/* -- CALL FUNCTIONS -- */
$category = get_category();
if (isset($_POST['btn_add_inspiration'])) {
    /* -- INSPIRATION -- */
    // PREDEFINED VALUE
    $name = addslashes($_POST['inspiration_name']);
    $description = '';
    $date_created = current_date_sql();
    $active = 1;
    $visibility = 1;
    $order = $_POST['order_banner'];
    $category = $_POST['inspiration_category'];
    // DATABASE
    insert_inspiration($name, $description, $date_created, $active, $visibility, $category);
    /* -- INSPIRATION IMAGE -- */
    // CALL FUNCTION
    $get_max = get_inspiration_latest_id();
    // PREDEFINED VALUE
    $max_id = $get_max['latest_inspiration_id'];
    // IMAGE & FEATURED
    $arr_img = $_POST['check_banner'];
    foreach ($arr_img as $key => $arr_img) {
        $image_name = substr($_FILES['upload_news_' . $arr_img]['name'], 0, -4);
        $image_type = substr($_FILES['upload_news_' . $arr_img]['name'], -4);
        $uploads_dir = '../files/uploads/inspiration_image/';
        $userfile_name = cleanurl(str_replace(array('(', ')', ' '), '_', $image_name)) . $image_type;
        $userfile_tmp = $_FILES['upload_news_' . $arr_img]['tmp_name'];
        $prefix = 'inspiration-' . $arr_img . "-";
        $prod_img = $uploads_dir . $prefix . $userfile_name;
Example #3
0
</script>
<?php 
        // ALERT
        $_SESSION['alert'] = "alert-danger";
        $_SESSION['msg'] = "Incorrect email or password.";
    }
}
if (isset($_POST['btn_register'])) {
    // DEFINED VALUE
    $fname = clean_alphabet($_POST['register_fname']);
    $lname = clean_alphabet($_POST['register_lname']);
    $fullname = $fname . " " . $lname;
    $email = clean_email($_POST['register_email']);
    $password = clean_alphanumeric($_POST['regeister_repassword']);
    $check = generate_alias($fullname);
    $date = current_date_sql();
    $check_email = validate_email(clean_email($_POST['register_email']));
    if ($check_email['rows'] > 0) {
        // ALERT
        $_SESSION['alert'] = "alert-danger";
        $_SESSION['msg'] = "The e-mail that you entered has been registered.";
    } else {
        if ($check['rows'] > 0) {
            $user_alias = cleanurl($fullname . $check['rows']);
        } else {
            $user_alias = cleanurl($fullname);
        }
        register_user($fname, $lname, $fullname, $email, $password, $user_alias, $date);
        //CALL FUNCTION
        $user = get_user($email, $password);
        // CONSTRUCT SESSION