本文整理汇总了PHP中gParam函数的典型用法代码示例。如果您正苦于以下问题:PHP gParam函数的具体用法?PHP gParam怎么用?PHP gParam使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了gParam函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
$this->load->model('cms/Pagemodel');
$this->load->library('form_validation');
$this->load->library('email');
$this->load->library('parser');
$this->load->helper('form');
$this->load->helper('text');
//validation check
$this->form_validation->set_rules('name', 'Name', 'trim|required');
$this->form_validation->set_rules('number', 'Phone Number', 'trim|required');
$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
$this->form_validation->set_rules('message', 'Message', 'trim');
$this->form_validation->set_error_delimiters('<li>', '</li>');
if ($this->form_validation->run() == FALSE) {
$shell = array();
$shell['contents'] = $this->load->view('contact-form', $inner, true);
$this->load->view("themes/" . THEME . "/templates/{$page['template_alias']}", $shell);
} else {
$emailData = array();
$emailData['DATE'] = date("jS F, Y");
$emailData['NAME'] = $this->input->post('name', TRUE);
$emailData['EMAIL'] = $this->input->post('email', TRUE);
$emailData['PHONE'] = $this->input->post('number', TRUE);
$emailData['COMMENTS'] = nl2br($this->input->post('message', TRUE));
$emailBody = $this->parser->parse('contact/emails/contactus', $emailData, TRUE);
$this->db->insert('enquery', array('name' => gParam('name'), 'email' => gParam('email'), 'number' => gParam('number'), 'message' => gParam('message')));
$config = array();
$emlarray = $this->config->item('EMAIL_CONFIG');
unset($emlarray['mailtype']);
$this->email->initialize($emlarray);
$this->email->from(DWS_EMAIL_NOREPLY, DWS_EMAIL_FROM);
$this->email->reply_to(DWS_EMAIL_REPLY_TO);
// $this->email->to(DWS_EMAIL_ADMIN);
// e($this->config->item('EMAIL_CONFIG'));
// The message
$subject = 'Landlord Contact us';
$headers = "From: " . strip_tags(DWS_EMAIL_FROM) . "\r\n";
$headers .= "Reply-To: " . strip_tags(DWS_EMAIL_FROM) . "\r\n";
$headers .= "CC: susan@example.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
mail(DWS_EMAIL_ADMIN, $subject, $emailBody, $headers);
redirect('/contact/thankyou');
exit;
//$this->email->to(gParam('email'));
//$this->email->subject('Contact Us');
//$this->email->message($emailBody);
// $status = $this->email->send();
// $status = true;
// e( $this->email->print_debugger());
// if ($status == TRUE) {
// redirect('/contact/thankyou');
// exit();
// }
// redirect('/contact-us/error');
// exit();
}
}
示例2: index
function index()
{
//print_r($this->session->all_userdata());
$this->load->library('user_agent');
$referred_from_url = $this->agent->referrer();
$this->load->model('Customermodel');
$this->load->library('form_validation');
$this->load->library('email');
$this->load->library('parser');
$this->load->helper('form');
$this->load->helper('text');
//Get Page Details
//validation check
if (count($_POST)) {
$this->session->set_flashdata('error', '<h1 style="color:red">Wrong email id or password</h1>');
}
$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
$this->form_validation->set_rules('password', 'Password', 'trim|required|callback_login_check');
$this->form_validation->set_error_delimiters('<li>', '</li>');
if ($this->form_validation->run() == FALSE) {
$inner = array();
$shell = array();
$shell['contents'] = $this->load->view('login-page', $inner, true);
$this->load->view("themes/" . THEME . "/templates/subpage", $shell);
} else {
$email = gParam('email');
$password = gParam('password');
if (!$email || !$password) {
return false;
}
$this->db->from('applicants');
$this->db->where('email', $email);
$this->db->where('password', md5($password));
$result = $this->db->get()->row_array();
if (!count($result)) {
redirect("/customer/login/");
} else {
//e($this->session->all_userdata());
$result['isAdmin'] = 0;
$result['isCompany'] = 0;
$result['isUser'] = 0;
$result['isCustomer'] = 1;
$this->session->set_userdata($result);
//echo $referred_from;
redirect('/');
// if($redirect!=''){
// redirect($redirect, 'refresh');
//
// $shortlist = $this->session->userdata('referred_from');
// unset($shortlist[0]);
//
// }
// else{
// redirect('/');
// }
//redirect('');
}
}
}
示例3: getGrpOpt
function getGrpOpt($elementId = null, $grp = null, $internal = false)
{
$grp;
if (!$grp) {
$grp = gParam('grp');
}
if (!$grp && !$internal) {
$selectRes = array();
echo json_encode(array('success' => 0, 'msg' => 'Please choose group'));
exit;
} else {
if (!$grp && $internal) {
return '';
}
}
$rule_grp_row = array();
if ($grp == 'allgrp') {
$result = $this->aauth->list_groups(true);
$rule_row = $this->Notificationmodel->getRow($elementId);
$rule_grp_row = explode(',', $rule_row['for_group']);
} else {
$result = $this->usermodel->listAllAsGrp(False, false, 'id, name', array('where' => 'group_id = ' . $grp));
}
$datamsg = null;
$selectRes = array();
if ($result) {
foreach ($result as $key => $kval) {
if (count($rule_grp_row) && !in_array($kval['id'], $rule_grp_row)) {
continue;
}
$selectRes[$kval['id']] = $kval['name'];
}
}
$selectedArr = array();
if (isset($internal['assignTo'])) {
$selectedArr = explode(',', $internal['assignTo']);
}
$js = 'id="assigne-' . $elementId . '" multiple class="assigne form-control" data-id="' . $elementId . '"';
$retHtml = form_dropdown('assigne[' . $elementId . '][]', $selectRes, $selectedArr, $js);
$retHtml .= '<script>
$(document).ready(
function () {
$(".assigne").multiselect({
includeSelectAllOption: true,
enableFiltering:true
});
}
);
</script>';
if ($internal) {
return $retHtml;
}
$datamsg = array('success' => 1, 'msg' => $retHtml);
echo json_encode($datamsg);
exit;
}
示例4: login_check
function login_check($str)
{
$this->aauth->login(gParam('username'), gParam('passwd'), true);
$data = $this->aauth->get_user();
if ($data) {
setcookie('user_id', $data->id, time() + 86400 * 30, "/");
return true;
}
$this->form_validation->set_message('login_check', 'Login failed');
return false;
}
示例5: rSF
function rSF($tableName)
{
$fields = tableFields($tableName);
$new_array = array();
foreach ($fields as $field) {
if (!gParam($field)) {
continue;
}
$new_array[$field] = gParam($field);
}
return $new_array;
}
示例6: indexOld
function indexOld()
{
$return['success'] = false;
if (!gParam('email') || !gParam('password')) {
echo json_encode($return);
}
$this->aauth->login(gParam('email'), gParam('password'));
$ar = array();
$ar = $this->aauth->get_user();
if (isset($ar->id)) {
$group = $this->aauth->get_user_groups($ar->id);
if ($group['group_id'] == 6) {
$return['success'] = true;
} else {
$this->aauth->logout();
}
}
echo json_encode($return);
}
示例7: index
function index()
{
$this->load->library('form_validation');
$this->load->helper('form');
$this->load->library('encrypt');
//validation check
$this->form_validation->set_rules('username', 'Username', 'trim|required');
$this->form_validation->set_rules('passwd', 'Password', 'trim|required|callback_login_check');
$this->form_validation->set_error_delimiters('<li>', '</li>');
if ($this->form_validation->run() == FALSE && !isset($this->session->userdata['loggedin'])) {
// print_r($_POST);
if (gParam('username') && gParam('passwd')) {
self::checkApplicantLogin(gParam('username'), gParam('passwd'));
}
$data = array();
$this->load->view(THEME . 'login', $data);
} else {
redirect(createUrl('user/dashboard'));
}
}
示例8: add
function add($id = null)
{
$table_name = 'franchise_testimonials';
if (gParam('content') && gParam('name')) {
$data = rSF($table_name);
$data['user_id'] = curUsrId();
if (!$id) {
$result = $this->commonmodel->insertRecord($data, $table_name);
} else {
$result = $this->commonmodel->updateRecord($data, $id, $table_name);
}
if ($result) {
redirect(createUrl('frontend/testimonials'));
}
}
$model = $this->commonmodel->getByPk($id, $table_name);
$inner = $page = array();
$inner['model'] = $model;
$page['content'] = $this->load->view('addtestimonials', $inner, true);
$this->load->view($this->default, $page);
}
示例9: save
function save()
{
$data = rSF('units_attributes');
$id = gParam('id');
if ($id) {
if (isset($_POST['deldrop'])) {
$ids = array_filter($_POST['deldrop']);
foreach ($ids as $delIds) {
if (trim($delIds) != "") {
$this->db->where('id', $delIds);
$this->db->delete('units_attributes_dropdown');
}
}
}
if (isset($_POST['drop'])) {
foreach (array_filter($_POST['drop']) as $dropdwn) {
if (trim($dropdwn) != "") {
$this->db->insert('units_attributes_dropdown', array('dropdown_id' => $id, 'value' => $dropdwn, 'sort' => 0));
}
}
}
//e($_POST);
$this->db->where('id', $id);
$this->db->update('units_attributes', $data);
$this->session->set_flashdata('SUCCESS', 'attribute_updated');
} else {
$this->db->insert('units_attributes', $data);
$lastDrodown = $this->db->insert_id();
if ($data['type'] == "dropdown") {
foreach (array_filter($_POST['drop']) as $dropdwn) {
if (trim($dropdwn) != "") {
$this->db->insert('units_attributes_dropdown', array('dropdown_id' => $lastDrodown, 'value' => $dropdwn, 'sort' => 0));
}
}
}
$this->session->set_flashdata('SUCCESS', 'attribute_added');
}
}
示例10: addsidelinks
function addsidelinks($id = null)
{
$model = $this->commonmodel->getByPk($id, 'front_events');
$inner = $page = array();
if (gParam('color')) {
// gAParams();
$data = rSF('front_events');
$data['user_id'] = curUsrId();
if (isset($_FILES['image']['name'])) {
$data['pic'] = self::uploadImage();
}
if (!$id) {
$result = $this->commonmodel->insertRecord($data, 'front_events');
} else {
$result = $this->commonmodel->updateRecord($data, $id, 'front_events');
}
if ($result) {
redirect(createUrl('frontend/sideEventsLinks'));
}
}
$inner['model'] = $model;
$page['content'] = $this->load->view('addsidelinks', $inner, true);
$this->load->view($this->default, $page);
}
示例11: csvdownload
function csvdownload($offet = 0)
{
$this->load->model('propertymodel');
$perpage = 500;
$attributes = gParam('attributes', array());
$property = $this->propertymodel->listCsvAll($attributes, $perpage, $offet);
echo count($property);
$html = "<table border='1'>";
$array = array('unit_number', 'post_code', 'county', 'property_type', 'street', 'city', 'amount');
$html .= '<tr>';
foreach ($array as $key) {
$html .= '<td>' . $key . '</td>';
}
$html .= '</tr>';
foreach ($property as $pro) {
$html .= '<tr>' . '<td>' . $pro['unit_number'] . '</td>' . '<td>' . $pro['post_code'] . '</td>' . '<td>' . $pro['county'] . '</td>' . '<td>' . $pro['property_type'] . '</td>' . '<td>' . $pro['street'] . '</td>' . '<td>' . $pro['city'] . '</td>' . '<td>' . $pro['amount'] . '</td>' . '</tr>';
}
$html .= "</table>";
echo $html;
//print_r($property);
}
示例12: updateRecord
function updateRecord($uid)
{
$group = current(gParam('group'));
if ($this->aauth->getUserGroup($uid) != $group) {
$this->aauth->remove_member($uid, $this->aauth->getUserGroup());
$this->aauth->add_member($uid, $group);
}
$this->aauth->update_user($uid, gParam('email'), gParam('pass'), gParam('name'), self::uploadImage());
$data = array();
$data['fname'] = $this->input->post('firstname', TRUE);
$data['lname'] = $this->input->post('lastname', TRUE);
$data['home_address'] = $this->input->post('address', TRUE);
$data['qualification'] = $this->input->post('qualifications', TRUE);
$data['city'] = $this->input->post('city', TRUE);
$data['county'] = $this->input->post('county', TRUE);
$data['post_code'] = $this->input->post('post_code', TRUE);
$data['telephone'] = $this->input->post('phone', TRUE);
$data['about_txt'] = $this->input->post('about_description');
$data['services_txt'] = $this->input->post('service_description');
$data['contact_txt'] = $this->input->post('contact_description');
$data['lat'] = $this->input->post('lat', TRUE);
$data['log'] = $this->input->post('lng', TRUE);
unset($data['id']);
$this->db->where('id', $uid);
$row = $this->db->get('user_extra_detail');
$row = $row->num_rows();
if ($row) {
unset($data['start_date']);
$this->db->where('id', $uid);
$this->db->update('user_extra_detail', $data);
} else {
$data['id'] = $uid;
$this->db->insert('user_extra_detail', $data);
}
}
示例13: updateQuestion
function updateQuestion()
{
$surveyId = gParam('survey_id');
if (!$surveyId) {
$surveyId = $_POST['survey_id'];
}
if (!$surveyId) {
return false;
}
$data[$this->is_active] = '0';
$on = array('fld' => $this->survey_id, 'fldval' => $surveyId);
$this->recordUpdate($on, $data);
$data = array();
foreach ($_POST as $postkey => $postval) {
if (is_array($postval)) {
if (!is_numeric($postkey)) {
continue;
}
if (isset($postval['dbid'])) {
$questionArr = $this->getQuestionInsertArray($postval);
$questionArr['survey_id'] = $surveyId;
$questionArr[$this->is_active] = '1';
$questionArr[$this->update_date] = date('Y-m-d H:i:s');
$on = array('fld' => $this->id, 'fldval' => $postval['dbid']);
$this->recordUpdate($on, $questionArr);
} else {
$questionArr = $this->getQuestionInsertArray($postval);
$questionArr['survey_id'] = $surveyId;
$questionArr[$this->is_active] = '1';
$questionArr[$this->update_date] = date('Y-m-d H:i:s');
$questionArr[$this->creation_date] = date('Y-m-d H:i:s');
$this->db->insert('survey_question', $questionArr);
}
}
}
$data = array('survey_id' => $surveyId, $this->is_active => 0);
$this->deleteUpdate($data);
}
示例14: booking
function booking($id)
{
$user_id = $this->session->userdata('user_id');
if (gParam('book_event')) {
$result = self::saveUserToEvent(gParam('event_id'), gParam('qty'), $user_id);
$this->session->set_flashdata('SUCCESS', 'booking_done');
redirect(createUrl('classes/booking/' . $id));
}
$this->load->model('classesmodel');
if (!$user_id) {
redirect(base_url());
}
$inner = $page = array();
$inner['event'] = $this->classesmodel->getOneEvent($id);
$page['contents'] = $this->load->view('booking', $inner, true);
$this->load->view("themes/" . THEME . "/templates/onlycontent", $page);
}
示例15: deletefile
function deletefile($fileId = null)
{
if (!$fileId) {
$fileId = gParam('fileid', false, true);
}
$fileDet = $this->VirtualCabinetmodel->fetchByID($fileId);
if ($fileDet) {
$ext = $fileDet[$this->VirtualCabinetmodel->filetype];
$virCabPath = $this->config->item('UPLOAD_PATH_VIRCAB_MISC');
if (in_array($ext, $this->imgArray)) {
$virCabPath = $this->config->item('UPLOAD_PATH_VIRCAB_IMG');
} else {
if (in_array($ext, $this->docArray)) {
$virCabPath = $this->config->item('UPLOAD_PATH_VIRCAB_DOC');
}
}
$file = $virCabPath . $fileDet[$this->VirtualCabinetmodel->visible_name];
$this->VirtualCabinetmodel->deleteByID($fileDet['id']);
if (file_exists($file) && unlink($file)) {
}
echo json_encode(array('success' => 1));
} else {
echo json_encode(array('success' => 1, 'msg' => 'File Not Exist'));
}
exit;
}