Esempio n. 1
0
 function update_product_table()
 {
     $action = $this->action;
     if ($action == 'visibility') {
         $this->update_product_table_visibility();
         $type = 'success';
         $msg = 'Changes successfully saved.';
     } else {
         if ($action == 'delete') {
             $this->update_product_table_delete();
             $type = 'success';
             $msg = 'Item(s) successfully deleted.';
         } else {
             if ($action == 'new') {
                 $this->update_product_table_new();
             } else {
                 if ($action == 'status') {
                     $this->update_product_active();
                     $type = 'success';
                     $msg = 'Changes successfully saved.';
                 }
             }
         }
     }
     $page = 'self';
     set_alert($type, $msg);
     safe_redirect($page);
 }
Esempio n. 2
0
 function edit()
 {
     //CI::library ( 'session' )->set_userdata ( 'editmode', false );
     $is_admin = is_admin();
     if ($is_admin == false) {
         $go = site_url('login');
         safe_redirect($go);
     }
     $layout = CI::view('admin/iframe', true, true);
     $layout = CI::model('template')->parseMicrwoberTags($layout);
     //$layout = CI::model('template')->parseMicrwoberTags ( $layout );
     CI::library('output')->set_output($layout);
 }
Esempio n. 3
0
 function update_category($name, $description, $visibility, $parent, $category_id)
 {
     if ($parent == 'top') {
         $category_level = '0';
     } else {
         $sql = "SELECT * from tbl_category WHERE category_id = '{$parent}'";
         $query = $this->conn->query($sql);
         if ($query->num_rows != null) {
             $get_level_array = $query->fetch_object();
             $category_level = $get_level_array->category_level * 1 + 1;
         }
     }
     $sql = "SELECT * FROM tbl_category ORDER BY category_order DESC";
     $query = $this->conn->query($sql);
     if ($query->num_rows != null) {
         $get_order_array = $query->fetch_object();
         $category_order = $get_order_array->category_order * 1 + 1;
     }
     $get_alias = $this->get_alias($parent);
     if ($parent == 'top') {
         $alias = cleanurl($name);
     } else {
         $alias = $get_alias->category_alias . '-' . cleanurl($name);
     }
     $count_alias = $this->count_alias($alias, $category_id);
     if ($count_alias->rows > 0) {
         $type = 'danger';
         $msg = $name . ' has already existed';
         safe_redirect('detail-category/' . $category_id . '/' . $name);
     } else {
         $alias = $alias;
     }
     $sql = "UPDATE tbl_category  SET category_name = ?,\n\t  \t\t\t\t\t\t\t\t\t  category_alias = ?,\n                                          category_level = ?,\n\t\t\t\t\t\t\t\t\t\t  category_visibility_status = ?,\n\t\t\t\t\t\t\t\t\t\t  category_description = ? \n                 WHERE category_id = ?\n\t\t\t   ";
     $stmt = $this->conn->prepare($sql);
     if ($stmt === false) {
         trigger_error('Database error: ' . $sql . ' Error: ' . $this->conn->errno . ' ' . $this->conn->error, E_USER_ERROR);
     } else {
         $stmt->bind_param("ssssss", $name, $alias, $category_level, $visibility, $description, $category_id);
         $stmt->execute();
     }
     $stmt->close();
     $this->update_category_relation($category_id, $parent);
 }
Esempio n. 4
0
     $payment = 'Confirmed';
     $fulfillment = 'Unfulfilled';
     $cancelled_date = '0000-00-00 00:00:00';
     $order_closed_date = '0000-00-00 00:00:00';
     $confirm_bank = 'Paypal';
     $confirm_name = $success->order_billing_fullname;
     //$confirm_amount    = price(2, ($success->order_total_amount / $_global_general->currency_rate));
     $confirm_amount = $success->order_total_amount;
     $order_number = $success->order_number;
     //$shipping_amount   = price(2, ($success->order_shipping_amount / $_global_general->currency_rate));
     $shipping_amount = $success->order_shipping_amount;
     if ($_SESSION['paypal']['email'] != 'done') {
         $_update->update_order_status($status, $payment, $fulfillment, $cancelled_date, $order_closed_date, $confirm_bank, $confirm_name, $confirm_amount, $order_number);
         //$_update->update_order('USD', $shipping_amount, $order_number);
         /* --- EMAIL: CHALLANGE --- */
         safe_redirect('email-paypal-customer-pending/' . $order_number);
     }
 } else {
     if ($code == 202) {
         /* --- FAILED / ERROR / DENIED --- */
         $ord_day = date("d");
         $ord_month = date("m");
         $ord_year = date("y");
         $ord_hour = date('H');
         $ord_min = date('i');
         $ord_sec = date('s');
         $ord_date = $ord_year . "-" . $ord_month . "-" . $ord_day . ' ' . $ord_hour . ':' . $ord_min . ':' . $ord_sec;
         $status = 'Cancelled';
         $payment = 'Unpaid';
         $fulfillment = 'Unfulfilled';
         $cancelled_date = $ord_date;
Esempio n. 5
0
    $data['post_title'] = $_POST['contact_title'];
    $data['post_content'] = $_POST['address_content'];
    $data['post_type'] = 'tab';
    $data['post_position'] = $_POST['tab_position'];
    if (isset($_GET['id'])) {
        if ($post->update_post($data, array('id' => $_GET['id']))) {
            $session->message("Your tab update successful! ");
            safe_redirect(admin_url('new-post') . '?post=tab&id=' . $_GET['id']);
        } else {
            var_dump($main_db->last_query);
            exit;
        }
    } else {
        if ($post->insert_posts($data)) {
            $session->message("Your tab has been created!");
            safe_redirect(admin_url('new-post') . '?post=tab&id=' . $main_db->insert_id);
        } else {
            var_dump($main_db->last_query);
            exit;
        }
    }
}
$current_post = NULL;
if (isset($_GET['id'])) {
    $current_post = $post->get_post_by_id($_GET['id']);
}
$allPosts = $post->get_post_by('address');
?>

<div class="row main-content special">
Esempio n. 6
0
	     $temp_stock = $_get->get_product_stock($get_item->type_id, $get_item->stock_name);
	     $stock      = $temp_stock->stock_quantity + $get_item->item_quantity;
			 
	     $_update->order_update_stock($stock, $temp_stock->stock_id);
	  }
	  
   }
   
   
   if(isset($_POST['cancel-option-notify']) && $_POST['cancel-option-notify'] == 'notify-cancel'){
      //safe_redirect('email-order-details-cancelled/'.$order_number);
	  require dirname(__FILE__).'/../../emails/order_/_cancel/_cancel.php';
   }else{
      $type = 'success';
	  $msg  = 'Changes successfully saved';
      safe_redirect('self');
   }
   
}



