<script src="<?php echo SITE_URL; ?>public/ckeditor/ckeditor.js"></script>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0"><?php echo get_text_by_lang('Add new email template','admin');?></h1>
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</div>
<!-- /.content-header -->
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<!-- Info boxes -->
<div class="row">
<div class="col-lg-12 col-sm-12 col-md-12">
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
<div class="col-lg-12 ">
<?php echo $alert;?>
<p>
<label><strong><?php echo get_text_by_lang('Title','admin');?></strong></label>
<input type="text" class="form-control post-title input-size-medium" name="send[title]" placeholder="Title" />
</p>
<p>
<label><strong><?php echo get_text_by_lang('Subject','admin');?></strong></label>
<input type="text" class="form-control post-subject input-size-medium" name="send[title]" placeholder="Subject" />
</p>
<p>
<label><strong><?php echo get_text_by_lang('Content','admin');?></strong> </label>
<textarea id="editor" rows="25" name="send[content]" class="form-control post-content ckeditor"></textarea>
</p>
</div>
</div>
<p>
<button type="button" class="btn btn-primary btn-addnew" ><i class='fas fa-thumbs-up'></i> <?php echo get_text_by_lang('Add new','admin');?></button>
</p>
</div>
</div>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<!-- /.row -->
</div><!--/. container-fluid -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<script>
// Replace the <textarea id="editor1"> with a CKEditor
// instance, using default configuration.
// CKEDITOR.replace( 'editor' ); extraPlugins: 'wordcount,notification',
CKEDITOR.replace( 'editor' ,{
extraPlugins: 'wordcount,notification,texttransform,justify',
height: 300,
filebrowserBrowseUrl : '<?php echo SITE_URL;?>public/ckeditor/filemanager/dialog.php?type=2&editor=ckeditor&fldr=',
filebrowserImageBrowseUrl : '<?php echo SITE_URL;?>public/ckeditor/filemanager/dialog.php?type=1&editor=ckeditor&fldr='
});
// CKEDITOR.instances.editor.insertHtml('<p><strong>sdfsdfsdf</strong></p>')
masterDB['media_selected_callback']=function(theMediaUrl){
console.log('Added...'+theMediaUrl);
// $('.txtThumbnail').val(theMediaUrl);
// $('.txtThumbnailSrc').attr('src',theMediaUrl+'?v='+moment().format('HHmm'));
CKEDITOR.instances.editor.insertHtml('<p><img src="'+theMediaUrl+'?v='+moment().format('HHmm')+'" style="width:100%;" /></p>');
};
</script>
<script type="text/javascript">
var root_url='<?php echo SITE_URL;?>';
$(document).ready(function(){
$('.pushmenu').trigger('click');
});
$(document).on('click','.btn-addnew',function(){
var sendData={};
sendData['title']=$('.post-title').val();
sendData['subject']=$('.post-subject').val();
sendData['content']=CKEDITOR.instances.editor.getData();
sendData['type']='1';
postData(API_URL+'insert_new_email_template', sendData).then(data => {
console.log(data); // JSON data parsed by `data.json()` call
console.log(data['error']);
showAlertOK('','Done!!');
});
});
</script>
|