public function get_html()
 {
     $ci = get_instance();
     $bookings = $ci->booking_model->get_latest_bookings(10);
     if (empty($bookings)) {
         return "<p>There are no bookings yet.</p>";
     }
     $html = '
         <table class="table table-striped table-hover" id="latest_bookings">
             <thead>
                 <tr><th>Booking Date</th><th>Message</th><th>Job site</th><th>Trade</th><th>Tradesman</th><th>Confirmed</th></tr>
             </thead>
             <tbody>
     ';
     foreach ($bookings as $booking) {
         $confirmed = $booking->confirmed ? 'Yes' : 'No';
         $html .= '
         <tr>
             <td>' . unix_to_human($booking->booking_date) . '</td>
             <td>' . $booking->message . '</td>
             <td>' . $booking->job_site_address . '</td>
             <td>' . $booking->trade . '</td>
             <td>' . $booking->tradesman_name . '</td>
             <td>' . $confirmed . '</td>
         </tr>';
     }
     $html .= '</tbody></table>';
     return $html;
 }
Example #2
0
 function backupDBFull()
 {
     // Получение бэкапа и присвоение его переменной
     $backup =& $this->dbutil->backup();
     $this->load->helper('download');
     force_download('fullbackup-' . unix_to_human(now(), TRUE, 'eu') . '.gz', $backup);
 }
Example #3
0
 public function cetak_surat()
 {
     setlocale(LC_TIME, 'id_ID');
     $this->load->helper('date');
     $timenow = unix_to_human(now('Asia/Jakarta'), TRUE, 'us');
     $time = date("Ymd-Hi", strtotime($timenow));
     $this->load->model('m_mpdf');
     $iduser = $this->input->post('iduser', TRUE);
     $kategori = $this->input->post('kategori', TRUE);
     $noaplikasi = $this->input->post('noaplikasi', TRUE);
     if ($kategori == "menlu") {
         $result = $this->m_mpdf->get_pdln_user($iduser);
         $nip = $result['nip_pemohon'];
         $html = $this->load->view('mpdf_template/surat_menlu', $result, true);
     } else {
         $result = $this->m_mpdf->get_pdln_user3($iduser, $noaplikasi);
         $nip = $result['nip_pemohon'];
         $html = $this->load->view('mpdf_template/surat_setneg', $result, true);
     }
     $filename = $time . '-' . $kategori . '-' . $nip;
     header("Content-Type: application/vnd.ms-word");
     header("Expires: 0");
     header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
     header("Content-disposition: attachment; filename=" . $filename . '.doc');
     echo $html;
 }
Example #4
0
 public function index()
 {
     // Define the page title.
     $data['title'] = lang('tle_recent_discussions');
     // Define the template.
     $data['template'] = 'pages/home/home';
     // Get the discussions from the database.
     $discussions = $this->discussions->order_by(array('sticky' => 'DESC', 'posted' => 'DESC'))->get_all();
     // Loop through the discussions.
     if (!empty($discussions)) {
         foreach ($discussions as $row) {
             // Get the category associated with the discussion.
             $cat = $this->categories->get_by('id', $row->category_id);
             $data['discussions'][] = array('subject' => anchor(site_url('discussions/view/' . $row->id), $row->subject), 'replies' => $row->replies, 'views' => $row->views, 'last_comment' => unix_to_human($row->last_comment), 'last_poster' => anchor(site_url('users/profile/' . $row->last_poster_id), $row->last_poster), 'category' => anchor(site_url('categories/' . $cat->slug . ''), $cat->name), 'is_sticky' => $row->sticky == 1 ? '<i class="fa fa-thumb-tack"></i>&nbsp;' : '', 'is_closed' => $row->closed == 1 ? '<i class="fa fa-lock"></i>&nbsp;' : '');
         }
     } else {
         // Fill with blank data to prevent errors.
         $data['discussions'] = '';
     }
     // Build the page breadcrumbs.
     $this->crumbs->add(lang('crumb_recent_discussions'));
     // Define the page data.
     $data['page'] = array('btn_new_discussion' => anchor(site_url('discussions/new_discussion'), lang('btn_new_discussion'), array('class' => 'btn btn-default btn-xs')), 'discussions' => element('discussions', $data), 'has_discussions' => !empty($discussions) ? 1 : 0, 'breadcrumbs' => $this->crumbs->output(), 'pagination' => $this->pagination->create_links());
     $this->render(element('page', $data), element('title', $data), element('template', $data));
 }
