📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
e-ticaretv9.demodesign.com.tr
/
adminco
/
inc
📝
customer_edit.php
← Geri Dön
<?php if(!defined('ADMIN_INCLUDED')) { exit; } ?> <?php $informations = $db->table('customers')->where('id','=',m_a_g('id'))->get(); if($informations['total_count']==0) { m_redirect(ADMIN_URL); } $info = $informations['data'][0]; ?> <div class="container-fluid"> <div class="row"> <div class="col-12"> <div class="page-title-box d-sm-flex align-items-center justify-content-between"> <a href="<?php echo ADMIN_URL; ?>/index.php?page=customers" class="menu_link"><h4 class="mb-sm-0 font-size-18"><?php echo LGA_CUSTOMERS; ?></h4></a> <div class="page-title-right"> <ol class="breadcrumb m-0"> <li class="breadcrumb-item"><a href="<?php echo ADMIN_URL; ?>"><?php echo LGA_HOME; ?></a></li> <li class="breadcrumb-item active"><?php echo LGA_CUSTOMERS; ?></li> </ol> </div> </div> </div> </div> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-header"> <h4 class="card-title"><?php echo LGA_CUSTOMER_EDIT; ?></h4> </div> <div class="card-body p-4"> <?php if(m_p_check()) { if(DEMO) { echo m_admin_alert(LGA_ERROR,LGA_DEMO_ERROR); } else { if(m_a_p('password')=='') { $password = $info['password']; } else { $password = m_password(m_a_p('password')); } $data = [ 'identity_number' => m_a_p('identity_number'), 'name' => m_a_p('name'), 'lastname' => m_a_p('lastname'), 'phone' => m_a_p('phone'), 'email' => m_a_p('email'), 'gender' => m_a_p('gender'), 'country' => m_a_p('country'), 'password' => $password, 'status' => m_a_p('status') ]; $query = $db->table('customers')->where('id','=',m_a_g('id'))->update($data); if($query) { echo m_admin_alert(LGA_SUCCESS,LGA_TRANSACTION_SUCCESS); } else { echo m_admin_alert(LGA_ERROR,LGA_TRANSACTION_ERROR); } $informations = $db->table('customers')->where('id','=',m_a_g('id'))->get(); $info = $informations['data'][0]; } } ?> <form action="" method="post" enctype="multipart/form-data"> <ul class="nav nav-pills nav-justified" role="tablist"> <li class="nav-item waves-effect waves-light"> <a class="nav-link active" data-bs-toggle="tab" href="#customer_informations" role="tab"> <span class="d-block d-sm-none"><i class="fa fa-info"></i></span> <span class="d-none d-sm-block"><?php echo LGA_CUSTOMER_INFORMATIONS; ?></span> </a> </li> <li class="nav-item waves-effect waves-light"> <a class="nav-link" data-bs-toggle="tab" href="#customer_orders" role="tab"> <span class="d-block d-sm-none"><i class="fa fa-shopping-cart"></i></span> <span class="d-none d-sm-block"><?php echo LGA_CUSTOMER_ORDERS; ?></span> </a> </li> <li class="nav-item waves-effect waves-light"> <a class="nav-link" data-bs-toggle="tab" href="#customer_logs" role="tab"> <span class="d-block d-sm-none"><i class="fa fa-bullseye"></i></span> <span class="d-none d-sm-block"><?php echo LGA_CUSTOMER_LOGS; ?></span> </a> </li> </ul> <div class="tab-content pt-3"> <div class="tab-pane active" id="customer_informations" role="tabpanel"> <div class="mb-3"> <div><label class="form-label"><?php echo LGA_STATUS; ?></label></div> <div class="switch-field"> <input type="radio" id="radio-one" name="status" value="1" <?php if($info['status']==1) { echo 'checked="checked"'; } ?> /> <label for="radio-one"><?php echo LGA_ENABLED; ?></label> <input type="radio" id="radio-two" name="status" value="0" <?php if($info['status']==0) { echo 'checked="checked"'; } ?> /> <label for="radio-two"><?php echo LGA_DISABLED; ?></label> </div> </div> <div class="row"> <div class="col-lg-6 col-sm-12 mb-3"> <label class="form-label"><?php echo LGA_REGISTER_DATE; ?></label> <input class="form-control" type="text" value="<?php echo m_date_to_tr($info['register_date']); ?>" disabled> </div> <div class="col-lg-6 col-sm-12 mb-3"> <label class="form-label"><?php echo LGA_REGISTER_IP; ?></label> <input class="form-control" type="text" value="<?php echo $info['register_ip']; ?>" disabled> </div> <div class="col-lg-6 col-sm-12 mb-3"> <label class="form-label"><?php echo LGA_LAST_LOGIN; ?></label> <input class="form-control" type="text" value="<?php echo m_date_to_tr($info['last_login']); ?>" disabled> </div> <div class="col-lg-6 col-sm-12 mb-3"> <label class="form-label"><?php echo LGA_LAST_LOGIN_IP; ?></label> <input class="form-control" type="text" value="<?php echo $info['last_ip']; ?>" disabled> </div> <div class="col-lg-12 col-sm-12 mb-3"> <label class="form-label"><?php echo LGA_IDENTITY_NUMBER; ?></label> <input class="form-control" type="text" name="identity_number" value="<?php echo $info['identity_number']; ?>" required> </div> <div class="col-lg-6 col-sm-12 mb-3"> <label class="form-label"><?php echo LGA_NAME; ?></label> <input class="form-control" type="text" name="name" value="<?php echo $info['name']; ?>" required> </div> <div class="col-lg-6 col-sm-12 mb-3"> <label class="form-label"><?php echo LGA_LASTNAME; ?></label> <input class="form-control" type="text" name="lastname" value="<?php echo $info['lastname']; ?>" required> </div> <div class="col-lg-6 col-sm-12 mb-3"> <label class="form-label"><?php echo LGA_PHONE; ?></label> <input class="form-control" type="text" name="phone" value="<?php echo $info['phone']; ?>" required> </div> <div class="col-lg-6 col-sm-12 mb-3"> <label class="form-label"><?php echo LGA_EMAIL; ?></label> <input class="form-control" type="email" name="email" value="<?php echo $info['email']; ?>" required> </div> <div class="col-lg-6 col-sm-12 mb-3"> <label class="form-label"><?php echo LGA_GENDER; ?></label> <select class="form-control select2" name="gender"> <option value="0" <?php if($info['gender']==0) { echo 'selected'; } ?>><?php echo LGA_MAN; ?></option> <option value="1" <?php if($info['gender']==1) { echo 'selected'; } ?>><?php echo LGA_WOMEN; ?></option> </select> </div> <div class="col-lg-6 col-sm-12 mb-3"> <label class="form-label"><?php echo LGA_COUNTRY; ?></label> <select class="form-control select2" name="country"> <?php $countrys = $db->table('regions')->where('r_type','=','country')->where('status','=',1)->order('title','asc')->get(); foreach($countrys['data'] as $country) { $selected = ''; if($info['country']==$country['id']) { $selected = 'selected="selected"'; } echo '<option value="'.$country['id'].'" '.$selected.'>'.$country['title'].'</option>'; } ?> </select> </div> <div class="col-lg-6 col-sm-12 mb-3"> <label class="form-label"><?php echo LGA_PASSWORD; ?></label> <input class="form-control" type="password" name="password" value="" placeholder="<?php echo LGA_NO_UPDATE_FOR_BLANK; ?>"> </div> </div> </div> <div class="tab-pane" id="customer_orders" role="tabpanel"> <table id="datatable_default" class="table table-bordered dt-responsive nowrap w-100" data-title="<?php echo LGA_ORDER_LIST; ?> - <?php echo $title; ?>"> <thead> <tr> <th>#</th> <th class="text-center"><?php echo LGA_PRODUCT_COUNT; ?></th> <th class="text-center"><?php echo LGA_TOTAL; ?></th> <th class="text-center"><?php echo LGA_PAYMENT_TYPE; ?></th> <th class="text-center"><?php echo LGA_STATUS; ?></th> <th class="text-center"><?php echo LGA_DATE; ?></th> <th class="text-end"><?php echo LGA_ACTIONS; ?></th> </tr> </thead> <tbody> <?php $customer_orders = $db->table('orders')->where('customer','=',$info['id'])->order('id','desc')->get(); if($customer_orders['total_count']>0) { foreach($customer_orders['data'] as $customer_order) { $order_products_count = $db->table('order_products')->where('o_id','=',$customer_order['id'])->count(); echo ' <tr> <td>'.$customer_order['id'].'</td> <td class="text-center" data-order="'.$order_products_count.'"><span class="btn btn-light waves-effect btn-label waves-light" style="width:100px"><i class="fa fa-shopping-cart label-icon text-primary"></i> '.$order_products_count.'</span></td> <td class="text-center" data-order="'.m_remove_dot($customer_order['total']).'">'.m_currency($customer_order['total']).' '.currency_types(m_setting('currency_type'),'value').'</td> <td class="text-center">'.m_payment_type($customer_order['payment_type']).'</td> <td class="text-center" data-order="'.$customer_order['status'].'">'.m_order_status($customer_order['status']).'</td> <td class="text-center" data-order="'.strtotime($customer_order['date']).'">'.m_date_to_tr($customer_order['date']).'</td> <td class="text-end"> <a href="'.ADMIN_URL.'/index.php?page=order_edit&id='.$customer_order['id'].'"><span class="btn btn-sm btn-soft-primary"><i class="fa fa-edit"></i></span></a> <a class="delete" data-question="'.LGA_DELETE_QUESTION.'" href="'.ADMIN_URL.'/index.php?page=delete&table=orders&id='.$customer_order['id'].'"><span class="btn btn-sm btn-soft-danger"><i class="fa fa-trash"></i></span></a> </td> </tr>'; } } ?> </tbody> </table> </div> <div class="tab-pane" id="customer_logs" role="tabpanel"> <table id="datatable_export" class="table table-bordered dt-responsive nowrap w-100" data-title="<?php echo LGA_CUSTOMER_LOGS; ?> - <?php echo $info['name']; ?> <?php echo $info['lastname']; ?>"> <thead> <tr> <th><?php echo LGA_TRANSACTION; ?></th> <th><?php echo LGA_IP; ?></th> <th><?php echo LGA_DATE; ?></th> </tr> </thead> <tbody> <?php $customer_logs = $db->table('customer_logs')->where('u_id','=',$info['id'])->order('id','desc')->get(); if($customer_logs['total_count']>0) { foreach($customer_logs['data'] as $customer_log) { echo ' <tr> <td>'.$customer_log['transaction'].'</td> <td>'.$customer_log['ip'].'</td> <td class="text-center" data-order="'.strtotime($customer_log['date']).'">'.m_date_to_tr($customer_log['date']).'</td> </tr>'; } } ?> </tbody> </table> </div> <button type="submit" class="btn btn-success waves-effect btn-label waves-light"><i class="bx bx-check-double label-icon"></i> <?php echo LGA_SAVE; ?></button> </form> </div> </div> </div> </div> </div>
💾 Kaydet
İptal
📝 Yeniden Adlandır
İptal
Kaydet
🔐 Dosya İzinleri (chmod)
İzin Değeri:
Hızlı Seçim:
777
755
644
600
777
= Herkes okur/yazar/çalıştırır
755
= Sahip tam, diğerleri okur/çalıştırır
644
= Sahip okur/yazar, diğerleri okur
600
= Sadece sahip okur/yazar
İptal
Uygula