<?php
include('nav.php');
include('response.php');

// Connect to the database
$mysqli = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);

// output any connection error
if ($mysqli->connect_error) {
	die('Error : ('.$mysqli->connect_errno .') '. $mysqli->connect_error);
}

// the query
$query2 = "SELECT * FROM company";
$result2 = mysqli_query ($mysqli, $query2);


if($result2) {
	while ($row = mysqli_fetch_assoc($result2)) {		
		$currency = $row['currency']; // customer address (shipping)
		$vat_rate = $row['vat_rate']; // customer town (shipping)


		
	}
}

/* close connection */
$mysqli->close();

?>

<script>
	$(function(){
    $("#datepicker22").datepicker({
        dateFormat: "yy-mm-dd"
    });	
});
</script>
<script>
	$(function(){
    $("#datepicker23").datepicker({
        dateFormat: "yy-mm-dd"
    });	
});
</script> 
<div style="margin-top: 15px" class="hp-main-layout-content">
<div class="row mb-32 gy-32">
				<div class="col-12">
    <div style="padding-left: 10px" class="page-header-modern">
            <h2 class="header-modern">New Schedule</h2>

    <div class="user-dropdown dropdown">
        <button class="btn btn-user" type="button" data-toggle="dropdown">
            <i class=""></i>
             <img src="images/icon/invoice360-user.png" height=30px; width=30px;>
            <span class="caret"></span>
        </button>

        <ul class="dropdown-menu user-menu" aria-labelledby="userDropdown">
            <li>
                <a class="dropdown-item" href="">
                    <i class="fa fa-user me-2"></i> <?php echo strtok($_SESSION['user_name'], ' ');?> (<?php echo $_SESSION['role']; ?>)
                </a>
            </li>

            <li>
                <a class="dropdown-item" href="Admin/payment-details.php">
                    <i class="fa fa-credit-card"></i> Billing history
                </a>
            </li>

            <li>
                <a class="dropdown-item" href="Admin/company-profile.php">
                    <i class="fa fa-cog me-2"></i> Settings
                </a>
            </li>

            <li><hr class="dropdown-divider"></li>

            <li>
                <a class="dropdown-item text-danger" href="logout.php">
                    <i class="fa fa-sign-out me-2"></i> Sign Out
                </a>
            </li>
        </ul>
        </div>
    </div>
</div>

</div>


                    <div class="content-body">
    <div class="container-fluid">
       
    <div id="response" class="alert alert-success" style="display:none;">
			<a href="#" class="close" data-dismiss="alert">&times;</a>
			<div class="message"></div>
		</div>
       
      


                    <div class="row">
            <div class="col-lg-12">

            
                <div class="card">
                            
                        <div class="card-body">
                        <div class="form-validation">
                        <form class="needs-validation" method="post" id="add_schedule">
							<input type="hidden" name="action" value="add_schedule">
                            <input type="hidden" name="end" value="2021-07-26">
                                <div class="row">
                                    <div class="col-xl-6">
                                    
                                       
                                       
                                        <div class=" row">
                                        <div class="form-group">
                                            <label class="col-lg-4 col-form-label" for="validationCustom01">Date
                                                <span class="text-danger">*</span>
                                            </label>
                                        <div class="col-lg-6 input-group date">
                                            <input type="text" id="datepicker22" class="form-control required" name="start" placeholder="YYYY/MM/DD" required />
				                            
                                               
                                        </div>
                                        </div>
                                        </div>
                                        
                                                            
                                        
                                        
                                        <div class="mb-24 row">
                                            <label class="col-lg-4 col-form-label" for="validationCustom01">Transaction Type
                                                <span class="text-danger">*</span>
                                            </label>
                                            <div class="col-xl-6">
                                            <div class="input-group">
                                                                                      
                                            <select name="schedule_type"  class="form-control required" required>
								<option value="renewal" selected>Contract Renewal</option>
								<option value="event">Event</option>
								    		</select>
                                                </div>
                                                
                                            </div>
                                        </div>  
                                        
                                        <div class="mb-24 row">
                                            <label class="col-lg-4 col-form-label" for="validationCustom01">Client/Event Location
                                                
                                            </label>
                                            <div class="col-xl-6">
                                            <div class="input-group">
                                                                                      
                                                <input type="text" class="form-control" name="client_location" class="form-control required" placeholder="Client/Event Location" aria-describedby="sizing-addon1" >
                                                </div>
                                                
                                            </div>
                                        </div>

 
                                    </div>
                                    <div class="col-xl-6">
                                    
                                    <div class="mb-24 row">
                                            <label class="col-lg-4" for="validationCustom01">Expected Amount <br><span style="font-size: 11px;">(If Contract Renewal)</span>
                                           
                                            </label>
                                            <div class="col-xl-6">
                                            <div class="input-group">
                                            <span class="input-group-addon"><?php echo $currency ?></span>                                           
                                                <input type="text" class="form-control" name="schedule_amount" class="form-control required" placeholder="0.00" aria-describedby="sizing-addon1">
                                                </div>
                                                
                                            </div>
                                        </div>
                                        <div class="mb-24 row">
                                            <label class="col-lg-4 col-form-label" for="validationCustom01">Schedule Title
                                            <span class="text-danger">*</span>   
                                            </label>
                                            <div class="col-xl-6">
                                            <div class="input-group">
                                                                                      
                                            <textarea class="form-control required" name="title" placeholder="Enter Description" rows="3" required></textarea>
                                                </div>
                                                
                                            </div>
                                        </div>

                                        <input type="hidden" name="description" value="">
                                                                           



                                        
                                       
                                       
                                            <div class="mb-3 row">
                                            <div class="col-lg-8 ms-auto">
                                                <button type="submit" id="action_add_schedule" class="btn btn-primary"value="Add schedule">Submit</button>
                                                <a href="schedule-list.php" class="btn btn-danger">Close</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <br>
                               
				<br>
			

                            </form>
                        </div>
                    </div>
                    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div>
<div style="height: 500px"></div>

                        
                    
                


<!-- Plugin -->

<script src="app-assets/js/plugin/bootstrap.bundle.min.js"></script>
    <script src="app-assets/js/plugin/swiper-bundle.min.js"></script>
    <script src="app-assets/js/plugin/jquery.mask.min.js"></script>
    <script src="app-assets/js/plugin/autocomplete.min.js"></script>
    <script src="app-assets/js/plugin/moment.min.js"></script>

    <!-- Layouts -->
    <script src="app-assets/js/layouts/header-search.js"></script>
    <script src="app-assets/js/layouts/sider.js"></script>
    <script src="app-assets/js/components/input-number.js"></script>

    <!-- Base -->
    <script src="app-assets/js/base/index.js"></script>
    <!-- Customizer -->
    <script src="app-assets/js/customizer.js"></script>

    <!-- Charts -->
    <script src="app-assets/js/plugin/apexcharts.min.js"></script>
    <script src="app-assets/js/charts/apex-chart.js"></script>

    <!-- Cards -->
    <script src="app-assets/js/cards/card-advance.js"></script>
    <script src="app-assets/js/cards/card-analytic.js"></script>
    <script src="app-assets/js/cards/card-statistic.js"></script>

    <!-- Pages -->
    <script src="app-assets/js/pages/dashboard-ecommerce.js"></script>

    <!-- Custom -->
    <script src="assets/js/main.js"></script> 
</body>


</html>