小编Chr*_* C.的帖子

HTML/PHP if-else语句

我正在使用Bootstrap创建一个网站,我想输入if-else语句,但我不知道该怎么做.让我解释:

这是我当前HTML代码段的图片: 在此输入图像描述

现在我想要的是,如果我通过"An-/Ausschalten"从"OFF"变为"ON",那么"状态aktuell"会自动从"OFF"变为"ON",而另一种方式则应该是像这样:

在此输入图像描述

我目前的这部分HTML代码是:

<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4">
<div class="services-wrapper">
<h3>GENERALSTEUERUNG</h3>
Steuern Sie mit nur einem Klick die komplette Lichtanlage Ihres Hauses.<br><br>
<b>Status aktuell:</b> <input id="switch-offColor" type="checkbox" data-off-color="warning" data-size="mini" readonly><br><br>
<b>An- / Ausschalten:</b> <input id="switch-offColor" type="checkbox" data-off-color="warning" data-size="mini">        
</div>
</div>
Run Code Online (Sandbox Code Playgroud)

谁能告诉我if-else代码我必须使用什么才能实现这一目标?代码应该是什么样的?

我将衷心感谢您的帮助.

谢谢,克里斯

html php if-statement twitter-bootstrap

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

将图标添加到fullcalendar.js

我正在寻找一种方法来添加不同的图标到我的fullcalendar.js条目.这些图标取决于用户的状态,因此我使用以下PHP代码实现这些状态:

if ($icon==1) { print "<i class='ace-icon fa fa-check-circle green bigger-250'></i>"; }
if ($icon==2) { print "<i class='ace-icon fa fa-times-circle red bigger-250'></i>"; }
if ($icon==3) { print "<i class='ace-icon fa fa-clock-o blue bigger-250'></i>"; }
if ($icon==4) { print "<i class='ace-icon fa fa-check-circle yellow bigger-250'></i>"; }
Run Code Online (Sandbox Code Playgroud)

我现在的问题是,我不知道如何在fullcalendar.js条目的标题旁边或标题下包含这些状态.因此,每个条目都有不同的图标,具体取决于用户的当前状态.

这是我的fullcalendar.js代码:

            // ------------------------- TIMETABLE-ANZEIGE -------------------------
            print "<div class='col-sm-12'>";
            print "<br /><br />";
            print "<div class='main-container' id='main-container'>\n";
            print " <div class='row'>\n";
            print "     <div id='calendar'></div>\n";
            print " </div>\n";
            print "</div><!-- /.main-container -->\n";


            print "<!-- page …
Run Code Online (Sandbox Code Playgroud)

javascript php fullcalendar

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

Dropzone.js - 上传后的成功消息

我正在使用Dropzone.js进行文件上传过程.我已经在stackoverflow上找到了一些关于我的问题的主题,但这些解决方案都没有帮助我.

现在,只要上传一个文件,用户就可以一次上传多个文件,有一个名为"删除文件"的链接.就这样!我想要的是以下内容:

如果用户上传我们说4张图片而不是上传所有图片后应该有成功消息.现在,用户不理解这些文件是否以100%上传.我不擅长jQuery/Ajax所以我真的不知道我的代码应该是什么样的.如果有人可以告诉我我的代码应该是什么样子以便它可以工作,那将会很棒.

这是我的表格:

    print "<div class='col-sm-12'><br /><br />";
    print "<form method='post' action='index.php' id='dropzone' class='form-horizontal dropzone'>";
    print "<input type='hidden' name='func' value='supportticket'>";
    print "<input type='hidden' name='id' value='".$id."'>";
    print "<input type='hidden' name='sid' value='".$sid."'>";
    print "<input type='hidden' name='attach_images' value='".$attach_images."'>";
    print "<div class='form-group'>";
    print "<div class='col-sm-8'>";
    print "<div class='fallback'>";
    print "<input name='file' type='file' multiple='' />";
    print "</div>";
    print "</div>";
    print "</div>";
    print "</form>";
    print "</div>";
Run Code Online (Sandbox Code Playgroud)

这是我的脚本:

    <script type="text/javascript">
        jQuery(function($){

        try {
          Dropzone.autoDiscover = false;
          var myDropzone = new Dropzone("#dropzone" , {
            paramName: "file", // …
Run Code Online (Sandbox Code Playgroud)

javascript php jquery file-upload dropzone.js

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

条纹:在我的网站上下载发票

我正在使用条纹支付网关,到目前为止一切正常,除了选项,我的用户可以在我的网站下载他们的发票.可以在条带仪表板中下载发票,但这不是我需要的.我的用户付款后,应该可以在我的系统下载我的发票.

目前我正在使用条纹webhooks.用户进行付款,数据保存在我的数据库中.这是我的代码的样子:

\Stripe\Stripe::setApiKey("$stripe_secret_key_test");
// Retrieve the request's body and parse it as JSON:
$input = @file_get_contents('php://input');
$event_json = json_decode($input);

// Update database with new billing entry
if ($event_json->type == 'invoice.payment_succeeded') {
    $invoice_id = $event_json->data->object->id;
    $customer = $event_json->data->object->customer;
    $date = $event_json->data->object->date;
    $price = $event_json->data->object->amount_paid;
    $user = $event_json->data->object->lines->data[0]->metadata->userid;
    $stripe_sub_id = $event_json->data->object->lines->data[0]->id;
    $plan_id = $event_json->data->object->lines->data[0]->plan->id;
    $stamp_created = $event_json->data->object->lines->data[0]->plan->created;
    $comments = $event_json->data->object->lines->data[0]->plan->nickname;
    $period_start = $event_json->data->object->lines->data[0]->period->start;
    $period_end = $event_json->data->object->lines->data[0]->period->end;

    $content=array("invoice"=>$invoice_id,
        "user"=>$user,
        "stripe_cust_id"=>$customer,
        "stripe_sub_id"=>$stripe_sub_id,
        "idea_id"=>0,
        "billing_date"=>$date,
        "plan"=>$plan_id,
        "price"=>$price,
        "stamp_created"=>$stamp_created,
        "period_start"=>$period_start,
        "period_end"=>$period_end,
        "status"=>'paid',
        "printed"=>0);
    insertGWInfo('billing',$content);

    $content=array("user"=>$user,
        "trans_time"=>date("Y-m-d …
Run Code Online (Sandbox Code Playgroud)

php mysql stripe-payments

2
推荐指数
3
解决办法
2336
查看次数