Viewing file: forms-edit-image.php (8.34 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<!doctype html> <html class="fixed"> <head>
<!-- Basic --> <meta charset="UTF-8">
<title>Administrator | สมาคมนักกฎหมายสาธารณสุข</title> <meta name="keywords" content="HTML5 Admin Template" /> <meta name="description" content="สมาคมนักกฎหมายสาธารณสุข,กฎหมายกระทรวงสาธารณสุข"> <meta name="author" content="mophlawyer.com">
<!-- Mobile Metas --> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<!-- Web Fonts --> <link href="https://fonts.googleapis.com/css?family=Mitr:300" rel="stylesheet">
<!-- Vendor CSS --> <link rel="stylesheet" href="assets/vendor/bootstrap/css/bootstrap.css" /> <link rel="stylesheet" href="assets/vendor/font-awesome/css/font-awesome.css" /> <link rel="stylesheet" href="assets/vendor/magnific-popup/magnific-popup.css" /> <link rel="stylesheet" href="assets/vendor/bootstrap-datepicker/css/datepicker3.css" /> <!-- Specific Page Vendor CSS --> <link rel="stylesheet" href="assets/vendor/bootstrap-fileupload/bootstrap-fileupload.min.css" />
<!-- Theme CSS --> <link rel="stylesheet" href="assets/stylesheets/theme.css" />
<!-- Skin CSS --> <link rel="stylesheet" href="assets/stylesheets/skins/default.css" />
<!-- Theme Custom CSS --> <link rel="stylesheet" href="assets/stylesheets/theme-custom.css">
<!-- Head Libs --> <script src="assets/vendor/modernizr/modernizr.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script> <script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script> <!-- include summernote css/js --> <link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.9/summernote.css" rel="stylesheet"> <script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.9/summernote.js"></script>
<link rel="stylesheet" href="assets/vendor/codemirror/lib/codemirror.css" /> </head> <body> <section class="body">
<?php require_once("topnav.php"); ?>
<div class="inner-wrapper"> <?php require_once("sidebar.php"); ?>
<section role="main" class="content-body"> <header class="page-header"> <h2>แบบฟอร์มแก้ไขข้อมูล</h2> <div class="right-wrapper pull-right"> <ol class="breadcrumbs"> <li> </li> </ol> </div> </header>
<!-- start: page --> <div class="row"> <div class="col-lg-12"> <section class="panel panel-featured panel-featured-primary"> <header class="panel-heading "> <h2 class="panel-title"></h2> </header> <?php require_once('db.php'); $r_id=$_GET['id']; $result1 = $conn->prepare("SELECT * FROM cat_image WHERE title_id='$r_id'"); $result1->execute(); for($i=0; $row1 = $result1->fetch(); $i++ ){ //for($i=0; $row = $result->fetch(); $i++){ $id1 = $row1['title_id'];
?> <div class="panel-body"> <form class="form-horizontal form-bordered" method="post" action="editimage.php<?php echo '?files_id='.$id1; ?>" enctype="multipart/form-data"> <div class="form-group"> <label class="col-md-3 control-label" for="inputname">ชื่อกิจกรรม</label> <div class="col-md-6"> <input type="text" class="form-control" id="inputname" name="inputname" value="<?php echo $row1 ['title_name']; ?>"> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">รูปปก</label> <div class="col-md-6"> <div class="fileupload fileupload-new" data-provides="fileupload"> <div class="input-append"> <div class="uneditable-input"> <i class="fa fa-file fileupload-exists"></i> <span class="fileupload-preview"></span> </div> <span class="btn btn-default btn-file"> <span class="fileupload-exists">Change</span> <span class="fileupload-new">Select file</span> <input type="file" name="inputfile" /> <input type="hidden" name="oldfile" value="<?php echo $row1['thumbnail'];?>"> </span>
<a href="#" class="btn btn-default fileupload-exists" data-dismiss="fileupload">Remove</a> </div> </div> <br> <img class="img-responsive img-rounded" src="module/uploadphoto/Thumbnails/<?php echo $row1['thumbnail']; ?>" width="150px" > </div> </div>
<div class="form-group"> <label class="col-md-3 control-label" for="detail">รายละเอียด</label> <div class="col-md-6"> <textarea id="summernote" name="detail" class="summernote" data-plugin-summernote data-plugin-options='{ "height": 180, "codemirror": { "theme": "ambiance" } }'><?php echo $row1 ['detail']; ?></textarea>
<!--<textarea class="form-control" rows="5" id="inputdetail" data-plugin-textarea-autosize name="inputdetail"><?php //echo $row1 ['detail']; ?> </textarea> <textarea class="summernote" data-plugin-summernote data-plugin-options='{ "height": 180, "codemirror": { "theme": "ambiance" } }' name="inputdetail" id="summernote" ><?php //echo $row1 ['detail']; ?></textarea>--> </div> </div>
<div class="form-group"> <div class="panel-body"> <div class="col-md-3"> </div> <div class="col-md-6"> <button type="submit" class="mb-xs mt-xs mr-xs btn btn-success"><i class="fa fa-hand-o-right"></i> แก้ไขข้อมูล</button> <button type="reset" class="mb-xs mt-xs mr-xs btn btn-danger"> <i class="fa fa-times"> </i> ยกเลิก</button> </div> </div> </div> </form> </div> <?php } ?> </section> </div> </div> <!-- end: page --> </section> </div> </section> <script> var IMAGE_PATH = 'http://localhost/mophlawyer/admin/'; $(document).ready(function() { $("#summernote").summernote({ placeholder: 'enter directions here...', height: 300, callbacks: { onImageUpload : function(files, editor, welEditable) {
for(var i = files.length - 1; i >= 0; i--) { sendFile(files[i], this); } } } }); }); function sendFile(file, el) { var form_data = new FormData(); form_data.append('file', file); $.ajax({ data: form_data, type: "POST", url: 'upload-img2.php', cache: false, contentType: false, processData: false, success: function(url) { //$(el).summernote('editor.insertImage', url);
var urls = IMAGE_PATH + url; $(el).summernote('editor.insertImage', urls); } }); } </script> <!-- Theme Base, Components and Settings --> <script src="assets/javascripts/theme.js"></script> <!-- Examples --> <script src="assets/javascripts/tables/examples.datatables.default.js"></script> <script src="assets/javascripts/tables/examples.datatables.row.with.details.js"></script> <script src="assets/javascripts/tables/examples.datatables.tabletools.js"></script> <script src="assets/javascripts/ui-elements/examples.modals.js"></script> <!-- Specific Page Vendor --> <script src="assets/vendor/jquery-autosize/jquery.autosize.js"></script> <script src="assets/vendor/bootstrap-fileupload/bootstrap-fileupload.min.js"></script> <!-- Theme Base, Components and Settings --> <script src="assets/javascripts/theme.js"></script> <!-- Theme Custom --> <script src="assets/javascripts/theme.custom.js"></script> <!-- Theme Initialization Files --> <script src="assets/javascripts/theme.init.js"></script> </body> </html>
|