Skip to content

Instantly share code, notes, and snippets.

@ChrisFlannagan
Last active April 25, 2016 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisFlannagan/10b5acfe0a4b5ce9da37605bcf4d5956 to your computer and use it in GitHub Desktop.
Save ChrisFlannagan/10b5acfe0a4b5ce9da37605bcf4d5956 to your computer and use it in GitHub Desktop.
$pay = 'Full Payment';
$result = $con->query( $sql );
while ( $row = $result->fetch_assoc() ) {
if( $row['sm_pay'] == 'Split Payment' ) {
$pay = 'Split Payment';
}
}
$result = $con->query( $sql );
while ( $row = $result->fetch_assoc() ) {
$ek = strtolower( $row['email'] );
if ( ! array_key_exists( $ek, $orders ) ) {
$orders[ $ek ] = array();
$orders[ $ek ]['items'] = array();
}
$orders[ $ek ]['items'][$cnt]['total'] = calc_total( $pay );
$cnt++;
}
@maximejobin
Copy link

$pay = 'Full Payment';
$result = $con->query( $sql );
while ( $row = $result->fetch_assoc() ) {
    if( $row['sm_pay'] == 'Split Payment' ) {
        $pay = 'Split Payment';
    }
//}

//$result = $con->query( $sql );
//while ( $row = $result->fetch_assoc() ) {
    $ek = strtolower( $row['email'] );
    if ( ! array_key_exists( $ek, $orders ) ) {
        $orders[ $ek ] = array();
        $orders[ $ek ]['items'] = array();
    }
    $orders[ $ek ]['items'][$cnt]['total'] = calc_total( $pay );
    $cnt++;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment