本文整理汇总了PHP中unix_to_human函数的典型用法代码示例。如果您正苦于以下问题:PHP unix_to_human函数的具体用法?PHP unix_to_human怎么用?PHP unix_to_human使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了unix_to_human函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_html
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;
}
示例2: backupDBFull
function backupDBFull()
{
// Получение бэкапа и присвоение его переменной
$backup =& $this->dbutil->backup();
$this->load->helper('download');
force_download('fullbackup-' . unix_to_human(now(), TRUE, 'eu') . '.gz', $backup);
}
示例3: cetak_surat
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;
}
示例4: index
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> ' : '', 'is_closed' => $row->closed == 1 ? '<i class="fa fa-lock"></i> ' : '');
}
} 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));
}
示例5: initialize
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');
}
示例6: signup
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('sharadrsoni@gmail.com', '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;
}
}
示例7: index
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);
}
示例8: get_with_author_names
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;
}
示例9: _get_tpl_filter
/**
* Получение данных фильтра для вставки в шаблон
*/
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;
}
示例10: get_current_date_start_time
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();
}
示例11: get_research
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;
}
示例12: auditQuery
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');
}
示例13: show_addform
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');
}
}
示例14: get_rubrics_front
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;
}
}
示例15: create_acount
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' => 'adriansdenis@gmail.com', 'smtp_pass' => 'adriansdenis2185', 'mailtype' => 'html');
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
//configuracion del correo
$this->email->from('noockers@denislab.com', '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());
}
}
}