コード例 #1
0
 public function find_companies()
 {
     $db = new data_base(tpl_companies::companies(), array(tpl_companies::id(), tpl_companies::active(), tpl_companies::name()), array(tpl_companies::active() => 1));
     $data = $db->get_where();
     $w = '';
     foreach ($data as $row) {
         $w = $w . '<option value="' . $row[tpl_companies::id()] . '">' . $row[tpl_companies::name()] . '</option>';
     }
     return $w;
 }
コード例 #2
0
                        <th data-field="<?php 
echo tpl_trainer::id();
?>
" data-halign="center" data-sortable="true"> id</th>
                        <th data-field="<?php 
echo tpl_trainer::name();
?>
"
                            data-formatter="operate<?php 
echo tpl_trainer::trainer();
?>
"
                            data-halign="center" data-sortable="true"> name
                        </th>
                        <th data-field="<?php 
echo tpl_companies::companies() . '_' . tpl_companies::id();
?>
" data-halign="center" data-sortable="true">
                            companies
                        </th>
                        <th data-field="<?php 
echo tpl_university::address();
?>
" data-halign="center" data-sortable="true">
                            address
                        </th>
                        <th data-field="<?php 
echo tpl_university::active();
?>
"
                            data-halign="center"
コード例 #3
0
 public function count_companies()
 {
     $db = new data_base(tpl_companies::companies(), array(tpl_companies::id()), array(tpl_companies::active() => 1));
     return count($db->get_where());
 }
コード例 #4
0
 public function find_department()
 {
     if (isset($_POST[tpl_companies::id() . '_' . tpl_companies::companies()])) {
         $id = $_POST[tpl_companies::id() . '_' . tpl_companies::companies()];
         if (!empty($id)) {
             $db = new data_base(tpl_department::department(), array(tpl_department::id(), tpl_department::name()), array(tpl_department::active() => 1, tpl_department::id_companies() => $id));
             $data = $db->get_where();
             $w = '<option></option>';
             foreach ($data as $row) {
                 $w = $w . '<option value="' . $row[tpl_department::id()] . '">' . $row[tpl_department::name()] . '</option>';
             }
             echo $w;
         } else {
             echo 'error';
             exit;
         }
     } else {
         echo 'error';
         exit;
     }
 }
コード例 #5
0
 public function find($id)
 {
     $db = new data_base(tpl_companies::companies(), array("*"), array(tpl_companies::id() => $id));
     $results = $db->get_where();
     if (!empty($results)) {
         return $results;
     } else {
         return false;
     }
 }
コード例 #6
0
 public function get_all_companies()
 {
     if (isset($_POST['id_category'])) {
         $id = $_POST['id_category'];
         if (!empty($id)) {
             $db = new data_base(tpl_companies::companies(), array(tpl_companies::id(), tpl_companies::name()), array(tpl_companies::id_category() => $id, tpl_companies::active() => 1));
             $data = $db->get_where();
             $w = '   <option></option>';
             foreach ($data as $row) {
                 $w = $w . '<option value="' . $row[tpl_specialty::id()] . '">' . $row[tpl_specialty::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'));
     }
 }
コード例 #7
0
 public function find_all_ajax()
 {
     $db = new data_base(tpl_trainer::trainer(), array(tpl_trainer::id(), tpl_trainer::status(), tpl_trainer::name(), data_base::select_multiple_table(tpl_department::department(), tpl_department::department() . '.' . tpl_department::id(), tpl_trainer::trainer() . '.' . tpl_trainer::id_department(), tpl_department::name(), tpl_department::department() . '_' . tpl_department::name()), data_base::select_multiple_table(tpl_section::section(), tpl_section::section() . '.' . tpl_section::id(), tpl_trainer::trainer() . '.' . tpl_trainer::id_section(), tpl_section::name(), tpl_section::section() . '_' . tpl_section::name()), data_base::select_multiple_table(tpl_companies::companies(), tpl_companies::companies() . '.' . tpl_companies::id(), tpl_trainer::trainer() . '.' . tpl_trainer::id_companies(), tpl_companies::name(), tpl_companies::companies() . '_' . tpl_companies::name())));
     echo json_encode($db->get());
 }
コード例 #8
0
            </div>
            <div class="modal-body">
                <form class="form" id="update_form" method="post"
                      action="<?php 
echo site_url('admin/' . tpl_companies::companies() . '/update');
?>
">

                    <div class="form-group">
                        <input type="hidden"
                               name="<?php 
echo tpl_companies::companies() . '_' . tpl_companies::id() . '_update';
?>
"
                               id="<?php 
echo tpl_companies::companies() . '_' . tpl_companies::id() . '_update';
?>
"/>
                    </div>

                    <div class="form-group">
                        <label for=""><?php 
echo tpl_companies::name() . ' ' . tpl_companies::companies();
?>
 : </label>
                        <input type="text" class="form-control"
                               id="<?php 
echo tpl_companies::companies() . '_' . tpl_companies::name() . '_update';
?>
"
                               name="<?php 
コード例 #9
0
            <div class="col-sm-4">
                <h3 class="page-header">Companies</h3>
                <div class="table-responsive">
                    <table id="tpl_college" data-toggle="table"
                           data-url="<?php 
echo site_url('admin/home/ajax_companies');
?>
"
                           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_companies::id();
?>
" data-halign="center" data-sortable="true"> ID</th>
                            <th data-field="<?php 
echo tpl_companies::name();
?>
" data-halign="center" data-sortable="true"> Name
                            <th data-field="<?php 
echo tpl_category::category() . '_' . tpl_university::name();
?>
"
                                data-halign="center" data-sortable="true"> Category
                            </th>
                        </tr>
                        </thead>
                    </table>
コード例 #10
0
 public function find_all_ajax()
 {
     $db = new data_base(tpl_onus_designate::onus_designate(), array(tpl_onus_designate::id(), tpl_onus_designate::id_onus(), tpl_onus_designate::id_student(), tpl_onus_designate::id_models(), tpl_onus_designate::id_degree(), tpl_onus_designate::status(), data_base::select_multiple_table(tpl_onus::onus(), tpl_onus::onus() . '.' . tpl_onus::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_onus(), tpl_onus::name(), tpl_onus::onus() . '_' . tpl_onus::name()), 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_students::students(), tpl_students::students() . '.' . tpl_students::id(), tpl_onus_designate::onus_designate() . '.' . tpl_onus_designate::id_student(), tpl_students::last_name(), tpl_students::students() . '_' . tpl_students::last_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_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())));
     echo json_encode($db->get());
 }