我有以下代码显示所有调用详细信息,我希望日期格式"call_date"更改为"dd-mm-yyyy",我的调用/ index.ctp中有以下代码:
<div class="callsIndex">
<h2><?php echo __('Call Details'); ?> </h2>
<div class="bottomButtonnew"><?php echo $this->Html->link(__('Add Calls'), array('action' => 'add')); ?></div>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('Call Date'); ?></th>
<th><?php echo $this->Paginator->sort('Call Time'); ?></th>
<th><?php echo $this->Paginator->sort('Comments'); ?></th>
<th><?php echo $this->Paginator->sort('Next Call Date'); ?></th>
<th><?php echo $this->Paginator->sort('Customer Name'); ?></th>
<th><?php echo $this->Paginator->sort('Company Name'); ?></th>
<th><?php echo $this->Paginator->sort('Employee Name'); ?></th>
<th class="actions"><?php echo __(''); ?></th>
</tr>
<?php foreach ($calls as $call): ?>
<tr>
<td><?php echo h($call['Call']['call_date']); ?> </td>
<td><?php echo h($call['Call']['call_time']); ?> </td>
<td><?php …Run Code Online (Sandbox Code Playgroud) 我想使用CakePHP Email在用户忘记密码时使用新密码向用户发送电子邮件.如果用户忘记了密码,则需要输入用户名和相应的电子邮件.系统将检查用户名和电子邮件是否在数据库中匹配,如果是,则创建随机密码并将其发送到用户电子邮件帐户.我是初学者,我不确定我是否正确地做到了.我的代码如下:
employeesController:
<?php
App::uses('AppController', 'Controller');
App::uses('SimplePasswordHasher', 'Controller/Component/Auth');
App::uses('CakeEmail', 'Network/Email');
class EmployeesController extends AppController {
//some code
public function forgotpassword()
{
$username=$this->request->data['fusername'];
//App::uses('SimplePasswordHasher', 'Controller/Component/Auth');
//$passwordHasher = new SimplePasswordHasher();
//$password = $passwordHasher->hash($this->request->data['password']);
$emailaddress=$this->request->data['emailadd'];
$msg = $this->Employee->getUserPassword($username,$emailaddress);
if($msg)
{
foreach ($msg as $userdetails)
{
$userhashedpass=$userdetails['Employee']['employee_pw'];//see access level here
$userid=$userdetails['Employee']['id'];
$useremail=$userdetails['Employee']['employee_email'];
}
$newpassword="$userhashedpass[0]$userhashedpass[4]$userhashedpass[13]$userhashedpass[8]$userhashedpass[11]$userhashedpass[12]";
//send email
$Email = new CakeEmail();
$Email->from(array('anuja_f@hotmail.com' => 'CentreVision CRM'))
->to($useremail)
->subject('New Password')
->send('Your new password is $newpassword ');
/* $to = $useremail;
$subject = "Your New Password";
$txt = …Run Code Online (Sandbox Code Playgroud) 我的调用/ index.ctp中有以下代码.目前,它在一个页面中显示所有记录.我想限制每页20条记录.当我烘焙项目时,提供了分页,但我仍然是初学者,不知道如何改变分页.有人可以帮忙吗?
电话/ index.ctp:
<div class="callsIndex">
<h2><?php echo __('Call Details'); ?> </h2>
<div class="bottomButtonnew"><?php echo $this->Html->link(__('Add Calls'), array('action' => 'add')); ?></div>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('Call Date'); ?></th>
<th><?php echo $this->Paginator->sort('Call Time'); ?></th>
<th><?php echo $this->Paginator->sort('Comments'); ?></th>
<th><?php echo $this->Paginator->sort('Next Call Date'); ?></th>
<th><?php echo $this->Paginator->sort('Customer Name'); ?></th>
<th><?php echo $this->Paginator->sort('Company Name'); ?></th>
<th><?php echo $this->Paginator->sort('Employee Name'); ?></th>
<th class="actions"><?php echo __(''); ?></th>
</tr>
<?php foreach ($calls as $call): ?>
<tr>
<td><?php echo date("d-m-Y", strtotime($call['Call']['call_date'])); ?> </td>
<td><?php echo …Run Code Online (Sandbox Code Playgroud)