<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$title}</title>
<link rel="stylesheet" type="text/css" href="css/yui-fonts-min.css" />
<link rel="stylesheet" type="text/css" href="css/yui-tabview.css" />
<link href="css/global.css" rel="stylesheet" type="text/css" />
<link href="../menu/css/dropdown/dropdown.css" media="all" rel="stylesheet" type="text/css" />
<link href="../menu/css/dropdown/themes/default/default.advanced.css" media="all" rel="stylesheet" type="text/css" />
<!--[if lt IE 7]>
<script type="text/javascript" src="../menu/js/jquery/jquery.js"></script>
<script type="text/javascript" src="../menu/js/jquery/jquery.dropdown.js"></script>
<![endif]-->
{literal}
<!-- jQuery -->
<script type="text/javascript" src="../jquery/jquery.pack.js"></script>
<!-- markItUp! -->
<script type="text/javascript" src="../jquery/markitup/jquery.markitup.pack.js"></script>
<!-- markItUp! toolbar settings -->
<script type="text/javascript" src="../jquery/markitup/sets/default/set_mini.js"></script>
{/literal}
<!-- markItUp! skin -->
<link rel="stylesheet" type="text/css" href="../jquery/markitup/skins/simple_mini/style.css" />
<!-- markItUp! toolbar skin -->
<link rel="stylesheet" type="text/css" href="../jquery/markitup/sets/default/style_mini.css" />
<!-- Initialize Dojo -->
{literal}
<script type="text/javascript" src="http://yui.yahooapis.com/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.6.0/build/element/element-beta-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.6.0/build/tabview/tabview-min.js"></script>
<script src='../dojo/dojo/dojo.js' type='text/javascript'></script>
<script type='text/javascript'>
//<!--
// The following function submits the data from the 'post-form' form
// to a PHP script located at
// 'http://www.dojoforum.com/demo-0.9/xhr/parse_form.php'
// The PHP script simply outputs a string in the format of
// 'Hello $name!', which is then put in the <div> w/ the id
// of 'response'.
//
// NOTE: As with xhrGet, you can also use handleAs to accept
// JSON objects in your load() function.
//dojo.require("dojo.style");
function deleteSelectedGroupInfo(group_id, product_id){
if(confirm("Are you sure that you want to delete this variant group?")){
//document.getElementById('group_variant_name_'+group_id).value;
dojo.xhrPost ({
// The page that parses the POST request
url: 'delete_variant_group_from_product.php?mode=delete&product_id='+product_id+'&group_id='+group_id,
// Name of the Form we want to submit
//form: 'login',
// Loads this function if everything went ok
load: function (data) {
// Put the data into the appropriate <div>
//document.getElementById('loader2').style.display="";
dojo.byId('update_variants_box').innerHTML = data;
//document.getElementById('loader2').style.display="none";
},
// Call this function if an error happened
error: function (error) {
console.error ('Error: ', error);
}
});
}//end confirm
}
function editProduct() {
//document.getElementById("attribute_set_id").value = set_id;
//alert(set_id);
dojo.xhrPost ({
// The page that parses the POST request
url: 'edit_product.php?btn_edit=save',
// Name of the Form we want to submit
form: 'edit_product_form',
// Loads this function if everything went ok
load: function (data) {
// Put the data into the appropriate <div>
//document.getElementById('loader2').style.display="";
//dojo.byId('update_list_attribute_value_box').innerHTML = data;
//document.getElementById('loader2').style.display="none";
},
// Call this function if an error happened
error: function (error) {
console.error ('Error: ', error);
}
});
}
function deleteProductImage(id, product_id) {
if(confirm("Are you sure that you want to delete this picture/image?")){
//document.getElementById("attribute_set_id").value = set_id;
//alert(set_id);
dojo.xhrPost ({
// The page that parses the POST request
url: 'delete_product_images.php?mode=delete&product_id='+product_id+'&id='+id,
// Name of the Form we want to submit
//form: 'edit_product_form',
// Loads this function if everything went ok
load: function (data) {
// Put the data into the appropriate <div>
//document.getElementById('loader2').style.display="";
dojo.byId('product_images_box').innerHTML = data;
//document.getElementById('loader2').style.display="none";
},
// Call this function if an error happened
error: function (error) {
console.error ('Error: ', error);
}
});
}
}
function deleteProductAttribute(id, product_id) {
if(confirm("Are you sure that you want to delete this product attribute?")){
//document.getElementById("attribute_set_id").value = set_id;
//alert(set_id);
dojo.xhrPost ({
// The page that parses the POST request
url: 'delete_product_attributes.php?mode=delete&product_id='+product_id+'&id='+id,
// Name of the Form we want to submit
//form: 'edit_product_form',
// Loads this function if everything went ok
load: function (data) {
// Put the data into the appropriate <div>
//document.getElementById('loader2').style.display="";
dojo.byId('product_attribute_box').innerHTML = data;
//document.getElementById('loader2').style.display="none";
},
// Call this function if an error happened
error: function (error) {
console.error ('Error: ', error);
}
});
}
}
function deleteTag(id) {
if(confirm("Are you sure that you want to delete this tag form the system?")){
//document.getElementById("attribute_set_id").value = set_id;
//alert(set_id);
dojo.xhrPost ({
// The page that parses the POST request
url: 'delete_tag.php?id='+id,
// Name of the Form we want to submit
//form: 'edit_product_form',
// Loads this function if everything went ok
load: function (data) {
// Put the data into the appropriate <div>
//document.getElementById('loader2').style.display="";
dojo.byId('available_tags_box').innerHTML = data;
//document.getElementById('loader2').style.display="none";
},
// Call this function if an error happened
error: function (error) {
console.error ('Error: ', error);
}
});
}
}
function setMainProductImage(id, product_id) {
//if(confirm("Are you sure that you want to delete this picture/image?")){
//document.getElementById("attribute_set_id").value = set_id;
//alert(set_id);
dojo.xhrPost ({
// The page that parses the POST request
url: 'set_main_product_image.php?mode=setmain&product_id='+product_id+'&id='+id,
// Name of the Form we want to submit
//form: 'edit_product_form',
// Loads this function if everything went ok
load: function (data) {
// Put the data into the appropriate <div>
//document.getElementById('loader2').style.display="";
dojo.byId('product_images_box').innerHTML = data;
//document.getElementById('loader2').style.display="none";
},
// Call this function if an error happened
error: function (error) {
console.error ('Error: ', error);
}
});
//}
}
function addInlineCat() {
category_name = document.getElementById("category_name").value;
category_description = document.getElementById("category_description").value;
parent_cat_id = document.getElementById("parent_cat_id").value;
dojo.xhrPost ({
// The page that parses the POST request
url: 'add_inline_cat.php?btn_create=Create&parent_cat_id='+parent_cat_id+'&category_name='+category_name+'&category_description='+category_description,
// Name of the Form we want to submit
//form: 'login',
// Loads this function if everything went ok
load: function (data) {
// Put the data into the appropriate <div>
//document.getElementById('loader2').style.display="";
dojo.byId('update_cat_box').innerHTML = data;
document.getElementById('inline_add_cat_box').style.display = "none";
//document.getElementById('loader2').style.display="none";
},
// Call this function if an error happened
error: function (error) {
console.error ('Error: ', error);
}
});
}
function showInlineCategoryForm(){
document.getElementById('inline_add_cat_box').style.display = "";
}
function hideInlineCategoryForm(){
document.getElementById('inline_add_cat_box').style.display = "none";
}
///////////
function addInlineAttribute() {
attribute_name = document.getElementById("attribute_name").value;
attribute_value = document.getElementById("attribute_value").value;
product_id = document.getElementById("product_id").value;
dojo.xhrPost ({
// The page that parses the POST request
url: 'add_inline_attributes_edit.php?btn_create=Create&product_id='+product_id+'&attribute_name='+attribute_name+'&attribute_value='+attribute_value,
// Name of the Form we want to submit
//form: 'login',
// Loads this function if everything went ok
load: function (data) {
// Put the data into the appropriate <div>
//document.getElementById('loader2').style.display="";
dojo.byId('update_list_attribute_value_box').innerHTML = data;
document.getElementById('inline_add_attribute_box').style.display = "none";
//document.getElementById('loader2').style.display="none";
},
// Call this function if an error happened
error: function (error) {
console.error ('Error: ', error);
}
});
}
function showInlineAttributeForm(){
document.getElementById('inline_add_attribute_box').style.display = "";
}
function hideInlineAttributeForm(){
document.getElementById('inline_add_attribute_box').style.display = "none";
}
////////
function saveVariantInfo(group_id){
variant_surcharge = document.getElementById('variant_surcharge_'+group_id).value;
variant_name = document.getElementById('variant_name_'+group_id).value;
dojo.xhrPost ({
// The page that parses the POST request
url: 'add_inline_variant.php?mode=add&variant_name='+variant_name+'&variant_surcharge='+variant_surcharge+'&group_id='+group_id,
// Name of the Form we want to submit
//form: 'login',
// Loads this function if everything went ok
load: function (data) {
// Put the data into the appropriate <div>
//document.getElementById('loader2').style.display="";
dojo.byId('update_variants_box').innerHTML = data;
//document.getElementById('group_variants_box_'+group_id).style.display="";
//document.getElementById('add_variant_form_'+group_id).style.display="";
//document.getElementById('variant_group_id').checked=true;
//document.getElementById('loader2').style.display="none";
},
// Call this function if an error happened
error: function (error) {
console.error ('Error: ', error);
}
});
}
///////////
function selectSubVariants(group_id){
if(document.getElementById('group_variants_box_'+group_id).style.display!=""){
document.getElementById('group_variants_box_'+group_id).style.display="";
//document.getElementById('add_variant_form_'+group_id).style.display="";
}else{
document.getElementById('group_variants_box_'+group_id).style.display="none";
//document.getElementById('add_variant_form_'+group_id).style.display="none";
}
}
function addTag(tag){
document.getElementById('tags').value = document.getElementById('tags').value+" , "+tag;
}
function showStockBoxes(v){
if(v=="product_based_stock_level"){
document.getElementById('current_stock_level_box').style.display="";
document.getElementById('variant_list_stock_box').style.display="none";
document.getElementById('variant_list_stock_heading').style.display="none";
}else{
document.getElementById('current_stock_level_box').style.display="none";
}
if(v=="no_stock_level"){
document.getElementById('availability_box').style.display="";
document.getElementById('variant_list_stock_box').style.display="none";
document.getElementById('variant_list_stock_heading').style.display="none";
}else{
document.getElementById('availability_box').style.display="none";
}
if(v=="variant_based_stock_level"){
document.getElementById('availability_box').style.display="none";
document.getElementById('current_stock_level_box').style.display="none";
document.getElementById('variant_list_stock_box').style.display="";
document.getElementById('variant_list_stock_heading').style.display="";
//alert("Please select variant to stock");
}
}
////////////
//-->
</script>
{/literal}
</head>
<body>
{literal}
<script type="text/javascript">
<!--
$(document).ready(function() {
// Add markItUp! to your textarea in one line
// $('textarea').markItUp( { Settings }, { OptionalExtraSettings } );
$('#product_description').markItUp(mySettings);
$('#product_overview').markItUp(mySettings);
// You can add content from anywhere in your page
// $.markItUp( { Settings } );
$('.add').click(function() {
$.markItUp( { openWith:'<opening tag>',
closeWith:'<\/closing tag>',
placeHolder:"New content"
}
);
return false;
});
// And you can add/remove markItUp! whenever you want
// $(textarea).markItUpRemove();
$('.toggle').click(function() {
if ($("#product_description.markItUpEditor").length === 1) {
$("#product_description").markItUpRemove();
$("span", this).text("get markItUp! back");
} else {
$('#product_description').markItUp(mySettings);
$("span", this).text("remove markItUp!");
}
return false;
});
});
-->
</script>
{/literal}
<div id="page_container">
<div id="admin_header">{include file='admin_header.tpl'}</div>
<div id="admin_nav">{include file='admin_navigation.tpl'}</div>
<div id="contents">
<!-- Manage category controls -->
<div id="manage_cat_box">
{include file='mini_product_nav.tpl'}
<h3>Edit Product</h3>
<div class=" yui-skin-sam">
{include file='edit_product_form.tpl'}
</div>
</div>
</div>
<!-- end manage categories -->
<!-- <div id="section_info_box">
<h4>Why to select image</h4>
</div>-->
<div style="clear:both;"></div>
</div>
<div id="admin_footer">{include file='admin_footer.tpl'}</div>
</div>
</body>
</html>