/*
# ----------------------------------------------------------------------
# ORDER - EDIT: CONTROL
# ----------------------------------------------------------------------
*/
if(isset($_POST['btn-edit-order'])){
	
   /*
   # ----------------------------------------------------------------------
Esempio n. 7
0
            $_checkout_update->success_update_productsoldout($get_product_id->id);
        }
    }
    /* --- UPDATE USER --- */
    if ($_global_user->user_address == '') {
        $_checkout_update->updateUser($order_ship_phone, $order_ship_address, $order_ship_country, $order_ship_province, $order_ship_city, $order_ship_postal, $_global_user->user_id);
    }
    /* --- MODULE --- */
    if ($order_payment_method == '2') {
        /* --- VERITRANS --- */
        safe_redirect('control-veritrans/' . $order_number);
    } else {
        if ($order_payment_method == '4') {
            /* --- PAYPAL --- */
            safe_redirect('control-paypal/' . $order_number);
        } else {
            if ($order_payment_method != '2' && $order_payment_method != '4') {
                /* --- EMAIL: CUSTOMER --- */
                //safe_redirect('email-order-customer/'.$order_number);
                /* --- ORDER LOG --- */
                $description = 1;
                $created_date = date('Y-m-d H:i:s');
                $note = '';
                $_global->update_log($get_order_id->latest_order_id, $description, $note, $created_date);
                require dirname(__FILE__) . '/../../admin/emails/order_/customer_/order_placed.php';
                require dirname(__FILE__) . '/../../admin/emails/order_/admin_/order_placed.php';
                safe_redirect('finish');
            }
        }
    }
}
Esempio n. 8
0
 function insert_product()
 {
     //include("static/thumbnail.php");
     /* --- DEFINED VARIABLE --- */
     $date = date('Y-m-d H:i:s');
     $date_only = date('d-m-y-H-i-s');
     $product_category = filter_var($this->product_category, FILTER_SANITIZE_NUMBER_INT);
     $product_name = filter_var($this->product_name, FILTER_SANITIZE_STRING);
     $product_size_type_id = filter_var($this->size_type, FILTER_SANITIZE_NUMBER_INT);
     $product_id = filter_var($this->product_id, FILTER_SANITIZE_NUMBER_INT);
     $type_id = $this->type_id;
     //array
     $color_id = $this->color_id;
     //array
     $type_name = $this->type_name;
     //array
     $type_code = $this->type_code;
     //array
     $type_price = $this->type_price;
     //array
     $type_description = $this->type_description;
     //array
     $type_sizefit = $this->type_sizefit;
     //array
     $type_image = $this->color_image;
     //double_array
     $type_delete = $this->type_delete;
     //array
     $order = $this->order;
     //double_array
     $image_id = $this->image_id;
     $image_delete = $this->image_delete;
     $stock_quantity = $this->stock_quantity;
     //double_array
     $stock_name = $this->stock_name;
     //double_array
     $type_weight = $this->type_weight;
     $page_title = filter_var($this->page_title, FILTER_SANITIZE_STRING);
     $page_description = filter_var($this->page_description, FILTER_SANITIZE_STRING);
     $page_keywords = filter_var($this->page_keywords, FILTER_SANITIZE_STRING);
     $product_alias = cleanurl($this->product_name, FILTER_SANITIZE_STRING);
     /* --- EDIT PRODUCT --- */
     $this->update_product($product_category, $product_name, $product_size_type_id, $product_alias, $page_title, $page_description, $page_keywords, $product_id);
     /* --- TYPE PRODUCT --- */
     $i = 0;
     $max_order = $this->get_max_type_order();
     foreach ($type_name as $key => $type_name) {
         $i = $key;
         $i = $i + $max_order->maximum_order;
         $temp_type_order = $this->get_type_data($this->type_id[$key]);
         /* --- DELETE PRODUCTS --- */
         if ($this->type_delete[$key] == '1') {
             if ($this->type_id[$key] != '') {
                 $type_id_ = $this->type_id[$key];
                 $this->update_delete_product('1', $type_id_);
                 $this->delete_stocks($type_id);
             }
         } else {
             $type_code = filter_var($this->type_code[$key], FILTER_SANITIZE_STRING);
             $type_name = filter_var($type_name, FILTER_SANITIZE_STRING);
             $type_alias = cleanurl($type_name);
             $type_price = filter_var($this->type_price[$key], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
             $type_description = $this->type_description[$key];
             $type_sizefit = $this->type_sizefit[$key];
             $type_information = $this->type_information[$key];
             $color_id = filter_var($this->color_id[$key], FILTER_SANITIZE_NUMBER_INT);
             $type_weight = filter_var($this->type_weight[$key], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
             $product_id = filter_var($this->product_id, FILTER_SANITIZE_NUMBER_INT);
             $type_id = filter_var($this->type_id[$key], FILTER_SANITIZE_NUMBER_INT);
             /* --- ADD --- */
             if ($type_id == '') {
                 $this->insert_type_id($type_code, $type_name, $type_price, $type_description, $type_sizefit, $type_information, $color_id, $type_weight, $product_id, $i, $page_title, $page_description, $type_alias);
             } else {
                 $this->update_type_id($type_code, $type_name, $type_price, $type_description, $type_sizefit, $type_information, $color_id, $type_weight, $temp_type_order->type_order, $type_alias, $page_title, $page_description, $type_id);
             }
             if ($type_id == '') {
                 $temp = $this->get_max_type_id();
                 $type_id = $temp->max_type_id;
             } else {
                 $type_id = $type_id;
             }
             /* --- END: ADD --- */
             /* --- TYPE COLOR IMAGE--- */
             $i = $key;
             if ($this->color_image["tmp_name"][$i] != null) {
                 $file_type = substr($this->color_image["name"][$i], -4);
                 $file_name = substr($this->color_image["name"][$i], 0, -4);
                 $tmp_name = $this->color_image["tmp_name"][$i];
                 $name = cleanurl($type_name) . "_" . $date_only . "_" . substr(cleanurl($file_name), 0, 20) . '-' . $k . $file_type;
                 $error = $this->color_image["error"][$i];
                 if ($error == 0) {
                     move_uploaded_file($tmp_name, "../files/uploads/type_color_image/{$name}");
                     $img_src = "files/uploads/type_color_image/{$name}";
                 } else {
                     $type = 'error';
                     $msg = 'Error: ' . $error;
                     set_alert($type, $msg);
                     safe_redirect('self');
                 }
                 $this->insert_type_color($img_src, $type_id);
             } else {
                 $color_id = $this->color_id[$i];
                 $img_src = $_POST["color_image_" . $i];
             }
             //$this->insert_type_color($img_src, $type_id);
             /* --- TYPE IMAGE --- */
             for ($j = 0; $j < 5; $j++) {
                 $k = $order[$i][$j];
                 //initial order
                 $image_id = $this->image_id[$i][$k];
                 if ($image_id == "") {
                     if ($this->type_image["tmp_name"][$i][$k] != null) {
                         $file_type = substr($this->type_image["name"][$i][$k], -4);
                         $file_name = substr($this->type_image["name"][$i][$k], 0, -4);
                         $tmp_name = $this->type_image["tmp_name"][$i][$k];
                         $name = cleanurl($product_name) . "_" . cleanurl($type_name) . "_" . $date_only . "_" . substr(cleanurl($file_name), 0, 20) . '-' . $k . $file_type;
                         $error = $this->type_image["error"][$i][$k];
                         if ($error == 0) {
                             move_uploaded_file($tmp_name, "../files/uploads/product_image/{$name}");
                             $img_src = "files/uploads/product_image/{$name}";
                         } else {
                             $type = 'error';
                             $msg = 'Error: ' . $error;
                             set_alert($type, $msg);
                             safe_redirect('self');
                         }
                         /* --- GENERATE TYPE IMAGE --- */
                         //$tg = new thumbnailGenerator;
                         //$tg->generate('../files/uploads/product_image/'.$name, 260, 195, '../files/uploads/product_image/thumb_260x195/'.$name);
                         $this->insert_type_image($type_id, $img_src, $j);
                     }
                 } else {
                     if ($this->type_image["tmp_name"][$i][$k] != null) {
                         $file_type = substr($this->type_image["name"][$i][$k], -4);
                         $file_name = substr($this->type_image["name"][$i][$k], 0, -4);
                         $tmp_name = $this->type_image["tmp_name"][$i][$k];
                         $name = cleanurl($product_name) . "_" . cleanurl($type_name[$i]) . "_" . $date_only . "_" . cleanurl($file_name) . $file_type;
                         $error = $this->type_image["error"][$i][$k];
                         if ($error == 0) {
                             move_uploaded_file($tmp_name, "../files/uploads/product_image/{$name}");
                             $img_src = "files/uploads/product_image/{$name}";
                         } else {
                             $type = 'error';
                             $msg = 'Error: ' . $error;
                             set_alert($type, $msg);
                             safe_redirect('self');
                         }
                         /* --- CREATE THUMBNAIL --- */
                         //$tg = new thumbnailGenerator;
                         //$tg->generate('../files/uploads/product_image/'.$name, 240, 360, '../files/uploads/product_image/thumb_240x360/'.$name);
                         $this->update_type_image($img_src, $image_id);
                     }
                     $image_delete = filter_var($this->image_delete[$i][$k], FILTER_SANITIZE_NUMBER_INT);
                     if ($image_delete == '1') {
                         $this->delete_type_image($image_id);
                     }
                     $this->update_type_image_order($j, $image_id);
                 }
             }
             /* --- TYPE STOCK --- */
             $this->delete_stock($type_id);
             $stock_name_ = current($stock_name[$i]);
             $product_size_type_id = filter_var($this->size_type, FILTER_SANITIZE_NUMBER_INT);
             foreach ($stock_quantity[$i] as $stock_quantity_) {
                 if ($stock_quantity_ != 0) {
                     $stock_sold_out = 0;
                 } else {
                     $stock_sold_out = 1;
                 }
                 //$this->insert_stock($type_id, $stock_name_, $stock_quantity_, $stock_sold_out);
                 $this->insert_stock($type_id, $product_size_type_id, $stock_name_, $stock_quantity_, $stock_sold_out);
                 $stock_name_ = next($stock_name[$i]);
             }
         }
     }
     $this->check_sold_out($product_id);
     $page = 'product-details-' . $product_alias;
     $type = 'success';
     $msg = 'Changes successfully saved.';
     set_alert($type, $msg);
     //safe_redirect($page);
 }
Esempio n. 9
0
        $result = $query->fetch_object();
        return $result;
    }
    function update_temp_stock($qty, $stock_id)
    {
        $sql = "UPDATE tbl_product_stock SET `stock_quantity` = ? WHERE `stock_id` = ?";
        $stmt = $this->conn->prepare($sql);
        if ($stmt === false) {
            trigger_error('Database error: ' . $sql . ' Error: ' . $conn->errno . ' ' . $conn->error, E_USER_ERROR);
        } else {
            $stmt->bind_param("ss", $qty, $stock_id);
            $stmt->execute();
        }
        $stmt->close();
    }
}
$_logout = new LOGOUT_CLEANER();
if (isset($_SESSION['cart_type_id']) && isset($_SESSION['cart_stock_id']) && isset($_SESSION['cart_qty'])) {
    $_session_type = $_SESSION['cart_type_id'];
    $_session_stock = $_SESSION['cart_stock_id'];
    $_session_qty = $_SESSION['cart_qty'];
    /* --- BAG HANDLER --- */
    foreach ($_session_type as $key => $_session_type) {
        $_stock_name = $_logout->get_stock_name($_session_stock[$key]);
        $_stock = $_logout->get_product($_session_type, $_stock_name->stock_name);
        $temp_stock = $_session_qty[$key] + $_stock_name->stock_quantity;
        $_logout->update_temp_stock($temp_stock, $_session_stock[$key]);
    }
}
safe_redirect('logout.php');
Esempio n. 10
0
<?php

