<?php include("../../check.php"); ?>

<!DOCTYPE html>
<html>

<head>
   
  <?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 fixed-sidebar">

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


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

<div id="wrapper">

<div class="small-header transition animated fadeIn">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li><a href="<?php print $baseurl; ?>welcome/standard/addEdit.php"><button class="btn btn-info " type="button"><i class="fa fa-paste"></i> Add Pages</button></a></li>
                    <li><a href="<?php print $baseurl; ?>welcome/standard/index.php"><button class="btn btn-success " type="button"><i class="fa fa-list"></i> <span class="bold">All Pages Show</span></button></a></li>
                </ol>
            </div>

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

<div class="content animate-panel">

<div>

    <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>
                    Create standard
                </div>
                <div class="panel-body" >
                
               <form method="post" action="postAction.php" enctype="multipart/form-data" class="form-horizontal">
						
				   
                      <?php $getall = $getData->runQuery("SELECT * FROM `standard_tbl` where id='".$_GET['edit']."'");?>

                      <div class="tab-content">

                                <div class="form-group">
								  <div class="col-md-6">
									  <label >Titile:</label>
									  <input type="hidden" name="dataid"  value="<?=$getall[0]['id'];?>">
									  <input type="text" name="title" class="form-control " id="title" value="<?=$getall[0]['title'];?>">
								  </div>
								  <div class="col-md-6">
									  <label >Standard:</label>
									  <input type="text" name="standard" class="form-control " id="standard"  value="<?=$getall[0]['standard'];?>">
								  </div>
								   <div class="col-md-6">
									  <label >Image:</label>
									  <input type="file" name="img" class="form-control " id="standard"  >
								  </div>
								  
								  <?php if($getall[0]['img'] != ''){ ?>
								  <div class="col-md-6">
									  <img src="img/<?= $getall[0]['img'];?>" width="100">
								  </div>
								  <?php } ?>
								</div>
                                
	
                        </div>
						<input type="hidden" name="id" >
						<input type="submit" name="imgSubmit" class="btn btn-success save-btn" value="SUBMIT">
            </form>
                 
                </div>
            </div>
        </div>
        
    </div>


</div>

</div>

   

    <?php include("../common/footer.php") ?>

</div>

<script src="<?php print $baseurl; ?>welcome/vendor/jquery/dist/jquery.min.js"></script>
<script src="<?php print $baseurl; ?>welcome/vendor/jquery-ui/jquery-ui.min.js"></script>
<script src="<?php print $baseurl; ?>welcome/vendor/slimScroll/jquery.slimscroll.min.js"></script>
<script src="<?php print $baseurl; ?>welcome/vendor/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="<?php print $baseurl; ?>welcome/vendor/metisMenu/dist/metisMenu.min.js"></script>
<script src="<?php print $baseurl; ?>welcome/vendor/iCheck/icheck.min.js"></script>
<script src="<?php print $baseurl; ?>welcome/vendor/sparkline/index.js"></script>
<script src="<?php print $baseurl; ?>welcome/vendor/sweetalert/lib/sweet-alert.min.js"></script>

<!-- App scripts -->
<script src="<?php print $baseurl; ?>welcomes/cripts/homer.js"></script>

<script>
	
	
	$(document).ready(function(){
		$(".heading-input").on("input",function(){
			var heading = $(this).val();
			heading = heading.toLowerCase();
			heading = heading.replace(/ /g, '-');
			
			$(".url").val(heading);
		});
	});
	
	$(document).ready(function(){
		$(".heading-input").on("change",function(){
			
            $.ajax({
                type : "POST",
                url : "check_url_page.php",
                data : {
                    url : $(".url").val()
                },
                success : function(response)
                {
                    if(response.trim() == "success")
                    {
                        $("#url-error").css({"display" : "none"});
						$(".save-btn").removeAttr("disabled");

                    }
                    else{
                        $("#url-error").css({"display" : "block"});
						$(".save-btn").attr("disabled","disabled");
                    }
                }

            });
        });
	});
		
	

</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>

