<?php
	include(''. $config['LocalPath'] . '/includes/.sql_con.php');


if(isset($_POST['name'])){
	$new_schedule_name=$_POST['name'];
		$insert_schedule ="INSERT INTO SCHEDULE_ID (DESCRIPTION) VALUES ('$new_schedule_name')";
			mysql_query($insert_schedule)or die ('Add Failed</br>'.mysql_error());
echo "Added Sucessfully!";
}
?>
<div class="row">
	<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
		<div class="card card-mini">
			<div class="card-header">
				<div class="card-title"><b><center>Add a Schedule</center></b></div>
			</div>
		<div class="card-body">

			<form class="form form-horizontal" method="post">
				<div class="form-group">
					<label class="col-md-3 control-label"><b>Schedule Name</b></label>
					<div class="col-md-8">
						<input type="text" name="name" class="form-control" placeholder="Montly">
						<h6>Note-- Currently a schedule will not function without manual scripting</br>To complete script contact <a href="mailto:chris.streicher@hostirian.com?Subject=Add%20Schedule%20Help" target="_top">Chris Streicher</a></h6>
					</div>
				</div>
		<!--<div class="form-group">
			<div class="col-md-3">
				<label class="control-label"><b>SOP URL</b></label>
			</div>
			<div class="col-md-8">
				<input type="text"  name="sop" class="form-control" placeholder="http://mission.hostiran.com/">
			</div>
		</div>-->
		<!--<div class="form-group">
			<label class="col-md-3 control-label">Price</label>
			<div class="col-md-9">
				<div class="input-group">
					<span class="input-group-addon">$</span>
					<input type="text" class="form-control" aria-label="Amount (to the nearest dollar)">
				</div>
			</div>
		</div>-->
		<!--<div class="form-group">
			<label class="col-md-3 control-label">Type</label>
			<div class="col-md-9">
				<div class="radio radio-inline">
					<input type="radio" name="radio4" id="radio10" value="option10">
					<label for="radio10">
					Global
					</label>
				</div>
				<div class="radio radio-inline">
					<input type="radio" name="radio4" id="radio11" value="option11" checked>
					<label for="radio11">
					Local
					</label>
				</div>
			</div>
		</div>-->
		<!--<div class="form-group">
			<label class="col-md-3 control-label">Cover</label>
			<div class="col-md-4">
				<div class="input-group">
					<select class="select2">
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
					</select>
					<span class="input-group-addon">Years</span>
				</div>
			</div>
		</div>-->
<div class="form-footer">
	<div class="form-group">
		<div class="col-md-6 col-md-offset-3">
			<center>	<button type="submit" class="btn btn-primary">Add Schedule</button>
			<button type="button" class="btn btn-default">Cancel</button> </center>
		</div>
	</div>
</div>
</form>
</div>
</div>
</div>
<div class="row">
	<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5">
		<div class="card card-mini">
      <div class="card-header">
        <div class="card-title"><b>Active Schedules</b></div>
        <ul class="card-action">
          <li>
            <a href="#" onClick="MyFunction();">
              <i class="fa fa-refresh"></i>
            </a>
		<script>
			function MyFunction() {
				location.reload();
			}
		</script>
          </li>
        </ul>
      </div>
      <div class="card-body no-padding table-responsive">
        <table class="table card-table">
          <thead>
            <tr>
              <th><b>Schedule Name</b></th>
            </tr>
          </thead>
          <tbody>
<?php


$schedule_result = mysql_query('SELECT DESCRIPTION FROM SCHEDULE_ID ');

while ($row=mysql_fetch_array($schedule_result)){
        $schedule_name=$row['DESCRIPTION'];
        


?>
            <tr>
              <td><?php echo $schedule_name;?></td>
            </tr>
<?php
}
?>
          </tbody>
        </table>
      </div>
    </div>

	</div>
</div>	