/*
# ----------------------------------------------------------------------
# VOUCHER - ADD: CONTROL
# ----------------------------------------------------------------------
*/
$_get = new CATEGORY_GET();
$_update = new CATEGORY_UPDATE();
if (isset($_POST['btn-add-voucher']) && $_POST['btn-add-voucher'] == 'Save Changes') {
    $usability = filter_var($_POST['usability'], FILTER_SANITIZE_STRING);
    $validity = filter_var($_POST['validity'], FILTER_SANITIZE_STRING);
    $type = filter_var($_POST['type'], FILTER_SANITIZE_STRING);
    $amount = filter_var($_POST['amount'], FILTER_SANITIZE_NUMBER_FLOAT);
    $code = filter_var($_POST['code'], FILTER_SANITIZE_STRING);
    $start = filter_var($_POST['date_from'], FILTER_SANITIZE_STRING);
    $end = filter_var($_POST['date_to'], FILTER_SANITIZE_NUMBER_INT);
    $status = filter_var($_POST['status'], FILTER_SANITIZE_NUMBER_INT);
    $visibility = filter_var($_POST['visibility'], FILTER_SANITIZE_NUMBER_INT);
    //minimum purchase
    $min_purchase = filter_var($_POST['min_purchase'], FILTER_SANITIZE_NUMBER_FLOAT);
    //$_update->insert($usability, $validity, $type, $amount, $code, $start, $end, $status, $visibility);
    //minimum purchase
    $_update->insert($usability, $validity, $type, $amount, $code, $start, $end, $status, $visibility, $min_purchase);
    $type = 'success';
    $msg = 'Voucher successfully saved';
    set_alert($type, $msg);
    safe_redirect('add-voucher');
}
Esempio n. 11
0
    $url = str_ireplace($site, '', $url);
    $segs = explode('/', $url);
    $segs_clean = array();
    foreach ($segs as $segment) {
        $origsegment = $segment;
        $segment = explode(':', $segment);
        if ($segment[0] == 'ref') {
            //return $segment [1];
        } else {
            $segs_clean[] = $origsegment;
        }
    }
    $segs_clean = implode('/', $segs_clean);
    $site = site_url($segs_clean);
    //	print $site;
    safe_redirect('Location: ' . $site);
    exit;
} else {
    // Set back_to url into session. Reset this session component when redirect.
    $back_to = CI::model('core')->getParamFromURL('back_to');
    if ($back_to) {
        //		var_dump($back_to);
        CI::library('session')->set_userdata('back_to', $back_to);
    }
    $url = getCurentURL();
    $segs = explode('.', $url);
    $segs = str_ireplace('http://', '', $segs);
    $segs = str_ireplace('https://', '', $segs);
    $segs = $segs[0];
    $test_if_user_subdomain = addslashes($segs);
    $subdomain_user = array();
Esempio n. 12
0
<?php

/*
# ----------------------------------------------------------------------
# CATEGORY - ADD: CONTROL
# ----------------------------------------------------------------------
*/
$_get = new CATEGORY_GET();
$_update = new CATEGORY_UPDATE();
if (isset($_POST['btn-add-category']) && $_POST['btn-add-category'] == 'Save Changes') {
    $name = filter_var($_POST['name'], FILTER_SANITIZE_STRING);
    $description = filter_var($_POST['description'], FILTER_SANITIZE_STRING);
    $active = filter_var($_POST['active_status'], FILTER_SANITIZE_STRING);
    $visibility = filter_var($_POST['visibility'], FILTER_SANITIZE_STRING);
    $parent = filter_var($_POST['parent'], FILTER_SANITIZE_STRING);
    $_update->add_category($name, $description, $parent, $active, $visibility);
    safe_redirect('add-category');
}
Esempio n. 13
0
	if(ACT != 'account_/login/login' && ACT != 'account_/register_/register' && ACT != 'account_/resetpassword_/reset' && ACT != 'pages_/_landing/landing'){
	   include("static/navbar-style-2.php");
	}
}/* --- DOKU NOTIFY --- */
	
	
	/*
	* ----------------------------------------------------------------------
	* DYNAMIC CONTENT
	* ----------------------------------------------------------------------
	*/
	
    if(empty($_REQUEST['act'])){
	   /* --- HOMEPAGE --- */
	   //include('pages_/home/index.php');
	   safe_redirect('new-arrival/all/all');
	}else{
	   include(str_replace ('http','',$_REQUEST['act']).".php");
	}
	
	
	/*
	* ----------------------------------------------------------------------
	* FOOTER
	* ----------------------------------------------------------------------
	*/
	