Example #5
0
 function initialize($data)
 {
     $this->load->helper('date');
     $now = time();
     $this->name = $data['name'];
     $this->email = $data['email'];
     $this->date = unix_to_human(time(), TRUE, 'eu');
 }
 public function signup()
 {
     $count = 1;
     $Domain = "";
     $temp = $this->input->post('Domain');
     if (isset($temp)) {
         foreach ($this->input->post('Domain') as $key => $value) {
             if ($count == 1) {
                 $Domain .= $value;
             } else {
                 $Domain .= ", " . $value;
             }
             $count++;
         }
     }
     $Error = NULL;
     $this->load->helper('date');
     $now = time();
     $RegistrationKey = md5(uniqid());
     $emailid = $_POST['username'] . '@daiict.ac.in';
     $this->load->helper('text');
     $startyearandprogrameid = floor($_POST['username'] / 1000);
     $startyear = floor($startyearandprogrameid / 100);
     $programid = $startyearandprogrameid % 100;
     $this->db->where('programId', $programid);
     $programdata = $this->db->get('program');
     $config = array('allowed_types' => 'pdf', 'max_size' => 2048, 'upload_path' => $_SERVER['DOCUMENT_ROOT'] . "SPC/resumes/" . $_POST['username']);
     $this->load->library('upload', $config);
     if ($programdata->num_rows == 1) {
         $insertdata = array('StudentFirstName' => $_POST['firstName'], 'StudentMiddleName' => $_POST['middleName'], 'StudentLastName' => $_POST['lastName'], 'StudentId' => $_POST['username'], 'StudentPassword' => md5($_POST['password']), 'StudentEmailAddress' => $emailid, 'StudentIsActivated' => 0, 'RoleId' => 1, 'StudentEditedDateAndTime' => unix_to_human($now), 'StudentEditorId' => $_POST['username'], 'StudentRegistrationKey' => $RegistrationKey, 'ProgramStartYear' => $startyear, 'ProgramId' => $programid, 'StudentCPI' => $_POST['CPI'], 'StudentDOB' => date("Y-m-d", strtotime($_POST['DOB'])), 'StudentSex' => $_POST['Gender'], 'StudentSSCPercentage' => $_POST['10th'], 'StudentHSCPercentage' => $_POST['12th'], 'StudentGraduationPercentage' => $_POST['Graduation'], 'StudentCurrentBacklogs' => $_POST['CurrentBackLogs'], 'StudentTotalBacklogs' => $_POST['TotalBackLogs'], 'StudentTechnicalElectives' => $_POST['TechnicalElectives'], 'StudentDomainChoice' => $Domain, 'StudentMobileNumber' => $_POST['MobileNumber'], 'StudentAlternateMobileNumber' => $_POST['AlternateMobileNumber1'], 'StudentAddressLine1' => $_POST['AddressLine1'], 'StudentAddressLine2' => $_POST['AddressLine2'], 'StudentCity' => $_POST['City'], 'StudentState' => $_POST['State'], 'StudentPostalCode' => $_POST['PostalCode'], 'StudentGuardianName' => $_POST['GuardianName'], 'StudentGuardianMobileNumber' => $_POST['GuardianMobileNumber'], 'StudentIsInterested' => $_POST['IsInterested']);
         if (!is_dir($_SERVER['DOCUMENT_ROOT'] . "SPC/resumes/" . $_POST['username'])) {
             mkdir($_SERVER['DOCUMENT_ROOT'] . "SPC/resumes/" . $_POST['username'], 0, true);
         }
         if ($this->upload->do_upload()) {
             $data = $this->upload->data();
             $insertdata['StudentResumePath'] = $_SERVER['DOCUMENT_ROOT'] . "resumes/" . $_POST['username'] . '/' . $data['raw_name'] . $data['file_ext'];
             $emailConfig = array('mailtype' => 'html');
             $this->load->library('email', $emailConfig);
             $this->email->from('*****@*****.**', 'Student Placement Cell');
             $this->email->to($emailid);
             $this->email->subject("Thanks for Registration.");
             $this->email->message("Please click on the below link to activate the account.<br /><a href = '" . base_url() . "register/activate/{$RegistrationKey}'>Activate Account.</a>");
             if ($this->email->send() && $this->db->insert('student', $insertdata)) {
                 $data = array('RegistrationProcess' => TRUE);
                 $this->session->set_userdata($data);
                 return 1;
             } else {
                 return -1;
             }
         } else {
             $Error = array("upload" => $this->upload->display_errors());
             return $Error;
         }
     } else {
         $Error = array("studentid" => "Invalid Student ID.");
         return $Error;
     }
 }
Example #7
0
 public function index()
 {
     $time_now = now('America/Mexico_City');
     $time_past = $time_now - $this->initial_date_generator(365);
     $createDate_past = new DateTime(unix_to_human($time_past, TRUE, 'EU'));
     $createDate_now = new DateTime(unix_to_human($time_now, TRUE, 'EU'));
     $data = array('titlederecha' => "Datos", 'titleizquierda' => "Grafica", 'portafolios' => $this->get_portafolios(), 'base_url' => base_url(), 'fecha_ini' => $createDate_past->format('Y-m-d'), 'fecha_fin' => $createDate_now->format('Y-m-d'));
     $this->call_views('reportes/reporte', $data);
 }
 public function get_with_author_names($id_or_fields = null, $first_only = false, $order_by = null, $select_fields = array())
 {
     $messages = parent::get($id_or_fields, $first_only, $order_by, $select_fields);
     foreach ($messages as $key => $message) {
         $messages[$key]->author = $this->user_model->get_name($message->author_id);
         $messages[$key]->date = unix_to_human($message->creation_date);
     }
     return $messages;
 }
Example #9
0
 /**
  * Получение данных фильтра для вставки в шаблон
  */
 private function _get_tpl_filter($filter = false)
 {
     if (!$filter) {
         $filter = $this->users->get_filter('users_list');
     }
     $tpl_data['filter_login'] = isset($filter['login']) ? $filter['login'] : '';
     $tpl_data['filter_register_before'] = isset($filter['register_before']) && $filter['register_before'] ? unix_to_human($filter['register_before']) : unix_to_human(now());
     $tpl_data['filter_register_after'] = isset($filter['register_after']) && $filter['register_after'] ? unix_to_human($filter['register_after']) : '';
     $tpl_data['filter_last_visit_before'] = isset($filter['last_visit_before']) && $filter['last_visit_before'] ? unix_to_human($filter['last_visit_before']) : unix_to_human(now());
     $tpl_data['filter_last_visit_after'] = isset($filter['last_visit_after']) && $filter['last_visit_after'] ? unix_to_human($filter['last_visit_after']) : '';
     return $tpl_data;
 }
