<?php
include_once"../config.php";
session_start();
$theme_color = $_POST['Theme_color'];
$font_color = $_POST['text_color'];
$top_heading = $_POST['chart_title'];
$area = $_POST['Area_title'];
$natinailty = $_POST['natianilty_title'];
$s_category  = $_POST['Special_title'];
$category_nat = $_POST['category_nat_title'];
$margin = $_POST['marginst'];
$marginb = $_POST['marginb'];
$Sequence = $_POST['Sequence'];
$Sequences = implode(", ", $Sequence);

$submit = isset($_POST['submit'])?$_POST['submit']:null;
$update = isset($_POST['update'])?$_POST['update']:null;



if($submit){
	
	mysqli_query($con, "INSERT INTO custome_page set chart_title = '$top_heading',	Area_title= '$area', Special_title = '$s_category', natianilty_title = '$natinailty', category_nat_title = '$category_nat', Theme_color = '$theme_color',marginst = '$margin' , , marginb = '$marginb'  Sequence_theme = '$Sequences', text_color = '$font_color'  ");
	$_SESSION['try']=1;
    header("location:../design.php?try=1");

}else if($update){
	mysqli_query($con, "update custome_page set chart_title = '$top_heading',	Area_title= '$area', Special_title = '$s_category', natianilty_title = '$natinailty', category_nat_title = '$category_nat', Theme_color = '$theme_color', Sequence_theme = '$Sequences', text_color = '$font_color', marginst = '$margin', marginb = '$marginb'  where id =  5 ");

    $_SESSION['try']=2;
	header("location:../design.php?try=2");

}