 
 <?php 
 include "includes/header.php";

$servername = "localhost";
$username = "graveprm_paraapp";
$password = "0m=s^TD[a8G3";
$db = "graveprm_paraapp";

// Create connection
$conn = new mysqli($servername, $username, $password , $db);

// Check connection
$sql = "SELECT * FROM `book` WHERE id='". $_GET['id'] ."'";
 $result = $conn->query($sql);

  if ($result) {
    $return = array();
    while($row = $result->fetch_assoc()) {
      $return = $row;
    // $data_value = json_decode($return['book']);
    $data_value = json_decode(base64_decode($return['book'])); // Added by developer
     $data_img =  $return['company_attachment'];
   
    // var_dump($data_value);
    }
  } else {
    $return = array();
  }


$conn->close();


?>
  
  <!-- Form is filled -->
  <section id="membership-application" class="app-form">
        <!-- START -->
        <form action="javascript:void(0)" method="post" id="logo-form" enctype="multipart/form-data">
            <div class="container">
                <div class="row">
                    <!-- Section 1 Start -->
                    <div class="col-md-10 col-md-offset-1">
                        <div class="panel panel-theme">
                            <div class="panel-heading cake_order">Initial Book Cover Design</div>
                            <div class="panel-body">
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="para">
                                             <p>	Feel free to provide additional information if you think it will help.</p>

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

                                <div class="row">
                                    <div class="col-md-12">
                                         <label>	Exact Wording <span> ( Book Title)</span></label>
                                        <input class="form-control" name="book_title" type="text" placeholder="Full Name" value="<?php echo $data_value->book_title??null; ?>">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-12">
                                       <label>Slogan/Tagline if any <span>(optional)</span></label>
                                        <input class="form-control" name="slogan" type="text" placeholder="Email Address" value="<?php echo $data_value->slogan??null; ?>">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-12">
                                         <label>Author Name<span></span></label>
                                        <input class="form-control" name="fullname" type="text" placeholder="Company Name" value="<?php echo $data_value->fullname??null; ?>">
                                    </div>
                                </div>
                                  <div class="row">
                                    <div class="col-md-12">
                                         <label>Email<span></span></label>
                                        <input class="form-control" name="email" type="email" placeholder="Company Name" value="<?php echo $data_value->email??null; ?>">
                                    </div>
                                </div>

                                <div class="row">
                                    <div class="col-md-12">
                                           <label>Genre</label>
                                        <input class="form-control" name="genre" type="text" placeholder="" value="<?php echo $data_value->genre??null; ?>">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-12">
                                        <label>ISBN </label>
                                        <input class="form-control" name="isbn" type="text" placeholder="" value="<?php echo $data_value->isbn??null; ?>">
                                    </div>
                                </div>
                                 <div class="row">
                                    <div class="col-md-12">
                                        <label>Book Cover Size </label>
                                        <input class="form-control" name="book_size" type="text" placeholder="" value="<?php echo $data_value->book_size??null; ?>">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-12">
                                        <label>Back Cover Description</label>
                                        <textarea class="form-control" name="book_detail_description" placeholder="Back Cover Description"><?php echo $data_value->book_detail_description??null; ?></textarea>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-12">
                                        <label>	 Describe Your Book / Service / Organization / Genre</label>
                                        <textarea class="form-control" name="book_services_description" placeholder="Book Description"><?php echo $data_value->book_services_description??null; ?></textarea>
                                    </div>
                                </div>
                                <!-- End of Section 1 -->
                            </div>
                        </div>
                    </div>
                    <!-- End of Section 1 -->
                    <!-- Section 2 Start -->
                    <div class="col-md-10 col-md-offset-1">
                        <div class="panel panel-theme">
                            <div class="panel-heading cake_order">Book Cover Design Categories</div>
                            <div class="panel-body">
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="para">
                                            <!-- <p class="note">Please select ONE category > Font Based Or Icon Based > Then
                                                Check One Sub-Category Of That</p> -->
                                        </div>
                                    </div>
                                </div>
                                  <?php if($data_value->book_cover_category== "Book_cover_1"){ ?>
                                    <div class="col-md-3">
                                        <div class="check_box">
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox00" type="checkbox" name="" value="" class="chb" checked>
                                                <label for="checkbox00"></label>
                                            </div>
                                         

                                            <div class="images_box">
                                               <img src="https://kindlesdirectpublishing.com/questionnaire/book-cover/images/book/01.jpg" width="100%" alt="logo">
                                            </div>
                                        </div>
                                    </div>
                                      <?php }else if($data_value->book_cover_category == "Book_cover_2"){ ?>
                                    <div class="col-md-3">
                                        <div class="check_box">
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox01" type="checkbox" name="" value="" class="chb" checked>
                                                <label for="checkbox01"></label>
                                            </div>
                                            <!--<p><span> Handmade</span>A calligraphic, handwritten or script font.</p>-->

                                            <div class="images_box">
                                                 <img src="https://kindlesdirectpublishing.com/questionnaire/book-cover/images/book/02.jpg" width="100%" alt="logo">
                                            </div>
                                        </div>
                                    </div>
                                      <?php }else if($data_value->book_cover_category == "Book_cover_3"){ ?>
                                    <div class="col-md-3">
                                        <div class="check_box">
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox02" type="checkbox" name="" value="" class="chb" checked> 
                                                <label for="checkbox02"></label>
                                            </div>
                                            <!--<p><span> Font meaning</span>A font with a tweak that symbolize company/ product/service</p>-->

                                            <div class="images_box">
                                                <img src="https://kindlesdirectpublishing.com/questionnaire/book-cover/images/book/03.jpg" width="100%" alt="logo">
                                            </div>
                                        </div>
                                    </div>
                                      <?php }else if($data_value->book_cover_category == "Book_cover_4"){ ?>
                                    <div class="col-md-3">
                                        <div class="check_box">
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox03" type="checkbox" name="" value="" class="chb" checked>
                                                <label for="checkbox03"></label>
                                            </div>
                                            <!--<p><span> Initials</span>Monogram with Company name initials.</p>-->

                                            <div class="images_box">
                                               <img src="https://kindlesdirectpublishing.com/questionnaire/book-cover/images/book/05.jpg" width="100%" alt="logo">
                                            </div>
                                        </div>
                                    </div>
                                      <?php }else if($data_value->book_cover_category == "Book_cover_5"){ ?>
                                    <div class="col-md-3">
                                        <div class="check_box">
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox04" type="checkbox" name="" value="" class="chb" checked>
                                                <label for="checkbox04"></label>
                                            </div>
                                            <!--<p><span> Font including in a shape</span>Company name inside / squares / ovals / rectangles or combined shapes.</p>-->

                                            <div class="images_box">
                                                 <img src="https://kindlesdirectpublishing.com/questionnaire/book-cover/images/book/06.jpg" width="100%" alt="logo">
                                            </div>
                                        </div>
                                    </div>
                                      <?php }else if($data_value->book_cover_category == "Book_cover_6"){ ?>
                                     <div class="col-md-3">
                                        <div class="check_box">
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox05" type="checkbox" name="" value="" class="chb" checked>
                                                <label for="checkbox05"></label>
                                            </div>
                                            <!--<p><span> Font including in a shape</span>Company name inside / squares / ovals / rectangles or combined shapes.</p>-->

                                            <div class="images_box">
                                                 <img src="https://kindlesdirectpublishing.com/questionnaire/book-cover/images/book/07.jpg" width="100%" alt="logo">
                                            </div>
                                        </div>
                                    </div>
                                      <?php }else if($data_value->book_cover_category == "Book_cover_7"){ ?>
                                     <div class="col-md-3">
                                        <div class="check_box">
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox06" type="checkbox" name="book_detail[logo_detail_cover_category]" value="" class="chb"  checked>
                                                <label for="checkbox06"></label>
                                            </div>
                                            <!--<p><span> Font including in a shape</span>Company name inside / squares / ovals / rectangles or combined shapes.</p>-->

                                            <div class="images_box">
                                                 <img src="https://kindlesdirectpublishing.com/questionnaire/book-cover/images/book/08.jpg" width="100%" alt="logo">
                                            </div>
                                        </div>
                                    </div>
                                      <?php }else if($data_value->book_cover_category == "Book_cover_8"){ ?>
                                     <div class="col-md-3">
                                        <div class="check_box">
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox07" type="checkbox" name="book_detail[logo_detail_cover_category]" value="" class="chb" checked>
                                                <label for="checkbox07"></label>
                                            </div>
                                            <!--<p><span> Font including in a shape</span>Company name inside / squares / ovals / rectangles or combined shapes.</p>-->

                                            <div class="images_box">
                                                 <img src="https://kindlesdirectpublishing.com/questionnaire/book-cover/images/book/09.jpg" width="100%" alt="logo">
                                            </div>
                                        </div>
                                    </div>
                                      <?php }else if($data_value->book_cover_category == "Book_cover_9"){ ?>
                                     <div class="col-md-3">
                                        <div class="check_box">
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox08" type="checkbox" name="book_detail[logo_detail_cover_category]" value="" class="chb" checked>
                                                <label for="checkbox08"></label>
                                            </div>
                                            <!--<p><span> Font including in a shape</span>Company name inside / squares / ovals / rectangles or combined shapes.</p>-->

                                            <div class="images_box">
                                                 <img src="https://kindlesdirectpublishing.com/questionnaire/book-cover/images/book/10.jpg" width="100%" alt="logo">
                                            </div>
                                        </div>
                                    </div>
                                      <?php }else if($data_value->book_cover_category == "Book_cover_10"){ ?>
                                     <div class="col-md-3">
                                        <div class="check_box">
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox09" type="checkbox" name="book_detail[logo_detail_cover_category]" value="" class="chb" checked>
                                                <label for="checkbox09"></label>
                                            </div>
                                            <!--<p><span> Font including in a shape</span>Company name inside / squares / ovals / rectangles or combined shapes.</p>-->

                                            <div class="images_box">
                                                 <img src="https://kindlesdirectpublishing.com/questionnaire/book-cover/images/book/14.jpg" width="100%" alt="logo">
                                            </div>
                                        </div>
                                    </div>
                                      <?php }else if($data_value->book_cover_category == "Book_cover_11"){ ?>
                                    <div class="col-md-3">
                                        <div class="check_box">
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox11" type="checkbox" name="book_detail[logo_detail_cover_category]" value="" class="chb" checked>
                                                <label for="checkbox11"></label>
                                            </div>
                                            <!--<p><span> Font including in a shape</span>Company name inside / squares / ovals / rectangles or combined shapes.</p>-->

                                            <div class="images_box">
                                                 <img src="https://kindlesdirectpublishing.com/questionnaire/book-cover/images/book/12.jpg" width="100%" alt="logo">
                                            </div>
                                        </div>
                                    </div>
                                      <?php }else if($data_value->book_cover_category == "Book_cover_12"){ ?>
                                    <div class="col-md-3">
                                        <div class="check_box">
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox11" type="checkbox" name="book_detail[logo_detail_cover_category]" value="" class="chb" checked>
                                                <label for="checkbox11"></label>
                                            </div>
                                            <!--<p><span> Font including in a shape</span>Company name inside / squares / ovals / rectangles or combined shapes.</p>-->

                                            <div class="images_box">
                                                 <img src="https://kindlesdirectpublishing.com/questionnaire/book-cover/images/book/13.jpg" width="100%" alt="logo">
                                            </div>
                                        </div>
                                    </div>
                                    <?php } ?>
                                                                        
                                <!-- End of Section 1 -->
                            </div>
                           
                            
                                <div class="panel-body">
                               <div class="row">
                                        <div class="col-md-12">
                                           
                                             <div class="attachmenttext">
                                                  <p>Download</p>
                                              <?php 
                                                  $data_img = json_decode($return['company_attachment']);
                                                  foreach($data_img as  $key => $value){ ?>
                                                 
                                                 <a href="./images/uploads/<?php echo $value; ?>" download>Attachment Download</a>
                                                
                                               
                                               <?php } ?>
                                               
                                               </div>
                                        </div>
                                    </div>
                                    </div>
                                  
                                    
                                   
                        </div>
                    </div>
                    
                </div>
            </div>
        </form>
        <!-- END -->
    </section>
  
  


   <?php include "includes/footer.php"?>