I have the following code that keeps giving me an "unexpected else" error. Does anyone see something that I missed that is jacking with the syntax?
<?php
$salesman = json_decode($invoice['salesman'], true);
if(empty($salesman)){
for($i = 1; $i <= 5; $i++) {
echo '<input type="checkbox" name="data-invoice-salesman[]" value="'.$i.'"/> '.$i.'<br>';
} else {
foreach($salesman as $k => $v) {
$i = $k+1;
if($v == "checked" {
echo '<input type="checkbox" name="data-invoice-salesman[]" value="'.$i.'" checked/> '.$i.'<br>'; // if checked, check.
} else {
echo '<input type="checkbox" name="data-invoice-salesman[]" value="'.$i.'"/> '.$i.'<br>'; // if not checked, don't check.
}
}
}