Esempio n. 1
0
 public function find_all_college_select()
 {
     $this->use->use_model('data_base');
     $this->use->use_lib('table/tpl_college');
     $tpl_college = new tpl_college();
     $db = new data_base($tpl_college->table(), array($tpl_college->id(), $tpl_college->name()));
     return $db->get();
 }
Esempio n. 2
0
 public function update_college()
 {
     $this->use->use_model('data_base');
     $this->use->use_lib('table/tpl_college');
     $tpl = new tpl_college();
     $db = new data_base($tpl->table(), array($tpl->name() => $_POST['name_update']), array($tpl->id() => $_POST['id']));
     echo json_encode(array('valid' => $db->change(), 'massage' => '<div class="alert alert-success alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button><h4>Alert!</h4> <strong>Update success </strong></div>'));
 }
Esempio n. 3
0
 public function find_all_specialty()
 {
     $this->use->use_model('data_base');
     $this->use->use_lib('table/tpl_specialty');
     $this->use->use_lib('table/tpl_college');
     $tpl_specialty = new tpl_specialty();
     $tpl_college = new tpl_college();
     $db = new data_base($tpl_specialty->table(), array($tpl_specialty->id(), '(select ' . $tpl_college->name() . ' from ' . $tpl_college->table() . ' where ' . $tpl_college->table() . '.' . $tpl_college->id() . ' = ' . $tpl_specialty->table() . '.' . $tpl_specialty->id_college() . ') ' . $tpl_specialty->id_college() . '_name', $tpl_specialty->id_college(), $tpl_specialty->name()));
     echo json_encode($db->get());
 }
 public function info_students()
 {
     $session = new session_supervisor();
     $id = $session->Get_id_user();
     $db = new data_base(tpl_students::students(), array(tpl_students::id(), tpl_students::first_name(), tpl_students::last_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_college::name()), data_base::select_multiple_table(tpl_university::university(), tpl_university::university() . '.' . tpl_university::id(), tpl_students::students() . '.' . tpl_students::id_college(), tpl_university::name(), tpl_university::university() . '_' . tpl_university::name()), data_base::select_multiple_table(tpl_specialty::specialty(), tpl_specialty::specialty() . '.' . tpl_specialty::id(), tpl_students::students() . '.' . tpl_students::id_college(), tpl_specialty::name(), tpl_specialty::specialty() . '_' . tpl_specialty::name())), array(tpl_students::id_supervisor() => $id, tpl_students::status() => 1));
     return $db->get_where();
 }
 public function find($id)
 {
     $db = new data_base(tpl_college::college(), array("*"), array(tpl_college::id() => $id));
     $results = $db->get_where();
     if (!empty($results)) {
         return $results;
     } else {
         return false;
     }
 }
    function operate<?php 
echo tpl_specialty::specialty();
?>
(value, row) {

        return '<a href="<?php 
echo site_url('admin/specialty/view_student/?id=');
?>
'+row.<?php 
echo tpl_specialty::id();
?>
+'">'+value+'</a>'
    }

    function operate<?php 
echo tpl_college::college();
?>
(value, row) {

        return '<a href="<?php 
echo site_url('admin/college/view_student/?id=');
?>
'+row.<?php 
echo tpl_specialty::id();
?>
+'">'+value+'</a>'
    }
</script>
<script type="text/javascript">
    function operate<?php 
echo tpl_specialty::active();
 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());
 }
        <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_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');
?>
"
Esempio n. 9
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();
 }
?>
" 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();
?>
"
                            data-halign="center" data-sortable="true">
                            specialty
                        </th>


                    </tr>
 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_college(), tpl_students::id_specialty(), 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_college::name())), array(tpl_students::id_university() => $_GET['id']));
     echo json_encode($db->get_where());
 }
echo tpl_college::college() . '_' . tpl_college::name() . '_update';
?>
"/>
                    </div>

                    <div class="form-group">
                        <label>country <?php 
echo tpl_college::college();
?>
 : </label>
                        <select name="<?php 
echo tpl_college::college() . '_' . tpl_college::id_university() . '_update';
?>
"
                                id="<?php 
