예제 #1
0
 public function update_image_students()
 {
     $this->use->use_model('data_base');
     $this->use->use_lib('table/tpl_students');
     $this->use->use_lib('system/image/class_upload_image');
     $tpl = new tpl_students();
     $image = new class_upload_image('image_students_update', 'include/img/student');
     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));
     }
 }
 public function get_info()
 {
     $session = new session_students();
     $id_students = $session->Get_id_user();
     $db = new data_base(tpl_students::students(), array(tpl_students::id(), tpl_students::first_name(), tpl_students::last_name(), tpl_students::email(), tpl_students::id_college(), tpl_students::id_specialty(), tpl_students::id_supervisor(), tpl_students::id_university(), data_base::select_multiple_table(tpl_college::college(), tpl_college::college() . '.' . tpl_college::id(), tpl_students::students() . '.' . tpl_students::id_college(), tpl_college::name(), tpl_college::college() . '_' . tpl_college::name()), data_base::select_multiple_table(tpl_supervisor::supervisor(), tpl_supervisor::supervisor() . '.' . tpl_supervisor::id(), tpl_students::students() . '.' . tpl_students::id_supervisor(), tpl_supervisor::name(), tpl_supervisor::supervisor() . '_' . tpl_supervisor::name()), data_base::select_multiple_table(tpl_specialty::specialty(), tpl_specialty::specialty() . '.' . tpl_specialty::id(), tpl_students::students() . '.' . tpl_students::id_specialty(), tpl_specialty::name(), tpl_specialty::specialty() . '_' . tpl_specialty::name()), data_base::select_multiple_table(tpl_university::university(), tpl_university::university() . '.' . tpl_university::id(), tpl_students::students() . '.' . tpl_students::id_university(), tpl_university::name(), tpl_university::university() . '_' . tpl_university::name())), array(tpl_students::id() => $id_students));
     return $db->get_where();
 }
                            data-halign="center" data-sortable="true"> name
                        </th>

                        <th data-field="<?php 
echo tpl_college::college() . '_' . tpl_college::name();
?>
"
                            data-formatter="operate<?php 
echo tpl_college::college();
?>
"
                            data-halign="center" data-sortable="true">College
                        </th>

                        <th data-field="<?php 
echo tpl_students::students() . '_' . tpl_students::id();
?>
"
                            data-halign="center"
                            data-formatter="operate<?php 
echo tpl_specialty::specialty();
?>
"
                            data-sortable="true"># students
                        </th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
 public function ajax_find_students()
 {
     $db = new data_base(tpl_models::models(), array(tpl_models::id(), tpl_models::id_companies(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::first_name(), tpl_students::students() . '_' . tpl_students::first_name()), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::last_name(), tpl_students::students() . '_' . tpl_students::last_name()), data_base::select_multiple_table(tpl_supervisor::supervisor(), tpl_supervisor::supervisor() . '.' . tpl_supervisor::id(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::id_supervisor()), tpl_supervisor::name(), tpl_supervisor::supervisor() . '_' . tpl_supervisor::name()), data_base::select_multiple_table(tpl_university::university(), tpl_university::university() . '.' . tpl_university::id(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::id_supervisor()), tpl_university::name(), tpl_university::university() . '_' . tpl_university::name()), data_base::select_multiple_table(tpl_college::college(), tpl_college::college() . '.' . tpl_college::id(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::id_supervisor()), tpl_college::name(), tpl_college::college() . '_' . tpl_college::name()), data_base::select_multiple_table(tpl_specialty::specialty(), tpl_specialty::specialty() . '.' . tpl_specialty::id(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::id_supervisor()), tpl_specialty::name(), tpl_specialty::specialty() . '_' . tpl_specialty::name()), data_base::select_multiple_table(tpl_department::department(), tpl_department::department() . '.' . tpl_department::id(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::id_supervisor()), tpl_department::name(), tpl_department::department() . '_' . tpl_department::name()), data_base::select_multiple_table(tpl_section::section(), tpl_section::section() . '.' . tpl_section::id(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::id_supervisor()), tpl_section::name(), tpl_section::section() . '_' . tpl_section::name())), array(tpl_models::id_companies() => $_GET['id']));
     echo json_encode($db->get_where());
 }
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_students');
$use->use_lib('table/tpl_college');
$tpl_college = new tpl_college();
$tpl_students = new tpl_students();
$use->use_lib('admin/college_admin');
$page = new college_admin();
$college = $page->find_all_college_select();
?>
    <h2 class="sub-header">Students table</h2>

    <div id="toolbar">
        <button id="add_new_students" 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_Students_table_ajax');
