0

I have tryed alots to connect the users id with their own orders that have been orderd in the checkout page and sent to backend.

Right now it just displays the users only and anothr page it displays all users with orders at the same time.

So please need help...

Here's my functions.php the following code:

function display_log_usres() {

$category_query = query("SELECT * FROM log_users");
confirm($category_query);

while ($row = fetch_array($category_query)) {
    $id          = $row['id'];
    $usernameg   = $row['usernameg'];
    $passwordg   = $row['passwordg'];

    $created_at  = $row['created_at'];
    $user = <<<DELIMETER
    <tr>
        <td>{$id}</td>
        <td>{$usernameg}</td>
        <td>{$passwordg}</td>



        </td>
<td>
    <a class="btn btn-default btn-number"
        href="index.php?edit_users_log&id={$row['id']}"><span
            class="glyphicon glyphicon-edit"></span></a>
</td>
<td><a class="btn btn-default btn-number"
        href="index.php?delete_user_log_id={$row['id']}"><span
            class="glyphicon glyphicon-remove"></span></a></td>
</tr>
DELIMETER;
    echo $user;
}
}


enter code here

function users_panel() {

$query_1 = query("SELECT * FROM log_users WHERE id  "  . " ");
confirm($query_1);



while ($row = fetch_array($query_1)) {
    $id = $row['id'];
    $usernameg = $row['usernameg'];


    $created_at = $row['created_at'];
    $payer = <<<DELIMETER
<tr>
    <td>{$id}</td>
    <td>{$usernameg}</td>
    <td>{$created_at}</td>
</tr>
DELIMETER;
    echo $payer;
    
}
}




function display_payers() {

$total = 0;
$totalmin = 0;
$totalminus = 0;
$totalmon = 0;
$totalmonout = 0;
$category_query = query("SELECT * FROM payers WHERE payers_id " . " ");
confirm($category_query);

while ($row = fetch_array($category_query)) {
    $sub = $row['price'] + $row['price_sec'];
    $submin = $row['price'] - $row['price_sec'];
    $subminus = $row['price'] + $row['price_sec'] - $row['price_minus'];
    $submonout = $row['price_minus'] - $row['price'] - $row['price_sec'];


    
    $payers_id = $row['payers_id'];
    $name = $row['name'];
    $name_account = $row['name_account'];
    $serial_number = $row['serial_number'];
    $serial_number2 = $row['serial_number2'];
    $first_mobile = $row['first_mobile'];
    $secound_mobile = $row['secound_mobile'];
    $email = $row['email'];
    $pass = $row['pass'];
    $price = $row['price'];
    $price_sec = $row['price_sec'];
    $price_minus = $row['price_minus'];
    $money = $row['money'];
    $code_note = $row['code_note'];
    $payer_photo = $row['payer_photo']; //**** */
    $user_show = $row['user_show']; //**** */
    $payer = <<<DELIMETER
<tr>
<td>{$payers_id}</td>
<th>{$name_account}</th>
<td>{$name}</td>
<td>{$serial_number}<br>
    {$serial_number2}
</td>
<td>{$first_mobile},
    <br>{$secound_mobile},
    <br>{$email},
    <br>{$pass}
</td>
<td>{$user_show}<br>
    <a>
        <img style="width: 80px; height=" 80px"
            src="../../resources/uploads/$payer_photo" alt="">
    </a>
</td>
<td>
    <b>{$price}SR</b>
    <br>
    <b>{$price_sec}SR</b>
    <br>
    <b>{$price_minus}SR</b>
    
</td>

<td>
<br>
    <b>{$subminus}SR</b> 
</td>

<td>
<div class="dropdown dropleft float-right">
<button type="button" data-toggle="dropdown" class="btn btn-default btn-number">
<b class="caret"></b>
</button>      

<div class="dropdown-menu">
    <p style="padding: 10px" class="dropdown-item" href="#">
        {$code_note}
    </p>
</div>
</div>
</div>
    
</td>



<td><a class="btn btn-default btn-number"
        href="index.php?edit_payer&id={$row['payers_id']}"><span
            class="glyphicon glyphicon-edit"></span></a></td>
<td><a class="btn btn-default"
        href="index.php?delete_payers_id={$row['payers_id']}"><span
            class="glyphicon glyphicon-remove"></span></a></td>
</tr>
DELIMETER;
    $_SESSION['item_totals_min']        = $totalmin += $submin;
    echo $payer;
    $_SESSION['item_totals']            = $total += $sub;
    $_SESSION['item_totals_minus']      = $totalminus += $subminus;
    $_SESSION['item_totals_mon']        = $totalmon += $money += $subminus;
    $_SESSION['item_totals_monout']     = $totalmonout += $submonout;
}
}

   function add_payer() {
    if (isset($_POST['add_payer'])) {
    $name_account      = escape_string($_POST['name_account']);
    $name              = escape_string($_POST['name']);
    $name2             = escape_string($_POST['name2']);
    $name3             = escape_string($_POST['name3']);
    $name_v            = escape_string($_POST['name_v']);
    $name_v2           = escape_string($_POST['name_v2']);
    $name_v3           = escape_string($_POST['name_v3']);
    $serial_number     = escape_string($_POST['serial_number']);
    $serial_number2     = escape_string($_POST['serial_number2']);
    $first_mobile       = escape_string($_POST['first_mobile']);
    $secound_mobile     = escape_string($_POST['secound_mobile']);
    $email             = escape_string($_POST['email']);
    $email2            = escape_string($_POST['email2']);
    $pass              = escape_string($_POST['pass']);
    $price             = escape_string($_POST['price']);
    $price_sec         = escape_string($_POST['price_sec']);
    $prices            = escape_string($_POST['prices']);
    $price_minus       = escape_string($_POST['price_minus']);
    $code_note          = escape_string($_POST['code_note']);
    $date               = escape_string($_POST['date']);
    $date2              = escape_string($_POST['date2']);
    $time                = escape_string($_POST['time']);
    $time2               = escape_string($_POST['time2']);
    $us_store            = escape_string($_POST['us_store']);
    $payment_method       = escape_string($_POST['payment_method']);
    $payment_method2      = escape_string($_POST['payment_method2']);
    $payer_photo          = $_FILES['file']['name'];
    $photo_temp_location  = $_FILES['file']['tmp_name'];
    
    move_uploaded_file($photo_temp_location, UPLOAD_DIRECTORY . DS . $payer_photo);
    $query = query("INSERT INTO payers(name_account,name,name2,name3,name_v, name_v2 ,name_v3 ,serial_number,serial_number2, first_mobile, secound_mobile, email,email2 , pass, price, prices, price_sec,price_minus,code_note, date,date2,time,time2, us_store, payment_method,payment_method2, payer_photo)
                VALUES('{$name_account}','{$name}','{$name2}','{$name3}','{$name_v}','{$name_v2}','{$name_v3}' ,'{$serial_number}','{$serial_number2}','{$first_mobile}','{$secound_mobile}','{$email}','{$email2}','{$pass}', '{$price}', '{$price_sec}', '{$prices}','{$price_minus}','{$code_note}', '{$date}','{$date2}', '{$time}', '{$time2}','{$us_store}', '{$payment_method}','{$payment_method2}','{$payer_photo}')");
    confirm($query);

    
    set_message("Payer CREATED");
    redirect("/public/checkout.php");
}
}
1
  • This doesn't seem to have anything to do with WordPress. Did you post this in the right place? – Jacob Peattie Feb 19 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.