小编Jis*_*had的帖子

在Android中5秒后执行功能

我是Android开发的新手,现在我的启动器活动只显示5秒,之后我想检查用户是否已登录或未执行操作并执行操作.

这是我的代码.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    exactPreferences = getSharedPreferences("ExactPreference",MODE_PRIVATE);
    setContentView(R.layout.activity_landing_page);

    session = exactPreferences.getString(Model.getSingleton().SHARED_SESSION_ID,null);
    Log.i("Session Id",session);
        displayData(); // I want to perform this function after 5 seconds.
}


private void displayData() {
    if(session.equals("")){
        Intent loginIntent = new Intent(LandingPage.this,
                LoginActivity.class);
        startActivity(loginIntent);
        Log.i("User Logged In", "False");
    }
    else
    {
        Intent objIntent = new Intent(LandingPage.this,
                IndexPageActivity.class);
        startActivity(objIntent);
        Log.i("User Logged In", "True");
    }

}
Run Code Online (Sandbox Code Playgroud)

java android timer

27
推荐指数
4
解决办法
5万
查看次数

如何获取Woocommerce Product Gallery图片网址?

我正在开发一个wordpress woo商业购物网站并添加了一些产品.我想获得每个产品的产品图库图片网址.

屏幕截图的产品页面

我怎样才能获得图片的网址?

php mysql wordpress wordpress-plugin woocommerce

25
推荐指数
1
解决办法
4万
查看次数

Laravel 将迁移字段 Float 更改为 Double

我想创建一个带有浮动列的表。

$table->float('TaxRate',5,5)->default(0.00000);
Run Code Online (Sandbox Code Playgroud)

但是Mysql把这个当成了DOUBLE。

在此处输入图片说明

这是如何工作的?

mysql laravel-migrations laravel-5.3

6
推荐指数
1
解决办法
1572
查看次数

单击按钮时附加新文本字段,然后单击Laravel 4中的按钮删除

我有一个表格有两个字段,如电话,电子邮件,如下图.

表格布局

当我点击加号按钮时,我想在按钮下面的表单中追加一个额外的文本字段.我想在单击减号按钮时删除文本字段.

动态添加字段并为其设置唯一的名称.我需要将这些数据插入表中.

我的html代码显示在下面..

 <div class="RegSpLeft"><input type="text" value="Phone"></div>

 <div class="RegSpRight"> <a href="#"><img src="images/plus.png"></a> <a href="#"><img src="images/minus.png"></a> </div>
Run Code Online (Sandbox Code Playgroud)

html javascript php jquery laravel-4

5
推荐指数
1
解决办法
5956
查看次数

Laravel不在Ubuntu中加载内部页面 - 找不到404

我开发了一个laravel Web应用程序并在实时服务器上运行良好,现在我正在尝试将该项目迁移到本地服务器,

我正在使用Ubuntu 14.04,内置php,apache和mysql.

当我在浏览器中指向localhost/xxxxxxx /(登录页面)时工作正常,在登录表单中输入值后,它显示404 Not Found错误.

我怎么能解决这个问题,请帮忙..

apache ubuntu .htaccess routes laravel-4

5
推荐指数
1
解决办法
5356
查看次数

带有条件语句的ng-init

我有一个Angular JS应用程序,

<div class="col-lg-12" ng-init="getTableData('{{URL::route('get_repair_category')}}')">
Run Code Online (Sandbox Code Playgroud)

当页面加载时,getTableData将执行,但我想检查变量$ rootScope.Dealer并切换初始化的函数名称.

例如:如果$ rootScope.Dealer值存在,我想执行名为getDealerData的函数

如果未设置该值,则需要执行getTableData函数.

我怎么能在anglar js模板中做到这一点.

我刚试过ng-if,但它不起作用......

javascript angularjs laravel-5.3

5
推荐指数
1
解决办法
1万
查看次数

Laravel通知 - 在字符串上调用成员函数routeNotificationFor()

Laravel 5.5

调节器

