<commit_before><?php 
/**
 *       __                             __ _  __       
 *      / /_   _____ ____ _ ____   ____/ /(_)/ /_ ____ 
 *     / __ \ / ___// __ `// __ \ / __  // // __// __ \
 *    / /_/ // /   / /_/ // / / // /_/ // // /_ / /_/ /
 *   /_.___//_/    \__,_//_/ /_/ \__,_//_/ \__/ \____/ 
 *                                                     
 *
 * @Author: Brandon
 * @Emai:   <EMAIL>
 * @Date:   2016-11-24 14:20:11
 * @Last Modified by:   Brandon
 * @Last Modified time: 2016-11-27 22:43:05
 */
?>

<!DOCTYPE html>
<html lang="en" class="no-js">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
    <title>ez AJAX Shop</title>
    <meta name="description" content="RSPS Store Webfront" />
    <meta name="keywords" content="rsps, serverscape, store, serverscape store, serverscape webfront" />
    <meta name="author" content="Brandon" />
    <link rel="stylesheet" type="text/css" href="css/stylingsheet.css" />
    <script src="js/modernizr.custom.js"></script>
    <link rel="stylesheet" type="text/css" href="js/css/alertify.css">
    <link rel="stylesheet" type="text/css" href="js/css/themes/semantic.css">
    <link rel="stylesheet" type="text/css" href="js/css/themes/semantic.min.css">
    <link rel="stylesheet" type="text/css" href="css/cart_style.css">
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/alertify.js"></script>
    <script type="text/javascript" src="js/url.min.js"></script>
    <script type="text/javascript">



    $(document).ready(function(){ 


      //Url.getLocation();
      $.ajax({
        type:'post',
        url:'store_items.php',
        data:{
          total_cart_items:"totalitems"
        },
        success:function(response) {
          document.getElementById("total_items").value=response;
        }
      });

    });

    function cart(id)
    {
    var ele=document.getElementById(id);
    var img_src=ele.getElementsByTagName("img")[0].src;
    var name=document.getElementById(id+"_name").value;
    var price=document.getElementById(id+"_price").value;
  
    alertify.notify('<font style="color:darkgreen;"><b>'+name+' ('+price+')</b><br> was added to the cart.', 'success', 5, function(){  console.log('Added '+name+' ('+price+') to cart.'); });

    $.ajax({
        type:'post',
        url:'store_items.php',
        data:{
          item_src:img_src,
          item_name:name,
          item_price:price
        },
        success:function(response) {
          document.getElementById("total_items").value=response;
        }
      });
    
    update_cart();

    }
    function empty_cart(id)
    {
  
    alertify.notify('<font style="color:darkred;"><b>You emptied the cart.</b>', 'error', 5, function(){  console.log('Cart was emptied by the user.'); });

    $.ajax({
        type:'post',
        url:'store_items.php',
        data:{
          cart_action:'empty'
        },<commit_msg>Changed the layout of the alert notifications<commit_after><?php 
/**
 *       __                             __ _  __       
 *      / /_   _____ ____ _ ____   ____/ /(_)/ /_ ____ 
 *     / __ \ / ___// __ `// __ \ / __  // // __// __ \
 *    / /_/ // /   / /_/ // / / // /_/ // // /_ / /_/ /
 *   /_.___//_/    \__,_//_/ /_/ \__,_//_/ \__/ \____/ 
 *                                                     
 *
 * @Author: Brandon
 * @Emai:   <EMAIL>
 * @Date:   2016-11-24 14:20:11
 * @Last Modified by:   Brandon
 * @Last Modified time: 2016-11-28 01:43:05
 */
?>

<!DOCTYPE html>
<html lang="en" class="no-js">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
    <title>ez AJAX Shop</title>
    <meta name="description" content="RSPS Store Webfront" />
    <meta name="keywords" content="rsps, serverscape, store, serverscape store, serverscape webfront" />
    <meta name="author" content="Brandon" />
    <link rel="stylesheet" type="text/css" href="css/stylingsheet.css" />
    <script src="js/modernizr.custom.js"></script>
    <link rel="stylesheet" type="text/css" href="js/css/alertify.css">
    <link rel="stylesheet" type="text/css" href="js/css/themes/semantic.css">
    <link rel="stylesheet" type="text/css" href="js/css/themes/semantic.min.css">
    <link rel="stylesheet" type="text/css" href="css/cart_style.css">
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/alertify.js"></script>
    <script type="text/javascript" src="js/url.min.js"></script>
    <script type="text/javascript">



    $(document).ready(function(){ 


      //Url.getLocation();
      $.ajax({
        type:'post',
        url:'store_items.php',
        data:{
          total_cart_items:"totalitems"
        },
        success:function(response) {
          document.getElementById("total_items").value=response;
        }
      });

    });

    function cart(id)
    {
    var ele=document.getElementById(id);
    var img_src=ele.getElementsByTagName("img")[0].src;
    var name=document.getElementById(id+"_name").value;
    var price=document.getElementById(id+"_price").value;
  
    alertify.notify('<font style="color:darkgreen;"><b>'+name+' <br> '+price+'</b><br> was added to the cart.', 'success', 5, function(){  console.log('Added '+name+' ('+price+') to cart.'); });

    $.ajax({
        type:'post',
        url:'store_items.php',
        data:{
          item_src:img_src,
          item_name:name,
          item_price:price
        },
        success:function(response) {
          document.getElementById("total_items").value=response;
        }
      });
    
    update_cart();

    }
    function empty_cart(id)
    {
  
    alertify.notify('<font style="color:darkred;"><b>You emptied the cart.</b>', 'error', 5, function(){  console.log('Cart was emptied by the user.'); });

    $.ajax({
        type:'post',
        url:'store_items.php',
        data:{
          cart_action:'empty'
        },
{'fraction_non_alphanumeric': 0.1892110805119067, 'fraction_numerical': 0.01133970516766564, 'mean_word_length': 2.3445287107258936, 'pattern_counts': {'":': 0, '<': 72, '<?xml version=': 0, '>': 72, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3537560', 'n_tokens_mistral': 2110, 'n_tokens_neox': 2014, 'n_words': 309}