0) { // $row_bonds = mysqli_fetch_assoc($get_bonds_sql); // $number = $row_bonds['number'] + 1; // $number_style = date('y', strtotime($date_time)) . 'A' . str_pad($number, 7, '0', STR_PAD_LEFT); // } else { // $number_style = date('y', strtotime($date_time)) . 'A' . "0000001"; // $number = 1; // } // if(mysqli_query( // $db, // "INSERT INTO `bonds`(`number`, `number_style`, `price`, `notes`, `tretment_id`, `invoices_page_id`, `bonds_type_id`, `bonds_type_type_id`, `date_time`, `user_id`, `activation_id`) // VALUES ('$number','$number_style','$payments','','$tretment_id','3','2','2','$date_time','$admin_id','2')" // )) { // $last_id = mysqli_insert_id($db); // if(mysqli_query($db, // "INSERT INTO `bonds_details`(`pay`, `notes`, `bonds_id`, `bonds_status_id`, `branch_id`, `date_time`, `user_id`, `activation_id`) // VALUES ('$payments','','$last_id','1','$admin_branch_id','$date_time','$admin_id','2')" // )) { // $last_id_2 = mysqli_insert_id($db); // if (!empty($cash_pay)) { // mysqli_query($db, // "INSERT INTO `bonds_details_has_how_pay`(`bonds_details_id`, `how_pay_id`, `pay`, `notes`, `date_time`, `user_id`, `activation_id`) // VALUES ('$last_id_2','1','$cash_pay','$cash_note','$date_time','$admin_id','2')" // ); // } // } // }