public function sendBookingSms(){
  $checkState = session()->get('checkState');
  $staffs = Staff::whereIn('staffId',$checkState)->get();
  foreach ($staffs as $staff) {
    $email = str_replace(" ","","44".substr($staff->mobile, 1)).'@mail.mightytext.net';
    Notification::send($email, new NewBooking($email));
  }
  return $staffs;
  session()->forget('checkState');
  return redirect(route('booking.current'))->with('message','Succesfully Send SMS to selected staffs !!');
}
Run Code Online (Sandbox Code Playgroud)

NewBooking.php(通知)

public function toMail($notifiable)
{
    return (new MailMessage)
                ->line('The introduction to the notification.')
                ->action('Notification Action', url('/'))
                ->line('Thank you for using our application!');
}
Run Code Online (Sandbox Code Playgroud)

调用此控制器时,我收到此错误.

在此输入图像描述

$员工.

{ "STAFFID是" 45 "的forName": "Eldhose", "姓": "约翰", "的categoryId":2, "电子邮件": "devhelloworld@gmail.com", "手机": "07588593278"," whatsappNumber ":" 57656578658" , "性别":1, …

php email laravel-5 laravel-notification laravel-5.5

4
推荐指数
1
解决办法
4063
查看次数

Laravel分页错误 - 调用未定义的方法stdClass :: links()

我开发了一个laravel应用程序,我想分页视图,

看看我的控制器.

$times=DB::table('timesheets')   
->leftJoin('users', 'timesheets.timesheet_user', '=', 'users.id')
->leftJoin('projects','projects.project_id','=','timesheets.timesheet_project_id')
->where('timesheet_user','=',$user)
->paginate(5);
return View::make('timesheet/index')->with('times',$times)->with('projects',$projects);
Run Code Online (Sandbox Code Playgroud)

在结果中获得结果,但是当我尝试显示链接时.它显示如下错误,

   Call to undefined method stdClass::links() 

 <?php echo $times->links(); ?> 
Run Code Online (Sandbox Code Playgroud)

我的代码中的错误是什么?

谢谢

mysql eloquent laravel-4 laravel-pagination

2
推荐指数
1
解决办法
5041
查看次数

Mac Mini中的Laravel安装错误

我正在尝试在我的Mac Mini中安装Laravel并且一直在收到错误.

错误:

Writing lock file
Generating autoload files
Mcrypt PHP extension required.
Script php artisan clear-compiled handling the post-install-cmd event returned with an error



[RuntimeException]  
Error Output:       



create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repository-url="..."] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [package] [directory] [version]
Run Code Online (Sandbox Code Playgroud)

一个月前我安装了Laravel 4.2,运行良好.但是现在当我安装新的Larvel 4.2时,它给出了上面给出的错误.

我使用内置的PHP,mySql,phpMyAdmin.(不是MAMP或XAMP)

我已经安装了mcrypt扩展.

php mcrypt laravel laravel-4

2
推荐指数
1
解决办法
117
查看次数

Laravel not updating null values to column

Migration

Schema::create('users', function (Blueprint $table) {
        $table->increments('user_id');
        $table->string('username',50)->unique();
        $table->date('start_date');
        $table->date('end_date')->nullable();
        $table->timestamps();
    });
Run Code Online (Sandbox Code Playgroud)

Here start_date set as column type date and nullable

When running Insert function like below its inserting null values

$insert = [
    'username'  =>strtoupper(request('username')),
    'password'  =>Hash::make(request('password')),
    'start_date'  =>date('Y-m-d',strtotime(request('start_date'))),
  ];
  if(request()->filled('end_date')){
    $insert['end_date'] = date('Y-m-d',strtotime(request('end_date')));
  }
  User::create($insert);
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

When Updating the same row left blank as end_date input,

$user = User::GetWithEncrypted(request('user_id'));
$update ['start_date'] = date('Y-m-d',strtotime(request('start_date')));
if(request()->filled('end_date')){
  $update['end_date'] = date('Y-m-d',strtotime(request('end_date')));
}else{
  $update['end_date'] = 'NULL';
}
$user->update($update);
Run Code Online (Sandbox Code Playgroud)

In Table, it comes like below …

laravel eloquent laravel-5.7

2
推荐指数
1
解决办法
2万
查看次数

Laravel/Composer安装错误

