コード例 #1
0
 public function settings()
 {
     /* Load js and css for upload logo */
     $this->append_javascript($this->data['theme_path'] . 'plugins/uploadifive/jquery.uploadifive.js');
     $this->append_stylesheet($this->data['theme_path'] . 'plugins/uploadifive/uploadifive.css');
     if (!_can('Master Settings')) {
         $this->_set_flashdata(lang('permission_denied'));
         redirect(site_url('dashboard'));
     }
     //for currency setting
     $this->load->model('currency_settings_model');
     $this->data['centres'] = $this->currency_settings_model->getCentresCurrencySettings();
     $this->data['countries'] = $this->currency_settings_model->getAll(IMS_DB_PREFIX . 'countries');
     $default = array('protocol' => 'mail', 'from_email' => '', 'from_name' => '');
     $this->data['mail_settings'] = $this->options_model->getOption('mail_settings', $default);
     $this->data['languages'] = $this->options_model->getOption('languages', $default);
     $default = array();
     $this->data['timezones'] = date_time_zone();
     $this->data['language_setting'] = $this->options_model->getOption('language_setting', $default);
     $this->data['parent_portal_setting'] = $this->options_model->getOption('parent_portal_setting', $default);
     $this->data['admin_logo'] = $this->options_model->getOption('admin_logo', $default);
     $this->data['fb_app_key'] = $this->options_model->getOption('fb_app_key', $default);
     global $date_format_settings;
     $this->data['date_format_settings'] = $date_format_settings;
     if ($this->input->post('setting') == 'email_setting') {
         if ($this->_validate_email_settings()) {
             $email_setting = array('protocol' => $this->input->post("protocol"), 'from_email' => $this->input->post("from_email"), 'from_name' => $this->input->post("from_name"));
             if ($this->input->post('protocol') == 'sendmail') {
                 $email_setting['sendmail_path'] = $this->input->post("sendmail_path");
             } else {
                 if ($this->input->post('protocol') == 'smtp') {
                     $email_setting['smtp_host'] = $this->input->post("smtp_host");
                     $email_setting['smtp_port'] = $this->input->post("smtp_port");
                     $email_setting['smtp_username'] = $this->input->post("smtp_username");
                     $email_setting['smtp_password'] = $this->input->post("smtp_password");
                 }
             }
             if ($this->options_model->setOption('mail_settings', $email_setting)) {
                 $this->_set_flashdata(lang('email_settings_changed_successfully'));
                 redirect(site_url('account/settings'));
             }
         }
     }
     if ($this->input->post('setting') == 'language_setting') {
         if ($this->_validate_language_setting()) {
             $language = $this->input->post("language");
             $language_setting = array('language' => $language);
             if ($this->options_model->setOption('language_setting', $language_setting)) {
                 $this->_set_flashdata(lang('language_setting_changed_successfully'));
                 redirect(site_url('account/settings'));
             }
         }
     }
     if ($this->input->post('setting') == 'date_format_setting') {
         if ($this->_validate_date_format_settings()) {
             $date_format_settings = array('date_format' => $this->input->post("date_format"), 'time_format' => $this->input->post("time_format"), 'timezone' => $this->input->post("timezone"));
             if ($this->options_model->setOption('date_format_settings', $date_format_settings)) {
                 $this->_set_flashdata(lang('date_time_settings_changed_successfully'));
                 redirect(site_url('account/settings'));
             }
         }
     }
     if ($this->input->post('setting') == 'parent_portal_setting') {
         $parent_portal_setting = array($this->input->post("feedback"), $this->input->post('progress_report'), $this->input->post('curriculum'), $this->input->post('gallery'), $this->input->post('apps_recommendation'), $this->input->post('live_class'), $this->input->post('roadmap'));
         $fbKey = $this->input->post('fb_app_key');
         $this->options_model->setOption('fb_app_key', serialize($fbKey));
         if ($this->options_model->setOption('parent_portal_setting', $parent_portal_setting)) {
             $this->_set_flashdata(lang('parent_portal_setting_changed_successfully'));
             redirect(site_url('account/settings'));
         }
     }
     /* Account Billing */
     $plan_name = $this->options_model->getOption('plan_name', array());
     $this->data['plan_name'] = isset($plan_name['plan_name']) ? $plan_name['plan_name'] : '';
     $expiry_date = $this->options_model->getOption('expiry_date', array());
     $this->data['expiry_date'] = isset($expiry_date['date']) ? cch_dateFormat($expiry_date['date']) : '';
     $sms_credit = $this->options_model->getOption('sms_credit', array());
     $this->data['sms_credit'] = isset($sms_credit['credit']) ? $sms_credit['credit'] : '';
     $this->data['no_of_SMS_used'] = $this->options_model->countAll(IMS_DB_PREFIX . 'sms_to');
     $max_user = $this->options_model->getOption('max_user', array());
     $this->data['max_user'] = isset($max_user['max_user']) ? $max_user['max_user'] : '';
     $this->data['no_of_active_users'] = $this->options_model->countWhere(array('active' => 1), IMS_DB_PREFIX . 'user');
     $max_centre = $this->options_model->getOption('max_centre', array());
     $this->data['max_centre'] = isset($max_centre['max_centre']) ? $max_centre['max_centre'] : '';
     $this->data['no_of_active_centre'] = $this->options_model->countWhere(array('status' => 1), IMS_DB_PREFIX . 'centre');
     $max_enrolled_students = $this->options_model->getOption('max_enrolled_students', array());
     $this->data['max_enrolled_students'] = isset($max_enrolled_students['max_enrolled_students']) ? $max_enrolled_students['max_enrolled_students'] : '';
     /* Account Billing */
     $this->breadcrumb->append_crumb(lang('settings'));
     if ($this->input->is_ajax_request()) {
         $this->load->view('admin/settings', $this->data);
     } else {
         $this->ims_template->build('parent_account/blank', $this->data);
     }
 }
