<?php
    // for actual template.
    $gradientFor = $_POST['gradientFor'];
    // $gradientPrefix = $_POST['gradientPrefix'];
    $TrimCcount = $_POST['trimCount'];

    $stop_color_1 = $_POST['stop_color_1'];
    $stop_color_2 = $_POST['stop_color_2'];
    $offset_1 = $_POST['offset_1'];
    $offset_2 = $_POST['offset_2'];

    if($gradientFor == "Body"){
        ?>
            <linearGradient id="Body_Gradient" gradientUnits="userSpaceOnUse" x1="0%" y1="100%" x2="0%" y2="0%"> 
                <stop id="Body_Gradient_Color2" offset="<?php echo $offset_2 ?>" stop-color="<?php echo $stop_color_2 ?>" />
                <stop id="Body_Gradient_Color1" offset="<?php echo $offset_1 ?>" stop-color="<?php echo $stop_color_1 ?>" />
            </linearGradient>
        <?php

    }
    if($gradientFor == "Body_Pattern"){
        ?>
            <linearGradient id="Body_Pattern_Gradient" gradientUnits="userSpaceOnUse" x1="0%" y1="100%" x2="0%" y2="0%"> 
                <stop id="Body_Pattern_Gradient_Color2" offset="<?php echo $offset_2 ?>" stop-color="<?php echo $stop_color_2 ?>" />
                <stop id="Body_Pattern_Gradient_Color1" offset="<?php echo $offset_1 ?>" stop-color="<?php echo $stop_color_1 ?>" />
            </linearGradient>
        <?php
    }
    if($gradientFor == "Trim"){
        ?>
        <linearGradient id="<?php echo 'Trim_'.$TrimCcount.'_Gradient' ; ?>" gradientUnits="userSpaceOnUse" x1="0%" y1="100%" x2="0%" y2="0%"> 
            <stop id="<?php echo 'Trim_'.$TrimCcount.'_Gradient_Color2' ; ?>" offset="<?php echo $offset_2 ?>" stop-color="<?php echo $stop_color_2 ?>" />
            <stop id="<?php echo 'Trim_'.$TrimCcount.'_Gradient_Color1' ; ?>" offset="<?php echo $offset_1 ?>" stop-color="<?php echo $stop_color_1 ?>" />
        </linearGradient>
        <?php
    }
    if($gradientFor == "Trim_Pattern"){
        ?>
        <linearGradient id="<?php echo 'Trim_'.$TrimCcount.'_Pattern_Gradient' ; ?>" gradientUnits="userSpaceOnUse" x1="0%" y1="100%" x2="0%" y2="0%"> 
            <stop id="<?php echo 'Trim_'.$TrimCcount.'_Pattern_Gradient_Color2' ; ?>" offset="<?php echo $offset_2 ?>" stop-color="<?php echo $stop_color_2 ?>" />
            <stop id="<?php echo 'Trim_'.$TrimCcount.'_Pattern_Gradient_Color1' ; ?>" offset="<?php echo $offset_1 ?>" stop-color="<?php echo $stop_color_1 ?>" />
        </linearGradient>
        <?php
    }


    

?>



