/**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $producer_id = Auth::user()->producer_id;
     $stmt = statement("DELETE FROM Product WHERE product_id = :id AND \n            member_id = :pid", ['id' => $id, 'pid' => $producer_id]);
     return redirect('/listings');
 }
<?php

include_once '../functions.php';
checklogin();
$conn = opendb();
if ($loggedin == 1) {
    $account = sanitise('account');
    $sd = sanitise('sd');
    $sm = sanitise('sm');
    $sy = sanitise('sy');
    $ed = sanitise('ed');
    $em = sanitise('em');
    $ey = sanitise('ey');
    $value = sanitise('value');
    $order = sanitise('order');
    $field = sanitise('field');
    $perpage = intval(sanitise('perpage'));
    if ($perpage == 0) {
        $perpage = 20;
    }
    $offset = intval(sanitise('offset'));
    checkAccount($user, $account, 0);
    $startdate = strtotime($sm . "/" . $sd . "/" . $sy) - 1;
    $enddate = strtotime($em . "/" . $ed . "/" . $ey) + 1;
    if ($enddate < $startdate) {
        $enddate = $startdate + 2;
    }
    statement($perpage, $user, $order, $account, $offset, $value, $field, $startdate, $enddate);
} else {
    loginform();
}
<?php

paymentForm($user);
echo $msg;
echo "<br>";
echo "<div id='statementcontrols'>";
accountPicker($user);
numperpage();
statementdatepicker();
echo "</div>";
echo "<div id='statementhold'>";
statement(20, $user);
echo "</div>";
budgeter($user);
                    $query = "UPDATE repeats SET PairedID='{$repeatid}' WHERE RepeatID='{$repeatinsertid}'";
                    mysql_query($query) or die(mysql_error() . " addpayment#008-4");
                }
                $time = $time + $rf * 86400;
                $i = 2;
                while ($time < time() + 604800 && $i <= $rt) {
                    if ($insertid != 0) {
                        $query = "INSERT INTO payments (UserID, AccountID, Timestamp, PaymentName, PaymentDesc, PaymentAmount, PaymentType, ToAccount, RepeatID, LabelID) VALUES ('{$user}', '{$toaccount}', '{$time}', '{$theotherparty}', '{$desc}', '{$toamount}', '{$type}', '{$account}', '{$repeatinsertid}', '{$label}')";
                        mysql_query($query) or die(mysql_error() . " addpayment#009");
                        $insertid = mysql_insert_id();
                    }
                    $query = "INSERT INTO payments (UserID, AccountID, Timestamp, PaymentName, PaymentDesc, PaymentAmount, PaymentType, ToAccount, PairedID, RepeatID, LabelID) VALUES ('{$user}', '{$account}', '{$time}', '{$otherparty}', '{$desc}', '{$amount}', '{$type}', '{$toaccount}', '{$insertid}', '{$repeatid}', '{$label}')";
                    mysql_query($query) or die(mysql_error() . " addpayment#010");
                    if ($insertid != 0) {
                        $paymentid = mysql_insert_id();
                        $query = "UPDATE payments SET PairedID='{$paymentid}' WHERE PaymentID='{$insertid}'";
                        mysql_query($query) or die(mysql_error() . " addpayment#011");
                    }
                    $i++;
                    $time = $time + $rf * 86400;
                }
            }
            $msg = "Added!";
        }
    } else {
        $msg = "All fields are required and the amount must be a number!";
    }
    statement($perpage, $user, $order, $accsel, $offset, $recvalue, $field);
} else {
    loginform();
}