<?php include("../check.php");
$type='home'; if(isset($_GET['p']) && trim($_GET['p'])!=='') { $type=trim($_GET['p']); }
?>
<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <!-- Page title -->
    <title>HOMER | WebApp admin theme</title>
    <?php include("common/head.php") ?>
    <script src="../ckeditor1/ckeditor/ckeditor.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

</head>
<body class="fixed-navbar sidebar-scroll">

<?php include("common/header.php") ?>
<?php include("common/aside.php") ?>

<!-- Main Wrapper -->
<div id="wrapper">

    <div class="small-header">
        <div class="hpanel">
            <div class="panel-body">
                <div id="hbreadcrumb" class="pull-right">
                    <ol class="hbreadcrumb breadcrumb">
                        <li><a href="index.html">Dashboard</a></li>
                        <li>
                            <span>Forms</span>
                        </li>
                        <li class="active">
                            <span>Wizard </span>
                        </li>
                    </ol>
                </div>
                <h2 class="font-light m-b-xs">
                    Wizard
                </h2>
                <small>Build a form with wizard functionality.</small>
            </div>
        </div>
    </div>

<div class="content">

    <div class="row">
        <div class="col-lg-12">
            <div class="hpanel">
                <div class="panel-heading">
                    <div class="panel-tools">
                        <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                        <a class="closebox"><i class="fa fa-times"></i></a>
                    </div>
                    Example fo wizard form
                </div>
                <div class="panel-body">

                <form action="<?php echo $_SERVER['PHP_SELF'];?>?p=<?php echo $type; ?>" method="POST" enctype="multipart/form-data" class="form-horizontal">
                <input type="hidden" name="token" id="token" value="<?php print $token_id; ?>">

                        <div class="text-center m-b-md" id="wizardControl">

                            <a class="btn btn-primary" href="#step1" data-toggle="tab">English</a>
                            <a class="btn btn-default" href="#step2" data-toggle="tab">Hindi</a>

                        </div>

                        <div class="tab-content">
                        <div id="step1" class="p-m tab-pane active">

                            <div class="row">
                                
                                <div class="col-lg-12">
                                    <div class="row">
                                        <div class="form-group col-lg-12">
                                            <label>English Title</label>
                                            <input type="text" value="<?php print $value['title']; ?>" id="" class="form-control" name="title" placeholder="Enter English Title">
                                        </div>
                                        <div class="form-group col-lg-12">
                                            <label>English Metakey</label>
                                            <input type="text" value="<?php print $value['metakey']; ?>" id="" class="form-control" name="metakey" placeholder="Enter English Metakey">
                                        </div>
                                        <div class="form-group col-lg-12">
                                            <label>English Description</label>
                                            <input type="text" value="<?php print $value['description']; ?>" id="" class="form-control" name="description" placeholder="Enter English Description">
                                        </div>
                                        <div class="form-group col-lg-12">
                                            <label>English Heading</label>
                                            <input type="text" value="<?php print $value['heading']; ?>" id="" class="form-control" name="heading" placeholder="Enter English Description">
                                        </div>
                                        <div class="form-group col-lg-12">
                                            <label>English Page Data</label>
                                            <textarea class="ckeditor" id="editor1" rows="8" id="details" name="data" style="max-width:100%;"><?php print $value['data']; ?></textarea>
                                        </div>
                                        <div class="form-group col-lg-12">
                                        <?php $filename='../../images/pages/'.$pageData[0]['img'];
                                      if($pageData[0]['img']!=='') {print '<img src="'.$filename.'" class="img-responsive" id="img" style="width:350px; margin:15px;">';
                                      echo '<i class="fa fa-trash" style="font-size:30px;color:red;margin-left:35%;" aria-hidden="true" id="delete-img"></i>';
                                      }
                                      ?>
                                    
                                    <br>
                                    <label class="col-sm-2 control-label">Image Upload</label>
                                      <div class="col-sm-8"><input type="file" name="myimage" id="myimage" class="form-control" >image size: max 500kb</div>
                                        </div>
                                        
                                        
                                    </div>
                                </div>
                            </div>

                            

                        </div>

                        <div id="step2" class="p-m tab-pane">

                            <div class="row">
                                
                                <div class="col-lg-12">
                                    <div class="row">
                                        <div class="form-group col-lg-12">
                                            <label>Hindi Title</label>
                                            <input type="text" value="<?php print $value['data_hindi']; ?>" class="form-control" name="title_hindi" placeholder="Enter Hindi Title">
                                        </div>
                                        <div class="form-group col-lg-12">
                                            <label>Hindi Metakey</label>
                                            <input type="text" value="<?php print $value['data_hindi']; ?>"  class="form-control" name="metakey_hindi" placeholder="Enter Hindi Metakey">
                                        </div>
                                        <div class="form-group col-lg-12">
                                            <label>Hindi Description</label>
                                            <input type="text" value="<?php print $value['data_hindi']; ?>"  class="form-control" name="description_hindi" placeholder="Enter HIndi Description">
                                        </div>
                                        <div class="form-group col-lg-12">
                                            <label>Hindi Heading</label>
                                            <input type="text" value="<?php print $value['data_hindi']; ?>"  class="form-control" name="heading_hindi" placeholder="Enter Hindi Heading" >
                                        </div>
                                        <div class="form-group col-lg-12">
                                            <label>Hindi Page Data</label>
                                            <textarea class="ckeditor" id="editor1" rows="8" id="details" name="data_hindi" style="max-width:100%;"><?php print $value['data_hindi']; ?></textarea>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            

                        </div>
                        <div class="form-group">
                          <div class="col-sm-8 col-sm-offset-2">
                              <button class="btn btn-primary" id="submitbtn" type="submit">Save Changes</button>
                              <button class="btn btn-deafult" type="button" onClick="window.location.reload()">Refresh</button>
                          </div>
                      </div>
                        </div>
                    </form>

                    

                </div>
            </div>
        </div>

    </div>
    </div>

    

    <!-- Footer-->
    <footer class="footer">
        <span class="pull-right">
            Example text
        </span>
        Company 2015-2020
    </footer>