我在2个月后开发了一个简单的laravel crud应用程序.现在试图再做一个.一旦进入命令提示符.它的显示错误如

 Warning: This development build of composer is over 30 days old. It is recommended to update it by running "C:\ProgramData\ComposerSetup\bin\composer.phar self-update" to get the latest version.
Run Code Online (Sandbox Code Playgroud)

现在我在路上:e:\ wamp\www \

然后尝试从getcomposer.com下载并安装作曲家..但它的显示错误如下.

"安装程序无法继续,因为以下应用程序正在使用需要更新的文件.

Windows资源管理器

"

我目前没有打开任何Windows资源管理器.然后这个错误是如何演变的.请给我任何解决方案.我重启了我的机器2次.

phar composer-php laravel-4

1
推荐指数
1
解决办法
3652
查看次数

Jquery 动态添加的类不起作用

我被 jquery 困在了我的 Timerapp 中。下面是我的场景

  1. 一个按钮有一个名为 toStart 的类
  2. 单击它时,ajax 函数会将当前时间存储在数据库中。(ajax 函数不在堆栈代码中)。

3.ajax响应成功后按钮类变为暂停。现在按钮的类名是暂停。

4.一段时间后,当再次单击按钮(类名为:pause)时,我想调用具有当前单击时间的 ajax 函数并将值存储在数据库中。

5.然后Button类名会改成旧的(toStart)。

HTML :

<button class="toStart" value="1" va>Start</button>
Run Code Online (Sandbox Code Playgroud)

JS:

$('.toStart').click(function()  
{
   //ajax function { addStart}
   $("button[value=1]").removeclass('toStart');
   $("button[value=1]").addClass('pause');
}

$(document.body).on('click','.pause',function() 
{
  //ajax function {addStop}
  $("button[value=1]").addClass('toStart');
}
Run Code Online (Sandbox Code Playgroud)

这个过程对每个点击功能同时重复。

在身体加载时,当我单击按钮时,它会转到 ajax 函数并将类(暂停)添加到按钮中(工作正常)。

但是当我点击按钮(类名:暂停)时, toStart 函数开始工作,然后暂停函数同​​时工作。

我该如何解决这个问题..

附加我的 Webdeveloper->Network Graph。您可以看到 addStart Ajax 执行了两次。

在此处输入图片说明

html javascript ajax jquery delegation

1
推荐指数
1
解决办法
2386
查看次数

如何使用 Jquery 获取上层 HTML 标签

我试图用 jquery 对我的 html 页面进行分类,这是我的代码。

 <tbody>
   <tr>
    <td class="itmId">1</td>
    <td class="entryNAmee">David</td>
   </tr>
   <tr>
    <td class="itmId">2</td>
    <td class="entryNamee">Alan</td>
   </tr>
</tbody> 
Run Code Online (Sandbox Code Playgroud)

我正在将 td 更改为使用 jquery 输入文本,然后单击除第一列之外的每个 td。这工作正常,当上述事件执行时,tr 变得如下所示。

    <tr>
      <td class="itmId">1</td>
      <td class="entryNAmee nowText">
        <input type="text" value="Alan">
      </td>
    </tr>
Run Code Online (Sandbox Code Playgroud)

进行更正后,事件模糊不清。代码如下。

js。

$(document).on('blur','table tr td input',function()
{   
    var fieldNewValue = $(this).val();
    var fieldNewId = $(this).closest('td.itmId').addClass("kkkkkkkkk");
    //console.log(fieldNewId);
    alert(fieldNewId);
    /*$.ajax({
        typr:"post",
        url:"updateEntry",
        dataType:'json',
        data:{newValue:fieldNewValue},
        success:function(data)
        {
            console.log("updated succesfully");
        }
    });
    */
    $(this).parents('td').text(fieldNewValue).removeClass('nowText');
    $(this).remove();

}); 
Run Code Online (Sandbox Code Playgroud)

我想在单击的 td 的上侧 td 添加一个类。我尝试了最接近和父母的 jquery api,但没有用,

任何人都可以请支持我如何赶上td?

jquery中最近的和父母之间有什么不同。

谢谢

html javascript ajax jquery

0
推荐指数
1
解决办法
491
查看次数