<!DOCTYPE html>
<html> 
<body> 
<?php
echo '<link rel='.'"'.'stylesheet'.'"'. 'type='.'"'.'text/css'.'"'. 'href='.'"'.'https://amjaysinglestoretest.myappts.ca/src/assets/ext/bootstrap/css/bootstrap.min.css?52FX8'.'"'.'>'; 
echo '<link rel='.'"'.'stylesheet'.'"'. 'type='.'"'.'text/css'.'"'. 'href='.'"'.'https://amjaysinglestoretest.myappts.ca/src/assets/ext/jquery-ui/jquery-ui.min.css?52FX8'.'"'.'>'; 
echo '<link rel='.'"'.'stylesheet'.'"'.'type='.'"'.'text/css'.'"'. 'href='.'"'.'https://amjaysinglestoretest.myappts.ca/src/assets/ext/jquery-qtip/jquery.qtip.min.css?52FX8'.'"'.'>'; 
echo '<link rel='.'"'.'stylesheet'.'"'. 'type='.'"'.'text/css'.'"'. 'href='.'"'.'https://amjaysinglestoretest.myappts.ca/src/assets/ext/trumbowyg/ui/trumbowyg.min.css?52FX8'.'"'.'>'; 
echo '<link rel='.'"'.'stylesheet'.'"'. 'type='.'"'.'text/css'.'"'. 'href='.'"'.'https://amjaysinglestoretest.myappts.ca/src/assets/css/backend.css?52FX8'.'"'.'>'; 
echo '<link rel='.'"'.'stylesheet'.'"'. 'type='.'"'.'text/css'.'"'. 'href='.'"'.'https://amjaysinglestoretest.myappts.ca/src/assets/css/general.css?52FX8'.'"'.'>'; 
echo '<link rel='.'"'.'stylesheet'.'"'. 'type='.'"'.'text/css'.'"'. 'href='.'"'.'https://amjaysinglestoretest.myappts.ca/src/assets/js/popup.js?52FX8'.'"'.'>'; 
require('config.php');
$linkID = new PDO('mysql:host='.Config::DB_HOST.';dbname='.Config::DB_NAME, Config::DB_USERNAME, Config::DB_PASSWORD);
$linkID->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Setting ERRMODE
$q = intval($_GET['q']);