コード例 #2
0
            ?>
        <tr class="dataTableHead">
            <td><?php 
            echo $j;
            ?>
</td>
            <td><?php 
            echo get_display_name($attendance['name'], $attendance['alias']);
            ?>
</td>
            <td><?php 
            echo isset($attendance['program_type']) ? $attendance['program_type'] : '';
            ?>
</td>
            <td><?php 
            echo isset($attendance['dob']) ? cch_dateFormat($attendance['dob']) : '';
            ?>
</td>
            <?php 
            if (!empty($attendance['att_date'])) {
                foreach ($attendance['att_date'] as $att_date1) {
                    $attendance_date1[] = date('d', strtotime($att_date1['attendance_date']));
                }
            }
            if (!empty($days)) {
                foreach ($days as $day) {
                    if (in_array($day['date'], $attendance_date1)) {
                        ?>
			<td style="text-align: center;"><?php 
                        echo isset($attendance['att_date'][$day['date']]['present']) && $attendance['att_date'][$day['date']]['present'] == 1 ? '1' : '0';
                        ?>
コード例 #3
0
 <?php 
        if ($year_term->default_year_term_for_parents_progress_report == 1) {
            echo 'checked';
        }
        ?>
/></td>

                                        <td><input type="text" class="start_date" value="<?php 
        echo $year_term->start_date == '0000-00-00' ? '' : cch_dateFormat($year_term->start_date);
        ?>
" name="start_date[<?php 
        echo $year_term->year . $year_term->term;
        ?>
]" style="max-width:110px;" /> </td>
                                        <td><input type="text" class="end_date"  value="<?php 
        echo $year_term->end_date == '0000-00-00' ? '' : cch_dateFormat($year_term->end_date);
        ?>
" name="end_date[<?php 
        echo $year_term->year . $year_term->term;
        ?>
]" style="max-width:110px;" /> </td>
                                        
                                        <td> <a href="javascript:;" getlink="<?php 
        echo site_url('year_term/delete/' . $year_term->id);
        ?>
" confirmation="<?php 
        echo lang('are_you_sure_you_want_to_delete_this_year_term');
        ?>
" class="ims_link"><img src="<?php 
        echo base_url($theme_path . 'images/icons/color/cross.png');
        ?>