Example #10
0
 public function get_current_date_start_time($country_code = 'BD')
 {
     $time_zone_array = DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, $country_code);
     $dateTimeZone = new DateTimeZone($time_zone_array[0]);
     $dateTime = new DateTime("now", $dateTimeZone);
     $unix_current_time = now() + $dateTime->getOffset();
     $human_current_time = unix_to_human($unix_current_time);
     $human_current_time_array = explode(" ", $human_current_time);
     $human_current_date = $human_current_time_array[0];
     $human_current_date_start_time = $human_current_date . ' 00:00 AM';
     $unix_current_date_start_time = human_to_unix($human_current_date_start_time);
     return $unix_current_date_start_time - $dateTime->getOffset();
 }
Example #11
0
 function get_research($research, $number_page, $per_page)
 {
     $where = "(c_title LIKE '%" . $research . "%'\n\t\t\t\tOR  c_content LIKE '%" . $research . "%'\n\t\t\t\tOR  c_tags LIKE '%" . $research . "%')\n\t\t\t\tAND c_status = 1\n\t\t\t\tAND c_cdate <= '" . unix_to_human(now(), TRUE, 'eu') . "'";
     $this->db->select('c_id, c_title, c_content, c_image, c_tags, c_cdate, c_url_rw, r_title, r_url_rw');
     $this->db->from('content');
     $this->db->join('rubric', 'rubric.r_id = content.r_id');
     $this->db->where($where);
     $this->db->order_by('c_cdate', 'DESC');
     if ($per_page and $number_page) {
         $this->db->limit($per_page, ($number_page - 1) * $per_page);
     } elseif ($per_page) {
         $this->db->limit($per_page);
     }
     $query = $this->db->get();
     return $query;
 }
 private function auditQuery($_POST)
 {
     $auditData = array();
     $now = time();
     $auditData['username'] = $this->session->userdata('username');
     $auditData['updateDate'] = unix_to_human($now, TRUE, 'us');
     $auditData['previousData'] = "";
     $auditData['currentData'] = "";
     if (isset($_POST['recordInformationID'])) {
         $id = $_POST['recordInformationID'];
         $this->db->select('*');
         $this->db->from('rm_recordType');
         $this->db->where('recordInformationID', $id);
         $query = $this->db->get();
         if ($query->num_rows() > 0) {
             foreach ($query->result() as $results) {
                 foreach ($results as $key => $value) {
                     $auditData['previousData'] .= "{$key}: {$value}" . "; ";
                 }
             }
         }
     } elseif (isset($_POST['retentionScheduleID'])) {
         $id = $_POST['retentionScheduleID'];
         $this->db->select('*');
         $this->db->from('rm_retentionSchedule');
         $this->db->where('retentionScheduleID', $id);
         $query = $this->db->get();
         if ($query->num_rows() > 0) {
             foreach ($query->result() as $results) {
                 foreach ($results as $key => $value) {
                     $auditData['previousData'] .= "{$key}: {$value}" . "; ";
                 }
             }
         }
     } else {
         $auditData['previousData'] = "No previous data recorded";
     }
     foreach ($_POST as $key => $value) {
         $auditData['currentData'] .= "{$key}: {$value}" . "; ";
     }
     $this->db->insert('rm_audit', $auditData);
     $this->db->select_max('auditID');
     $this->db->get('rm_audit');
 }
Example #13
0
 public function show_addform()
 {
     $time = now('America/Mexico_City');
     /* Reglas para la forma */
     $this->form_validation->set_rules('portafolios', 'Portafolios', 'required|callback_validate_portafolios');
     $this->form_validation->set_rules('fecha', 'Fecha', 'required');
     $this->form_validation->set_rules('cantidad', 'Cantidad', 'required');
     if ($this->form_validation->run() == FALSE) {
         // se corre validación de reglas definidas
         //Array con los datos que se le van a enviar a la vista.
         $data = array('accion' => 'aportacion/show_addform', 'title' => 'Agregar aportacion', 'cantidad' => $this->form_validation->set_value('cantidad'), 'portafolios' => $this->get_portafolios(), 'selectedPortafolios' => $this->form_validation->set_value('portafolios'), 'fecha' => unix_to_human($time, TRUE, 'EU'));
         $this->call_views('aportaciones/form', $data);
     } else {
         $p_fecha = $this->input->post('fecha');
         $p_cantidad = $this->input->post('cantidad');
         $p_portafolios = $this->input->post('portafolios');
         $this->Operaciones_Model->insert_Operaciones_Model($p_cantidad, $p_fecha, $p_portafolios, 'AP');
         redirect('aportacion/show_list', 'refresh');
     }
 }
