function cleanup_new_row($new_row) { foreach ($new_row as $key => $value) { if (is_array($value) and isset($value['H'])) { $new_row[$key] = get_datetime($value); } else { if (is_array($value) and isset($value['d'])) { $new_row[$key] = get_date($value); } } if ($value == '') { $new_row[$key] = null; } } return $new_row; }
} if ($urow->skype != "") { $cnt .= '<img src="' . image_url('skype.png') . '" width="19" height="19" title="skype"/>' . " "; } echo $cnt; } ?> </td> </tr> <tr> <td class="dt1 dt0"><?php echo $this->lang->line('Member Since:'); ?> </td> <td class="dt1"><?php echo get_datetime($user->created); ?> </td> </tr> <tr> <td class="dt2 dt0"><?php echo $this->lang->line('Open Projects:'); ?> </td> <td class="dt2"><?php if (isset($openProjects) and $openProjects->num_rows() > 0) { $i = 1; ?> <ul> <?php
} ?> </a></td> <td class="<?php echo $class1; ?> "> $ <?php echo $res->amount; ?> </td> <td class="<?php echo $class1; ?> "><?php echo get_datetime($res->transaction_time); ?> </td> <td class="<?php echo $class1; ?> "><?php echo $res->status; ?> </td> <?php } if ($k == '0') { echo '<td colspan="5">'; echo 'There is no Transaction'; echo '</td>';
/** * Loads Buyer signUp page. * * @access public * @param nil * @return void */ function create() { //echo $this->loggedInUser->email; $result = '0'; $manage = '1'; $this->outputData['showPreview'] = false; //Load Language $this->lang->load('enduser/withdrawMoney', $this->config->item('language_code')); $this->lang->load('enduser/createBids', $this->config->item('language_code')); $this->outputData['created'] = get_est_time(); $this->outputData['enddate'] = get_est_time() + $this->input->post('openDays') * 86400; //Check For Buyer Session if (!isBuyer()) { $this->session->set_flashdata('flash_message', $this->common_model->flash_message('error', $this->lang->line('You must be logged in as a buyer to post projects'))); redirect('info'); } //load validation libraray $this->load->library('form_validation'); //Load Form Helper $this->load->helper('form'); //Intialize values for library and helpers $this->form_validation->set_error_delimiters($this->config->item('field_error_start_tag'), $this->config->item('field_error_end_tag')); if ($this->input->post('projectid')) { $project = $this->input->post('projectid'); } //Save the draft projects if ($this->input->post('save_draft')) { //echo $this->input->post('projectName'); if ($this->input->post('projectName')) { $draft_name = $this->input->post('projectName'); $condition = array('draftprojects.project_name' => $draft_name); $draft = $this->skills_model->getDraft($condition); //pr($draft->num_rows()); //pr($draft->result()); if ($draft->num_rows() <= 0) { $insertData = array(); $insertData['project_name'] = $this->input->post('projectName'); $insertData['description'] = $this->input->post('description'); if ($this->input->post('budget_min', TRUE)) { $insertData['budget_min'] = $this->input->post('budget_min'); } else { $insertData['budget_min'] = ''; } if ($this->input->post('budget_max', TRUE)) { $insertData['budget_max'] = $this->input->post('budget_max'); } else { $insertData['budget_max'] = ''; } $insertData['is_feature'] = $this->input->post('is_feature'); $insertData['is_urgent'] = $this->input->post('is_urgent'); $insertData['is_hide_bids'] = $this->input->post('is_hide_bids'); if ($this->input->post('is_private')) { $insertData['is_private'] = $this->input->post('is_private'); } $insertData['creator_id'] = $this->loggedInUser->id; $insertData['created'] = get_est_time(); $insertData['enddate'] = get_est_time() + $this->input->post('openDays') * 86400; //$insertData['open_days'] = $this->input->post('openDays'); //pr($insertData); if ($insertData) { $this->skills_model->draftProject($insertData); } } else { $draft = $draft->row(); $updateDraft = array(); $updateDraft['project_name'] = $this->input->post('projectName'); $updateDraft['description'] = $this->input->post('description'); if ($this->input->post('budget_min', TRUE)) { $updateDraft['budget_min'] = $this->input->post('budget_min'); } else { $updateDraft['budget_min'] = ''; } if ($this->input->post('budget_max', TRUE)) { $updateDraft['budget_max'] = $this->input->post('budget_max'); } else { $updateDraft['budget_max'] = ''; } $updateDraft['is_feature'] = $this->input->post('is_feature'); $updateDraft['is_urgent'] = $this->input->post('is_urgent'); $updateDraft['is_hide_bids'] = $this->input->post('is_hide_bids'); //$updateDraft['open_days'] = $this->input->post('openDays'); if ($this->input->post('is_private')) { $updateDraft['is_private'] = $this->input->post('is_private'); } $updateDraft['creator_id'] = $this->loggedInUser->id; $updateDraft['created'] = get_est_time(); $updateDraft['enddate'] = get_est_time() + $this->input->post('openDays') * 86400; $categories = $this->input->post('categories'); //pr($categories); //Work With Project Categories $project_categoriesNameArray = $this->skills_model->convertCategoryIdsToName($categories); $project_categoriesNameString = implode(',', $project_categoriesNameArray); $updateDraft['project_categories'] = $project_categoriesNameString; //pr($updateDraft); if ($updateDraft) { $condition = array('draftprojects.id' => $draft->id); $this->skills_model->updateDraftProject($updateDraft, $condition); } } } else { $this->session->set_flashdata('flash_message', $this->common_model->flash_message('error', $this->lang->line('You cannot save this project as Draft'))); redirect('info'); } //Notification message $this->session->set_flashdata('flash_message', $this->common_model->flash_message('success', $this->lang->line('Your project has been saved as Draft'))); redirect('info/index/success'); } //Get Form Data if ($this->input->post('createProject') or $this->input->post('preview_project')) { //Set rules $this->form_validation->set_rules('projectName', 'lang:project_name_validation', 'required|trim|min_length[5]|xss_clean'); $this->form_validation->set_rules('description', 'lang:description_validation', 'required|min_length[25]|trim|xss_clean'); $this->form_validation->set_rules('attachment', 'lang:attachment_validation', 'callback_attachment_check'); $this->form_validation->set_rules('categories[]', 'lang:categories_validation', 'required'); $this->form_validation->set_rules('is_feature', 'lang:is_feature_validation', 'trim'); $this->form_validation->set_rules('is_urgent', 'lang:is_urgent_validation', 'trim'); $this->form_validation->set_rules('is_hide_bids', 'lang:is_hide_bids_validation', 'trim'); if ($this->form_validation->run()) { //This is condition check for post similar project $conditions = array('projects.project_name' => $this->input->post('projectName')); $postSimilar = $this->skills_model->getUsersproject($conditions); $res = $postSimilar->num_rows(); if ($res > 0) { $sameProject = $postSimilar->row(); $project = $sameProject->id; } //echo $this->input->post('update'); //Check the post project is already exists or not //echo $this->input->post('update'); if ($this->input->post('update', true) === false) { $manage = '1'; } else { $manage = '0'; } if ($manage != '0') { if ($res > 0) { $this->session->set_flashdata('flash_message', $this->common_model->flash_message('error', $this->lang->line('Project already Exists'))); redirect('project/postProject/' . $project); } } $insertData = array(); $insertData['project_name'] = $this->input->post('projectName'); $insertData['description'] = $this->input->post('description'); if ($this->input->post('update') == '0') { $insertData['description'] = $this->input->post('description') . '<br/>'; $insertData['description'] .= $this->input->post('add_description'); } else { $insertData['description'] = $this->input->post('description'); } $insertData['budget_min'] = $this->input->post('budget_min'); $insertData['budget_max'] = $this->input->post('budget_max'); $insertData['is_feature'] = $this->input->post('is_feature'); $insertData['is_urgent'] = $this->input->post('is_urgent'); $insertData['is_hide_bids'] = $this->input->post('is_hide_bids'); //$insertData['open_days'] = $this->input->post('openDays'); if ($this->input->post('is_private')) { $insertData['is_private'] = $this->input->post('is_private'); } $insertData['creator_id'] = $this->loggedInUser->id; $insertData['created'] = get_est_time(); $insertData['enddate'] = get_est_time() + $this->input->post('openDays') * 86400; $result = '0'; if ($this->input->post('preview_project')) { $this->outputData['showPreview'] = true; $result = '1'; $this->outputData['project_status'] = 'Pending'; $this->outputData['project_name'] = $this->input->post('projectName'); //Update additional information for projects if ($this->input->post('update') == '0') { $this->outputData['description'] = $this->input->post('description') . '<br>'; $this->outputData['description'] .= $this->input->post('add_description'); } else { $this->outputData['description'] = $this->input->post('description'); } $this->outputData['budget_min'] = $this->input->post('budget_min'); $this->outputData['budget_max'] = $this->input->post('budget_max'); $this->outputData['is_feature'] = $this->input->post('is_feature'); $this->outputData['is_urgent'] = $this->input->post('is_urgent'); $this->outputData['is_hide_bids'] = $this->input->post('is_hide_bids'); // $this->outputData['open_days'] = $this->input->post('openDays'); if ($this->input->post('is_private')) { $insertData['is_private'] = $this->input->post('is_private'); } $this->outputData['creator_id'] = $this->loggedInUser->id; $this->outputData['created'] = get_est_time(); $this->outputData['enddate'] = get_est_time() + $this->input->post('openDays') * 86400; $categories = $this->input->post('categories'); //Work With Project Categories $project_categoriesNameArray = $this->skills_model->convertCategoryIdsToName($categories); $project_categoriesNameString = implode(',', $project_categoriesNameArray); $this->outputData['project_categories'] = $project_categoriesNameString; } //check the condition for view the preview about the project if ($result == '0') { //Get the values from settings table $paymentSettings = $this->settings_model->getSiteSettings(); $feature_project = $paymentSettings['FEATURED_PROJECT_AMOUNT']; $urgent_project = $paymentSettings['URGENT_PROJECT_AMOUNT']; $hide_project = $paymentSettings['HIDE_PROJECT_AMOUNT']; $this->outputData['feature_project'] = $feature_project; $this->outputData['urgent_project'] = $urgent_project; $this->outputData['hide_project'] = $hide_project; $this->outputData['created'] = get_est_time(); $this->outputData['enddate'] = get_est_time() + $this->input->post('openDays') * 86400; if ($manage != '0') { //initial value set for check the featured , urgent, hide projects $settingAmount = 0; //check the values for featured, urgent, hide projects if ($this->input->post('is_feature', TRUE)) { $settingAmount = $settingAmount + $feature_project; } if ($this->input->post('is_urgent', TRUE)) { $settingAmount = $settingAmount + $urgent_project; } if ($this->input->post('is_hide_bids', TRUE)) { $settingAmount = $settingAmount + $hide_project; } //Check User Balance $condition_balance = array('user_balance.user_id' => $this->loggedInUser->id); $results = $this->transaction_model->getBalance($condition_balance); //If Record already exists if ($results->num_rows() > 0) { //get balance detail $rowBalance = $results->row(); $this->outputData['userAvailableBalance'] = $rowBalance->amount; // $avail_balance = $rowBalance->amount; } if ($this->input->post('is_hide_bids', TRUE) or $this->input->post('is_urgent', TRUE) or $this->input->post('is_feature', TRUE)) { $withdrawvalue = $rowBalance->amount - ($settingAmount + $paymentSettings['PAYMENT_SETTINGS']); if ($withdrawvalue < 0) { $this->session->set_flashdata('flash_message', $this->common_model->flash_message('error', $this->lang->line('your not having sufficient balance'))); //redirect('project/create'); } else { //Check User Balance //Update Amount $updateKey = array('user_balance.user_id' => $this->loggedInUser->id); $updateData = array(); $updateData['amount'] = $rowBalance->amount - $settingAmount; $results = $this->transaction_model->updateBalance($updateKey, $updateData); //Insert transaction for post projects $insertTransaction = array(); $insertTransaction['creator_id'] = $this->loggedInUser->id; $insertTransaction['type'] = $this->lang->line('Project Fee'); $insertTransaction['amount'] = $settingAmount; $insertTransaction['transaction_time'] = get_est_time(); $insertTransaction['status'] = 'Completed'; //Can Be success,failed,pending $insertTransaction['description'] = $this->lang->line('Project Fee for Bid'); //$insertData['user_type'] = $role; if ($this->loggedInUser->role_id == '1') { $insertTransaction['buyer_id'] = $this->loggedInUser->id; $insertTransaction['user_type'] = $this->lang->line('Project Fee for Bid'); } if ($this->loggedInUser->role_id == '2') { $insertTransaction['provider_id'] = $this->loggedInUser->id; $insertTransaction['user_type'] = $this->lang->line('Project Fee for Bid'); } //pr($insertData); $this->load->model('transaction_model'); $this->transaction_model->addTransaction($insertTransaction); } } } //Get payment settings for check minimum balance from settings table $this->outputData['paymentSettings'] = $paymentSettings; $this->outputData['PAYMENT_SETTINGS'] = $paymentSettings['PAYMENT_SETTINGS']; $categories = $this->input->post('categories'); //Work With Project Categories $project_categoriesNameArray = $this->skills_model->convertCategoryIdsToName($categories); $project_categoriesNameString = implode(',', $project_categoriesNameArray); $insertData['project_categories'] = $project_categoriesNameString; //Create Projects before it for update the projects datas for manage option if ($this->input->post('update') == '0') { if ($this->input->post('projectid')) { //Notification message //Load Model For Mail $this->load->model('email_model'); //Send Mail $conditionUserMail = array('email_templates.type' => 'projectpost_notification'); $result = $this->email_model->getEmailSettings($conditionUserMail); $rowUserMailConent = $result->row(); $splVars = array("!site_name" => $this->config->item('site_title'), "!username" => $this->loggedInUser->user_name, "!profile" => $project_categoriesNameString, "!projectid" => $this->db->insert_id(), "!date" => get_datetime(time())); $mailSubject = strtr($rowUserMailConent->mail_subject, $splVars); $mailContent = strtr($rowUserMailConent->mail_body, $splVars); $toEmail = $this->loggedInUser->email; $fromEmail = $this->config->item('site_admin_mail', TRUE); //echo $mailContent; //$this->email_model->sendHtmlMail($toEmail,$fromEmail,$mailSubject,$mailContent); //Update the data $project = $this->input->post('projectid'); $condition = array('projects.id' => $project); $this->skills_model->manageProjects($insertData, $condition); $this->session->set_flashdata('flash_message', $this->common_model->flash_message('success', $this->lang->line('Your Project has been Updated Successfully'))); redirect('buyer/viewMyProjects'); } } if ($this->input->post('createProject')) { //Load Model For Mail $this->load->model('email_model'); //Send Mail $conditionUserMail = array('email_templates.type' => 'projectpost_notification'); $result = $this->email_model->getEmailSettings($conditionUserMail); $rowUserMailConent = $result->row(); $splVars = array("!site_name" => $this->config->item('site_title'), "!username" => $this->loggedInUser->user_name, "!profile" => $project_categoriesNameString, "!projectid" => $this->db->insert_id(), "!date" => get_datetime(time())); $mailSubject = strtr($rowUserMailConent->mail_subject, $splVars); $mailContent = strtr($rowUserMailConent->mail_body, $splVars); $toEmail = $this->loggedInUser->email; $fromEmail = $this->config->item('site_admin_mail', TRUE); // $this->email_model->sendHtmlMail($toEmail,$fromEmail,$mailSubject,$mailContent); // insert the projects details into project table $this->skills_model->createProject($insertData); $delete_condition = array('draftprojects.project_name' => $this->input->post('projectName')); $this->skills_model->deletedraftprojects($delete_condition); //Notification message $this->session->set_flashdata('flash_message', $this->common_model->flash_message('success', $this->lang->line('Your Project has been Posted Successfully'))); redirect('buyer/viewMyProjects'); } redirect('info/index/success'); } } //Form Validation End } //If - Form Submission End //Get Groups $this->outputData['groupsWithCategories'] = $this->skills_model->getGroupsWithCategory(); if ($result == '0') { $this->load->view('project/createProject', $this->outputData); } else { $this->load->view('project/previewProject', $this->outputData); } }
/** * manage Job from Buyer who post project * * @access public for buyer * @param project id * @return contents */ function manageJoblist() { //Load Language $this->lang->load('enduser/createProject', $this->config->item('language_code')); $this->lang->load('enduser/project', $this->config->item('language_code')); $this->lang->load('enduser/review', $this->config->item('language_code')); //load validation libraray $this->load->library('form_validation'); //Load Form Helper $this->load->helper('form'); //Check for Login details. if (!isset($this->loggedInUser->id)) { $this->session->set_flashdata('flash_message', $this->common_model->flash_message('error', $this->lang->line('You must be login access to this page'))); redirect('info'); } //Intialize values for library and helpers $this->form_validation->set_error_delimiters($this->config->item('field_error_start_tag'), $this->config->item('field_error_end_tag')); if ($this->loggedInUser->role_id) { if ($this->loggedInUser->role_id == '2') { $this->session->set_flashdata('flash_message', $this->common_model->flash_message('error', $this->lang->line('You must be logged in as a buyer to post projects'))); redirect('info'); } } //Get Groups $this->outputData['groupsWithCategories'] = $this->skills_model->getGroupsWithCategory(); if ($this->uri->segment(3, 0)) { $project_id = $this->uri->segment(3, 0); } else { $project_id = $this->input->post('projectid'); } $update = $this->input->post('update'); //Get the project details for post similar projects $conditions = array('projects.id' => $project_id, 'projects.creator_id' => $this->loggedInUser->id); //pr($conditions); $postSimilar = $this->skills_model->getUsersproject($conditions); $this->outputData['postSimilar'] = $postSimilar; $res = $postSimilar->num_rows(); if ($res <= 0) { $this->session->set_flashdata('flash_message', $this->common_model->flash_message('error', $this->lang->line('Your are not allow to manage this project'))); redirect('project/view/' . $project_id); } $this->form_validation->set_rules('attachment', 'lang:attachment_validation', 'callback_attachment_check'); $this->form_validation->set_rules('categories[]', 'lang:categories_validation', 'trim|integer|is_natural|abs|xss_clean|callback__maxvalcheckcat'); if ($this->form_validation->run()) { $res = $postSimilar->num_rows(); //pr($postSimilar->result()); if ($res <= 0) { $this->session->set_flashdata('flash_message', $this->common_model->flash_message('error', $this->lang->line('Your are not allow to manage this project'))); redirect('project/view/' . $project_id); } //Create job before it for update the projects datas for manage option if ($this->input->post('update') == '0') { if ($this->input->post('projectid')) { $insertData = array(); $insertData['project_name'] = $this->input->post('projectName'); $insertData['description'] = $this->input->post('description'); if (isset($this->data['file'])) { $insertData['attachment_url'] = $this->data['file']['file_name']; $insertData['attachment_name'] = $this->data['file']['orig_name']; } if ($this->input->post('categories')) { $categories = $this->input->post('categories'); //Work With Project Categories $project_categoriesNameArray = $this->skills_model->convertCategoryIdsToName($categories); $project_categoriesNameString = implode(',', $project_categoriesNameArray); $insertData['project_categories'] = $project_categoriesNameString; } if ($this->input->post('update') == '0') { $insertData['description'] = $this->input->post('description') . '<br/>'; $insertData['description'] .= $this->input->post('add_description'); } else { $insertData['description'] = $this->input->post('description'); } $paymentSettings = $this->settings_model->getSiteSettings(); $joblistvalidity = $paymentSettings['JOBLIST_VALIDITY_LIMIT']; $insertData['creator_id'] = $this->loggedInUser->id; $insertData['created'] = get_est_time(); $insertData['enddate'] = get_est_time() + $joblistvalidity * 86400; $result = '0'; if ($this->input->post('categories')) { $categories = $this->input->post('categories'); //Work With Project Categories $project_categoriesNameArray = $this->skills_model->convertCategoryIdsToName($categories); $project_categoriesNameString = implode(',', $project_categoriesNameArray); $insertData['project_categories'] = $project_categoriesNameString; } //Update the data $project = $this->input->post('projectid'); $condition = array('projects.id' => $project); $this->skills_model->manageProjects($insertData, $condition); //Notification message //Load Model For Mail $this->load->model('email_model'); //Send Mail $conditionUserMail = array('email_templates.type' => 'projectpost_notification'); $result = $this->email_model->getEmailSettings($conditionUserMail); $rowUserMailConent = $result->row(); $splVars = array("!site_name" => $this->config->item('site_title'), "!username" => $this->loggedInUser->user_name, "!projectid" => $this->db->insert_id(), "!date" => get_datetime(time())); $mailSubject = strtr($rowUserMailConent->mail_subject, $splVars); $mailContent = strtr($rowUserMailConent->mail_body, $splVars); $toEmail = $this->loggedInUser->email; $fromEmail = $this->config->item('site_admin_mail'); $this->email_model->sendHtmlMail($toEmail, $fromEmail, $mailSubject, $mailContent); $this->session->set_flashdata('flash_message', $this->common_model->flash_message('success', $this->lang->line('Your Job has been Updated Successfully'))); redirect('joblist/viewAlljoblists/flag'); } } $this->session->set_flashdata('flash_message', $this->common_model->flash_message('success', $this->lang->line('Your Job has been Updated Successfully'))); redirect('joblist/viewAlljoblists/flag'); } $this->load->view('joblist/managejoblist', $this->outputData); }
/** * Sending new project notifications every hour to Providers * * @access private * @param project id and checkstamp * @return contents */ function hourlyProjectsNotify() { //Load Models $this->load->model('search_model'); $prev_hour = date('j/n/Y H', get_est_time() - 60 * 60); $conditions = array('users.role_id' => '2', 'users.user_status' => '1', 'user_categories.user_categories !=' => '', 'users.project_notify' => 'Hourly'); $users = $this->user_model->getUsersWithCategories($conditions); $prids = array(); $i = 0; foreach ($users->result() as $user) { $cate = explode(",", $user->user_categories); //Get projects by categories foreach ($cate as $cat) { $cond = array('categories.id' => $cat); $res = $this->skills_model->getCategories($cond); $row = $res->row(); $cname = $row->category_name; $like = array('projects.project_categories' => $cname); $conditions2 = array("FROM_UNIXTIME( projects.created, '%e/%c/%Y %H' ) = " => $prev_hour, 'projects.project_status' => '0'); $projects = $this->search_model->getProjects($conditions2, 'projects.id', $like); //Get projects foreach ($projects->result() as $prid) { $prids[$i] = $prid->id; $i++; } } //Check if projects are available to send notifications if (count($prids) > 0) { $prids1 = array_unique($prids); $mailSubject = $this->config->item('site_title') . " Project Notice"; $mailContent = "The following " . count($prids1) . " projects were recently added to " . $this->config->item('site_title') . " and match your expertise:<br><br>"; foreach ($prids as $prj) { $condition3 = array('projects.id' => $prj); $mpr = $this->skills_model->getProjects($condition3); $prj = $mpr->row(); $mailContent .= $prj->project_name . " (Posted by " . $prj->user_name . ", " . get_datetime($prj->created) . ", Job type:" . $prj->project_categories . ")" . "<br>" . site_url('project/view/' . $prj->id) . "<br><br>"; } //Send mail $toEmail = $user->email; $fromEmail = $this->config->item('site_admin_mail'); $this->email_model->sendHtmlMail($toEmail, $fromEmail, $mailSubject, $mailContent); } } }
<option value="savedraft">-- Select a project to load a saved draft --</option> <?php foreach ($draftProjects->result() as $draft) { ?> <option value="<?php echo $draft->id; ?> " <?php if (isset($draftProjectsid)) { if ($draftProjectsid == $draft->id) { echo "selected"; } } ?> ><?php echo get_datetime($draft->created) . ' ' . $draft->project_name; ?> </option> <?php } ?> <option value="clear">-- Clear form and create new project... --</option> </select> <input name="projectid1" value="<?php if (isset($draftProjectsid)) { echo $draftProjectsid; } ?> "type="hidden"/> </p> </form>
<td class='summaryValue'><span class='sleft'><?php echo get_system_load(); ?> </span> </td> </tr> <tr> <td class='summaryKey'> Hostname </td> <td class='summaryValue'><span class='sleft'><?php echo get_hostname(); ?> </span> </td> </tr> <tr> <td class='summaryKey'> Current Date </td> <td class='summaryValue'><span class='sleft'><?php echo get_datetime(); ?> </span> </td> </tr> </table> <?php echo "<h3>Memory Information</h3>"; $meminfo = get_memory(); ?> <table class='summarySection'> <tr> <td class='summaryKey'> Mem. Total </td>
"><?php echo $rec->project_name; ?> </a></td> <td class="<?php echo $class2; ?> "><?php echo '$' . $rec->budget_min . ' - $' . $rec->budget_max; ?> </td> <td class="<?php echo $class2; ?> "><?php echo get_datetime($rec->created); ?> </td> <td class="<?php echo $class2; ?> etopsp"><?php if ($rec->project_status == '0') { echo '<b style="color:green;">' . 'Open' . '</b>'; } if ($rec->project_status == '2') { echo '<b style="color:red;">' . 'Closed' . '</b>'; } //Only for project Awards notification if (!isset($invitation) and isset($awards)) { ?>
echo $class; ?> "> <td class="<?php echo $class2; ?> "><?php echo $message->user_name; $k = $k + 1; ?> </td> <td class="<?php echo $class2; ?> "><?php echo '# ' . $message->id . ' posted ' . get_datetime($message->created); ?> </td> <td class="<?php echo $class2; ?> "><?php $user = getUserInfo($message->to_id); if ($message->to_id == '0' and $message->project_id == $project->id) { ?> <span class="clsMsgLink"><?php echo $this->lang->line('['); echo $this->lang->line('Message for Everyone'); } else {
/** * 验证手机验证码方法 * @param $user * @param $code * @param $action * @return int */ public function verifycode($user, $code, $action) { $smscode = M('51_smscode'); $exist = $smscode->where("mobile='{$user}' AND code='{$code}'")->select(); if (!is_null($exist)) { $expire = (int) C('SMS')['SMS_EXPIRE'] * 60; $codedata = $exist[0]['code']; $datetime = get_datetime($exist[0]['datetime']); //检查是否过期 if (time() - $datetime > $expire) { return 20002; } else { if ($codedata == $code) { //验证完之后把验证码设置为失效 $update['datetime'] = '0000-00-00 00:00:00'; $update['lastaction'] = $action; $update['todo'] = $action; $smscode->where("mobile='{$user}' AND code='{$code}'")->save($update); return 0; } } } return 20003; }
echo $class2; ?> "> <?php echo $bid->bid_days . $this->lang->line('days'); ?> <?php if ($bid->bid_hours != 0) { echo $bid->bid_hours . $this->lang->line('hours'); } ?> </td> <td class="<?php echo $class2; ?> "> <?php echo get_datetime($bid->bid_time); ?> </td> </tr> <?php $i++; } //For Each End - Latest Project Traversal } //If - End Check For Latest Projects ?> </table> <p><input type="submit" name="pickBid" class="clsSmall" value="<?php echo $this->lang->line('Pick Bid');
</a> <?php if(isset($user_details->certifyend))if($user_details->certifyend >= get_est_time()){ ?> <img src="<?php echo image_url('certified.png'); ?>" alt="Special User" border="0" width="10" height="13"> <?php }?> </td> <td> <?php if (isset($bid->bid_desc))echo $bid->bid_desc; ?></td> <td><?php echo $currency.$bid->bid_amount;?></td> <td><?php if($bid->bid_hours == 0 && $bid->bid_days == 0) echo $this->lang->line('Immediately'); elseif($bid->bid_days != 0) echo $bid->bid_days.$this->lang->line('days');?> <?php if($bid->bid_hours != 0) echo $bid->bid_hours." ".$this->lang->line('hours');?> </td> <td><?php echo get_datetime($bid->bid_time);?></td> <td><?php if($bid->num_reviews == 0) echo '(No Feedback Yet) '; else{ ?> <a href="<?php echo site_url('owner/review/'.$bid->uid);?>"> <img height="7" border="0" width="81" alt="rating" src="<?php echo image_url('rating_'.$bid->user_rating.'.gif');?>"/> (<b><?php echo $bid->num_reviews;?> </b> <?php echo $this->lang->line('reviews');?>)</a> <?php } ?> <?php if(isset($this->loggedInUser->id)) { ?> <a href="<?php echo site_url('job/bidReport/'.$bid->id); ?>"><img src="<?php echo image_url('icons.png'); ?>" height="28" width="21" alt="Report Job Violation" title="Report Job Violation"/> </a> <?php } else { ?> <a href="<?php echo site_url('users/login'); ?>"><img src="<?php echo image_url('icons.png'); ?>" height="28" width="21" alt="Report Job Violation"/> </a> <?php } ?>
</td> <td class="dt2"> <?php echo get_datetime($user->created); ?> </td> </tr> <tr> <td class="dt1 dt0"><?php echo $this->lang->line('Last Activity:'); ?> </td> <td class="dt1"><?php echo get_datetime($user->last_activity); ?> </td> </tr> <tr> <td class="dt2 dt0"><?php echo $this->lang->line('Profile:'); ?> </td> <td class="dt2"><?php echo $user->profile_desc; ?>
function get_last_days(&$date, $nums) { $year = 0; $month = 0; $day = 0; get_sep_date($year, $month, $day); for ($i = $nums - 1; $i >= 0; --$i) { $aDay = $day - $i; $t = mktime(0, 0, 0, $month, $aDay, $year); $d = array(); $d['day'] = get_date($t); $d['range'] = array(get_datetime($t), get_datetime(mktime(23, 59, 59, $month, $aDay, $year))); $date[] = $d; } }