</div>



<!-- Vendor scripts -->
<script src="vendor/jquery/dist/jquery.min.js"></script>
<script src="vendor/jquery-ui/jquery-ui.min.js"></script>
<script src="vendor/slimScroll/jquery.slimscroll.min.js"></script>
<script src="vendor/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="vendor/metisMenu/dist/metisMenu.min.js"></script>
<script src="vendor/iCheck/icheck.min.js"></script>
<script src="vendor/sparkline/index.js"></script>
<script src="vendor/sweetalert/lib/sweet-alert.min.js"></script>

<!-- App scripts -->
<script src="scripts/homer.js"></script>

<script>

    $(function(){

        $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
            $('a[data-toggle="tab"]').removeClass('btn-primary');
            $('a[data-toggle="tab"]').addClass('btn-default');
            $(this).removeClass('btn-default');
            $(this).addClass('btn-primary');
        })

        $('.next').click(function(){
            var nextId = $(this).parents('.tab-pane').next().attr("id");
            $('[href=#'+nextId+']').tab('show');
        })

        $('.prev').click(function(){
            var prevId = $(this).parents('.tab-pane').prev().attr("id");
            $('[href=#'+prevId+']').tab('show');
        })

        $('.submitWizard').click(function(){

            var approve = $(".approveCheck").is(':checked');
            if(approve) {
                // Got to step 1
                $('[href=#step1]').tab('show');

                // Serialize data to post method
                var datastring = $("#simpleForm").serialize();

                // Show notification
                swal({
                    title: "Thank you!",
                    text: "You approved our example form!",
                    type: "success"
                });
//            Example code for post form
//            $.ajax({
//                type: "POST",
//                url: "your_link.php",
//                data: datastring,
//                success: function(data) {
//                    // Notification
//                }
//            });
            } else {
                // Show notification
                swal({
                    title: "Error!",
                    text: "You have to approve form checkbox.",
                    type: "error"
                });
            }
        })
    });
</script>

</body>
</html>