���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/oladi/code/admin/brand/ |
<?php $brand_id = $CORE->input['brand_id'] ?? 0; if($brand_id==0){ $row_check = $DB->get_colum_tb('tb_brand'); }else{ $row_check = $DB->fetch_row($DB->query("SELECT * FROM tb_brand WHERE brand_id='$brand_id' ")); } if(isset($CORE->input['submitbt'])){ $brand_id = $CORE->input['brand_id'] ?? 0; $brand_name = $CORE->input['brand_name'] ?? ''; $fname = $func->format_string($brand_name); if($brand_name!=''){ if($brand_id==0){ $row_check = $DB->fetch_row($DB->query("SELECT * FROM tb_brand WHERE brand_fname='$fname' ")); if(!$row_check) { $arr_insert = array('brand_name' => $brand_name, 'brand_fname' => $fname); $brand_id = $DB->do_insert('tb_brand', $arr_insert); } }else{ $row_check = $DB->fetch_row($DB->query("SELECT * FROM tb_brand WHERE brand_fname='$fname' AND brand_id!='$brand_id' ")); if(!$row_check) { $arr_update = array('brand_name' => $brand_name); $DB->do_update('tb_brand', $arr_update, " WHERE brand_id='$brand_id' "); } } } if($_FILES['image_field'] && $_FILES['image_field']['name']!=''){ $row_check_thumb = $DB->fetch_row($DB->query("SELECT brand_img FROM tb_brand WHERE brand_id='$brand_id' ")); $url_img = local_img_upload($_FILES['image_field'],'brand',250,200); if ($url_img!='') { if($row_check_thumb['brand_img']!='' && file_exists($row_check_thumb['brand_img'])){ unlink($row_check_thumb['brand_img']); } $DB->query("UPDATE tb_brand SET brand_img='$url_img' WHERE brand_id='$brand_id' "); } } close_popup('Updated!'); } include ROOT_PATH . 'include/block/header_popup.php'; ?> <div class="card"> <div class="card-header">Post brand</div> <div class="card-body" style="font-size: 12px;"> <form method="post" id="form_hoan_tra" action="" enctype="multipart/form-data"> <input type="hidden" value="<?php echo $brand_id;?>" name="brand_id" id="brand_id"> <div class="row"> <div class="col-sm-12"> <div class="form-group"> <label>Brand name</label> <input type="text" name="brand_name" class="form-control" value="<?php echo $row_check['brand_name'];?>" required> </div> </div> <div class="col-sm-12"> <div class="form-group"> <label>Brand image</label> <input type="file" name="image_field" class="dropify" data-default-file="<?php echo $row_check['brand_img'];?>" data-height="100" data-max-file-size="2M" data-show-remove="false"> </div> </div> </div> <input type="submit" class="submit" style="display:none;" name="submitbt"> </form> </div> <div class="card-footer"> <a class="gui_yeu_cau btn btn-danger" href="javascript:void(0);">Submit</a> <a class="dong m-l-5 btn btn-dark" href="javascript:void(0);">Close</a> </div> </div> <script> $('.gui_yeu_cau').click(function (){ $('#form_hoan_tra .submit').click(); return false; }); $('.dong').click(function (){ window.close(); }); </script> <?php include ROOT_PATH . 'include/block/footer_popup.php'; exit(); ?>