if(ACT != 'static/_doku/doku_notify'){
	
	/* --- HIDDEN @ LOGIN & REGISTER PAGE--- */
	if(ACT != 'account_/login/login' && ACT != 'account_/register_/register' && ACT != 'account_/resetpassword_/reset' && ACT != 'pages_/_landing/landing'){
Esempio n. 14
0
<?php

/*
* ----------------------------------------------------------------------
* EMAIL - WAITING FOR PAYMENT CUSTOMER: VIEW
* ----------------------------------------------------------------------
*/
include 'get.php';
include 'update.php';
include 'control.php';
$headers = '';
$name = $_global_general->website_title;
$email = $_global_notification->email_order;
$recipient = $_global_user->user_email;
$subject = '[' . $_global_general->website_title . '] ' . $order_number . ' Waiting for Payment';
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers .= "From: " . $_global_general->website_title . " <" . $_global_info->email . ">\r\n";
mail($recipient, $subject, $mail_body, $headers);
/* --- EMAIL: ADMIN --- */
safe_redirect('email-veritrans-admin-challange/' . $order_number);
Esempio n. 15
0
<?php

/*
* ----------------------------------------------------------------------
* EMAIL - WAITING FOR PAYMENT CUSTOMER: VIEW
* ----------------------------------------------------------------------
*/
include 'get.php';
include 'update.php';
include 'control.php';
$headers = '';
$name = $_global_general->website_title;
$email = $_global_notification->email_order;
$recipient = $_global_user->user_email;
$subject = '[' . $_global_general->website_title . '] ' . $order_number . ' Waiting for Payment';
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers .= "From: " . $_global_general->website_title . " <" . $_global_info->email . ">\r\n";
mail($recipient, $subject, $mail_body, $headers);
/* --- EMAIL: ADMIN --- */
safe_redirect('email-paypal-admin-pending/' . $order_number);
Esempio n. 16
0
function exit_redirect()
{
    global $auto_restrict;
    @session_unset();
    @session_destroy();
    delete_cookie();
    if ($auto_restrict['redirect_error'] && $auto_restrict['redirect_error'] != '') {
        safe_redirect($auto_restrict['redirect_error']);
    } else {
        exit($auto_restrict['error_msg']);
    }
}
Esempio n. 17
0
<?php

require_once __DIR__ . '/get.php';
require_once __DIR__ . '/update.php';
$_get = new Admin_Custom_Inspiration_Get();
$_update = new Admin_Custom_Inspiration_Update();
$category_id = $_REQUEST['ins_id'];
$category = $_get->get_category($category_id);
$detail_category = $_get->get_category($category_id);
if (isset($_POST['btn_detail_project_category'])) {
    // DEFINED VARIABLE
    $category_id = $_POST['hidden_category_id'];
    $category_name = filter_var($_POST['category_name'], FILTER_SANITIZE_STRING);
    $visibility = $_POST['visibility_status'];
    $projectText = $_POST['projectText'];
    if ($_FILES['upload_news_1']['name'] != '') {
        $image = upload_file($_global_general->url, 'images', $_FILES['upload_news_1'], 'projects', 'files/uploads/projects/', $ini_max_upload);
    } else {
        $image = $detail_category['description'];
    }
    if ($_FILES['upload_news_2']['name'] != '') {
        $cover = upload_file($_global_general->url, 'images', $_FILES['upload_news_2'], 'projects', 'files/uploads/projects/', $ini_max_upload);
    } else {
        $cover = $detail_category['cover'];
    }
    $_update->update($category_name, $image, $cover, $visibility, $projectText, $category_id);
    $type = 'success';
    $msg = 'Changes has been successfully saved';
    set_alert($type, $msg);
    safe_redirect('project-category-detail/' . $category_id);
}
Esempio n. 18
0
if(empty($_REQUEST['shop_view'])){
   $query_per_page = $query_per_page;
}else{
   $query_per_page = clean_number($_REQUEST['shop_view']);
}


/* --- NORMALIZE URL PAGINATION -- */
if($page != 1 && $page > $total_page){
   $tester        = str_replace('page='.$page, 'page=1', CURR_URL);
   $len_base_url  = strlen(BASE_URL);
   $len_curr_url  = strlen($tester);
   $normalize_url = substr($tester, $len_base_url, $len_curr_url);
   
   safe_redirect($normalize_url);
}



$active_price = '';
$active_atoz  = '';
$active_new   = '';
   
if(isset($_REQUEST['shop_sort'])){
   if($_REQUEST['shop_sort'] == 'price' || $_REQUEST['shop_sort'] == 'pricedown'){
      $active_price = 'active';
      $active_atoz  = '';
      $active_new   = '';
   }else if($_REQUEST['shop_sort'] == 'atoz' || $_REQUEST['shop_sort'] == 'ztoa'){
      $active_price = '';
Esempio n. 19
0
      if($data_item->promo_start_datetime <= date('Y-m-d') and $data_item->promo_end_datetime >= date('Y-m-d')){
	     if($data_item->promo_id == '1'){
	     
		    $data_item->type_price = $data_item->type_price - (($data_item->promo_value / 100) * $data_item->type_price);
		 
		 }else if($data_item->promo_id == '2'){
	        $data_item->type_price = $data_item->type_price - $data_item->promo_value;
		 }
		 
	  }else{
	     $data_item->type_price;
	  }
	  
   }else{
      $data_item->type_price = $data_item->type_price;
   }
   
   
   $params['items']['id'][$key] = 'order-'.($key+1);
   $params['items']['price'][$key] = $data_item->type_price;
   $params['items']['quantity'][$key] = $data_item->item_quantity;
   $params['items']['name'][$key] = $data_item->product_name.' - '.$data_item->type_name;
}
*/
$params = array("vtweb" => array("credit_card_3d_secure" => false, 'finish_redirect_url' => BASE_URL . 'finish-veritrans', 'unfinish_redirect_url' => BASE_URL . 'bag-veritrans', 'error_redirect_url' => BASE_URL . 'finish-veritrans'), 'transaction_details' => array('order_id' => $data_order->order_number, 'gross_amount' => $data_order->order_total_amount));
try {
    $veritrans_url = strrchr(Veritrans_Vtweb::getRedirectionUrl($params), 'https://');
    safe_redirect($veritrans_url);
} catch (Exception $e) {
    echo $e->getMessage();
}
Esempio n. 20
0
function upload_file($global_url, $type, $file, $prefix, $upload_dir, $ini_max_upload)
{
    /* ----------------------------------------------------------------------
     * TYPE:
     * string: images / files
     * ----------------------------------------------------------------------
     */
    $files_name = substr($file['name'], 0, -4);
    $file_type = $file['type'];
    if ($type === 'images') {
        if ($file_type === 'image/jpeg') {
            $file_type = '.jpg';
        } else {
            if ($file_type === 'image/png') {
                $file_type = '.png';
            } else {
                if ($file_type === 'image/gif') {
                    $file_type = '.gif';
                }
            }
        }
    } else {
        if ($type === 'files') {
            if ($file_type === 'application/zip') {
                $file_type = '.zip';
            } else {
                if ($file_type === 'application/x-rar-compressed') {
                    $file_type = '.rar';
                } else {
                    if ($file_type === 'application/pdf') {
                        $file_type = '.pdf';
                    }
                }
            }
        }
    }
    $uploads_dir = __DIR__ . '/../../../' . $upload_dir;
    $userfile_name = cleanurl(str_replace(array('(', ')', ' '), '_', substr($files_name, 0, 20))) . $file_type;
    $userfile_tmp = $file['tmp_name'];
    $file_error = $file['error'];
    $file_type = $file['type'];
    $slideshow_size = $file['size'];
    $prefix = $prefix . '-' . date('d-m-y-H-i-s') . '-';
    $prod_img = $uploads_dir . $prefix . $userfile_name;
    $filename = $upload_dir . $prefix . $userfile_name;
    if ($type === 'images') {
        $allowed_type = array('image/jpeg', 'image/png', 'image/gif');
    } else {
        if ($type === 'files') {
            $allowed_type = array('application/zip', 'application/x-rar-compressed', 'application/pdf');
        }
    }
    /* --- TOTAL SIZE SLIDESHOW --- */
    if ($slideshow_size > $ini_max_upload) {
        $type = 'danger';
        $msg = 'Maximum file size: ' . price(1, $ini_max_upload) . 'Byte(s)';
        set_alert($type, $msg);
        safe_redirect('self');
        /* --- FILE TYPE (IMAGE: JPG, PNG, GIF & FILES: PDF, ZIP) --- */
    } else {
        if (!in_array($file_type, $allowed_type)) {
            $type = 'danger';
            $msg = 'Only allowed images format: .jpg, .png, .gif & files format: .pdf, .zip, .rar';
            set_alert($type, $msg);
            safe_redirect('self');
        } else {
            if (!move_uploaded_file($userfile_tmp, $prod_img)) {
                $type = 'danger';
                $msg = 'Error: Permission denied, check folder: ' . $uploads_dir . ' permission';
                set_alert($type, $msg);
                safe_redirect('self');
            } else {
                if (move_uploaded_file($userfile_tmp, $prod_img) && $file_error == 0) {
                }
            }
        }
    }
    return $filename;
}
Esempio n. 21
0
            /* --- FAILED / ERROR / DENIED --- */
            $ord_day = date("d");
            $ord_month = date("m");
            $ord_year = date("y");
            $ord_hour = date('H');
            $ord_min = date('i');
            $ord_sec = date('s');
            $ord_date = $ord_year . "-" . $ord_month . "-" . $ord_day . ' ' . $ord_hour . ':' . $ord_min . ':' . $ord_sec;
            $status = 'Cancelled';
            $payment = 'Unpaid';
            $fulfillment = 'Unfulfilled';
            $cancelled_date = $ord_date;
            $order_closed_date = $ord_date;
            $confirm_bank = '';
            $confirm_name = '';
            $confirm_amount = '';
            $order_number = $success->order_number;
            if ($_SESSION['veritrans']['email'] != 'done') {
                $_update->update_order_status($status, $payment, $fulfillment, $cancelled_date, $order_closed_date, $confirm_bank, $confirm_name, $confirm_amount, $order_number);
                $order_item = $_get->get_cart_item($order_number);
                foreach ($order_item as $order_item) {
                    $current_stock = $_get->get_item_stock($order_item->type_id, $order_item->stock_name);
                    $temp_stock = $current_stock->stock_quantity + $order_item->item_quantity;
                    $_update->update_order_item($temp_stock, $order_item->type_id, $order_item->stock_name);
                }
                /* --- EMAIL: CHALLANGE --- */
                safe_redirect('email-veritrans-customer-failed/' . $order_number);
            }
        }
    }
}
Esempio n. 22
0
            //safe_redirect('login');
            safe_redirect(DEFAULT_PAGE);
        }
    } else {
        if (isset($_SESSION['admin']['control_login']) && $_SESSION['admin']['control_login'] === 1) {
            unset($_SESSION['admin']['control_login']);
            safe_redirect('logout');
        } else {
            if (isset($_SESSION['admin']['control_login']) && $_SESSION['admin']['control_login'] === 1) {
                unset($_SESSION['admin']['control_login']);
                safe_redirect('login');
            } else {
                if (ACT == 'account/_login/signin' || ACT == 'account/_forgot/forgot' || ACT == 'account/_recover/recover') {
                    include str_replace('http', '', $_REQUEST['act']) . ".php";
                } else {
                    safe_redirect('login');
                }
            }
        }
    }
}
/*
# ----------------------------------------------------------------------
# FOOTER
# ----------------------------------------------------------------------
*/
//if(isset($_SESSION['admin']['login_id'])){
if (isset($_SESSION['admin'][DOMAIN_ADDRESS]['login']) && $_SESSION['admin'][DOMAIN_ADDRESS]['login'] === 1) {
    include "static/footer.php";
}
?>
Esempio n. 23
0
 */
