Location: PHPKode > projects > Simple PHP Shopping cart - asaancart > asaancart v-0.9/templates/manage_products.tpl
<!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 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]-->


<!-- Initialize Dojo -->
        {literal}
        <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");

		dojo.addOnLoad (
		function() {
		//dojo.style.setDisplay('loader_properties', true);
			
                dojo.xhrPost ({
                        // The page that parses the POST request
                        url: 'list_all_products.php',
                
                        // Name of the Form we want to submit
                       // form: 'post-form',
                
                        // Loads this function if everything went ok
                        load: function (data) {
                                // Put the data into the appropriate <div>
								//document.getElementById('loader_properties').style.display="";
                                dojo.byId('product_list').innerHTML = data;
								//document.getElementById('loader_properties').style.display="none";
								
                        },
                        // Call this function if an error happened
                        error: function (error) {
                                console.error ('Error: ', error);
                        }
						
            });
			//dojo.style.setDisplay('loader_properties', false);
			
        });
		
		function deleteProduct(product_id){
		if(confirm("Are you sure that you wnat to delete this product?")){
			dojo.xhrPost ({
							// The page that parses the POST request
							url: 'delete_product.php?mode=delete&product_id='+product_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('product_list').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 updateProductStatus(product_id, action){
			dojo.xhrPost ({
							// The page that parses the POST request
							url: 'update_product_status.php?mode='+action+'&product_id='+product_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('product_list').innerHTML = data;
									//document.getElementById('loader2').style.display="none";
									
									
							},
							// Call this function if an error happened
							error: function (error) {
									console.error ('Error: ', error);
							}
				});
		}

        </script>
        {/literal}
</head>
<body>


<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>Manage Products</h3>
             <div id="product_list">
            {include file='list_all_products.tpl'}
            </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>
Return current item: Simple PHP Shopping cart - asaancart