$result = $linkID->query("SELECT * FROM millie_service WHERE service='".$q."'")->fetchAll(PDO::FETCH_ASSOC);
echo $result[0]['service']; 
if($result[0]['service'] == null){

?>
    <div id="form-group">
<label for="email_header">Email Header:</label><a href="https://myappts.org/images/header.png" target="_blank"><image src="info-icon.png" width="20" height="20"></a><br> 
<textarea id="email_header" name="email_header" style="width: 1223px; height: 70px;"></textarea><br>
</div> 

<div id="form-group">
<label for="email_description">Email Description:</label><a href="https://myappts.org/images/description.png" target="_blank"><image src="info-icon.png" width="20" height="20"></a><br>
<textarea id="email_description" name="email_description" style="width: 1223px; height: 70px;"></textarea><br>
</div>

<div id="form-group">
<image src="https://myappts.org/images/1.png" width="20" height="20"><label for="email_form">Email Form Link:</label><br> 
<textarea id="email_form" name="email_form" style="width: 1223px; height: 70px;"></textarea><br> 
</div> 

<div id="form-group">
<image src="https://myappts.org/images/1.png" width="20" height="20"><label for="email_form_name">Email Form Link Name: </label><br> 
<textarea id="email_form_name" name="email_form_name" style="width: 1223px; height: 70px;"></textarea><br>  
</div> 

<div id="form-group">
<image src="https://myappts.org/images/1.png" width="20" height="20"><label for="email_form_description">Email Form Link Description:</label><br> 
<textarea id="email_form_description" name="email_form_description" style="width: 1223px; height: 70px;"></textarea><br>  
 </div>
 
<div id="form-group">
<image src="https://myappts.org/images/2.png" width="20" height="20"><label for="email_form2">Email Form Two Link</label><br> 
<textarea id="email_form2" name="email_form2" style="width: 1223px; height: 70px;"></textarea><br>
</div> 

<div id="form-group">
<image src="https://myappts.org/images/2.png" width="20" height="20"><label for="email_header">Email Form Two Link Name</label><br> 
<textarea id="email_form2_name" name="email_form2_name" style="width: 1223px; height: 70px;"></textarea><br>
</div> 

<div id="form-group">
<image src="https://myappts.org/images/2.png" width="20" height="20"><label for="email_header">Email Form Two Link Description</label><br> 
<textarea id="email_form2_description" name="email_form2_description" style="width: 1223px; height: 70px;"></textarea><br>
 </div>
 
 <div id="form-group">
<image src="https://myappts.org/images/3.png" width="20" height="20"><label for="email_header">Email Form Three Link</label><br> 
<textarea id="email_form3" name="email_form3" style="width: 1223px; height: 70px;"></textarea><br>
 </div>
 
 <div id="form-group">
<image src="https://myappts.org/images/3.png" width="20" height="20"><label for="email_header">Email Form Three Link Name</label><br> 
<textarea id="email_form3_name" name="email_form3_name" style="width: 1223px; height: 70px;"></textarea><br>  
 </div>
 
 <div id="form-group">
<image src="https://myappts.org/images/3.png" width="20" height="20"><label for="email_header">Email Form Three Link Description</label><br> 
<textarea id="email_form3_description" name="email_form3_description" style="width: 1223px; height: 70px;"></textarea><br>  
</div> 
<label for="reminder_on_off">Turn Reminders for this service off/on (checked for on, unchecked for off)</label>
<select id="reminder_on_off" name="reminder_on_off">
<option value="ON" name="reminder_on_off">ON</option>
<option value="OFF" name="reminder_on_off">OFF</option>

</select><br>

<input type="submit" id="reminder_submit" name="reminder_submit"> 

<?php
}else{

foreach($result as $p){
    
    ?>
<div id="form-group">
<label for="email_header">Email Header:</label><a href="https://myappts.org/images/header.png" target="_blank"><image src="info-icon.png" width="20" height="20"></a><br> 
<textarea id="email_header" name="email_header" style="width: 1223px; height: 70px;"><?php echo $p['email_header'] ?></textarea><br>
</div> 

<div id="form-group">
<label for="email_description">Email Description:</label><a href="https://myappts.org/images/description.png" target="_blank"><image src="info-icon.png" width="20" height="20"></a><br> 
<textarea id="email_description" name="email_description" style="width: 1223px; height: 70px;"><?php echo $p['email_description'] ?></textarea><br>
</div>

<div id="form-group">
<image src="https://myappts.org/images/1.png" width="20" height="20"><label for="email_form">Email Form Link:</label><br> 
<textarea id="email_form" name="email_form" style="width: 1223px; height: 70px;"><?php echo $p['email_form'] ?></textarea><br> 
</div> 

<div id="form-group">
<image src="https://myappts.org/images/1.png" width="20" height="20"><label for="email_form_name">Email Form Link Name: </label><br> 
<textarea id="email_form_name" name="email_form_name" style="width: 1223px; height: 70px;"><?php echo $p['email_form_name'] ?></textarea><br>  
</div> 

<div id="form-group">
<image src="https://myappts.org/images/1.png" width="20" height="20"><label for="email_form_description">Email Form Link Description:</label><br> 
<textarea id="email_form_description" name="email_form_description" style="width: 1223px; height: 70px;"><?php echo $p['email_form_description'] ?></textarea><br>  
 </div>
 
<div id="form-group">
<image src="https://myappts.org/images/2.png" width="20" height="20"><label for="email_form2">Email Form Two Link</label><br> 
<textarea id="email_form2" name="email_form2" style="width: 1223px; height: 70px;"><?php echo $p['email_form_two'] ?></textarea><br>
</div> 

<div id="form-group">
<image src="https://myappts.org/images/2.png" width="20" height="20"><label for="email_header">Email Form Two Link Name</label><br> 
<textarea id="email_form2_name" name="email_form2_name" style="width: 1223px; height: 70px;"><?php echo $p['email_form_two_name'] ?></textarea><br>
</div> 

<div id="form-group">
<image src="https://myappts.org/images/2.png" width="20" height="20"><label for="email_header">Email Form Two Link Description</label><br> 
<textarea id="email_form2_description" name="email_form2_description" style="width: 1223px; height: 70px;"><?php echo $p['email_form_two_description'] ?></textarea><br>
 </div>
 
 <div id="form-group">
<image src="https://myappts.org/images/3.png" width="20" height="20"><label for="email_header">Email Form Three Link</label><br> 
<textarea id="email_form3" name="email_form3" style="width: 1223px; height: 70px;"><?php echo $p['email_form_three'] ?></textarea><br>
 </div>
 
 <div id="form-group">
<image src="https://myappts.org/images/3.png" width="20" height="20"><label for="email_header">Email Form Three Link Name</label><br> 
<textarea id="email_form3_name" name="email_form3_name" style="width: 1223px; height: 70px;"><?php echo $p['email_form_three_name'] ?></textarea><br>  
 </div>
 
 <div id="form-group">
<image src="https://myappts.org/images/3.png" width="20" height="20"><label for="email_header">Email Form Three Link Description</label><br> 
<textarea id="email_form3_description" name="email_form3_description" style="width: 1223px; height: 70px;"><?php echo $p['email_form_three_description'] ?></textarea><br>  
</div> 
<label for="reminder_on_off">Turn Reminders for this service off/on (checked for on, unchecked for off)</label>
<select id="reminder_on_off" name="reminder_on_off">
<?php
if($p['send_reminder'] == "ON"){
?>
<option value="ON" name="reminder_on_off" selected>ON</option>
<option value="OFF" name="reminder_on_off">OFF</option>

<?php
}else{
?>
<option value="ON" name="reminder_on_off" >ON</option>
<option value="OFF" name="reminder_on_off" selected>OFF</option>
<?php
}
?>
</select><br>

<input type="submit" id="reminder_submit" name="reminder_submit"> 
<?php
}
}
?>
</body>
</html>