?>
"
               data-cache="false" data-height="400" data-show-refresh="true" data-show-toggle="true"
?>
"
                               name="<?php 
echo tpl_students::students() . '_' . tpl_students::password() . '_update_password';
?>
"/>
                    </div>

                    <div class="form-group">
                        <label for="">Retype New Password <?php 
echo tpl_students::students();
?>
 : </label>
                        <input type="text" class="form-control"
                               id="<?php 
echo tpl_students::students() . '_' . tpl_students::password() . '_r_update_password';
?>
"
                               name="<?php 
echo tpl_students::students() . '_' . tpl_students::password() . '_r_update_password';
?>
"/>
                    </div>
                    <button type="submit" class="btn btn-success" id="update" name="update">Save</button>
                </form>
                </br>
                <div class="" id="result_massages_update_password"></div>
            </div>
        </div>
    </div>
</div>
 public function find_models()
 {
     $db = new data_base(tpl_models::models(), array(tpl_models::id(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_models::models() . '.' . tpl_models::id_student(), tpl_students::first_name(), tpl_students::students() . '_' . tpl_students::first_name())), array(tpl_models::active() => 1));
     $data = $db->get();
     $w = '';
     foreach ($data as $row) {
         $w = $w . '<option value="' . $row[tpl_models::id()] . '">' . $row[tpl_students::students() . '_' . tpl_students::first_name()] . '</option>';
     }
     return $w;
 }
                       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>
                    <tr>
                        <th data-field="<?php 
echo tpl_university::id();
?>
" data-halign="center" data-sortable="true"> id</th>
                        <th data-field="<?php 
echo tpl_students::first_name();
?>
" data-halign="center" data-sortable="true">
                            first_name
                        </th>
                        <th data-field="<?php 
echo tpl_students::last_name();
?>
" data-halign="center" data-sortable="true">
                            last_name
                        </th>
                        <th data-field="<?php 
echo tpl_college::college() . '_' . tpl_college::name();
?>
"
                            data-halign="center" data-sortable="true">
                            college
                        </th>
                        <th data-field="<?php 
echo tpl_specialty::specialty() . '_' . tpl_specialty::name();
?>
"
                    <tr>

                        <th data-field="<?php 
echo tpl_category::id();
?>
" data-halign="center" data-sortable="true"> id</th>

                        <th data-field="<?php 
echo tpl_onus::onus() . '_' . tpl_onus::name();
?>
"
                            data-halign="center" data-sortable="true">onus name
                        </th>

                        <th data-field="<?php 
echo tpl_students::students() . '_' . tpl_students::first_name();
?>
"
                            data-halign="center" data-sortable="true">students name
                        </th>

                        <th data-field="<?php 
echo tpl_degree::degree() . '_' . tpl_degree::name();
?>
"
                            data-halign="center" data-sortable="true">degree name
                        </th>

                        <th data-field="<?php 
echo tpl_companies::companies() . '_' . tpl_companies::name();
?>
 public function find_supervisor()
 {
     if (isset($_POST[tpl_students::id() . '_' . tpl_students::students()])) {
         $id = $_POST[tpl_students::id() . '_' . tpl_students::students()];
         if (!empty($id)) {
             $db = new data_base(tpl_students::students(), array(tpl_students::id(), tpl_students::id_supervisor(), data_base::select_multiple_table(tpl_supervisor::supervisor(), tpl_supervisor::supervisor() . '.' . tpl_supervisor::id(), tpl_students::students() . '.' . tpl_students::id_supervisor(), tpl_supervisor::name(), tpl_supervisor::supervisor() . '_' . tpl_supervisor::name())), array(tpl_students::status() => 1, tpl_students::id() => $id));
             $data = $db->get_where();
             $w = '<option></option>';
             foreach ($data as $row) {
                 $w = $w . '<option value="' . $row[tpl_students::id_supervisor()] . '">' . $row[tpl_supervisor::supervisor() . '_' . tpl_supervisor::name()] . '</option>';
             }
             echo $w;
         } else {
             echo 'error empty';
             die;
         }
     } else {
         echo 'error isset';
         exit;
     }
 }
예제 #11
0
    ?>