/* --- HIDDEN @ LOGIN & REGISTER PAGE--- */
if (ACT != '' && ACT != 'account_/login/login' && ACT != 'account_/register_/register' && ACT != 'account_/resetpassword_/reset' && ACT != 'pages_/_landing/landing') {
    include "static/navbar-hillpak.php";
    // include("static/navbar-nagarey.php");
    // include("static/navbar-bionic.php");
}
/*
 * ----------------------------------------------------------------------
 * DYNAMIC CONTENT
 * ----------------------------------------------------------------------
 */
if (empty($_REQUEST['act'])) {
    //safe_redirect('welcome');
    /* --- HOMEPAGE --- */
    safe_redirect('home');
    //include('pages_/home/index.php');
} else {
    include str_replace('http', '', $_REQUEST['act']) . ".php";
}
/*
 * ----------------------------------------------------------------------
 * FOOTER
 * ----------------------------------------------------------------------
 */
/* --- HIDDEN @ LOGIN & REGISTER PAGE--- */
if (ACT != '' && ACT != 'account_/login/login' && ACT != 'account_/register_/register' && ACT != 'account_/resetpassword_/reset' && ACT != 'pages_/_landing/landing') {
    include "static/footer-hillpak.php";
    // include("static/footer-nagarey.php");
    // include("static/footer-bionic.php");
    echo '<script src="' . BASE_URL . 'script/mailchimp.js"></script>';
Esempio n. 24
0
if (count($_SESSION['cart_type_id']) > 0) {
} else {
    unset($_SESSION['cart']);
}
$getCartItem = $_cron->getCartItem();
foreach ($getCartItem as $CartItem) {
    $time = date('Y-m-d H:i:s');
    $getCurrentStock = $_cron->get_product_stock($CartItem->TYPE_ID, $CartItem->STOCK);
    $cartTime = $_cron->check_on_hold($CartItem->LAST_UPDATE);
    if ($cartTime->second > 14400) {
        $currentStock = $getCurrentStock->stock_quantity;
        $tempStock = $currentStock + $CartItem->QTY;
        $_cron->order_update_stock($tempStock, $getCurrentStock->stock_id);
        $_cron->updateCart($time, -1, $CartItem->CART_HASH);
        $_cron->updateCartItem($time, -1, $CartItem->CART_HASH);
    }
}
if (isset($_SESSION['cart']['hash'])) {
    $cartHash = $_SESSION['cart']['hash'];
    $getCart = $_cron->getCart($cartHash);
    $cartTime = $_cron->check_on_hold($getCart->LAST_UPDATE);
    $time = date('Y-m-d H:i:s');
    if ($cartTime->second > 14400) {
        if (ACT != 'static/_cleaner') {
            safe_redirect('logout');
        }
    } else {
        $_cron->updateCart($time, 1, $cartHash);
        $_cron->updateCartItem($time, 1, $cartHash);
    }
}
Esempio n. 25
0
    $page_name = $_POST['page_name'];
    $position = $_POST['position'];
    $desc = $_POST['desc'];
    if ($page_name == '' || strlen($page_name) < 4) {
        $error[] = "Please check out page name. Page should be minimum 4 character";
    } elseif ($position == 0) {
        $error[] = "Please select a position";
    } elseif ($desc == '' && strlen($desc) < 10) {
        $error[] = 'Please type about the page description';
    }
    if (count($error) < 1) {
        $data = array('name' => $page_name, 'desc' => $desc, 'position' => $position, 'date' => date('Y-m-d'));
        $query = $main_page->insert_page_data($data);
        if ($query) {
            $sesion->message("You page has been created" . $query);
            safe_redirect(admin_url('create-page'));
        } else {
            echo "Your Page did not created";
        }
    }
}
?>
<div class="form col-md-8">

	<form method="post" action="">
		<div class="row form-group">
			<label class="col-md-4"> Page Name </label>
			<div class="col-md-8"> 
				<input name="page_name" type="text" class="form-control" value="<?php 