Example #14
0
    function get_rubrics_front()
    {
        $get_rubrics = $this->db->distinct()->select('rubric.r_id')->join('content', 'content.r_id = rubric.r_id')->from('rubric')->where('c_pdate <=', unix_to_human(now(), TRUE, 'eu'))->where('c_status', 1)->get();
        if ($get_rubrics->num_rows() > 0) {
            foreach ($get_rubrics->result() as $row) {
                $r_id[] = ' OR r_id = ' . $row->r_id;
                $r_id[0] = current($r_id);
            }
            $first = current($r_id);
            $explode = explode(" OR", $first);
            $first_id = $explode[1];
            $params = implode('', $r_id);
            $query = $this->db->query('SELECT r_id, r_title, r_description, r_url_rw
										FROM rubric
										WHERE ' . $first_id . ' ' . $params . ' 
										ORDER BY r_title ASC');
            return $query;
        } else {
            return false;
        }
    }
Example #15
0
File: users.php Project: nindeo/nkr
 function create_acount()
 {
     $this->form_validation->set_rules('username', 'Usuario', 'trin|required|min_length[5]|max_length[12]|callback__username_check');
     $this->form_validation->set_rules('correo', 'Correo', 'trin|required|valid_email|callback__email_check');
     $this->form_validation->set_rules('password', 'Password', 'trin|required|md5');
     $this->form_validation->set_rules('repassword', 'Confirmar Password', 'trin|required|matches[password]|md5');
     $this->form_validation->set_message('required', 'El campo %s es requerido');
     $this->form_validation->set_message('valid_email', 'El campo %s no es valido');
     $this->form_validation->set_message('_username_check', 'El campo %s ya existe');
     $this->form_validation->set_message('_email_check', 'El campo %s ya existe');
     $this->form_validation->set_message('matches', 'Las passwords no coinciden');
     if ($this->form_validation->run() == FALSE) {
         $this->join();
     } else {
         $username = $this->input->post('username');
         $correo = $this->input->post('correo');
         $password = $this->input->post('password');
         $activation_code = $this->_random_string(10);
         $password = $this->input->post('password');
         $now = time();
         $gmt = unix_to_human($now, TRUE, 'eu');
         $insert = $this->users_model->insert_user($username, $correo, $password, $activation_code, $gmt);
         //email confirmacion
         $config = array('protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.googlemail.com', 'smtp_port' => 465, 'smtp_user' => '*****@*****.**', 'smtp_pass' => 'adriansdenis2185', 'mailtype' => 'html');
         $this->load->library('email', $config);
         $this->email->set_newline("\r\n");
         //configuracion del correo
         $this->email->from('*****@*****.**', 'noockers');
         $this->email->to($correo);
         $this->email->subject('Verificacion de Registro en Noockers');
         $this->email->message('Por favor verifique su registro ' . anchor('http://nkr.nindeo.com/users/register_confirm/' . $activation_code, 'Valida tu correo'));
         //$this->email->send();
         if ($this->email->send()) {
             echo 'Email enviado correctamente!!';
         } else {
             show_error($this->email->print_debugger());
         }
     }
 }
 public function edit($maintenance_contract_id = null)
 {
     $maintenance_contract_data = $this->maintenance_contract_model->get_values($maintenance_contract_id);
     $locked = false;
     if (!empty($maintenance_contract_id)) {
         require_capability('maintenance_contracts:editcontracts');
         $maintenance_contract_data['creation_date'] = unix_to_human($maintenance_contract_data['creation_date'], '%d/%m/%Y %h:%i');
         $maintenance_contract_data['next_maintenance_date'] = unix_to_human($maintenance_contract_data['next_maintenance_date'], '%d/%m/%Y %h:%i');
         form_element::$default_data = (array) $maintenance_contract_data;
         // Set up title bar
         $title = "Edit maintenance contract #{$maintenance_contract_id}";
         $help = "Use this form to edit the maintenance contract";
     } else {
         // adding a new maintenance_contract
         $title = "Create a new maintenance contract";
         $help = 'Use this form to create a new maintenance contract';
     }
     $post_vars = $this->input->post();
     if (!empty($post_vars)) {
         foreach ($post_vars as $var => $val) {
             form_element::$default_data[$var] = $val;
         }
     }
     $this->config->set_item('replacer', array('miniant' => array('/miniant/maintenance_contracts/index|Maintenance contracts')));
     $title_options = array('title' => $title, 'help' => $help, 'expand' => 'page', 'icons' => array());
     $jstoload = array('signaturepad/json2', 'maintenance_contracts/edit', 'application/messages');
     if (!empty($maintenance_contract_id)) {
         $jstoload[] = 'maintenance_contracts/units';
     }
     $dropdowns = $this->get_dropdowns();
     if (!empty($maintenance_contract_id)) {
         $this->db->where('account_id', $maintenance_contract_data['account_id']);
         $dropdowns['tenancies'] = $this->tenancy_model->get_dropdown('name', '-- Select a Tenancy/Owner --');
     } else {
         $dropdowns['tenancies'] = array();
     }
     $pageDetails = array('title' => $title, 'title_options' => $title_options, 'content_view' => 'maintenance_contract/edit', 'maintenance_contract_id' => $maintenance_contract_id, 'maintenance_contract_data' => $maintenance_contract_data, 'dropdowns' => $dropdowns, 'jstoloadinfooter' => $jstoload, 'module' => 'miniant', 'csstoload' => array('jquery.signaturepad'), 'feature_type' => 'Custom Feature');
     $this->load->view('template/default', $pageDetails);
 }
Example #17
0
 public function getContestDetail()
 {
     $participantid = $this->session->userdata('participantid');
     $q = "SELECT pcc.contest_id, pcc.contest_name, pcc.contest_start, pcc.contest_freeze, pcc.contest_end, pcp.participant_id, pcc.contest_penalty " . "FROM pc_contest pcc, pc_participant pcp WHERE pcc.contest_id = pcp.contest_id AND " . "pcp.participant_id = " . $participantid;
     $qr = $this->db->query($q);
     $row = $qr->first_row();
     $limit = now();
     $user = "******" . $row->contest_id;
     $userr = $this->db->query($user);
     if ($qr->num_rows() > 0) {
         echo "<table>";
         echo "<tr><td colspan='2'>" . character_limiter($row->contest_name, 15) . "</td></tr>";
         // echo "<tr><td colspan='2'>Participant ID : " . $row->participant_id . "</td></tr>";
         echo "<tr><td>Start</td><td>: " . unix_to_human($row->contest_start) . "</td></tr>";
         echo "<tr><td>Frz</td><td>: " . unix_to_human($row->contest_freeze) . "</td></tr>";
         echo "<tr><td>End</td><td>: " . unix_to_human($row->contest_end) . "</td></tr>";
         // echo "<tr><td>Pty</td><td>: " . $row->contest_penalty . " s</td></tr>";
         echo "<tr><td>Active</td><td>: " . $userr->first_row()->sum . " users</td></tr>";
         echo "</table>";
     } else {
         echo "Cannot Load Contest Detail";
     }
 }
Example #18
0
 public function show_addform()
 {
     $time = now('America/Mexico_City');
     //se agregan reglas a la forma
     $this->form_validation->set_rules('nombre', 'Nombre de portafolios', 'required');
     $this->form_validation->set_rules('valorinicial', 'Valor inicial', 'required');
     $this->form_validation->set_rules('fechacreacion', 'Fecha creacion', 'required');
     if ($this->form_validation->run() == FALSE) {
         //Array con los datos que se le van a enviar a la vista.
         $data = array('accion' => 'portafolios/show_addform', 'title' => 'Agregar portafolios', 'nombre' => $this->form_validation->set_value('nombre'), 'valorinicial' => $this->form_validation->set_value('valorinicial'), 'portafolios' => $this->get_portafolios(), 'selectedPortafolios' => $this->form_validation->set_value('portafolios'), 'fechacreacion' => unix_to_human($time, TRUE, 'EU'));
         $this->call_views('portafolios/form', $data);
     } else {
         $p_nombre = $this->input->post('nombre');
         $p_valorinicial = $this->input->post('valorinicial');
         $p_fechacreacion = $this->input->post('fechacreacion');
         $p_portafoliospadre = $this->input->post('portafolios');
         if ($p_portafoliospadre == 0) {
             $p_portafoliospadre = null;
         }
         $this->Portafolios_Model->insert_Portafolios_Model($p_nombre, $p_valorinicial, $p_fechacreacion, $p_portafoliospadre);
         redirect('portafolios', 'refresh');
     }
 }
 public function edit($assignment_id)
 {
     require_capability('assignments:edit');
     $assignment_data = $this->assignment_model->get_values($assignment_id);
     if (empty($assignment_data)) {
         redirect(base_url() . 'miniant/orders/schedule');
     }
     $assignment_data->appointment_date = unix_to_human($assignment_data->appointment_date, '%d/%m/%Y %h:%i');
     $order = (object) $this->order_model->get_values($assignment_data->order_id);
     $order_type = $this->order_model->get_type_string($order->order_type_id);
     $statuses = $this->assignment_model->get_statuses($assignment_id, false);
     $current_statuses = array();
     if (!empty($statuses)) {
         foreach ($statuses as $status) {
             $current_statuses[] = $status->status_id;
         }
     }
     $allstatuses_array = $this->status_model->get_for_document_type('assignment');
     $allstatuses = array();
     foreach ($allstatuses_array as $status) {
         $allstatuses[$status->id] = $status->name;
     }
     $assigned_technicians = $this->assignment_model->get_assigned_technicians($order->id, $assignment_data->unit_id);
     $this->user_model->filter_by_role($this->role_model->get(array('name' => 'Technician'), true)->id);
     $technicians = $this->user_model->get_dropdown('first_name', false);
     form_element::$default_data = (array) $assignment_data;
     form_element::$default_data['technician_id'] = $assigned_technicians;
     form_element::$default_data['senior_technician_id'] = $order->senior_technician_id;
     // Set up title bar
     $title = "Edit {$assignment_data->reference_id} assignment";
     $help = "Use this form to edit the assignment";
     $this->config->set_item('replacer', array('miniant' => null, 'orders' => array('/miniant/orders/order|Jobs'), 'assignments' => array('/miniant/orders/schedule|Schedule'), 'edit' => $title, 'add' => $title));
     $title_options = array('title' => $title, 'help' => $help, 'expand' => 'page', 'icons' => array());
     $pageDetails = array('title' => $title, 'title_options' => $title_options, 'content_view' => 'assignments/edit', 'order_id' => $order->id, 'assignment_id' => $assignment_id, 'assignment_data' => $assignment_data, 'technicians' => $technicians, 'senior_technician_id' => $order->senior_technician_id, 'statuses' => $current_statuses, 'allstatuses' => $allstatuses, 'module' => 'miniant', 'feature_type' => 'Custom Feature', 'module' => 'miniant', 'assigned_technicians' => $assigned_technicians, 'priority_levels' => $this->priority_level_model->get_dropdown('name'), 'jstoloadinfooter' => array('orders/assignment_edit'), 'csstoload' => array());
     $this->load->view('template/default', $pageDetails);
 }
Example #20
0
 public function cetak_surat()
 {
     setlocale(LC_TIME, 'id_ID');
     $this->load->helper('date');
     $timenow = unix_to_human(now('Asia/Jakarta'), TRUE, 'us');
     $time = date("Ymd-Hi", strtotime($timenow));
     $this->load->model('m_mpdf');
     $iduser = $this->input->post('iduser', TRUE);
     $kategori = $this->input->post('kategori', TRUE);
     $noaplikasi = $this->input->post('noaplikasi', TRUE);
     if ($kategori == "menlu") {
         $result = $this->m_mpdf->get_pdln_user($iduser);
         $nip = $result['nip_pemohon'];
         $html = $this->load->view('mpdf_template/surat_menlu', $result, true);
     } else {
         $result['query'] = $this->m_mpdf->get_pdln_user2($iduser, $noaplikasi);
         $nip = $result['query'][0]['nip_pemohon'];
         $html1 = $this->load->view('mpdf_template/surat_setneg_2', $result, true);
         $html2 = $this->load->view('mpdf_template/surat_setneg_2_page2', $result, true);
     }
     $filename = $time . '-' . $menset . '-' . $nip;
     $this->load->library('l_mpdf');
     $mpdf = $this->l_mpdf->load();
     $mpdf = new mPDF('', 'A4', '', '', 30, 20, 20, 25);
     if ($kategori == "menlu") {
         $mpdf->WriteHTML($html);
     } else {
         $mpdf->WriteHTML($html1);
         $mpdf->AddPage();
         $mpdf->WriteHTML($html2);
     }
     if ($filename != "") {
         $mpdf->Output(FCPATH . '../files/' . $kategori . '.pdf', 'F');
     }
     $mpdf->Output();
 }
Example #21
0
 function processLogin($username, $password)
 {
     $obj =& get_instance();
     $obj->load->database();
     $obj->load->library('session');
     $obj->load->helper('url');
     $obj->index = $obj->config->item('base_url');
     $login = 0;
     $strQuery = "SELECT * FROM tbl_users where email_id='" . $username . "' and password='******' and access_id=1";
     $query = $obj->db->query($strQuery);
     $res = $query->result_array();
     if ($query->num_rows() > 0) {
         $login = 1;
     }
     if ($login == 1) {
         $query = $obj->db->query("SELECT * from tbl_users where email_id='" . $username . "' and access_id=1");
         $details = $query->result_array();
         $username = $details[0]['username'];
         $group = $details[0]['group_id'];
         $loginname = $details[0]['email_id'];
         $obj->load->helper('date');
         //echo time();
         $dd = time('YYYY-MM-DD HH:MM:SS');
         $ee = unix_to_human($dd);
         $dd = date("Y-m-d H:i:s");
         // for audit login
         $eachlogindata = array('user_id' => $details[0]['user_id'], 'log_datetime' => $dd, 'log_ipaddress' => $obj->input->ip_address());
         $obj->db->insert('tbl_login_audit', $eachlogindata);
         $data = array('username' => $username, 'userid' => $details[0]['user_id'], 'logged_in' => TRUE, 'loginVal' => 1, 'chapter' => $details[0]['chap_id'], 'group' => $details[0]['group_id']);
         $obj->session->set_userdata($data);
         $processval = True;
     } else {
         $processval = False;
     }
     return $processval;
 }
Example #22
0
 public function get_bookings()
 {
     $start = human_to_unix($this->input->post('start'), true);
     $end = human_to_unix($this->input->post('end'), true);
     $confirmed = $this->input->post('confirmed');
     $bookings = array();
     $bookings = $this->booking_model->get_for_schedule($start, $end, null, $confirmed);
     $events = array();
     foreach ($bookings as $booking) {
         $recipients = $this->booking_model->get_recipients($booking->id);
         $staff = $this->user_model->get_dropdown_full_name(false);
         $job_site = $this->job_site_model->get($booking->job_site_id);
         $event = new stdClass();
         $event->id = "{$booking->id}";
         $event->title = $this->load->view('job_site/booking_title', compact('booking', 'confirmed', 'job_site'), true);
         $event->allDay = true;
         $event->start = unix_to_human($booking->booking_date, '%Y-%m-%d');
         $event->end = unix_to_human($booking->booking_date + 60, '%Y-%m-%d');
         $event->job_site_id = $booking->job_site_id;
         $event->confirmed = $confirmed;
         $events[] = $event;
     }
     echo json_encode($events);
 }
Example #23
0
 /**
  * Profile
  *
  * Allows the user to view their profile.
  *
  * @param       integer     $user_id
  * @author      Chris Baines
  * @since       0.2.0
  */
 public function profile($user_id = NULL)
 {
     // Check if the user has permission.
     if (!$this->permission->has_permission('view_profile')) {
         // Create a message.
         $this->messageci->set(lang('error_permission_required'), 'error');
         // Redirect.
         redirect($this->agent->referrer(), 'refresh');
     }
     // Check if a user is logged in, otherwise load the achievements library.
     if ($this->ion_auth->logged_in() === FALSE) {
         $config['user_id'] = $user_id;
         $this->load->library('achievements', $config);
     }
     // Get the users achievements.
     $achievements = $this->achievements->get_user_achievements();
     if (!empty($achievements)) {
         foreach ($achievements as $row) {
             $data['achievements'][] = array('name' => $row->name, 'description' => $row->description, 'points' => $row->points);
         }
     }
     // Get the users thumbs.
     $thumbs = $this->thumbs->get_many_by('recipient_user_id', $user_id);
     // Set the table template.
     $data['tmpl'] = array('table_open' => '<table class="table table-hover">');
     $this->table->set_template(element('tmpl', $data));
     // Set the table headings.
     $this->table->set_heading('', lang('tbl_in_discussion'), lang('tbl_given_by'), lang('tbl_date'), lang('tbl_for_comment'));
     if (!empty($thumbs)) {
         foreach ($thumbs as $thumb) {
             // Get the discussion.
             $discussion = $this->discussions->get_by('id', $thumb->discussion_id);
             // Get the givers user details.
             $user = $this->ion_auth->user($thumb->giver_user_id)->row();
             // Build the givers avatar.
             $data['avatar'] = array('src' => $this->gravatar->get_gravatar($user->email, $this->config->item('gravatar_rating'), 20, $this->config->item('gravatar_default_image')));
             $this->table->add_row(img(element('avatar', $data)), anchor(site_url('discussions/view/' . $thumb->discussion_id), $discussion->subject), anchor(site_url('users/profile/' . $thumb->giver_user_id), ucwords($thumb->giver_username)), unix_to_human($thumb->given), anchor(site_url('discussions/view/' . $thumb->discussion_id . '/#' . $thumb->comment_id), 'View'));
         }
     }
     // Get the user from the database.
     if (!$user_id) {
         $user = $this->ion_auth->user()->row();
     } else {
         $user = $this->ion_auth->user($user_id)->row();
     }
     // Define the page title.
     $data['title'] = sprintf(lang('tle_profile'), $user->username);
     // Define the page template.
     $data['template'] = 'pages/users/profile';
     // Build the page breadcrumbs.
     $this->crumbs->add(lang('crumb_users'), 'users');
     $this->crumbs->add(sprintf(lang('crumb_profile'), $user->username));
     // Build the discussion starters avatar.
     $data['avatar'] = array('src' => $this->gravatar->get_gravatar($user->email, $this->config->item('gravatar_rating'), 100, $this->config->item('gravatar_default_image')), 'class' => 'media-object img-circle center-block');
     $data['page'] = array('username' => $user->username, 'joined' => timespan($user->created_on, time()), 'last_visit' => timespan($user->last_login, time()), 'first_name' => $user->first_name, 'last_name' => $user->last_name, 'points' => $user->points, 'avatar' => img(element('avatar', $data)), 'total_discussions' => $this->discussions->count_by('poster', $user->username), 'total_comments' => $this->comments->count_by('poster_id', $user->id), 'online' => $this->users->user_online($user->id) == TRUE ? '<i class="fa fa-circle online" title="' . lang('txt_online') . '"></i>' : '<i class="fa fa-circle offline" title="' . lang('txt_offline') . '"></i>', 'achievements' => element('achievements', $data), 'tbl_thumbs' => $this->table->generate(), 'has_achievements' => !empty($achievements) ? 1 : 0, 'btn_send_pm' => anchor(site_url('messages/send/' . $user->id . ''), lang('btn_pm'), array('class' => 'btn btn-default btn-sm', 'data-toggle' => 'tooltip', 'data-placement' => 'top', 'title' => lang('tip_send_user_pm'))), 'btn_login' => form_submit('submit', lang('btn_login'), 'class="btn btn-primary"'), 'btn_forgot_password' => anchor(site_url('users/forgot_password'), lang('btn_forgot_password'), array('class' => 'btn btn-danger')), 'breadcrumbs' => $this->crumbs->output());
     $this->render(element('page', $data), element('title', $data), element('template', $data));
 }
Example #24
0
 function simpan_back()
 {
     $config['upload_path'] = './uploads/';
     $config['allowed_types'] = 'pdf|rar|zip|docx|doc|ppt|pps|pptx|ppsx';
     $config['max_size'] = '2048';
     $this->load->library('upload', $config);
     if (!$this->upload->do_upload('mpath')) {
         print $this->upload->display_errors();
         $data['content'] = 'tambah_arsip';
         $this->load->view('admin/layout.php', $data);
     } else {
         $upload_data = $this->upload->data();
         $filedok = $config['upload_path'] . $upload_data["file_name"];
     }
     //user level
     $level = $this->session->userdata('status');
     if ($level == 'dosen' || $level == 'admin') {
         $status = 1;
     } else {
         $status = 0;
     }
     //timestamp
     $now = time();
     $timezone = 'UP7';
     $daylight_saving = false;
     $now = gmt_to_local($now, $timezone, $daylight_saving);
     $now = unix_to_human($now, TRUE, 'eu');
     $data = array('mjudul' => $this->input->post('mjudul'), 'mdesc' => $this->input->post('mdesc'), 'tipe' => $this->input->post('tipe'), 'mpath' => $filedok, 'mcatid' => $this->session->userdata('idcat'), 'mdate' => $now, 'mauthor' => $this->session->userdata('id'), 'm_isdel' => 0, 'm_ispub' => $status);
     $this->arsip_model->simpan_arsip($data);
     $this->session->set_flashdata('message', 'Data berhasil disimpan');
     redirect('admin/arsipmateri/tampildata');
 }
                    -->
                    <tr>
                        <th>Estimated start</th><td><?php 
echo unix_to_human($assignment->appointment_date, '%h:%i%a');
?>
</td>
                    </tr>
                    <tr>
                        <th>Estimated time</th><td><?php 
echo get_duration($assignment->estimated_duration);
?>
</td>
                    </tr>
                    <tr>
                        <th>Estimated finish</th><td><?php 
echo unix_to_human($assignment->appointment_date + $assignment->estimated_duration * 60, '%h:%i%a');
?>
</td>
                    </tr>
                    <?php 
// TODO Display a summary of time spent on job
?>
                </table>
            </div>
            <div class="modal-footer">
                <button class="btn btn-default" onclick="window.location='<?php 
echo base_url() . 'miniant/orders/assignments/edit/' . $assignment->id;
?>
'">Edit</button>
                <?php 
if ($this->order_model->can_be_unscheduled($order->id)) {
Example #26
0
    public function getAllClarificationContest($contestid)
    {
        $q = '
			SELECT pcu.user_name,
			  pcclar.clarification_id,
			  pcclar.clarification_time,
			  pcclar.clarification_title,
			  pcclar.clarification_content,
			  pcclar.clarification_response
			FROM pc_clarification pcclar,
			  pc_user pcu,
			  pc_participant pcp
			WHERE pcclar.participant_id IN
			  ( SELECT participant_id FROM pc_participant WHERE contest_id = ' . $contestid . '
			  )
			AND pcclar.participant_id = pcp.participant_id
			AND pcp.user_name         = pcu.user_name
			ORDER BY pcclar.clarification_time DESC
		';
        $qr = $this->db->query($q);
        foreach ($qr->result() as $row) {
            $color = "#FFFFFF";
            if ($row->clarification_response == "Not Responsed Yet") {
                $color = "#FF7777";
            }
            echo "<table border='1' width='100%' bgcolor='{$color}'>";
            echo "<tr>";
            echo "<td width='75%'>By : " . $row->user_name . "</td>";
            echo "<td>" . unix_to_human($row->clarification_time) . "</td>";
            echo "</tr>";
            echo "<tr>";
            echo "<td colspan='2'><strong>" . htmlentities($row->clarification_title) . "</strong></td>";
            echo "</tr>";
            echo "<tr>";
            echo "<td colspan='2'>" . htmlentities($row->clarification_content) . "</td>";
            echo "</tr>";
            echo "<tr>";
            echo "<td colspan='2'><i>" . htmlentities($row->clarification_response) . "</i></td>";
            echo "</tr>";
            echo "<tr>";
            echo "<td colspan='2'>";
            ?>
				<form action="" method="post">
					<input type="hidden" name="clid" value="<?php 
            echo $row->clarification_id;
            ?>
" />
					<input type="text" name="answer" size="50" />
					<input type="submit" value="Update Answer" />
				</form>
				<?php 
            echo "</td>";
            echo "</tr>";
            echo "<tr>";
            ?>
				<table>
					<tr>
						<td>Quick Answer : </td>
						<td>
							<form action="" method="post">
								<input type="hidden" name="clid" value="<?php 
            echo $row->clarification_id;
            ?>
" />
								<input type="hidden" name="answer" value="Ya" />
								<input type="submit" value="Ya" />
							</form>
						</td>
						<td>
							<form action="" method="post">
								<input type="hidden" name="clid" value="<?php 
            echo $row->clarification_id;
            ?>
" />
								<input type="hidden" name="answer" value="Tidak" />
								<input type="submit" value="Tidak" />
							</form>
						</td>
						<td>
							<form action="" method="post">
								<input type="hidden" name="clid" value="<?php 
            echo $row->clarification_id;
            ?>
" />
								<input type="hidden" name="answer" value="Tidak Ada Komentar" />
								<input type="submit" value="Tidak Ada Komentar" />
							</form>
						</td>
						<td>
							<form action="" method="post">
								<input type="hidden" name="clid" value="<?php 
            echo $row->clarification_id;
            ?>
" />
								<input type="hidden" name="answer" value="Baca Kembali Soal" />
								<input type="submit" value="Baca Kembali Soal" />
							</form>
						</td>
					</tr>
				</table>
				<?php 
            echo "</tr>";
            echo "</table>";
            echo "<br />";
        }
    }
Example #27
0
if ($this->ion_auth->in_group(array('business', 'students', 'ecommerce', 'designer'))) {
    include_once 'user_menu.php';
} elseif ($this->ion_auth->in_group(array('employer'))) {
    include_once 'recruiter_menu.php';
} elseif ($this->ion_auth->in_group(array('admin'))) {
    include_once 'admin_menu.php';
}
?>
                    </ul>
                    <div class="timeinfo">
                        <div class="pull-left"><?php 
echo 'Local time';
?>
</div>
                        <div class="pull-right"><?php 
echo unix_to_human(time());
?>
</div>
                        <div class="clearfix"><!-- --></div>
                        <div class="pull-left"><?php 
echo 'System time';
?>
</div>
                        <div class="pull-right"><?php 
echo date('Y-m-d H:i:s');
?>
</div>
                        <div class="clearfix"><!-- --></div>
                    </div>                 
                </section>
            </aside>
Example #28
0
 public function checkNotActivatedUsers()
 {
     //Added by Thejan
     $this->load->helper('date');
     $this->load->database();
     $today = new DateTime(unix_to_human(now()));
     $this->db->select('email, last_logged_date');
     $this->db->from('users');
     $this->db->where('status', 0);
     $result = $this->db->get();
     foreach ($result->result() as $row) {
         $registeredDate = new DateTime($row->last_logged_date);
         $interval = $today->diff($registeredDate);
         if ($interval->days == 1) {
             //Here send the email to the user
             $this->sendEmailRemainder($row->email);
         }
     }
 }
Example #29
0
echo form_input($data);
?>
          </div>
          <div class="col-md-8 col-xs-2">&nbsp;</div>
        </div>        

        <div>&nbsp;</div>
        
        <?php 
# ------------ tanggal dan waktu kendaraan masuk (otomatis) ------
//$datestring = '%Y-%m-%d %h:%i:00';
// $time = time();
// echo mdate($datestring, $time);
$time = time();
$sekarang = now();
$tanggal_waktu_masuk = unix_to_human($sekarang, TRUE, 'eu');
echo form_hidden('tanggal_waktu_masuk', $tanggal_waktu_masuk);
# ---------------------- Tombol -------------------------------
?>
        <div class="form-group">
          <div class="col-md-offset-2 col-md-2 col-xs-12">
            <?php 
echo form_submit(array('name' => 'submit', 'value' => 'input', 'class' => 'form-control btn btn-primary'));
?>
          </div>
        </div>

        <?php 
echo form_close();
?>
          </div>
Example #30
0
 /**
  * Получение списка пользователей
  * 
  * @param int  		лимит списка
  * @param int 		смещение
  * @param string	префикс названия ключей в массиве, по умолчанию user_
  * 
  * @return array
  */
 public function tpl_users_list($limit = null, $offset = 0, $prefix = 'user_')
 {
     $this->load->helper('date');
     if (empty($this->users_list)) {
         $this->get_users_list(false, $limit, $offset);
     }
     $list = array();
     $num = -1;
     foreach ($this->users_list as $users) {
         $num++;
         $list[$num] = $users;
         $list[$num][$prefix . 'id'] = $users['id'];
         $list[$num][$prefix . 'login'] = $users['login'];
         $list[$num][$prefix . 'reg_date'] = unix_to_human($users['reg_date'], true, 'eu');
         $list[$num][$prefix . 'last_auth'] = unix_to_human($users['last_auth'], true, 'eu');
         $list[$num][$prefix . 'balance'] = $users['balance'];
     }
     return $list;
 }