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();
 }
" data-halign="center" data-sortable="true"> ID</th>
                <th data-field="<?php 
echo $tpl_slider->text();
?>
" data-halign="center" data-sortable="true"> Text</th>
                <th data-field="<?php 
echo $tpl_slider->status();
?>
"  data-width="10"
                    data-halign="center" data-sortable="true" data-formatter="operate<?php 
echo $tpl_slider->status();
?>
"> Status
                </th>
                <th data-field="<?php 
echo $tpl_slider->image();
?>
"
                    data-formatter="operate<?php 
echo $tpl_slider->image();
?>
"
                    data-events="events<?php 
echo $tpl_slider->image();
?>
"
                    data-width="10" data-halign="center" data-sortable="true"> Image
                </th>
                <th
                    data-field="operate"
                    data-formatter="operateFormatter"
Exemplo n.º 4
0
    ?>
        <?php 
}
?>
    </ol>

    <!-- Wrapper for slides -->
    <div class="carousel-inner" role="listbox">
        <?php 
foreach ($data as $slider) {
    if ($first == 1) {
        $first = 2;
        ?>
            <div class="item active">
                <img src="<?php 
        echo site_url($slider[$tpl->image()]);
        ?>
" class="img-responsive">

                <div class="carousel-caption">
                    <?php 
        echo $slider[$tpl->text()];
        ?>
                </div>
            </div>
        <?php 
    } else {
        ?>
            <div class="item">
                <img src="<?php 
        echo site_url($slider[$tpl->image()]);