/home2/kerimkazan/dvf/magaza/inc/settings.php
<?php if(!defined('ADMIN_INCLUDED')) { exit; } ?>
<?php
if(!m_authority(m_admin('authoritys'),'settings'))
{
m_redirect(ADMIN_URL);
}
?>
<?php
$informations = $db->table('settings')->where('id','=',1)->get();
if($informations['total_count']=='0')
{
m_redirect(ADMIN_URL);
}
$info = $informations['data'][0];
?>
<div class="card mt-2 mb-3">
<div class="card-header fw-bold">Hesap Bilgileri</div>
<div class="card-body">
<?php
if($_POST)
{
$data = [
'brand' => m_u_p('brand'),
'address' => m_u_p('address'),
'phone' => m_u_p('phone'),
'email' => m_u_p('email'),
'usd_try' => m_u_p('usd_try'),
'eur_try' => m_u_p('eur_try'),
'discount' => m_u_p('discount')
];
$query = $db->table('settings')->where('id','=',1)->update($data);
if($query)
{
echo m_alert('Başarılı','İşleminiz başarıyla gerçekleştirildi.');
}
else
{
echo m_alert('Hata','İşlem gerçekleştirilirken bir hata oluştu.');
}
}
$informations = $db->table('settings')->where('id','=',1)->get();
$info = $informations['data'][0];
?>
<form action="" method="post" enctype="multipart/form-data">
<div class="mb-2">
<label class="form-label fw-bold">Marka</label>
<input type="text" class="form-control" name="brand" value="<?php echo $info['brand']; ?>" required>
</div>
<div class="mb-2">
<label class="form-label fw-bold">Adres</label>
<input type="text" class="form-control" name="address" value="<?php echo $info['address']; ?>" required>
</div>
<div class="mb-2">
<label class="form-label fw-bold">Telefon</label>
<input type="text" class="form-control" name="phone" value="<?php echo $info['phone']; ?>" required>
</div>
<div class="mb-2">
<label class="form-label fw-bold">Email</label>
<input type="text" class="form-control" name="email" value="<?php echo $info['email']; ?>" required>
</div>
<div class="mb-2">
<label class="form-label fw-bold">Dolar Kuru</label>
<input type="text" class="form-control" name="usd_try" value="<?php echo $info['usd_try']; ?>" required>
</div>
<div class="mb-2">
<label class="form-label fw-bold">Euro Kuru</label>
<input type="number" class="form-control" name="eur_try" value="<?php echo $info['eur_try']; ?>" required>
</div>
<div class="mb-2">
<label class="form-label fw-bold">Döviz Son Güncellenme</label>
<input type="text" class="form-control" name="currency_update" value="<?php echo m_date_to_tr($info['currency_update']); ?>" disabled>
</div>
<div class="mb-2">
<label class="form-label fw-bold">Varsayılan İskonto %</label>
<input type="number" class="form-control" name="discount" value="<?php echo $info['discount']; ?>" required>
</div>
<button class="btn btn-primary w-100" type="submit"><i class="fa fa-save"></i> Kaydet</button>
</form>
</div>
</div>