</h4>


                <table class="table table-bordered">
                    <thead>
                    <tr>
                        <td>onus name</td>
                        <td>onus description</td>
                        <td>degree name</td>

                    </tr>
                    </thead>
                    <tbody>
                    <?php 
    foreach ($lib->info_onus_designate($row[tpl_students::id()]) as $rows) {
        ?>
                        <tr>
                            <td><?php 
        echo $rows[tpl_onus::onus() . '_' . tpl_onus::name()];
        ?>
</td>
                            <td><?php 
        echo $rows[tpl_onus::onus() . '_' . tpl_onus::description()];
        ?>
</td>
                            <td><?php 
        echo $rows[tpl_degree::degree() . '_' . tpl_degree::name()];
        ?>
</td>
                        </tr>
예제 #12
0
echo site_url('admin/slider');
?>
">Slider</a></li>
        <li><a href="<?php 
echo site_url('admin/users');
?>
">Users</a></li>
    </ul>
</div>
<?php 
$use = new class_loader();
$use->use_lib('admin/election_admin');
$use->use_lib('table/tpl_students');
$use->use_lib('table/tpl_election');
$class = new election_admin();
$tpl_students = new tpl_students();
$tpl_election = new tpl_election();
$data = $class->find_more_election();
?>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <h2 class="page-header">Number election ( (  <?php 
echo $class->count_election();
?>
 ) )</h2>
    <div class="row placeholders">

        <?php 
foreach ($data as $row) {
    ?>

            <div class="col-xs-6 col-sm-3 placeholder">
예제 #13
0
        <li><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_students');
$use->use_lib('table/tpl_election');
$tpl_students = new tpl_students();
$tpl_election = new tpl_election();
?>
    <h2 class="sub-header">Election table</h2>

    <div class="table-responsive">
        <table id="table" data-toggle="table" data-url="<?php 
echo site_url('admin/find_election_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">
            <thead>
            <tr>
                <th data-field="<?php 
예제 #14
0
        <script src="<?php 
echo site_url('include/ext/bootstrap-table.js');
?>
"></script>
        <?php 
$use = new class_loader();
$use->use_lib('site/students/students_lib');
$lib = new students_lib();
$data = array_shift($lib->get_info());
$data_co = array_shift($lib->info_companies());
?>
        <div class="col-sm-12 main">
            <div class="col-sm-6">

                    <h4>Name : <?php 
echo $data[tpl_students::first_name()] . ' ' . $data[tpl_students::last_name()];
?>
</h4>
                    <h4>Supervisor : <?php 
echo $data[tpl_supervisor::supervisor() . '_' . tpl_supervisor::name()];
?>
</h4>
                    <h4>Specialty : <?php 
echo $data[tpl_specialty::specialty() . '_' . tpl_specialty::name()];
?>
</h4>
                    <h4>University : <?php 
echo $data[tpl_university::university() . '_' . tpl_university::name()];
?>
</h4>
                    <h4>College : <?php 
예제 #15
0
                    <thead>
                    <tr>
                        <th data-field="<?php 
echo tpl_models::id();
?>
" data-halign="center" data-sortable="true"> id</th>

                        <th data-field="<?php 
echo tpl_students::students() . '_' . tpl_students::first_name();
?>
"
                            data-halign="center" data-sortable="true"> first name
                        </th>

                        <th data-field="<?php 
echo tpl_students::students() . '_' . tpl_students::last_name();
?>
"
                            data-halign="center" data-sortable="true"> Last name
                        </th>

                        <th data-field="<?php 
echo tpl_companies::companies() . '_' . tpl_companies::name();
?>
"
                            data-halign="center" data-sortable="true"> Companies
                        </th>
                        <th data-field="<?php 
echo tpl_university::university() . '_' . tpl_university::name();
?>
"
예제 #16
0
 public function get_more_election()
 {
     $this->use->use_model('data_base');
     $this->use->use_lib('table/tpl_students');
     $this->use->use_lib('table/tpl_election');
     $this->use->use_lib('table/tpl_specialty');
     $this->use->use_lib('table/tpl_college');
     $tpl = new tpl_students();
     $tpl_college = new tpl_college();
     $tpl_specialty = new tpl_specialty();
     $tpl_election = new tpl_election();
     $db = new data_base($tpl->table(), array($tpl->id(), $tpl->last_name(), $tpl->first_name(), '( select ' . $tpl_college->name() . ' from ' . $tpl_college->table() . ' where ' . $tpl_college->id() . ' = ' . $tpl->table() . '.' . $tpl->id_college() . ' ) ' . $tpl->id_college(), '( select ' . $tpl_specialty->name() . ' from ' . $tpl_specialty->table() . ' where ' . $tpl_specialty->id() . ' = ' . $tpl->table() . '.' . $tpl->id_specialty() . ' ) ' . $tpl->id_specialty(), '( select COUNT(' . $tpl_election->id() . ') from ' . $tpl_election->table() . ' where ' . $tpl_election->id_elect() . ' = ' . $tpl->table() . '.' . $tpl->id() . ' ) sum', $tpl->id_students(), $tpl->image()), array($tpl->elect() => 1), '', array('sum' => 'DESC'));
     return $db->get_where_order();
 }
 public function count_students()
 {
     $db = new data_base(tpl_students::students(), array(tpl_students::id()));
     return count($db->get());
 }
예제 #18
0
<?php

$use = new class_loader();
$use->use_lib('site/students');
$use->use_lib('site/sessions');
$use->use_lib('table/tpl_students');
$students = new students();
$tpl_students = new tpl_students();
$session = new sessions();
?>

<div class="container w">
    <div class="row centered">
        <br><br>
        <h4>Students</h4>
        <hr>
        <br><br>
        <?php 
foreach ($students->find_elect() as $row) {
    ?>
            <div class="col-lg-4 form-control-row">
                <img src="<?php 
    echo site_url($row[$tpl_students->image()]);
    ?>
" class="img-responsive"/>
                <h4><?php 
    echo $row[$tpl_students->first_name()] . ' ' . $row[$tpl_students->first_name()];
    ?>
</h4>

                <p><?php 
예제 #19
0
<?php

$use = new class_loader();
$use->use_lib('site/students');
$use->use_lib('site/sessions');
$use->use_lib('table/tpl_students');
$students = new students();
$tpl_students = new tpl_students();
$session = new sessions();
$data = $students->get_more_election();
$total = $students->count_all();
?>
<script src="<?php 
echo site_url('include/js/Chart.js');
?>
"></script>
<!-- PORTFOLIO SECTION -->
<div id="dg">
    <div class="container">
        <div class="row centered">
            <h4>Elect</h4>
            <br>

            <?php 
foreach ($data as $rows) {
    if ($rows['sum'] > 0) {
        ?>

                <div class="col-lg-3">

                    <canvas id="canvas" height="130" width="130"></canvas>
예제 #20
0
?>
"
                                class="form-control">

                        </select>
                    </div>


                    <div class="form-group Supervisor" style="display: none">
                        <label>Supervisor : </label>
                        <select name="<?php 
echo tpl_students::students() . '_' . tpl_students::id_supervisor();
?>
"
                                id="<?php 
echo tpl_students::students() . '_' . tpl_students::id_supervisor();
?>
"
                                class="form-control">

                        </select>
                    </div>


                    <div class="form-group Category" style="display: none">
                        <label>Category : </label>
                        <select name="<?php 
echo tpl_category::category() . '_' . tpl_category::id();
?>
"
                                id="<?php 
 public function ajax_find_students()
 {
     $db = new data_base(tpl_students::students(), array(tpl_students::id(), tpl_students::first_name(), tpl_students::last_name(), tpl_students::id_specialty(), tpl_students::id_college(), data_base::select_multiple_table(tpl_specialty::specialty(), tpl_specialty::specialty() . '.' . tpl_specialty::id(), tpl_students::students() . '.' . tpl_students::id_specialty(), tpl_specialty::name(), tpl_specialty::specialty() . '_' . tpl_specialty::name()), data_base::select_multiple_table(tpl_college::college(), tpl_college::college() . '.' . tpl_college::id(), tpl_students::students() . '.' . tpl_students::id_college(), tpl_college::name(), tpl_college::college() . '_' . tpl_specialty::name())), array(tpl_students::id_specialty() => $_GET['id']));
     echo json_encode($db->get_where());
 }
 public function update_status()
 {
     $id = $_POST[tpl_students::students() . '_' . tpl_students::id()];
     $status = $_POST[tpl_students::students() . '_' . tpl_students::status()];
     $db = new data_base(tpl_students::students(), array(tpl_students::status() => $status), array(tpl_students::id() => $id));
     $results = $db->change();
     $status_data = $status == 1 ? 'active' : 'dative';
     if ($results) {
         echo json_encode(array('valid' => 1, 'title' => 'Successfully !!', 'massage' => 'I\'ve been Update ' . $status_data));
     } else {
         echo json_encode(array('valid' => 0, 'title' => 'Oops !!', 'massage' => 'Was not Update ' . $status_data . ', please try again'));
     }
 }