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();
 }
 public function update_students()
 {
     $this->use->use_model('data_base');
     $this->use->use_lib('table/tpl_students');
     $tpl = new tpl_students();
     $data = array($tpl->id_students() => $_POST['id_student_u'], $tpl->first_name() => $_POST['first_name_u'], $tpl->last_name() => $_POST['last_name_u'], $tpl->id_college() => $_POST['name_college_u']);
     if (!empty($_POST['password_u'])) {
         $data[$tpl->password()] = md5($_POST['password_u']);
     }
     if (!empty($_POST['name_specialty_u'])) {
         $data[$tpl->id_specialty()] = $_POST['name_specialty_u'];
     }
     $db = new data_base($tpl->table(), $data, array($tpl->id() => $_POST['id_update']));
     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>'));
 }
 public function update()
 {
     $id = $_POST[tpl_students::students() . '_' . tpl_students::id() . '_update'];
     $first_name = $_POST[tpl_students::students() . '_' . tpl_students::first_name() . '_update'];
     $last_name = $_POST[tpl_students::students() . '_' . tpl_students::last_name() . '_update'];
     $id_supervisor = $_POST[tpl_students::students() . '_' . tpl_students::id_supervisor() . '_update'];
     $id_university = $_POST[tpl_students::students() . '_' . tpl_students::id_university() . '_update'];
     $id_college = $_POST[tpl_students::students() . '_' . tpl_students::id_college() . '_update'];
     $id_specialty = $_POST[tpl_students::students() . '_' . tpl_students::id_specialty() . '_update'];
     $db = new data_base(tpl_students::students(), array(tpl_students::first_name() => $first_name, tpl_students::last_name() => $last_name, tpl_students::id_supervisor() => $id_supervisor, tpl_students::id_university() => $id_university, tpl_students::id_college() => $id_college, tpl_students::id_specialty() => $id_specialty), array(tpl_students::id() => $id));
     $results = $db->change();
     if ($results) {
         echo json_encode(array('valid' => 1, 'title' => 'Successfully !!', 'massage' => 'I\'ve been Update ' . $first_name));
     } else {
         echo json_encode(array('valid' => 0, 'title' => 'Oops !!', 'massage' => 'Was not Update ' . $first_name . ', please try again'));
     }
 }
Exemple #4
0
        ?>
,
                                color:"#3498db"
                            },
                            {
                                value : <?php 
        echo $rows['sum'];
        ?>
,
                                color : "#ecf0f1"
                            }
                        ];
                        var myDoughnut = new Chart(document.getElementById("canvas").getContext("2d")).Doughnut(doughnutData);
                    </script>
                    <p><b><?php 
        echo $rows[$tpl_students->first_name()] . ' ' . $rows[$tpl_students->first_name()];
        ?>
</b></p>

                </div>
            <?php 
    }
}
?>

            <!-- First Chart -->

        </div><!-- row -->
    </div><!-- container -->
</div><!-- DG -->
                    <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 ajax_onus_designate()
 {
     $db = new data_base(tpl_onus_designate::onus_designate(), array(data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_student(), tpl_students::first_name(), tpl_students::students() . '_' . tpl_students::first_name()), data_base::select_multiple_table(tpl_degree::degree(), tpl_degree::degree() . '.' . tpl_degree::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_degree(), tpl_degree::name(), tpl_degree::degree() . '_' . tpl_degree::name()), data_base::select_multiple_table(tpl_department::department(), tpl_department::department() . '.' . tpl_department::id(), data_base::select_multiple_table(tpl_models::models(), tpl_models::models() . '.' . tpl_models::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_models(), tpl_models::id_department()), tpl_department::name(), tpl_department::department() . '_' . tpl_department::name()), data_base::select_multiple_table(tpl_companies::companies(), tpl_companies::companies() . '.' . tpl_companies::id(), data_base::select_multiple_table(tpl_models::models(), tpl_models::models() . '.' . tpl_models::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_models(), tpl_models::id_companies()), tpl_companies::name(), tpl_companies::companies() . '_' . tpl_companies::name()), data_base::select_multiple_table(tpl_section::section(), tpl_section::section() . '.' . tpl_section::id(), data_base::select_multiple_table(tpl_models::models(), tpl_models::models() . '.' . tpl_models::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_models(), tpl_models::id_section()), tpl_section::name(), tpl_section::section() . '_' . tpl_section::name()), data_base::select_multiple_table(tpl_supervisor::supervisor(), tpl_supervisor::supervisor() . '.' . tpl_section::id(), data_base::select_multiple_table(tpl_models::models(), tpl_models::models() . '.' . tpl_models::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_models(), tpl_models::id_supervisor()), tpl_supervisor::name(), tpl_supervisor::supervisor() . '_' . tpl_supervisor::name())));
     echo json_encode($db->get());
 }
 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());
 }
               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_students->id();
?>
" data-halign="center" data-sortable="true"> ID</th>
                <th data-field="<?php 
echo $tpl_students->id_students();
?>
" data-halign="center" data-sortable="true"> ID
                    Student
                </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_students->id_college() . '_name';
?>
" data-halign="center" data-sortable="true">
                    College
 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;
 }
 public function find_students()
 {
     $db = new data_base(tpl_students::students(), array(tpl_students::id(), tpl_students::first_name(), tpl_students::last_name()), array(tpl_students::status() => 1));
     $data = $db->get_where();
     $w = '<option></option>';
     foreach ($data as $row) {
         $w = $w . '<option value="' . $row[tpl_students::id()] . '">' . $row[tpl_students::first_name()] . ' ' . $row[tpl_students::last_name()] . '</option>';
     }
     return $w;
 }
echo $data[tpl_university::university() . '_' . tpl_university::name()];
?>
</h4>
                <h4>College : <?php 
echo $data[tpl_college::college() . '_' . tpl_college::name()];
?>
</h4>
            </div>
            </div>
            <?php 
foreach ($lib->info_students() as $row) {
    ?>
            <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>
Exemple #12
0
foreach ($data as $row) {
    ?>

            <div class="col-xs-6 col-sm-3 placeholder">
                <img src="<?php 
    echo site_url($row[$tpl_students->image()]);
    ?>
" width="200"
                     height="200" class="img-responsive" alt="Generic placeholder thumbnail">
                <h4><?php 
    echo $row['sum'];
    ?>
</h4>
                <span
                    class="text-muted"><?php 
    echo $row[$tpl_students->first_name()] . ' ' . $row[$tpl_students->first_name()];
    ?>
</span>
            </div>
        <?php 
}
?>
    </div>
    <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]"
    <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 
echo $tpl_election->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_students->first_name() . '_' . $tpl_students->elect();
?>
" data-halign="center"
                    data-sortable="true"> First Name Elect
        <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 
                <table id="table_srudent" data-toggle="table"
                       data-url="<?php 
echo site_url('admin/university/ajax_find_students/?id=' . $_GET['id']);
?>
"
                       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>
                        <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">
 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());
 }
Exemple #17
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();
 }