echo tpl_college::college() . '_' . tpl_college::id_university() . '_update';
?>
"
                                class="form-control">
                            <?php 
$news = new university_lib_ad();
echo $news->select();
?>
                        </select>
                    </div>

                    <button type="submit" class="btn btn-success" id="update" name="update">Save</button>
                </form>
                </br>
                </br>
                <div class="" id="result_massages_update"></div>
?>
</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 
echo $data[tpl_college::college() . '_' . tpl_college::name()];
?>
</h4>


            </div>

            <div class="col-sm-6">
                    <h4>companies : <?php 
echo $data_co[tpl_companies::companies() . '_' . tpl_companies::name()];
?>
</h4>
                    <h4>Department : <?php 
echo $data_co[tpl_department::department() . '_' . tpl_department::name()];
?>
</h4>
                    <table id="tpl_college" data-toggle="table"
                           data-url="<?php 
echo site_url('admin/home/ajax_college');
?>
"
                           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 
echo tpl_college::id();
?>
" data-halign="center" data-sortable="true"> ID</th>
                            <th data-field="<?php 
echo tpl_college::name();
?>
" data-halign="center" data-sortable="true"> Name
                            <th data-field="<?php 
echo tpl_university::university() . '_' . tpl_university::name();
?>
"
                                data-halign="center" data-sortable="true"> university
                            </th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>

            <div class="col-sm-4">
?>
"
                            data-halign="center" data-sortable="true">
                            specialty
                        </th>


                    </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function operate<?php 
echo tpl_college::college();
?>
(value, row) {

        return '<a href="<?php 
echo site_url('admin/college/view_student/?id=');
?>
'+row.<?php 
echo tpl_college::id();
?>
+'">'+value+'</a>'
    }

</script>
 public function get_all_college()
 {
     if (isset($_POST['id_university'])) {
         $id = $_POST['id_university'];
         if (!empty($id)) {
             $db = new data_base(tpl_college::college(), array(tpl_college::id(), tpl_college::name()), array(tpl_college::id_university() => $id, tpl_college::active() => 1));
             $data = $db->get_where();
             $w = '   <option></option>';
             foreach ($data as $row) {
                 $w = $w . '<option value="' . $row[tpl_college::id()] . '">' . $row[tpl_college::name()] . '</option>';
             }
             echo $w;
         } else {
             echo json_encode(array('valid' => false, 'title' => 'Oops !!', 'massage' => 'error empty'));
         }
     } else {
         echo json_encode(array('valid' => false, 'title' => 'Oops !!', 'massage' => 'error isset'));
     }
 }
 public function count_college()
 {
     $db = new data_base(tpl_college::college(), array(tpl_college::id()), array(tpl_college::active() => 1));
     return count($db->get_where());
 }
            <div class="row">
                <hr>
                <h4>Name : <?php 
    echo $row[tpl_students::first_name()] . ' ' . $row[tpl_students::last_name()];
    ?>
</h4>
                <h4>Specialty : <?php 
    echo $row[tpl_specialty::specialty() . '_' . tpl_specialty::name()];
    ?>
</h4>
                <h4>University : <?php 
    echo $row[tpl_university::university() . '_' . tpl_university::name()];
    ?>
</h4>
                <h4>College : <?php 
    echo $row[tpl_college::college() . '_' . tpl_college::name()];
    ?>
</h4>


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

                    </tr>
                    </thead>
                    <tbody>
                    <?php 
 public function find_college()
 {
     $db = new data_base(tpl_college::college(), array(tpl_college::id(), tpl_college::active(), tpl_college::name()), array(tpl_college::active() => 1));
     $data = $db->get_where();
     $w = '';
     foreach ($data as $row) {
         $w = $w . '<option value="' . $row[tpl_college::id()] . '">' . $row[tpl_college::name()] . '</option>';
     }
     return $w;
 }
">Students</a></li>
        <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_college');
$tpl_college = new tpl_college();
?>
    <h2 class="sub-header">College table</h2>
    <div id="toolbar">
        <button id="add_new_college" 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_college_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>
            <tr>