if (isset($page_name)) {
    echo $page_name;
Esempio n. 26
0
function upload_image($files, $upload_dir, $prefix, $page)
{
    /* --- FILE: NAME & TYPE --- */
    $files_name = substr($files['name'], 0, -4);
    $file_type = substr($files['name'], -4);
    $uploads_dir = $upload_dir;
    $name = cleanurl(str_replace(array('(', ')', ' '), '_', $files_name)) . $file_type;
    $tmp = $files['tmp_name'];
    $prefix = $prefix;
    $prod_img = $uploads_dir . $prefix . $name;
    $error = $files['error'];
    if ($error == 0) {
        if (move_uploaded_file($tmp, $prod_img)) {
            $filename = $prod_img;
        } else {
            $type = 'danger';
            $msg = "Image upload failed";
            set_alert($type, $msg);
            safe_redirect($page);
        }
    } else {
        $type = 'danger';
        $msg = 'Error: ' . upload_code_message($error);
        set_alert($type, $msg);
        safe_redirect($page);
    }
    return $filename;
}
Esempio n. 27
0
function public_login()
{
    $p_user = new PublicUser();
    global $main_db, $session;
    if (isset($_POST['login_submit'])) {
        $login = false;
        if ($_POST['email'] != '') {
            if ($user = $p_user->loged_in($_POST['email'], $_POST['password'])) {
                $_SESSION['p_user'] = $user->id;
            }
        } else {
            if ($user = $p_user->loged_in($_POST['mobile'], $_POST['password'], 'mobile')) {
                $_SESSION['p_user'] = $user->id;
            }
        }
        if (isset($_SESSION['p_user'])) {
            safe_redirect(get_home_url() . '/user-admin.php');
        } else {
            $session->message('* The username or password you entered was incorrect !' . $main_db->last_query);
            safe_redirect(get_home_url() . '/login.php');
        }
    }
}
Esempio n. 28
0
//mail($recipient, $subject, $mail_body, $headers);


/* --- MAILGUN --- */
require dirname(__FILE__).'/../../_mailgun/vendor/autoload.php';
use Mailgun\Mailgun;

$_mailgun_api_key = MAILGUN_KEY;
$_mailgun_domain  = MAILGUN_DOMAIN;

$_mailgun_from    = '['.$_global_general->website_title.'] <'.$_global_notification->email_order.'>';
$_mailgun_to      = $recipient;
$_mailgun_subject = $subject;
$_mailgun_text    = $mail_body;

$mg     = new Mailgun($_mailgun_api_key);
$domain = $_mailgun_domain;

# Now, compose and send your message.
$mg->sendMessage($domain, array('from'    => $_mailgun_from, 
                                'to'      => $_mailgun_to, 
                                'subject' => $_mailgun_subject, 
                                'html'    => $mail_body));
								
								
$_global->counter_mailgun();


/* --- EMAIL: ADMIN --- */
safe_redirect('order-detailing/'.$order_number);
?>
Esempio n. 29
0
                }
            } else {
                $image_delete = filter_var($_POST['delete_news_' . $i], FILTER_SANITIZE_NUMBER_INT);
                if ($image_delete == 1) {
                    $image = '';
                    $_update->delete_news_img($news_id, $i);
                    if (is_file('../' . $news_detail->news_image)) {
                        unlink('../' . $news_detail->news_image);
                    }
                } else {
                    $oldImg = $_get->get_news_image($news_id, $i);
                    /*$image = $oldImg->image;*/
                }
            }
        }
        $image_null = '';
        if ($_req_lang === 'ID') {
            $_update->updateNewsLangField($news_detail->news_category, $image_null, $date, $visibility, $news_id);
            $_update->updateNews($category, $title, $alias, $date, $image_null, $excerpt, $content, $description, $keywords, $visibility, $news_id);
        } else {
            if ($_req_lang === 'EN') {
                $_update->updateNewsLang($title, $alias, $excerpt, $content, $description, $keywords, $news_id);
            }
        }
        $page = 'news-detail/' . $_req_lang . '/' . $news_detail->news_id . '/' . cleanurl(preg_replace("/[^A-Za-z0-9]/", ' ', $alias));
        $type = 'success';
        $msg = 'Changes successfully saved';
        set_alert($type, $msg);
        safe_redirect($page);
    }
}
Esempio n. 30
0
<?php

/*
* ----------------------------------------------------------------------
* EMAIL - WAITING FOR PAYMENT CUSTOMER: VIEW
* ----------------------------------------------------------------------
*/
include 'get.php';
include 'update.php';
include 'control.php';
$headers = '';
$name = $_global_general->website_title;
$email = $_global_notification->email_order;
$recipient = $_global_user->user_email;
$subject = '[' . $_global_general->website_title . '] ' . $order_number . ' Waiting for Payment';
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers .= "From: " . $_global_general->website_title . " <" . $_global_info->email . ">\r\n";
mail($recipient, $subject, $mail_body, $headers);
/* --- EMAIL: ADMIN --- */
safe_redirect('email-veritrans-admin-failed/' . $order_number);