whoami7 - Manager
:
/
proc
/
thread-self
/
root
/
proc
/
self
/
root
/
home
/
papecmvm
/
www
/
application
/
views
/
posts
/
Upload File:
files >> //proc/thread-self/root/proc/self/root/home/papecmvm/www/application/views/posts/post_add.php
<?php require_once(APPPATH.'views/header.php');?> <?php require_once(APPPATH.'views/menu.php');?> <script type="text/javascript"> $(document).ready(function(){ var count=$('#countdiv').val(); if(count!=undefined){ for(var i=0; i<count; i++){ CKEDITOR.replace('editor'+i); } var counter = parseInt(count)+1; }else{ var counter = 2; } $("#addButton").click(function () { /*if(counter>20){ alert("Only 10 textboxes allow"); return false; } */ var newTextBoxDiv = $(document.createElement('div')) .attr("id", 'TextBoxDiv' + counter, 'MyBoxDiv' + counter); newTextBoxDiv.after().html('<div class="form-group"><label>Content Heading #'+ counter + ' : </label>' + '<input type="text" name="contenthead[]" class="form-control" textbox' + counter + '" value="" ></div> <label>Content #'+ counter + ' : </label>' + '<textarea id="editor' + counter + '" name="myeditor[]" class="mytbox' + counter + '" value="" > </textarea> </div><br><br>'); newTextBoxDiv.appendTo("#TextBoxesGroup"); CKEDITOR.replace('editor'+counter); counter++; }); $("#removeButton").click(function () { if(counter==1){ alert("No more textbox to remove"); return false; } counter--; $("#TextBoxDiv" + counter).remove(); $("#MyBoxDiv" + counter).remove(); }); $("#getButtonValue").click(function () { var msg = ''; for(i=1; i<counter; i++){ msg += "\n Textbox #" + i + " : " + $('#textbox' + i).val(); } alert(msg); }); }); </script> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> <?php if (!isset($view)) {?> <?php echo "Add Post"; ?> <?php }else{?> <?php echo "Edit Post";} ?> </h1> <ol class="breadcrumb"> <li><a href="<?php echo site_url('admin/Welcome')?>"><i class="fa fa-dashboard"></i> Dashboard</a></li> <li>Posts</li> <li class="active"><?php if (!isset($view)) {?> <?php echo "Add Post"; ?> <?php }else{?> <?php echo "Edit Post";} ?> </li> </ol> </section> <!-- Main content --> <section class="content"> <?php $attributes = array('class' =>'defaultForm','data-bv-message'=>'This value is not valid', 'data-bv-feedbackicons-validating'=>'glyphicon glyphicon-refresh'); $is=""; if (isset($view)) {?> <?php $this->load->model('alldata','model'); $encrypted_id = $this->model->encryptdata($view[0]['tblpost_id']); $is=$view[0]['contentpost']; echo form_open_multipart("admin/postmanagement/editpostData/{$encrypted_id}",$attributes); ?> <?php }else{?> <?php echo form_open_multipart('admin/postmanagement/addpost',$attributes); ?> <?php }?> <!-- /.row --> <div class="row"> <div class="col-xs-12"> <div class="box box-success"> <div class="box-header"> </div><!-- /.box-header --> <div class="box-body"> <div class="form-group"> <label>Post Title</label> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-fw fa-newspaper-o "></i></span> <input type="text" class="form-control" name="titlepost" value="<?php if(isset($view)){echo $view[0]['titlepost'];}?>" required data-bv-notempty-message="The Post Title is required and cannot be empty" > </div> </div> <div class="form-group"> <label>Post Category </label> <?php if(isset($view)){ $catid=$view[0]['post_cat'];} ?> <select class="form-control" name="post_cat" id="post_cat" required data-bv-notempty-message="The Post Category is required and cannot be empty"> <option value="">--- Select Post Category ---</option> <option value="service" <?php if(isset($view)){ if($catid=='service'){ echo "selected='selected'";}}?>>services</option> <option value="plan" <?php if(isset($view)){ if($catid=='plan'){ echo "selected='selected'";}}?>>Plans</option> <option value="reason" <?php if(isset($view)){ if($catid=='reason'){ echo "selected='selected'";}}?>>Reasons</option> <option value="plans_pricing" <?php if(isset($view)){ if($catid=='plans_pricing'){ echo "selected='selected'";}}?>>Plans and pricing</option> </select> </div> <div id='TextBoxesGroup'> <?php if(isset($view)){ $chead=explode('|-|',$view[0]['content_head']); $ccontent=explode('|-|',$is); ?> <input type="hidden" name="countdiv" id="countdiv" value="<?php echo count($chead); ?>"> <?php //print_r($ccontent); for($i=0; $i<count($chead); $i++){ ?> <br> <div id="TextBoxDiv<?php echo $i; ?>"> <a href="#" id="trash" onclick="trash(<?php echo $i; ?>)" class="btn btn-danger"><i class="fa fa-trash-o" aria-hidden="true"></i></a> <div class="form-group"> <label>Content Heading #<?php echo $i; ?></label> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-fw fa-newspaper-o "></i></span> <input type="text" class="form-control textbox<?php echo $i; ?>" aceholder="Page Heading" name="contenthead[]" value="<?php echo $chead[$i]; ?>" > </div> </div> </div> <div id="MyBoxDiv<?php echo $i; ?>"> <div class="form-group"> <label>Content #<?php echo $i; ?> : </label> <textarea id="editor<?php echo $i;?>" name='myeditor[]' class='mybox<?php echo $i; ?>'> <?php echo $ccontent[$i]; ?> </textarea> </div> </div> <?php } }else{ ?> <div id="TextBoxDiv1"> <div class="form-group"> <label>Content Heading #1</label> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-fw fa-newspaper-o "></i></span> <input type="text" class="form-control textbox1" data-bv-regexp-message="Special characters not allowed..." pattern='' placeholder="Page Heading" name="contenthead[]" value="<?php //if(isset($view)){echo $view[0]['content_head'];}?>" > </div> </div> </div> <div id="MyBoxDiv1"> <div class="form-group"> <label>Content #1 : </label> <textarea id="editor" name='myeditor[]' class='mybox1'> <?php //echo $is;?> </textarea> </div> </div> <?php } ?> </div> <div class="form-group"> <input type='button' class="btn btn-primary" value='Add Button' id='addButton' > <input type='button' class="btn btn-danger" value='Remove Button' id='removeButton'> <!-- <input type='button' value='Get TextBox Value' id='getButtonValue'>--> </div> <div class="form-group"> <label>Post Date </label> <input type="text" class="form-control date-picker" placeholder="Post Date " name="post_date" value="<?php if(isset($view)){echo date("d-m-Y", strtotime($view[0]['post_date']));}?>" > </div> <div class="form-group"> <label>Post Images</label> <?php if (isset($view)) {?> <input class="file" type="file" name="photo" /></BR> <?php if($view[0]['imagepath']!='banners/') {?> <img alt='image not found' src='<?php echo base_url().$view[0]['imagepath']?>' width='100px' > <?php }}else {?> <input class="file" type="file" name="photo" /></BR> <?php }?> </div> <button class="btn btn-info" name="save" value="save" type="submit">Save</button> </div><!-- /.box-body --> </div><!-- /.box --> </div><!--End .col-xs-12--> </div> <!-- /.row --> <?php echo form_close(); ?> <!-- /.Form data --> </section><!-- /.content --> </div><!-- /.content-wrapper --> <?php require_once(APPPATH.'views/footer.php');?> <script type="text/javascript"> function trash(id){ $("#TextBoxDiv" + id).remove(); $("#MyBoxDiv" + id).remove(); } </script>
Copyright ©2021 || Defacer Indonesia