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

<!DOCTYPE html>
<html>

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

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

            <h1> Bodies Listing</h1>
	
    
   
            
        </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 Bodies
                </div>
                <div class="panel-body" >
                
               <form method="post" action="postAction.php" enctype="multipart/form-data" class="form-horizontal">
                   <?php $getall = $getData->runQuery("SELECT * FROM `bodies_tbl` where id='".$_GET['edit']."'");?>
						<div class="form-group">
							  <div class="col-sm-4">
									<label>PDF File</label>
									<input type="file" name="pdf" class="form-control" >
									<?php if($getall[0]['pdf'] != ''){ ?>
    								  <div class="col-md-6">
    									  <a href="pdf/<?= $getall[0]['pdf'];?>" target="_blank">View file</a>
    								  </div>
								  <?php } ?>
						
							  </div>
							<div class="col-sm-4">
									<label >Bodies Name:</label>
									<input type="hidden" name="dataid"  value="<?=$getall[0]['id'];?>">
									<input type="text" name="title" class="form-control" placeholder=""  value="<?=$getall[0]['title'];?>" >
						
							  </div>
							<div class="col-sm-4">
									<label >Standard Select Multiple:</label>
									  <select class="form-control js-example-basic-multiple" name="standard[]" multiple="multiple">
                                         <option value=""> -- Select Standard -- </option>
                                         <?php
                                         $getalls = $getData->runQuery("SELECT * FROM `standard_tbl`");
                                            foreach($getalls as $rows){
                                                 $dataaa = $getall[0]['standard'];
                                                 $result = explode(',',$dataaa);
                                         ?>
                                         <option value="<?= $rows['id']?>" <?php if(in_array($rows['id'],$result)){ echo "selected"; } ?>><?= $rows['title']?></option>
                                         <?php } ?>
                                      </select>
						
							  </div>
							  
					  	</div>
				   

                      
				      
						<input type="hidden" name="id" value="#">
						<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>

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

<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
	<script>
    $(document).ready(function() {
        $('.js-example-basic-multiple').select2();
    });
    </script>

</body>

</html>

