Exemplo n.º 1
0
 public function update_image_students()
 {
     $this->use->use_model('data_base');
     $this->use->use_lib('table/tpl_slider');
     $this->use->use_lib('system/image/class_upload_image');
     $tpl = new tpl_slider();
     $image = new class_upload_image('image_update', 'include/img/slider');
     if ($image->get_type() == 'image/png' || $image->get_type() == 'image/jpeg') {
         if ($image->get_error()) {
             $image_path = $image->move_file();
             if ($image_path == false) {
                 echo json_encode(array('valid' => false));
             } else {
                 $db = new data_base($tpl->table(), array($tpl->image() => $image_path), array($tpl->id() => $_POST['id_image_update']));
                 if ($db->change()) {
                     echo json_encode(array('valid' => true, 'image' => $image_path));
                 } else {
                     echo json_encode(array('valid' => false));
                 }
             }
         } else {
             echo json_encode(array('valid' => false));
         }
     } else {
         echo json_encode(array('valid' => false));
     }
 }
Exemplo n.º 2
0
 public function find_slider()
 {
     $this->use->use_model('data_base');
     $this->use->use_lib('table/tpl_slider');
     $tpl = new tpl_slider();
     $db = new data_base($tpl->table(), array($tpl->id(), $tpl->text(), $tpl->image()), array($tpl->status() => 1));
     return $db->get_where();
 }
">Students</a></li>
        <li class="active"><a href="<?php 
echo site_url('admin/slider');
?>
">Slider</a></li>
        <li><a href="<?php 
echo site_url('admin/users');
?>
">Users</a></li>
    </ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <?php 
$use = new class_loader();
$use->use_lib('table/tpl_slider');
$tpl_slider = new tpl_slider();
?>
    <h2 class="sub-header">slider table</h2>

    <div id="toolbar">
        <button id="add_new_slider" class="btn btn-success btn-xs">New</button>
    </div>
    <div class="table-responsive">
        <table id="table" data-toggle="table" data-url="<?php 
echo site_url('admin/find_all_slider_table_ajax');
?>
"
               data-cache="false" data-height="400" data-show-refresh="true" data-show-toggle="true"
               data-show-columns="true" data-pagination="true" data-page-list="[5, 10, 20, 50, 100, 200]"
               data-search="true" data-flat="true" data-toolbar="#toolbar">
            <thead>
Exemplo n.º 4
0
    <script type="text/javascript">
        $(document).ready(function () {
        $('#login_btn_s').click(function(){
            $('#login_modal').modal('show');
        });
        });
    </script>
</head>

<body>
<?php 
$use = new class_loader();
$use->use_lib('site/slider');
$use->use_lib('table/tpl_slider');
$slider = new slider();
$tpl = new tpl_slider();
$use->use_lib('site/sessions');
$first = 1;
$two = 1;
$counter = 1;
$data = $slider->find_slider();
$sessions = new sessions();
?>
<!-- Fixed navbar -->
<div class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>