<?php require view('theme/header'); ?>

<div class="container">
	<div class="row">
		<?php if($user["user_balance"] < 10): ?>
			<div class="col-md-12">
				<div class="alert alert-dismissible alert-danger">
					<b>Uyarı!</b>
					<p style="margin:0">Sevgili müşterimiz, bakiyeniz azalmış gibi gözüküyor, sorunsuz sipariş verebilmek için lütfen bakiye yüklemeyi unutmayınız.</p>
				</div>
			</div>
		<?php endif; ?>
		<div class="col-md-8">
			<div class="well">
				<form id="new_order" onsubmit="return false;">

					<div class="form-loader">
						<span class="intro-banner-vdo-play-btn pinkBg">
							<span class="ripple pinkBg"></span>
							<span class="ripple pinkBg"></span>
							<span class="ripple pinkBg"></span>
						</span>
					</div>

					<div class="form-group">
						<label>{ORDER_FORM_CATEGORY_TITLE}:</label>
						<select id="category" class="form-control ">
							{ORDER_FORM_CATEGORIES}
						</select>
					</div>

					<div class="form-group">
						<label>{ORDER_FORM_SERVICE_TITLE}:</label>
						<select id="service" name="service" class="form-control ">
						</select>
					</div>

					<div class="form-group">
						<label>{ORDER_FORM_DESC_TITLE}:</label>
						<div class="panel panel-default">
							<div class="panel-body">
								<small id="description" class="card-text"></small>
							</div>
						</div>
					</div>

					<div class="form-group">
						<label>{ORDER_FORM_LINK_TITLE}:</label>
						<input type="text" name="link" id="link" class="form-control " />
					</div>

					<div id="comment-group" class="form-group hide">
						<label>{ORDER_FORM_COMMENTS_TITLE}:</label>
						<textarea name="comments" id="comments" class="form-control " rows="8"></textarea>
					</div>

					<div id="quantity_div" class="form-group">
						<label>{ORDER_FORM_QUANTITY_TITLE}: <small class="help-block min-max">(Min: <span id="min"></span> - Maks: <span id="max"></span>)</small></label>
						<input type="text" name="quantity" id="quantity" class="form-control " />

					</div>

					<div id="drip-order" class="form-group hide">
						<div class="custom-control custom-checkbox">
							<input type="checkbox" class="custom-control-input" id="drip-check">
							<label class="custom-control-label" for="drip-check">{ORDER_FORM_DRIP_CHECK_TITLE}</label>
						</div>
					</div>

					<div id="drip-group" class="hide">
						<div class="form-group">
							<label>{ORDER_FORM_DRIP_RUNS_TITLE}:</label>
							<input type="text" name="runs" id="runs" class="form-control" value="" />
						</div>

						<div class="form-group">
							<label>{ORDER_FORM_DRIP_INTERVAL_TITLE}:</label>
							<select name="interval" id="interval" class="form-control">
								<option value="0" selected>0</option>
								<option value="5">5</option>
								<option value="10">10</option>
								<option value="15">15</option>
								<option value="20">20</option>
								<option value="25">25</option>
								<option value="30">30</option>
							</select>
							<small class="form-text text-muted">{ORDER_FORM_DRIP_INTERVAL_MESSAGE_TITLE}</small>
						</div>
						<div class="form-group">
							<label>{ORDER_FORM_DRIP_TOTAL_QUANTITY_TITLE}:</label>
							<input type="text" id="total_quantity" class="form-control" value="" /readonly>
						</div>
					</div>

					<div class="form-group">
						<label>{ORDER_FORM_AMOUNT_TITLE}:</label>
						<input type="text" id="amount" class="form-control" value="0" /readonly>
					</div>

					<div class="form-group">
						<button class="btn btn-primary">{ORDER_FORM_SUBMIT}</button>
					</div>

				</form>
			</div>
		</div>
		<style>
		    /* width */
            ::-webkit-scrollbar {
              width: 10px;
            }
            
            /* Track */
            ::-webkit-scrollbar-track {
              background: #f1f1f1;
            }
            
            /* Handle */
            ::-webkit-scrollbar-thumb {
              background: #888;
            }
            
            /* Handle on hover */
            ::-webkit-scrollbar-thumb:hover {
              background: #555;
            }
		</style>
		<div class="col-md-4">
			<div class="well">
				<ul class="nav nav-tabs">
					<li class="active"><a data-toggle="tab" href="#info">Bilgilendirme</a></li>
					<li><a data-toggle="tab" href="#announcements">Duyurular</a></li>
				</ul>

				<div class="tab-content">
					<div id="info" class="tab-pane fade in active">
						<h4>{INDEX_LOGIN_HELLO}, {USER_USERNAME}</h4>
						<p><b>{INDEX_BALANCE_INFO}: {USER_BALANCE} <?=CURRENCY_SYMBOL?></b></p>
						<p><b>{TOTAL_SPENT_TITLE}: {TOTAL_SPENT} <?=CURRENCY_SYMBOL?></b></p>
						<hr>
						<?= htmlspecialchars_decode($page_content['page_content']) ?>
					</div>
					<div id="announcements" class="tab-pane fade" style="max-height: 650px;overflow-x: scroll;">
						<h4>Duyurular</h4>
						<div class="scroll" style="padding:15px;">
							<?php if($duyurular):
								foreach($duyurular as $duyuru): ?>
									<div class="panel panel-default">
										<div class="panel-heading">
										    <div class="icon" style="float:left; margin-right: 5px; text-align:center; border-radius: 10px; width:20px;
                                              height:20px; 
                                              background-color: <?= $duyuru['duyuru_daire_color'] ?>; color: <?= $duyuru['duyuru_icon_color'] ?>;">
                                              <i class="<?= $duyuru['duyuru_icon'] ?>"></i>
                                            </div>
										    <?=$duyuru['duyuru_title']?></div>
										<div class="panel-body">
											<?=htmlspecialchars_decode($duyuru['duyuru_content'])?>
										</div>
										<div class="panel-footer">
											<?=str_date($duyuru['duyuru_date'])?>
										</div>
									</div>
								<?php endforeach; else: ?>
								<p>Henüz duyuru eklenmemiş.</p>
							<?php endif; ?>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<?php require view('theme/footer'); ?>

