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; }
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()); }
?> + ',1)" type="checkbox"/>'; } function update_status(id, value) { $(document).ready(function () { $.post('<?php echo site_url('admin/' . tpl_college::college() . '/update_status'); ?> ', { '<?php echo tpl_college::college() . '_' . tpl_college::id(); ?> ': id, '<?php echo tpl_college::college() . '_' . tpl_college::active(); ?> ': value }, function (result) { var data = JSON.parse(result); if (data['valid']) { $('#status_massage').html(<?php echo class_massage::info('title', 'massage'); ?> ); window.setTimeout(function () { $('#status_massage').html(''); }, 2000); var $table = $('#table'); $table.bootstrapTable('showLoading'); $table.bootstrapTable('refresh');
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 ajax_students() { $db = new data_base(tpl_college::college(), array(tpl_college::id(), tpl_college::active(), tpl_college::name(), data_base::select_multiple_table(tpl_students::students(), tpl_students::students() . '.' . tpl_students::id_college(), tpl_college::college() . '.' . tpl_college::id(), 'COUNT(' . tpl_students::id() . ')', tpl_students::students() . '_' . tpl_students::id()))); echo json_encode($db->get()); }