function show_thumbs(jobnr) {
dojo.xhrGet(
{
url: "order3_show_thumbs.php?jobnr=" + escape(jobnr),
handleAs: "text",
timeout: 5000,
load: function(response, ioArgs) {
dojo.byId("thumbs_" + escape(jobnr)).innerHTML = response ;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function remove_upload(jobnr,file) {
dojo.xhrGet(
{
url: "upload/remove.php?jobnr=" + escape(jobnr) + "&file=" + escape(file),
handleAs: "text",
timeout: 5000,
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
show_thumbs(jobnr);
show_thumbs(jobnr);
}
/*
function syscalendartype_calendar_save(calendartype,calendartypecalendarid) {
dojo.xhrPost (
{
url: "calendar/syscalendartypes/properties_save.php",
handleAs: "text",
// Name of the Form we want to submit
form: 'form_calendartype_save',
// Call this function if an error happened
error: function (error) {
console.error ('Error: ', error);
}
}
);
}
*/
function show_small_cart() {
// alert (userid + " " + onoff);
dojo.xhrGet(
{
url: "tools/shop/shop/small_cart.php",
handleAs: "text",
timeout: 25000,
load: function(response, ioArgs) {
dojo.byId("right").innerHTML = response ;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function cart_finish() {
editPopup('open');
// alert (userid + " " + onoff);
dojo.xhrGet(
{
url: "tools/shop/shop/actions/cart_finish.php",
handleAs: "text",
timeout: 25000,
load: function(response, ioArgs) {
dojo.byId("popup").innerHTML = response ;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function cart_wayofpay_save(wayofpay) {
// alert (userid + " " + onoff);
dojo.xhrGet(
{
url: "tools/shop/shop/actions/cart_step3_way_of_pay.php?wayofpay=" + escape(wayofpay),
handleAs: "text",
timeout: 25000,
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function cart_deliverydate_save(date,number) {
// alert (userid + " " + onoff);
dojo.xhrGet(
{
url: "tools/shop/shop/actions/cart_step3_update_deliverydate.php?date=" + escape(date) + "&number=" + escape(number),
handleAs: "text",
timeout: 25000,
load: function(response, ioArgs) {
dojo.byId("layer_date" + number).innerHTML = response ;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function cart_agree_update(agree) {
dojo.xhrGet(
{
url: "tools/shop/shop/actions/update_agree.php?agree=" + escape(agree),
handleAs: "text",
timeout: 25000,
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function order_add_contact (userid, onoff) {
// alert (userid + " " + onoff);
dojo.xhrGet(
{
url: "tools/shop/shop/actions/cart_step2_addcontact.php?userid=" + escape(userid) + "&onoff=" + escape(onoff),
handleAs: "text",
timeout: 25000,
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function select_invoice_data(invoice,delivery) {
if (invoice == undefined)
{
invoice = 0;
}
if (delivery == undefined)
{
delivery = 0;
}
dojo.xhrGet(
{
url: "tools/shop/shop/actions/cart_step2.php?invoiceid=" + escape(invoice) + "&deliveryid=" + escape(delivery),
handleAs: "text",
timeout: 25000,
load: function(response, ioArgs) {
dojo.byId("main-content-fw").innerHTML = response ;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}/*get_mp*/
function change_deliverydate(value,jobnr) {
dojo.xhrGet(
{
url: "tools/shop/shop/actions/change_deliverydate.php?jobnr=" + escape(jobnr) + "&dateid=" + escape(value),
handleAs: "text",
timeout: 25000,
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function set_width_options_inbar(value,jobnr) {
var breedte = parseInt(document.getElementById("options-inbar-" + jobnr).style.width);
var element = document.getElementById("options-inbar-" + jobnr);
breedte = breedte + value;
document.getElementById("options-inbar-" + jobnr).style.width = breedte + "px";
// alert (document.getElementById("options-inbar").style.width);
}
function change_option(jobnr,propertynr,propertyvalue) {
var elementid = "optsel_" + jobnr + "_" + propertynr;
var element = document.getElementById(elementid);
for(loop = 0;loop < element.options.length; loop++) {
if(element.options[loop].value == propertyvalue) {
element.selectedIndex = loop;
}
}
}/*change_option*/
function load_optionbar(jobnr) {
dojo.xhrGet(
{
url: "tools/shop/shop/actions/show_optionbar.php?jobnr=" + escape(jobnr),
handleAs: "text",
timeout: 25000,
load: function(response, ioArgs) {
dojo.byId("option_bar_"+jobnr).innerHTML = response ;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function savethis_form(jobnr) {
var formname = "FORM_" + jobnr;
//alert(formname);
dojo.xhrPost(
{
url: 'tools/shop/shop/actions/remark_description_save.php',
handleAs: "text",
form: formname,
error: function (error) {
console.error ('Error: ', error);
}
}
);
}
function show_job_price(jobnr) {
dojo.xhrGet(
{
url: "tools/shop/shop/actions/show_job_price.php?jobnr=" + escape(jobnr),
handleAs: "text",
timeout: 25000,
load: function(response, ioArgs) {
dojo.byId("job_price_"+jobnr).innerHTML = response ;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function show_order_price(ordernr) {
dojo.xhrGet(
{
url: "tools/shop/shop/actions/show_order_price.php?ordernr=" + escape(ordernr),
handleAs: "text",
timeout: 25000,
load: function(response, ioArgs) {
dojo.byId("total").innerHTML = response ;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function update_product_price(quantity,jobnr,productid,supplierid,options,ordernr,productpriceid) {
dojo.xhrGet(
{
url: "tools/shop/shop/actions/update_product_price.php?jobnr=" + escape(jobnr) + "&quantity=" + escape(quantity)
+ "&productid=" + escape(productid)
+ "&supplierid=" + escape(supplierid) + "&productpriceid=" + escape(productpriceid),
handleAs: "text",
timeout: 25000,
load: function(response, ioArgs) {
show_product_price(jobnr);
// for(i in options){
// show_property_price(jobnr,options[i]);
// }
show_job_price(jobnr);
show_order_price(ordernr);
show_small_cart()
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}/*update_product_price*/
function show_product_price(jobnr) {
dojo.xhrGet(
{
url: "tools/shop/shop/actions/show_product_price.php?jobnr=" + jobnr,
handleAs: "text",
timeout: 5000,
load: function(response, ioArgs) {
dojo.byId("product_price_"+jobnr).innerHTML = response ;
return response;
},
error: function(response, ioArgs) {
//show_product_price(jobnr);
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}/*show_product_price*/
function show_product_unit_price(jobnr) {
dojo.xhrGet(
{
url: "tools/shop/shop/actions/show_product_unit_price.php?jobnr=" + jobnr,
handleAs: "text",
timeout: 25000,
load: function(response, ioArgs) {
dojo.byId("product_unit_price_"+jobnr).innerHTML = response ;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}/*show_product_price*/
function show_property_price(jobnr,propertyid) {
dojo.xhrGet(
{
url: "tools/shop/shop/actions/show_property_price.php?jobnr=" + escape(jobnr) + "&propertyid=" + escape(propertyid),
handleAs: "text",
timeout: 25000,
load: function(response, ioArgs) {
dojo.byId("option_price_"+propertyid+"_"+jobnr).innerHTML = response ;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}/*show_property_price*/
function update_property_price(jobnr,propertyvalueid,supplierid,propertyid,ordernr) {
dojo.xhrGet(
{
url: "tools/shop/shop/actions/update_property_price.php?jobnr=" + escape(jobnr) + "&propertyvalueid=" + escape(propertyvalueid)
+ "&supplierid=" + escape(supplierid)
+ "&propertyid=" + escape(propertyid),
handleAs: "text",
timeout: 25000,
load: function(response, ioArgs) {
show_property_price(jobnr,propertyid);
show_job_price(jobnr);
show_order_price(ordernr);
load_optionbar(jobnr);
show_small_cart();
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function contacts_add_save()
{
dojo.xhrPost (
{
url: 'tools/shop/shop/actions/contacts_add_save.php',
handleAs: "text",
form: "contact_add",
load: function(response, ioArgs) {
editPopup('close');
select_invoice_data();
},
error: function (error) {
console.error ('Error: ', error);
}
}
);
}
function contacts_add_enable_inputs(value)
{
if (value != 0)
{
document.getElementById("firstname").disabled = false;
document.getElementById("lastname").disabled = false;
document.getElementById("email").disabled = false;
document.getElementById("gsm").disabled = false;
document.getElementById("savebutton").disabled = false;
document.getElementById("title").disabled = false;
}
else
{
document.getElementById("firstname").disabled = true;
document.getElementById("lastname").disabled = true;
document.getElementById("email").disabled = true;
document.getElementById("gsm").disabled = true;
document.getElementById("savebutton").disabled = true;
document.getElementById("title").disabled = true;
}
}
function contacts_add_form()
{
dojo.xhrGet(
{
url: "tools/shop/shop/actions/contacts_add_form.php",
handleAs: "text",
timeout: 5000,
load: function(response, ioArgs) {
dojo.byId("popup").innerHTML = response;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function contacts_add_first_form()
{
dojo.xhrGet(
{
url: "tools/shop/shop/actions/contacts_add_form.php",
handleAs: "text",
timeout: 5000,
load: function(response, ioArgs) {
dojo.byId("contact_first_form").innerHTML = response;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function delivery_add_enable_inputs(value)
{
if (value != 0)
{
document.getElementById("name").disabled = false;
document.getElementById("street").disabled = false;
document.getElementById("number").disabled = false;
document.getElementById("zip").disabled = false;
document.getElementById("city").disabled = false;
document.getElementById("tel").disabled = false;
document.getElementById("fax").disabled = false;
document.getElementById("savebutton").disabled = false;
}
else
{
document.getElementById("name").disabled = true;
document.getElementById("street").disabled = true;
document.getElementById("number").disabled = true;
document.getElementById("zip").disabled = true;
document.getElementById("city").disabled = true;
document.getElementById("tel").disabled = true;
document.getElementById("fax").disabled = true;
document.getElementById("savebutton").disabled = true;
}
}
function delivery_add_save()
{
dojo.xhrPost (
{
url: 'tools/shop/shop/actions/delivery_add_save.php',
handleAs: "text",
form: "delivery_add",
load: function(response, ioArgs) {
contacts_add_first_form()
// select_invoice_data();
},
error: function (error) {
console.error ('Error: ', error);
}
}
);
}
function delivery_add_form()
{
dojo.xhrGet(
{
url: "tools/shop/shop/actions/delivery_add_form.php",
handleAs: "text",
timeout: 5000,
load: function(response, ioArgs) {
dojo.byId("delivery_first_form").innerHTML = response;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function delivery_add_first_form()
{
dojo.xhrGet(
{
url: "tools/shop/shop/actions/delivery_add_form.php",
handleAs: "text",
timeout: 5000,
load: function(response, ioArgs) {
dojo.byId("delivery_first_form").innerHTML = response;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function invoice_add_save(invoiceid,deliveryid)
{
dojo.xhrPost (
{
url: 'tools/shop/shop/actions/invoice_add_save.php',
handleAs: "text",
form: "invoice_add",
load: function(response, ioArgs) {
delivery_add_form()
},
error: function (error) {
console.error ('Error: ', error);
}
}
);
}
function choose_private_company(waarde)
{
if (waarde == 1)
{
document.getElementById("clientVAT").innerHTML = "";
document.getElementById("clientVatLabel").innerHTML = "";
}
}
function invoice_add_form()
{
dojo.xhrGet(
{
url: "tools/shop/shop/actions/invoice_add_form.php",
handleAs: "text",
timeout: 5000,
load: function(response, ioArgs) {
dojo.byId("popup").innerHTML = response;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function invoice_add_first_form()
{
dojo.xhrGet(
{
url: "tools/shop/shop/actions/invoice_add_form.php",
handleAs: "text",
timeout: 5000,
load: function(response, ioArgs) {
dojo.byId("invoice_first_form").innerHTML = response;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function mp(number) {
get_mp_nav(number);
get_mp(number);
}/*mp*/
function get_mp_nav(number){
dojo.xhrGet(
{
url: "tools/shop/shop/actions/mp_show_nav.php?number=" + number,
handleAs: "text",
timeout: 5000,
load: function(response, ioArgs) {
dojo.byId("mp_nav").innerHTML = response;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}/*get_mp_nav*/
function get_mp(number) {
var myurl;
switch (number) {
case 0: myurl = "tools/shop/shop/actions/mp_show_login.php";break;
case 1: myurl = "tools/shop/shop/actions/mp_show_my_profile.php";break;
case 2: myurl = "tools/shop/shop/actions/mp_show_invoicing.php";break;
case 3: myurl = "tools/shop/shop/actions/mp_show_jobs.php";break;
case 4: myurl = "tools/shop/shop/actions/mp_show_messagecenter.php";break;
default: break;
}
dojo.xhrGet(
{
url: myurl,
handleAs: "text",
timeout: 5000,
load: function(response, ioArgs) {
dojo.byId("main-content-fw").innerHTML = response ;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}/*get_mp*/
function show_profile(action) {
var myform;
if(action == 'start' ) {
myform = 'form_start';
}
else {
myform = 'form_profile';
}
dojo.xhrPost (
{
url: 'tools/shop/shop/actions/mp_show_profile.php',
handleAs: "text",
form: myform,
load: function (data) {
dojo.byId('div_profile').innerHTML = data;
},
error: function (error) {
console.error ('Error: ', error);
}
}
);
}/*show_profile*/
function product_overview_price(productid,quantity,option1,option2,option3,productpriceid) {
var name = "numberofitems_" + escape(productid) + "_" + escape(option1) + "_" + escape(option2) + "_" + escape(option3);
//alert(name);
var element = document.getElementById(name);
element.value = quantity;
//numberofitems_" . $productid . "_" . $option1 . "_" . $option2 . "_" . $option3 . "
dojo.xhrGet(
{
url: "tools/shop/shop/actions/products_show_price.php?productid=" + escape(productid) + "&quantity=" + escape(quantity) + "&productpriceid=" + escape(productpriceid),
handleAs: "text",
timeout: 5000,
load: function(response, ioArgs) {
dojo.byId("product_overview_price_" + escape(productid) + "_" + escape(option1) + "_" + escape(option2) + "_" + escape(option3)).innerHTML = response ;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
}
);
}
function editPopup(action) {
if (action == 'open') {
document.getElementById("popup").style.visibility = "visible";
}
else if (action == 'close') {
document.getElementById("popup").innerHTML = '';
document.getElementById("popup").style.visibility = "hidden";
}
}