} } if ($do == "importall") { //print_r($_POST['id']);exit; $imported = false; foreach ($_POST['id'] as $val) { $vals['created'] = $time_stamp; $handsetinfo = $handset->read("*", $val); $vals['device_id'] = $handsetinfo['deviceID']; $vals['brand_name'] = $handsetinfo['brand_name']; $vals['model_name'] = $handsetinfo['model_name']; $concheck = array(); $concheck[] = "device_id='" . $handsetinfo['deviceID'] . "'"; $concheck[] = "product_id=" . $pid; $concheck[] = "game_id=" . $gid; $deviceid = $gamehandset->field("device_id", $concheck); if (empty($deviceid)) { $imported = $gamehandset->save($vals); //echo "tét"; } } flash("Danh sách thiết bị đã được thêm vào thành công!"); } if ($do == "import" && !empty($id)) { $imported = false; $concheck = array(); $concheck[] = "device_id='" . $handsetinfo['deviceID'] . "'"; $concheck[] = "product_id=" . $pid; $concheck[] = "game_id=" . $gid; print_r($concheck); exit;