<?php

$con = new mysqli("localhost","root","toor","museam_db");
mysqli_set_charset($con, 'utf8');

// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

$super_name=$_POST['isdb'];
$super_id=$_POST['isid'];

$result = $con->query("SELECT * FROM  ".$_POST['isdb']." WHERE id=".$_POST['isid']." AND used=0;");
if ($result)
$row=$result->fetch_assoc();
 

 $full_name=$row['full_name'];
 $address=$row['address'];
 $phone=$row['phone'];
 $salary=$row['salary'];
 $ident_card=$row['ident_card'];
 $degree_title=$row['degree_title'];
 $degree_date=$row['degree_date'];
 $master_title=$row['master_title'];
 $master_date=$row['master_date'];
    

if(!isset($_POST['isid'])||!isset($_POST['isdb']))
	echo'Cannot get packets';

else


echo'
            <div class="row">       
                <div class="box"> 
                    <div id="wrapper">
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                        <tr>
                                            <th>Κωδικός</th>
                                            <th>Προϋπ.</th>
                                            <th>Ημερ.Έναρξης:</th>
                                            <th>Ημερ.Λήξης:</th>
                                            <th>Επισκευαστής</th>
                                            <th>Υπεύθ.Προϋπ.</th>
                                            <th>Υπεύθ.Επίβλ.</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr class="">
                                        <td><?=$row['kwdikos']?></td>
                                        <td><?=$row['budget']?></td>
                                        <td><?=$row['start_date']?></td>
                                        <td><?=$row['end_date']?></td>
                                        <td><?=$row['techname']?></td>
                                        <td><?=$row['managername']?></td>
                                        <td><?=$row['archaeologistname']?></td>
                                        </tr>       
                                        <div id="result"></div>
                                    </tbody>
                                </table>
                            </div>  
                        </div>
                    </div>
                </div>
            </div>
';


















	echo' 

    <section class="top_pad" id="arxaiologous">
        <div class="container"> 

            <div class="row">
                <div class="col-lg-12 text-center">
                    <hr class="star-primary">
                    <h2 class="intro-text text-center">ΕΠΕΞΕΡΓΑΣΙΑ
                            <strong>'.$super_name.'</strong>
                    </h2>
                    <hr class="star-primary2">
                </div>
            </div>
        
            <div class="row">
                <div class="col-lg-12 text-center">
                    <p class="main_img_text2"> 
                    <?=$anaf_msg?> </p>
                </div>
            </div>

            <div class="row">       
                <div class="box">
                    <div class="col-md-6">  

                        <table class="main_table">
                            <tr>

                            <td>
                            <figure class="cap-left">
                                        <img class="img_inside_box" src="images/images_inside_box/ypalliloi/arxaiologoi/arxaiologoi.jpg" alt="">
                                        <figcaption>Θεμέλης Πέτρος | Αρχαιολόγος.</figcaption>
                                    </figure>
                            </td>
                            <td rowspan="2">

                            <form method="get" action="">
                                    <div class="main_div1">

                                       <label>Ονοματεπώνυμο:</label>
                                        <div class="form-group input-group">
                                            <span class="input-group-addon"> <i class="fa fa-user"> </i> </span>
                                            <input name="anaf_name" value="'.$full_name.'" type="text" class="form-control" placeholder="Δώστε ένα ονοματεπώνυμο.">
                                        </div>

                                         <label>Διεύθυνση:</label>
                                        <div class="form-group input-group">
                                            <span class="input-group-addon"> <i class="fa fa-location-arrow"> </i> </span>
                                            <input name="anaf_adr" value="'.$address.'"type="text" class="form-control" placeholder="Δώστε μία διεύθυνση.">
                                        </div>

                                         <label>Τηλέφωνο:</label>
                                        <div class="form-group input-group">
                                            <span class="input-group-addon"><i class="fa fa-phone"> </i></span>
                                            <input name="anaf_numb" value="'.$phone.'"type="text" class="form-control" placeholder="Δώστε ένα τηλέφωνο.">
                                        </div>

                                         <label>Μισθός:</label>
                                        <div class="form-group input-group">
                                            <span class="input-group-addon"><i class="fa fa-euro"> </i></span>
                                            <input name="anaf_sal" value="'.$salary.'" type="text" class="form-control" placeholder="Δώστε ένα μισθό.">
                                        </div>

                                         <label>Αριθμό Ταυτότητας:</label>
                                        <div class="form-group input-group">
                                            <span class="input-group-addon"> <i class="fa fa-newspaper-o"> </i> </span>
                                            <input name="anaf_ident"  value="'.$ident_card.'" type="text" class="form-control" placeholder="Δώστε ένα αριθμό ταυτότητας.">
                                        </div>

                            </td>
                            <td rowspan="2">
                               <div class="main_div1">

                                          <label>Πτυχίο:</label>
                                        <div class="form-group input-group">
                                            <span class="input-group-addon"> <i class="fa fa-file-text"> </i> </span>
                                            <input name="anaf_degr" value="'.$degree_title.'" type="text" class="form-control" placeholder="Δώστε ένα τίτλο πτυχίου.">
                                        </div>

                                          <label>Ημερομηνία Κτήσης Πτυχίου:</label>
                                        <div class="form-group input-group">
                                            <span class="input-group-addon"> <i class="fa fa-calendar"> </i> </span>
                                            <input name="anaf_degdate" value="'.$degree_date.'" type="date" class="form-control">
                                        </div>

                                          <label>Μεταπτυχιακό:</label>
                                        <div class="form-group input-group">
                                            <span class="input-group-addon"> <i class="fa fa-graduation-cap"> </i> </span>
                                            <input name="anaf_master" value="'.$master_title.'" type="text" class="form-control" placeholder="Δώστε ένα τίτλο μεταπτυχιακού.">
                                        </div>

                                         <label>Ημερομηνία Κτήσης Μεταπτυχιακού:</label>
                                        <div class="form-group input-group">
                                            <span class="input-group-addon"> <i class="fa fa-calendar"> </i> </span>
                                            <input name="anaf_masdate" value="'.$master_date.'" type="date" class="form-control">
                                        </div>

                                    <label>Για καταχώρηση πατήστε εδώ:</label>
                                        <div class="form-group input-group">
                                            <input type="hidden" name="save" value="anaf">
                                            <input type="submit" onclick="this.form.submit();" class="btn btn-default"></submit>
                                    <button class="btn btn-danger btn-xs" onclick="delete_from(\'archaeologist\', \''.$super_id.'\')">'.'<i class="fa fa-trash-o">'.'</i>'.'</button>

                                        </div>
                                        </div>
                                </div>
                            </td>
                            </form>

                            </tr>
                            <tr>
                                <td>
                                    <div id="info_box">           
                                        <p id="info_p"> <strong> <i class="fa fa-user"> </i> Ονοματεπώνυμο: </strong> Θεμέλης Πέτρος</p>
                                        <p id="info_p"> <strong> <i class="fa fa-map-marker"> </i> Διεύθυνση: </strong> Ψαρομηλίγκου 33</p>
                                        <p id="info_p"> <strong> <i class="fa fa-phone"> </i> Τηλέφωνο: </strong> 2810257671 </p>
                                    </div> 
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </section>


';

?>